FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
marenv::current::DepthVaryingCurrentField Class Reference

#include <DepthVaryingCurrentField.h>

+ Inheritance diagram for marenv::current::DepthVaryingCurrentField:
+ Collaboration diagram for marenv::current::DepthVaryingCurrentField:

Public Member Functions

 DepthVaryingCurrentField (std::vector< double > velocity, std::vector< double > directionRad, std::vector< double > depthZ)
 
 ~DepthVaryingCurrentField () override=default
 Default destructor.
 
Status GetCurrent (double time, const double position[3], double currentVelocity[3]) override
 
- Public Member Functions inherited from marenv::current::CurrentField
virtual ~CurrentField ()=default
 Virtual destructor.
 

Detailed Description

Depth-varying ocean current field implementation.

This class models an ocean current field where velocity and direction vary with depth. It implements the CurrentField to provide current velocity queries at arbitrary positions in space and time.

The north and east components, v cos(theta) and v sin(theta) of each layer (theta the direction the current flows towards, from North towards East), are interpolated linearly in depth (calc::DepthAxis, located once per query). Above the surface (z < 0) the surface value applies. Above the first layer and below the last the current is that of the nearest layer, with Status::OUT_OF_RANGE_INACCURATE (owner ruling R122, MENV-0053), a usable value that EnvironmentFacade sums; the vertical component is 0.

Constructor & Destructor Documentation

◆ DepthVaryingCurrentField()

marenv::current::DepthVaryingCurrentField::DepthVaryingCurrentField ( std::vector< double >  velocity,
std::vector< double >  directionRad,
std::vector< double >  depthZ 
)

Constructs a depth-varying current field.

Parameters
[in]velocityVector of current velocities [m/s] for each depth layer.
[in]directionRadVector of current directions [rad] for each depth layer.
[in]depthZVector of depth values [m] corresponding to each layer.
Exceptions
std::invalid_argumentunless the three vectors have the same size, at least two layers, finite values and strictly increasing depths (calc::DepthAxis).

Member Function Documentation

◆ GetCurrent()

Status marenv::current::DepthVaryingCurrentField::GetCurrent ( double  time,
const double  position[3],
double  currentVelocity[3] 
)
overridevirtual

Returns the ocean current velocity at a given position.

Parameters
[in]timeSimulation time [s].
[in]positionPosition (x,y,z) in meters where the current is queried.
[out]currentVelocityCurrent velocity vector [m/s] at the given position.
Returns
marenv::Status::OK between the first and the last layer (at a layer, its value); Status::OUT_OF_RANGE_INACCURATE above the first or below the last layer, with the current of that layer; Status::ERROR_NOT_SET and zero for a NaN depth.

Implements marenv::current::CurrentField.


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