|
FhSim
3.1.0
Marine systems simulation
|
#include <Tide.h>
Classes | |
| struct | Constituent |
| One constituent of the input. More... | |
Public Member Functions | |
| Tide (double meanLevel, std::vector< Constituent > constituents, double startTime) | |
| double | Level (double t) const |
| The water level eta [m] at the simulation time t [s], positive up. | |
| double | Rate (double t) const |
| The rate of the water level [m/s] at the simulation time t [s]. | |
| double | MaxLevel () const |
| An upper bound of |eta| [m]: |Z0| + sum of f_i H_i. | |
| double | MeanLevel () const |
| double | StartTime () const |
| const std::vector< Constituent > & | Constituents () const |
Static Public Member Functions | |
| static std::vector< Constituent > | ReadFile (const std::string &path, double &meanLevel) |
| static double | ParseUtc (const std::string &text) |
| static bool | Known (const std::string &name) |
| True when the name is in the constituent table (case-insensitive). | |
| static double | SpeedDegPerHour (const std::string &name) |
| The angular speed [deg/h] of a constituent in the table (for tests and documentation). | |
The astronomical tide at one place from its harmonic constituents (Tide.*; plan doc/plans/tide-wakes-gunnerus.md, Phase T1).
eta(t) = Z0 + sum_i f_i H_i cos(V_i(t) + u_i - g_i)
with t the calendar time in UTC (the start time plus the simulation time), H_i and g_i the amplitude and the Greenwich phase lag of constituent i (UTC, degrees), V_i its astronomical argument from its Doodson numbers and f_i, u_i its nodal factor and angle (Schureman's formulas, from the longitude of the Moon's node). The nodal terms are taken at the start time: they change by less than 0.1 % of the amplitude per week.
The constituent table holds the 30 constituents that fit a year of Kartverket's predictions for Trondheim to 1.7 cm (rms, checked in another year): the main semi-diurnal, diurnal, long-period and shallow-water ones. Names as in the IHO list (case-insensitive): M2 S2 N2 K2 K1 O1 P1 Q1 M4 MS4 MN4 Mf Mm Sa Ssa 2N2 MU2 NU2 L2 T2 LAM2 J1 OO1 2Q1 S1 M3 MK3 M6 2MS6 MSf.
Heights are positive up, relative to the scene's z = 0 (NED: the still-water surface is at z = -eta). No Ogre types.
| environment::Tide::Tide | ( | double | meanLevel, |
| std::vector< Constituent > | constituents, | ||
| double | startTime | ||
| ) |
| [in] | meanLevel | Z0 [m], positive up. |
| [in] | constituents | The constituents (each name once). |
| [in] | startTime | The calendar time at simulation time 0, seconds since 1970-01-01T00:00Z (UTC). |
| std::invalid_argument | for an unknown or repeated name, or a negative or non-finite value. |
|
static |
Parse an ISO 8601 time in UTC, "YYYY-MM-DDThh:mm[:ss[.fff]]" with an optional "Z" or "+00:00".
| std::invalid_argument | for anything else (other time zones included). |
|
static |
Read the constituents from a JSON file (fhsim_environment.tide/1):
| [in] | path | The file. |
| [out] | meanLevel | The file's mean level [m]. |
| std::runtime_error | with the reason. |