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#include <string>
69
71{
72public:
74 TrawlDoorAddedFoil(std::string simObjectName, ISimObjectCreator* creator);
75 virtual ~TrawlDoorAddedFoil() = default;
76
77 void FinalSetup(const double dT, const double* const adX, ISimObjectCreator* const creator);
78
80 const double* OutFoilEnergyConsumed(const double dT, const double* const adX);
81
82
83#ifdef FH_VISUALIZATION
84 // Initial specification of the simObject geometry for rendering.
85 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator);
86
87 // Updating the simObject for rendering the next frame.
88 virtual void RenderUpdate(const double dT, const double* const adX);
89#endif
90
91protected:
93 struct FoilLoad
94 {
95 double wrench[6];
96 double normalForce;
97 };
98
100 FoilLoad Foil(double T, const double* X, const plate_door::Inflow& inflow) const;
102 void AddInflowDependentForces(double T, const double* X, const plate_door::Inflow& inflow, hydro_body::Wrench& wrench) const override;
104 void AddOwnDerivatives(double T, const double* X, const plate_door::Inflow& inflow, double* XDot) const override;
105 void SetFoilRatio(const double dT, const double* const adX);
106
108 static FoilPolar ReadFoilPolar(ISimObjectCreator* creator);
109
110 ISignalPort* m_inFoilRelAoa;
111 ISignalPort* m_inFoilRelAoaRate;
112 ISignalPort* m_inFoilExposedAreaRatio;
113 ISignalPort* m_inFoilRelPosition;
114
115 FoilPolar m_foilPolar;
116 double m_foilCord;
117 double m_foilSpan;
119 int m_IStateEnergy;
120 bool m_foilIsVertical;
121
122#ifdef FH_VISUALIZATION
123 Ogre::Vector3 ToFoilScale(double x, double y, double z);
124 void SetFoilPos(double x, double y, double z);
125 float m_foilRelRollAngle;
126 Ogre::ManualObject* m_foilManualObject;
127 Ogre::SceneNode* m_foilRenderNode;
128#endif
129};
Definition FoilPolar.h:18
Definition ToTrawlDoor.h:129
Definition TrawlDoorAddedFoil.h:71
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:118
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:94
double wrench[6]
Door frame [N, Nm].
Definition TrawlDoorAddedFoil.h:95
double normalForce
N = L cos(a) + D sin(a), towards the lift side, mirrored frame [N].
Definition TrawlDoorAddedFoil.h:96
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