FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
environment::TidalWaveField Class Reference

#include <WaterMapFields.h>

+ Inheritance diagram for environment::TidalWaveField:
+ Collaboration diagram for environment::TidalWaveField:

Public Member Functions

 TidalWaveField (std::shared_ptr< marenv::wave::WaveField > base, std::shared_ptr< const Tide > tide)
 
const std::shared_ptr< marenv::wave::WaveField > & Base () const
 
const std::shared_ptr< const Tide > & GetTide () const
 
std::string SpectrumName () const override
 
std::string WaveTheoryName () const override
 
marenv::Status ComputeSurfaceElevation (double time, const double pos[2], double &elevationOut) override
 
marenv::Status ComputeDynamicPressure (double time, const double pos[3], double &pressureOut) override
 
marenv::Status ComputeTotalPressure (double time, const double pos[3], double &pressureOut) override
 
marenv::Status ComputeSurfaceUnitNormal (double time, const double pos[2], double unitNormalOut[3]) override
 
marenv::Status ComputeParticleVelocity (double time, const double pos[3], double velOut[3]) override
 
marenv::Status ComputeParticleAcceleration (double time, const double pos[3], double accOut[3]) override
 
marenv::Status ComputePointQuery (double time, const double pos[3], double &surface_elevation, double surface_unit_normal[3], double particle_velocity[3], double particle_acceleration[3], double &pressure) override
 
InsecureDatapointers GetWaveComponents () const override
 
marenv::wave::WaveComponentData GetWaveComponentsCopy () const override
 
marenv::wave::WaveComponentData GetWaveComponentsCopy (double time, size_t maxComponents=0) const override
 
double MaxWaveElevation () const override
 The base field's bound plus the largest tidal level.
 
- Public Member Functions inherited from marenv::wave::WaveField
virtual ~WaveField ()=default
 

Additional Inherited Members

- Protected Member Functions inherited from marenv::wave::WaveField
 WaveField ()=default
 Constructor.
 

Detailed Description

The waves on a tidal water level (Tide.*; plan doc/plans/tide-wakes-gunnerus.md, Phase T1).

The still-water surface is at z = -eta(t) (NED). Every query of the base field is made at the depth below that surface: the base field sees (x, y, z + eta). So the elevation is the base elevation plus eta, the total pressure rho g (z + eta) plus the dynamic pressure there (0 above the surface), and the normal, the particle velocity and acceleration and the dynamic pressure are the base field's at the shifted depth. The vertical velocity of the level itself (at most a few cm/min) is left out. The component list is the base field's: the drawing adds the level itself (Environment::RenderUpdate).

Constructor & Destructor Documentation

◆ TidalWaveField()

environment::TidalWaveField::TidalWaveField ( std::shared_ptr< marenv::wave::WaveField >  base,
std::shared_ptr< const Tide >  tide 
)
Parameters
[in]baseThe waves about the still-water surface (may be a ShelteredWaveField).
[in]tideThe tide.

Member Function Documentation

◆ ComputeDynamicPressure()

marenv::Status environment::TidalWaveField::ComputeDynamicPressure ( double  time,
const double  pos[3],
double &  pressureOut 
)
overridevirtual

Returns the dynamic pressure at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the pressure is desired.
[out]pressureOutThe pressure at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implements marenv::wave::WaveField.

◆ ComputeParticleAcceleration()

marenv::Status environment::TidalWaveField::ComputeParticleAcceleration ( double  time,
const double  pos[3],
double  accOut[3] 
)
overridevirtual

Returns the particle acceleration at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the particle acceleration is desired.
[out]accOutThe particle acceleration at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

The wave particle acceleration only; a current is not included.

Implements marenv::wave::WaveField.

◆ ComputeParticleVelocity()

marenv::Status environment::TidalWaveField::ComputeParticleVelocity ( double  time,
const double  pos[3],
double  velOut[3] 
)
overridevirtual

Returns the particle velocity at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the particle velocity is desired.
[out]velOutThe particle velocity at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

The wave particle velocity only; a current is not included (EnvironmentFacade adds it).

Implements marenv::wave::WaveField.

◆ ComputePointQuery()

marenv::Status environment::TidalWaveField::ComputePointQuery ( double  time,
const double  pos[3],
double &  surface_elevation,
double  surface_unit_normal[3],
double  particle_velocity[3],
double  particle_acceleration[3],
double &  pressure 
)
overridevirtual

