FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
TrawlDoorAddedFoil.h
1#pragma once
66#include "ToTrawlDoor.h"
67#include "subroutines/FoilPolar.h"
68
70{
71public:
73 TrawlDoorAddedFoil(std::string simObjectName, ISimObjectCreator* creator);
74 virtual ~TrawlDoorAddedFoil() = default;
75
76 void FinalSetup(const double dT, const double* const adX, ISimObjectCreator* const creator);
77
79 const double* OutFoilEnergyConsumed(const double dT, const double* const adX);
80
81
82#ifdef FH_VISUALIZATION
83 // Initial specification of the simObject geometry for rendering.
84 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
85
86 // Updating the simObject for rendering the next frame.
87 virtual void RenderUpdate(const double dT, const double* const adX);
88#endif
89
90protected:
92 struct FoilLoad
93 {
94 double wrench[6];
95 double normalForce;
96 };
97
99 FoilLoad Foil(double T, const double* X, const plate_door::Inflow& inflow) const;
101 void AddInflowDependentForces(double T, const double* X, const plate_door::Inflow& inflow, hydro_body::Wrench& wrench) const override;
103 void AddOwnDerivatives(double T, const double* X, const plate_door::Inflow& inflow, double* XDot) const override;
104 void SetFoilRatio(const double dT, const double* const adX);
105
107 static FoilPolar ReadFoilPolar(ISimObjectCreator* creator);
108
109 ISignalPort* m_inFoilRelAoa;
110 ISignalPort* m_inFoilRelAoaRate;
111 ISignalPort* m_inFoilExposedAreaRatio;
112 ISignalPort* m_inFoilRelPosition;
113
114 FoilPolar m_foilPolar;
115 double m_foilCord;
116 double m_foilSpan;
118 int m_IStateEnergy;
119 bool m_foilIsVertical;
120
121#ifdef FH_VISUALIZATION
122 Ogre::Vector3 ToFoilScale(double x, double y, double z);
123 void SetFoilPos(double x, double y, double z);
124 float m_foilRelRollAngle;
125 Ogre::ManualObject* m_foilManualObject;
126 Ogre::SceneNode* m_foilRenderNode;
127#endif
128};
Definition FoilPolar.h:18
Definition ToTrawlDoor.h:128
Definition TrawlDoorAddedFoil.h:70
const double * OutFoilEnergyConsumed(const double dT, const double *const adX)
Output port returning the foil energy consumption.
void AddOwnDerivatives(double T, const double *X, const plate_door::Inflow &inflow, double *XDot) const override
The derivative of the foil energy: the power the actuator delivers against the foil's hinge moment.
double m_foilHingeOffset
Hinge to pressure centre along the chord.
Definition TrawlDoorAddedFoil.h:117
static FoilPolar ReadFoilPolar(ISimObjectCreator *creator)
Reads the FoilHydro_* polar, reporting a parameter error when it is malformed.
FoilLoad Foil(double T, const double *X, const plate_door::Inflow &inflow) const
The foil's load at time T and global state X, at the plate-door inflow of that state.
void AddInflowDependentForces(double T, const double *X, const plate_door::Inflow &inflow, hydro_body::Wrench &wrench) const override
Adds the foil's wrench (Foil()).
TrawlDoorAddedFoil(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
The foil's load at the plate-door inflow of a state: its wrench in the door frame and its chord-norma...
Definition TrawlDoorAddedFoil.h:93
double wrench[6]
Door frame [N, Nm].
Definition TrawlDoorAddedFoil.h:94
double normalForce
N = L cos(a) + D sin(a), towards the lift side, mirrored frame [N].
Definition TrawlDoorAddedFoil.h:95
The sum of the loads on a body: the force [0..2] and the moment about the origin [3....
Definition HydroBody.h:57
The door's inflow angles, in the starboard convention, and speed.
Definition PlateDoorLaw.h:60