FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetElement3N Class Reference

Public Member Functions

 NetElement3N (const std::string netName, const unsigned long iID, const NetElementDef *netPanel, const double dRho_water, const double knotDiameter, const double knotMomStiff, const double dKknotMomStiff_contact, const net_solidity::PanelSolidity &solidity, const double dampingRatio)
 The constructor.
 
 ~NetElement3N (void)
 The destructor.
 
 NetElement3N (const NetElement3N &)=delete
 
NetElement3N & operator= (const NetElement3N &)=delete
 
template<class T >
void AddNodeForces (const hydrodynamics::PanelLoadLaw &law, const hydrodynamics::Fluid &fluid, const T *const posA_ned, const T *const posB_ned, const T *const posC_ned, const T *const velA_ned, const T *const velB_ned, const T *const velC_ned, const T *const waterVel_ned, T *const nodeAforce_ned, T *const nodeBforce_ned, T *const nodeCforce_ned, double addedLinearDrag=0.0, const hydrodynamics::PanelClampLog *clampLog=nullptr) const
 
void NodeForceJacobian (const hydrodynamics::PanelLoadLaw &law, const hydrodynamics::Fluid &fluid, const double posA_ned[3], const double posB_ned[3], const double posC_ned[3], const double velA_ned[3], const double velB_ned[3], const double velC_ned[3], const double waterVel_ned[3], double addedLinearDrag, double dF[3][6][9]) const
 
hydrodynamics::PanelLoad< double > EvaluatePanelLoad (const hydrodynamics::PanelLoadLaw &law, const hydrodynamics::Fluid &fluid, const double *const posA_ned, const double *const posB_ned, const double *const posC_ned, const double elementVel[3], const double waterVel_ned[3], double &area) const
 
bool HasBarDirections () const
 True when the bar directions are defined, which needs a non-zero mesh determinant.
 
double Solidity (double meshOpeningAngle) const
 The solidity of the element at the given mesh half opening angle [rad].
 
double Solidity (const double *const posA_ned, const double *const posB_ned, const double *const posC_ned) const
 The solidity of the element at the given node positions, global frame.
 
double WakeSolidity (const double *const posA_ned, const double *const posB_ned, const double *const posC_ned) const
 The solidity the element hands to its wake source at the given node positions, global frame (NetSolidity.h WakeSolidity, R56).
 
double CalcNodeInertia (int node)
 Calculates the inertia of a node.
 

Member Function Documentation

◆ AddNodeForces()

template<class T >
void NetElement3N::AddNodeForces ( const hydrodynamics::PanelLoadLaw &  law,
const hydrodynamics::Fluid &  fluid,
const T *const  posA_ned,
const T *const  posB_ned,
const T *const  posC_ned,
const T *const  velA_ned,
const T *const  velB_ned,
const T *const  velC_ned,
const T *const  waterVel_ned,
T *const  nodeAforce_ned,
T *const  nodeBforce_ned,
T *const  nodeCforce_ned,
double  addedLinearDrag = 0.0,
const hydrodynamics::PanelClampLog *  clampLog = nullptr 
) const
inline

Adds this element's contribution to the forces on its three nodes.

Templated on the scalar type: over double it is the force function, over sfh::ad::Dual<N> it gives the element's exact Jacobian (NodeForceJacobian). The solidity comes from the element's rule (NetSolidity.h), at the mesh opening angle of the given positions, and the hydrodynamic force from one evaluation of law (NetElement3NForces.h).

Parameters
[in]lawThe panel load law.
[in]fluidDensity and kinematic viscosity.
[in]posA_nedPosition of node A, global frame.
[in]posB_nedPosition of node B, global frame.
[in]posC_nedPosition of node C, global frame.
[in]velA_nedVelocity of node A, global frame.
[in]velB_nedVelocity of node B, global frame.
[in]velC_nedVelocity of node C, global frame.
[in]waterVel_nedFree-stream water velocity at the element, global frame.
[in,out]nodeAforce_nedAccumulator for the force on node A.
[in,out]nodeBforce_nedAccumulator for the force on node B.
[in,out]nodeCforce_nedAccumulator for the force on node C.
[in]addedLinearDragAdditional linear drag per node.
[in]clampLogReceives the load law's clamp flags (MARE-0140); none when null.

◆ EvaluatePanelLoad()

hydrodynamics::PanelLoad< double > NetElement3N::EvaluatePanelLoad ( const hydrodynamics::PanelLoadLaw &  law,
const hydrodynamics::Fluid &  fluid,
const double *const  posA_ned,
const double *const  posB_ned,
const double *const  posC_ned,
const double  elementVel[3],
const double  waterVel_ned[3],
double &  area 
) const
inline

Evaluates the panel load law on the element without adding any node force.

The same evaluation as AddNodeForces makes, at a given element velocity instead of the mean of the node velocities; a wake caster uses it for the source strength (fhsim_environment/PanelSourceSet.h).

Parameters
[in]lawThe panel load law.
[in]fluidDensity and kinematic viscosity.
[in]posA_nedPosition of node A, global frame.
[in]posB_nedPosition of node B, global frame.
[in]posC_nedPosition of node C, global frame.
[in]elementVelVelocity of the element, global frame.
[in]waterVel_nedFree-stream water velocity at the element, global frame.
[out]areaThe element's area at the given positions, m^2.
Returns
The panel load.

◆ NodeForceJacobian()

void NetElement3N::NodeForceJacobian ( const hydrodynamics::PanelLoadLaw &  law,
const hydrodynamics::Fluid &  fluid,
const double  posA_ned[3],
const double  posB_ned[3],
const double  posC_ned[3],
const double  velA_ned[3],
const double  velB_ned[3],
const double  velC_ned[3],
const double  waterVel_ned[3],
double  addedLinearDrag,
double  dF[3][6][9] 
) const
inline

The exact Jacobian of the node forces AddNodeForces adds: the derivatives of the forces on A, B and C with respect to the positions and velocities of A, B and C.

Forward-mode AD over sfh::ad::Dual<12> (MARE-0205). Nine slots carry the positions. The node velocities enter the force only through their mean, in the load law, and linearly, in the damping (NetElement3NForces.h, AddNodeForces and CalcDampingForces). So the three remaining slots carry the three components of all three velocities at once: their gradient on node n's force is G_n = sum_m dF_n/dv_m = L'/3 - (a/3) I, where L' is the law's derivative with respect to the mean velocity and a the added linear drag (the damping part cancels). Each velocity block is then dF_n/dv_m = (G_n + (a/3) I)/3 + c (1/3 - delta_nm) I - (a/3) delta_nm I, with c the damping coefficient: the Jacobian of AddNodeForces over Dual<18>, to rounding, at about half its cost.

Parameters
[in]lawThe panel load law.
[in]fluidDensity and kinematic viscosity.
[in]posA_nedPosition of node A, global frame (likewise B and C).
[in]velA_nedVelocity of node A, global frame (likewise B and C).
[in]waterVel_nedFree-stream water velocity at the element, a constant.
[in]addedLinearDragAdditional linear drag per node, as for AddNodeForces.
[out]dFdF[node][group], node 0..2 = A, B, C, group 0..2 = the positions of A, B, C and 3..5 their velocities; each block 3x3 row-major, dF[node][group][3 * j + k] = dF_j / dx_k.

The documentation for this class was generated from the following file: