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"
196 virtual void OdeFcn(
const double dT,
const double*
const adX,
double*
const adXDot)
const override;
211 bool HasJacobians()
const override;
212 void OdeJacobian(
double T,
const double* X,
double* J,
int nStates)
override;
213 int GetJacobianSparsity(
int nStates,
int* rowPtr,
int* colIdx)
override;
220#ifdef FH_VISUALIZATION
222 virtual void RenderInit(Ogre::Root*
const ogreRoot, ISimObjectCreator*
const creator);
225 virtual void RenderUpdate(
const double dT,
const double*
const adX);
230 void HydroForceAt(
const double* X,
const double relVel_n[3],
double force_n[3])
const;
259 virtual void CalcOutput(
const double dT,
const double*
const adX);
260 void CalcOutputCommon(
const double dT,
const double*
const adX)
const;
261 void FinalSetup(
const double dT,
const double*
const adX, ISimObjectCreator*
const creator);
271 double m_mdCornerPos_body[4][3];
278 double m_warpPos_d[3];
292 class DoorCaster final :
public environment::wake::WakeCastingObject
301 environment::wake::WakeCastState
Reference(
double T,
const double* X)
const override;
303 void CurrentLoad(
double T,
const double* X,
const double freeStream[3],
const double flowDir[3],
double force[3],
double& frontalArea,
304 double rearCentre[3])
const override;
308 environment::wake::SourceLoad
BodyLoad(
double T,
const double* X,
const double bodyVel[3],
const double waterVel[3])
const override;
312 void PlateAxes(
const double* X,
double normal[3],
double chordAxis[3])
const;
314 environment::plate_geometry::Plate Plate()
const;
321 environment::wake::BodyFlowInteraction
m_flow;
329 const double* OutPos1(
const double dT,
const double*
const adX);
330 const double* OutPos3(
const double dT,
const double*
const adX);
331 const double* OutPos2(
const double dT,
const double*
const adX);
332 const double* OutVel1(
const double dT,
const double*
const adX);
333 const double* OutVel3(
const double dT,
const double*
const adX);
334 const double* OutVel2(
const double dT,
const double*
const adX);
345 unsigned long m_IStatePos;
346 unsigned long m_IStateQuater;
347 unsigned long m_IStateLocalVel;
348 unsigned long m_IStateOmega;
349 unsigned long m_IStateHydroForce;
358#ifdef FH_VISUALIZATION
359 void BottomContactRenderInit();
360 void RenderBottomContact(
double depth,
double m_cornerPos_ned[4][3],
double m_submergence[4]);
361 Ogre::ParticleSystem* m_particleSystem;
362 Ogre::SceneNode* m_particleNode;
363 Ogre::ParticleEmitter* m_particleEmitter;
364 Ogre::Vector3 m_visualizationScale;
366 std::string m_meshName;
368 double m_lengthScale;
369 double m_heightScale;
370 double m_curvatureScale;
371 Ogre::Entity* m_renderEntity;
372 Ogre::SceneNode* m_renderNode;
373 Ogre::Quaternion m_InitOrientation;
374 Ogre::SceneManager* m_sceneMgr;
376# ifdef USE_BILLBOARD_LABELS
377 Ogre::SceneNode* m_BBRenderNode;
378 Ogre::CMovableText* m_BBTxt;
Definition HydroBody.h:101
Definition TrawlDoorBase.h:293
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:190
hydro_body::Wrench WaterLoad(double T, const double *X, const hydro_body::FlowFrame &frame) const
double m_area
The trawldoor area.
Definition TrawlDoorBase.h:265
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:256
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:284
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:258
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:321
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:319
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:356
double m_rhoDoor
The density of the trawl door material.
Definition TrawlDoorBase.h:272
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:264
double m_rhoWater
The density of the surrounding fluid.
Definition TrawlDoorBase.h:283
double m_force_LB[3]
A pointer to the force.
Definition TrawlDoorBase.h:285
double m_force_UB[3]
A pointer to the input force.
Definition TrawlDoorBase.h:286
ISignalPort * m_inLB_F
The cable length input port.
Definition TrawlDoorBase.h:325
DoorCaster m_caster
The door for its wake; declared before m_flow, which keeps a pointer to it.
Definition TrawlDoorBase.h:320
double m_mass
The mass of the object.
Definition TrawlDoorBase.h:270
ISignalPort * m_inUB_F
The cable length input port.
Definition TrawlDoorBase.h:326
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:252
bool m_isPort
Is this a port trawl door?
Definition TrawlDoorBase.h:263
ISignalPort * m_inWarp_F
The cable length input port.
Definition TrawlDoorBase.h:324
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:343
plate_door::Door m_law
The door's constants for the plate-door law (Area, AR, Rho, IsPort, MaxLiftCoeff, DragCoeffAtMaxLift)...
Definition TrawlDoorBase.h:275
ICommonComputation * m_commonCalc
Calculations necessary for more than one output port.
Definition TrawlDoorBase.h:287
double m_outAlpha
Definition TrawlDoorBase.h:353
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