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

#include <WaterMapFields.h>

+ Inheritance diagram for environment::ShelteredWaveField:
+ Collaboration diagram for environment::ShelteredWaveField:

Public Member Functions

 ShelteredWaveField (std::shared_ptr< marenv::wave::WaveField > base, std::shared_ptr< const WaterMap > map)
 
const std::shared_ptr< marenv::wave::WaveField > & Base () const
 The open-sea waves.
 
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: still an upper bound of the sheltered elevation.
 
- 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

Waves felt in sheltered water (Waves.ShelterMap; river and sheltered-water plan, Phase 2): a wave field whose kinematics are those of the base field times the water map's shelter s at the horizontal position.

Elevation, particle velocity and acceleration and the dynamic pressure scale with s, the surface normal's tilt with s. The total pressure is rho g z plus the scaled dynamic pressure below the sheltered surface and 0 above it (marenv's convention, owner ruling D8). The component list (GetWaveComponents, used by the drawing) is the base field's: the picture applies Visual.WaterMap itself. An approximation (a real shelter changes the spectrum, not only the amplitude), meant to stop bodies in a basin or a river from moving in open-sea waves.

Constructor & Destructor Documentation

◆ ShelteredWaveField()

environment::ShelteredWaveField::ShelteredWaveField ( std::shared_ptr< marenv::wave::WaveField >  base,
std::shared_ptr< const WaterMap >  map 
)
Parameters
[in]baseThe open-sea waves.
[in]mapThe water map with the shelter.

Member Function Documentation

◆ ComputeDynamicPressure()

marenv::Status environment::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::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::ShelteredWaveField::MaxWaveElevation ( ) const
inlineoverridevirtual

Reimplemented from marenv::wave::WaveField.

◆ SpectrumName()

std::string environment::ShelteredWaveField::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::ShelteredWaveField::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: