|
FhSim
3.1.0
Marine systems simulation
|
#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. | |
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.
| marenv::current::DepthVaryingCurrentField::DepthVaryingCurrentField | ( | std::vector< double > | velocity, |
| std::vector< double > | directionRad, | ||
| std::vector< double > | depthZ | ||
| ) |
Constructs a depth-varying current field.
| [in] | velocity | Vector of current velocities [m/s] for each depth layer. |
| [in] | directionRad | Vector of current directions [rad] for each depth layer. |
| [in] | depthZ | Vector of depth values [m] corresponding to each layer. |
| std::invalid_argument | unless the three vectors have the same size, at least two layers, finite values and strictly increasing depths (calc::DepthAxis). |
|
overridevirtual |
Returns the ocean current velocity at a given position.
| [in] | time | Simulation time [s]. |
| [in] | position | Position (x,y,z) in meters where the current is queried. |
| [out] | currentVelocity | Current velocity vector [m/s] at the given position. |
Implements marenv::current::CurrentField.