Calculates multiple properties of the environment in one call.

Parameters
[in]timeSimulation time.
[in]posPosition.
[out]surface_elevationThe surface elevation above this point.
[out]surface_unit_normalThe surface unit normal above this point.
[out]particle_velocityThe particle velocity in this point.
[out]particle_accelerationThe particle acceleration in this point.
[out]pressureThe pressure. The pressure in this point.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implements marenv::wave::WaveField.

◆ ComputeSurfaceElevation()

marenv::Status environment::TidalWaveField::ComputeSurfaceElevation ( double  time,
const double  pos[2],
double &  elevationOut 
)
overridevirtual

Returns the surface elevation at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y) for which surface elevation is desired.
[out]elevationOutSurface elevation at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implements marenv::wave::WaveField.

◆ ComputeSurfaceUnitNormal()

marenv::Status environment::TidalWaveField::ComputeSurfaceUnitNormal ( double  time,
const double  pos[2],
double  unitNormalOut[3] 
)
overridevirtual

Returns the unit normal vector of the surface at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y) for which the unit normal surface vector is desired.
[out]unitNormalOutThe unit normal surface vector at pos.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Implements marenv::wave::WaveField.

◆ ComputeTotalPressure()

marenv::Status environment::TidalWaveField::ComputeTotalPressure ( double  time,
const double  pos[3],
double &  pressureOut 
)
overridevirtual

Returns the total (gauge) pressure at a specific position.

Parameters
[in]timeCurrent simulation time.
[in]posPosition (x,y,z) for which the pressure is desired.
[out]pressureOutThe pressure at pos, relative to the atmosphere.
Returns
marenv::Status::OK on success. See marenv::Status for other values.

Owner ruling D8: the total pressure is rho g z + the dynamic pressure of ComputeDynamicPressure() (z positive down), and 0 for a point above the free surface. The dynamic pressure already holds the free-surface elevation, so the elevation is not added again.

Implements marenv::wave::WaveField.

◆ GetWaveComponents()

InsecureDatapointers environment::TidalWaveField::GetWaveComponents ( ) const
inlineoverridevirtual

Getter for wave component pointers.

Returns
A structure with pointers to wave component data.

Their use focus on efficiency. The views live as long as the field: its component snapshot is set only in the constructor, so the pointers stay valid until the field is destroyed. Do not use them after that.

Implements marenv::wave::WaveField.

◆ GetWaveComponentsCopy() [1/2]

marenv::wave::WaveComponentData environment::TidalWaveField::GetWaveComponentsCopy ( ) const
inlineoverridevirtual

Getter for a copy of wave component specifications.

Returns
A structure with wave component data.

Implements marenv::wave::WaveField.

◆ GetWaveComponentsCopy() [2/2]

marenv::wave::WaveComponentData environment::TidalWaveField::GetWaveComponentsCopy ( double  time,
size_t  maxComponents = 0 
) const
inlineoverridevirtual

Getter for a copy of wave component specifications at a given time.

Parameters
[in]timeSimulation time used to evaluate the interpolation factor.
[in]maxComponentsMaximum number of components to return (0 = all).
Returns
A structure with wave component data.

During a transition this may return the merged components from both source and destination fields with amplitudes scaled by the interpolation factor. The default implementation ignores time: it takes the components of the time-independent overload and returns them sorted by descending amplitude (a signed zetaA, with std::sort or std::partial_sort, so components of equal amplitude come in an unspecified order). When limited, the components with the largest amplitudes are kept.

Reimplemented from marenv::wave::WaveField.

◆ MaxWaveElevation()

double environment::TidalWaveField::MaxWaveElevation ( ) const
inlineoverridevirtual

Reimplemented from marenv::wave::WaveField.

◆ SpectrumName()

std::string environment::TidalWaveField::SpectrumName ( ) const
inlineoverridevirtual

Getter for the name of the wave spectrum used for the realisation of the waves.

Returns
Ittc or Jonswap.

Implements marenv::wave::WaveField.

◆ WaveTheoryName()

std::string environment::TidalWaveField::WaveTheoryName ( ) const
inlineoverridevirtual

Getter for the name of the wave theory used for the realisation of the waves.

Returns
Airy or Gerstner.

Implements marenv::wave::WaveField.


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