3#include "PlateDoorLaw.h"
5#include "sfh/sim/kinematics.h"
7#include <fhsim/simobject/SimObject.h>
8#include <fhsim_base/body/HydroBody.h>
9#include <fhsim_environment/BodyFlowInteraction.h>
10#include <fhsim_environment/EnvironmentProvider.h>
11#include <fhsim_environment/WakeSourceSet.h>
12#include <fhsim_environment/hydrodynamics/PlateGeometry.h>
17#ifdef FH_VISUALIZATION
18# include "OgreParticleSystem.h"
19# ifdef USE_BILLBOARD_LABELS
20# include "sfh/ogre/CMovableText.h"
197 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
212 bool HasJacobians()
const override;
213 void OdeJacobian(
double T,
const double* X,
double* J,
int nStates)
override;
214 int GetJacobianSparsity(
int nStates,
int* rowPtr,
int* colIdx)
override;
221#ifdef FH_VISUALIZATION
223 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
226 virtual void RenderUpdate(
const double dT,
const double*
const adX);
231 void HydroForceAt(
const double* X,
const double relVel_n[3],
double force_n[3])
const;
260 virtual void CalcOutput(
const double dT,
const double*
const adX);
261 void CalcOutputCommon(
const double dT,
const double*
const adX)
const;
262 void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
272 double m_mdCornerPos_body[4][3];
279 double m_warpPos_d[3];
293 class DoorCaster final :
public environment::wake::WakeCastingObject
302 environment::wake::WakeCastState
Reference(
double T,
const double* X)
const override;
304 void CurrentLoad(
double T,
const double* X,
const double freeStream[3],
const double flowDir[3],
double force[3],
double& frontalArea,
305 double rearCentre[3])
const override;
309 environment::wake::SourceLoad
BodyLoad(
double T,
const double* X,
const double bodyVel[3],
const double waterVel[3])
const override;
313 void PlateAxes(
const double* X,
double normal[3],
double chordAxis[3])
const;
315 environment::plate_geometry::Plate Plate()
const;
322 environment::wake::BodyFlowInteraction
m_flow;
330 const double* OutPos1(
const double dT,
const double*
const adX);
331 const double* OutPos3(
const double dT,
const double*
const adX);
332 const double* OutPos2(
const double dT,
const double*
const adX);
333 const double* OutVel1(
const double dT,
const double*
const adX);
334 const double* OutVel3(
const double dT,
const double*
const adX);
335 const double* OutVel2(
const double dT,
const double*
const adX);
346 unsigned long m_IStatePos;
347 unsigned long m_IStateQuater;
348 unsigned long m_IStateLocalVel;
349 unsigned long m_IStateOmega;
350 unsigned long m_IStateHydroForce;
359#ifdef FH_VISUALIZATION
360 void BottomContactRenderInit();
361 void RenderBottomContact(
double depth,
double m_cornerPos_ned[4][3],
double m_submergence[4]);
362 Ogre::ParticleSystem* m_particleSystem;
363 Ogre::SceneNode* m_particleNode;
364 Ogre::ParticleEmitter* m_particleEmitter;
365 Ogre::Vector3 m_visualizationScale;
367 std::string m_meshName;
369 double m_lengthScale;
370 double m_heightScale;
371 double m_curvatureScale;
372 Ogre::Entity* m_renderEntity;
373 Ogre::SceneNode* m_renderNode;
374 Ogre::Quaternion m_InitOrientation;
375 Ogre::SceneManager* m_sceneMgr;
377# ifdef USE_BILLBOARD_LABELS
378 Ogre::SceneNode* m_BBRenderNode;
379 Ogre::CMovableText* m_BBTxt;
Definition HydroBody.h:101
Definition TrawlDoorBase.h:294
environment::wake::SourceLoad BodyLoad(double T, const double *X, const double bodyVel[3], const double waterVel[3]) const override
plate_door::SteadyLoad at the inflow, M = F·ê/(½ρ|U|²), the plate's frontal area along ê (as CurrentL...
double Radius() const override
√(Area/π), the radius of the plate area (O9a).
void CurrentLoad(double T, const double *X, const double freeStream[3], const double flowDir[3], double force[3], double &frontalArea, double rearCentre[3]) const override
plate_door::SteadyLoad at the free stream; the plate chord × span of the door frame.
environment::wake::WakeCastState Reference(double T, const double *X) const override
The door's centre and its velocity in NED.
Definition TrawlDoorBase.h:191
hydro_body::Wrench WaterLoad(double T, const double *X, const hydro_body::FlowFrame &frame) const
double m_area
The trawldoor area.
Definition TrawlDoorBase.h:266
virtual void OdeFcn(const double dT, const double *const adX, double *const adXDot) const override
Calculates the state derivatives.
void OutOfBoundRotationalDamping(const hydro_body::FlowFrame &frame, double damping[3]) const
The derivative of the out-of-bound rotational damping moments against the angular rate,...
virtual void AddBottomForces(const hydro_body::FlowFrame &frame, hydro_body::Wrench &wrench) const
Adds the bottom contact. The base door has none.
Definition TrawlDoorBase.h:257
void HydroForceAt(const double *X, const double relVel_n[3], double force_n[3]) const
plate_door::SteadyLoad at the velocity relVel_n relative to the water (NED) and the attitude and rate...
double m_force_warp[3]
A pointer to the Warp force.
Definition TrawlDoorBase.h:285
virtual void AddOwnDerivatives(double T, const double *X, const plate_door::Inflow &inflow, double *XDot) const
Writes the derivatives of a subclass's own states, after the 13 of m_body. The base door has none.
Definition TrawlDoorBase.h:259
void AddDampingForces(const hydro_body::FlowFrame &frame, hydro_body::Wrench &wrench) const
Adds the linear damping, a numerical stabiliser on the door's own velocity and rates (R75,...
environment::wake::BodyFlowInteraction m_flow
The wake the door casts and receives.
Definition TrawlDoorBase.h:322
virtual void AddExternalForces(double T, const double *X, const hydro_body::FlowFrame &frame, hydro_body::Wrench &wrench) const
Adds the warp and bridle forces of the input ports at their fastening points.
environment::EnvironmentProvider * m_environment
m_flow's Environment, from FinalSetup.
Definition TrawlDoorBase.h:320
hydro_body::Wrench SumLoads(double T, const double *X, const hydro_body::FlowFrame &frame, plate_door::Inflow &inflow) const
plate_door::Inflow m_lastInflow
The inflow of the last OdeFcn, for the render only (the billboard label); never read by the dynamics.
Definition TrawlDoorBase.h:357
double m_rhoDoor
The density of the trawl door material.
Definition TrawlDoorBase.h:273
TrawlDoorBase(std::string simObjectName, ISimObjectCreator *creator)
The constructor sets the pointer to the output object and the parser object.
double m_cOG[3]
The trawl door center of gravity.
Definition TrawlDoorBase.h:265
double m_rhoWater
The density of the surrounding fluid.
Definition TrawlDoorBase.h:284
double m_force_LB[3]
A pointer to the force.
Definition TrawlDoorBase.h:286
double m_force_UB[3]
A pointer to the input force.
Definition TrawlDoorBase.h:287
ISignalPort * m_inLB_F
The cable length input port.
Definition TrawlDoorBase.h:326
DoorCaster m_caster
The door for its wake; declared before m_flow, which keeps a pointer to it.
Definition TrawlDoorBase.h:321
double m_mass
The mass of the object.
Definition TrawlDoorBase.h:271
ISignalPort * m_inUB_F
The cable length input port.
Definition TrawlDoorBase.h:327
void PreOdeFcn(double T, const double *X) override
Rebuilds the door's wake when due (CastWake) and takes the other objects' wakes at the door.
virtual void AddInflowDependentForces(double T, const double *X, const plate_door::Inflow &inflow, hydro_body::Wrench &wrench) const
Adds forces that depend on the plate-door inflow of this state. The base door has none.
Definition TrawlDoorBase.h:253
bool m_isPort
Is this a port trawl door?
Definition TrawlDoorBase.h:264
ISignalPort * m_inWarp_F
The cable length input port.
Definition TrawlDoorBase.h:325
void AddInternalForces(double T, const hydro_body::FlowFrame &frame, hydro_body::Wrench &wrench) const
Adds gravity at COG and the buoyancy of the wet part of the plate (R66, FISH-0092).
HydroBody m_body
The states Pos, Quater, LocalVel and Omega, the inertia (R70) and the derivatives.
Definition TrawlDoorBase.h:344
plate_door::Door m_law
The door's constants for the plate-door law (Area, AR, Rho, IsPort, MaxLiftCoeff, DragCoeffAtMaxLift)...
Definition TrawlDoorBase.h:276
ICommonComputation * m_commonCalc
Calculations necessary for more than one output port.
Definition TrawlDoorBase.h:288
double m_outAlpha
Definition TrawlDoorBase.h:354
Definition HydroBody.h:42
The sum of the loads on a body: the force [0..2] and the moment about the origin [3....
Definition HydroBody.h:57
A door's constants for the law; constant after construction.
Definition PlateDoorLaw.h:29
The door's inflow angles, in the starboard convention, and speed.
Definition PlateDoorLaw.h:60