FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
BodyFlowInteraction.h
1#pragma once
2
20#include <fhsim/simobject/SimObject.h>
21#include <fhsim_environment/BodyWake.h>
22#include <fhsim_environment/EnvironmentProvider.h>
23#include <fhsim_environment/LumpedWakeCaster.h>
24#include <memory>
25#include <string>
26
28{
29public:
34 explicit BodyFlowInteraction(ISimObjectCreator* creator);
35
42 void FinalSetup(const std::string& objectName, double waterDensity, ISimObjectCreator* creator);
43
45 bool CastsWake() const { return m_wake && m_wake->Casts(); }
46
48 const environment::wake::LumpedWakeCaster* WakeCaster() const { return m_wake ? m_wake->LumpedCaster() : nullptr; }
49
57 void PreOdeFcn(double T, const double* X, const double position[3], const environment::wake::WakeCastingObject& body);
58
65 void WaterVelocity(double T, const double position[3], double velocity[3]) const;
66
74 double Submergence(double T, const double position[3], double halfExtent) const;
75
82 void WaveAcceleration(double T, const double position[3], double acceleration[3]) const;
83
85 environment::EnvironmentProvider* Environment() const { return m_environment; }
86
87private:
88 environment::EnvironmentProvider* m_environment = nullptr;
89 environment::wake::BodyWakeSettings m_settings;
90 std::unique_ptr<environment::wake::BodyWake> m_wake;
91};
Definition BodyFlowInteraction.h:28
environment::EnvironmentProvider * Environment() const
The Environment; null before FinalSetup, and after it only if it was reported missing.
Definition BodyFlowInteraction.h:85
double Submergence(double T, const double position[3], double halfExtent) const
void PreOdeFcn(double T, const double *X, const double position[3], const environment::wake::WakeCastingObject &body)
const environment::wake::LumpedWakeCaster * WakeCaster() const
The wake caster; null without CastWake or before FinalSetup.
Definition BodyFlowInteraction.h:48
void FinalSetup(const std::string &objectName, double waterDensity, ISimObjectCreator *creator)
void WaterVelocity(double T, const double position[3], double velocity[3]) const
BodyFlowInteraction(ISimObjectCreator *creator)
void WaveAcceleration(double T, const double position[3], double acceleration[3]) const
bool CastsWake() const
True with CastWake and an Environment, after FinalSetup.
Definition BodyFlowInteraction.h:45