FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
NetWakePanels.h
1#pragma once
2
14#include "NetCore.h"
15
16#include <fhsim_environment/PanelSourceSet.h>
17
19class NetWakePanels final : public environment::wake::WakePanelSource
20{
21public:
23 explicit NetWakePanels(const NetCore& core)
24 : m_core(core)
25 {
26 }
27
28 int NumNodes() const override { return m_core.NumNodes(); }
29 int NumPanels() const override { return m_core.NumPanels(); }
30
31 void PanelNodes(int panel, int nodes[3]) const override
32 {
33 const int* panelNodes = m_core.PanelNodes(panel);
34 for (int k = 0; k < 3; k++)
35 nodes[k] = panelNodes[k];
36 }
37
38 void NodePosition(const double* X, int node, double pos[3]) const override
39 {
40 const double* state = m_core.View(X).Position(node);
41 for (int k = 0; k < 3; k++)
42 pos[k] = state[k];
43 }
44
45 void NodeVelocity(const double* X, int node, double vel[3]) const override
46 {
47 const double* state = m_core.View(X).Velocity(node);
48 for (int k = 0; k < 3; k++)
49 vel[k] = state[k];
50 }
51
52 int NumCables() const override { return m_core.NumCables(); }
53
54 void CableNodes(int cable, int nodes[2]) const override
55 {
56 for (int k = 0; k < 2; k++)
57 nodes[k] = m_core.Cable(cable).m_conn[k];
58 }
59
60 environment::wake::PanelEvaluation EvaluatePanel(const double* X, int panel, const double elementVel[3], const double waterVel[3]) const override
61 {
62 const NetNodeView view = m_core.View(X);
63 const int* nodes = m_core.PanelNodes(panel);
64 const double* posA = view.Position(nodes[0]);
65 const double* posB = view.Position(nodes[1]);
66 const double* posC = view.Position(nodes[2]);
67 const NetElement3N& element = m_core.Panel(panel);
68 environment::wake::PanelEvaluation evaluation;
69 evaluation.load = element.EvaluatePanelLoad(m_core.PanelHydrodynamics().law, m_core.PanelHydrodynamics().fluid, posA, posB, posC, elementVel, waterVel, evaluation.area);
70 evaluation.solidity = element.WakeSolidity(posA, posB, posC);
71 return evaluation;
72 }
73
74 void CableHydrodynamicForce(double T, const double* X, double force[3]) const override { m_core.CableHydrodynamicForce(T, X, force); }
75
76private:
77 const NetCore& m_core;
78};
int m_conn[2]
The node numbers that the element is connected to.
Definition NetCableElement.h:97
Definition NetCore.h:49
NetNodeView View(const double *X, int stateBase=0) const
The nodes of X; stateBase as NetNodeView. Valid after FinalSetup.
Definition NetCore.h:95
int NumNodes() const
The calculation nodes.
Definition NetCore.h:97
void CableHydrodynamicForce(double T, const double *X, double force[3]) const
const int * PanelNodes(int panel) const
The three nodes of panel.
Definition NetCore.h:103
Definition NetElement3N.h:47
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
Definition NetElement3N.h:198
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 (NetSolid...
Definition NetElement3N.h:222
Definition NetWakePanels.h:20
NetWakePanels(const NetCore &core)
Definition NetWakePanels.h:23
The nodes of one state vector, as the net core reads them: plain index arithmetic,...
Definition NetNodeStates.h:26
const double * Position(int node) const
The position of node, 3 states.
Definition NetNodeStates.h:32
const double * Velocity(int node) const
The velocity of node, 3 states.
Definition NetNodeStates.h:34
hydrodynamics::Fluid fluid
From Rho and Nu.
Definition NetPanelSetup.h:40
hydrodynamics::PanelLoadLaw law
From HydroModel and the law's parameters.
Definition NetPanelSetup.h:39