15#include <fhsim_environment/ElementFlowInteraction.h>
16#include <fhsim_environment/EnvironmentProvider.h>
17#include <fhsim_environment/hydrodynamics/BodySubmergence.h>
18#include <fhsim_environment/hydrodynamics/WetCylinderLaw.h>
20#include <sfh/constants.h>
22#include <marenv/marenv.h>
28namespace wet_cylinder_water
50inline WaterAtElement SampleWater(
const environment::wake::ElementFlowInteraction& flow,
double T,
const double centre[3],
const double axis[3],
double length,
double radius,
int point)
52 environment::EnvironmentProvider& environment = *flow.Environment();
55 flow.WaterVelocity(T, point, centre, water.
waterVelocity.data());
57 const double half = 0.5 * length;
58 const double endA[3] = {centre[0] - half * axis[0], centre[1] - half * axis[1], centre[2] - half * axis[2]};
59 const double endB[3] = {centre[0] + half * axis[0], centre[1] + half * axis[1], centre[2] + half * axis[2]};
60 water.
wetFraction = environment::body_submergence::CylinderWetFraction(environment, environment.MaxWaveElevation(), T, endA, endB, radius);
61 const auto waves = environment.GetWaves();
63 environment::wet_cylinder::Vector mean;
64 environment::body_submergence::MeanWaveAcceleration(waves.get(), T, endA, endB, mean.data());
83 Eigen::Vector3d
force = Eigen::Vector3d::Zero();
102inline FixedDragLoad FixedDragLoadOnElement(
const environment::wake::ElementFlowInteraction& flow,
double T,
const Eigen::Vector3d& P,
const Eigen::Vector3d& V,
105 using environment::wet_cylinder::Vector;
107 const auto water = SampleWater(flow, T, P.data(), axis.data(), element.
length, element.
radius, point);
112 environment::wet_cylinder::WetCylinder cylinder {};
113 cylinder.length = element.
length;
114 cylinder.radius = element.
radius;
117 cylinder.addedMassCoefficient = 0.0;
120 const Vector unitAxis {axis(0), axis(1), axis(2)};
122 const Vector drag = environment::wet_cylinder::Drag(cylinder, environment::wet_cylinder::DragCoefficients {element.
normal, element.
tangential}, f, relative, unitAxis);
123 load.
force += Eigen::Vector3d(drag.data());
125 load.
force += Eigen::Vector3d(environment::wet_cylinder::MorisonForce(cylinder, f, *water.
waveAcceleration, unitAxis).data());
constexpr double seawaterDensity
Ocean water density.
Definition marenv.h:20
A cylinder element with fixed drag coefficients (RbCable/6DofCable, RbCable/Ring).
Definition WetCylinderWater.h:72
double radius
The element radius [m].
Definition WetCylinderWater.h:74
double normal
Cn, on the flow normal to the axis.
Definition WetCylinderWater.h:76
double waterDensity
The water density [kg/m³].
Definition WetCylinderWater.h:77
double tangential
Ct, on the skin area π D L, on the flow along the axis.
Definition WetCylinderWater.h:75
double length
The element length [m].
Definition WetCylinderWater.h:73
The water load on an element with fixed drag coefficients.
Definition WetCylinderWater.h:82
double displacedMass
ρ f V, the mass of the water the wet part displaces [kg]; its buoyancy is g times it,...
Definition WetCylinderWater.h:84
Eigen::Vector3d force
The drag and the Froude-Krylov force [N], NED.
Definition WetCylinderWater.h:83
The wet fraction, the water velocity and the wave acceleration at one element.
Definition WetCylinderWater.h:32
double wetFraction
f in [0, 1].
Definition WetCylinderWater.h:33
std::optional< environment::wet_cylinder::Vector > waveAcceleration
The mean of the ends [m/s²]; none without waves or when dry.
Definition WetCylinderWater.h:35
environment::wet_cylinder::Vector waterVelocity
u at the centre [m/s].
Definition WetCylinderWater.h:34