|
FhSim
3.1.0
Marine systems simulation
|
#include <WakeAccumulator.h>
Public Member Functions | |
| double | Add (const WakeField &field, double t, const double pos[3]) |
| double | Add (const WakeSample &sample) |
| double | Add (const WakeSampleParts &parts, double t) |
| double | AddOwn (const WakeField &field, double t, const double pos[3]) |
| double | AddOwn (const WakeSample &sample) |
| double | AddOwn (const WakeSampleParts &parts, double t) |
| WakeComposition | Result () const |
| The composed deficit, the deficit-weighted source velocity (zero without a deficit) and the number of contributing fields. | |
Running composition of wakes at one point: the rule of WakeRegistry::Compose() (owner rulings R88, R95).
Each added deficit is clamped to [0, 1]; a zero or NaN deficit, or a field that answers a status other than Status::OK, adds nothing (MENV-0020). The registered (Add()) deficits compose by the momentum-flux rule, D (1 - D) = sum d_i (1 - d_i) (MomentumFluxSum); the own deficit (AddOwn(), a net's private per-panel field, normalised by its local, shaded inflow) multiplies onto them, d_tot = 1 - (1 - D) (1 - d_own); the source velocity is the deficit-weighted mean of all of them. WakeRegistry::Compose() is this accumulator over the registered fields in registration order, then the own field, so a caller that holds samples (fhsim_environment's held sums, R46) or pre-samples (a caster's rebuild) gets the same result bit for bit when it adds them in that order. Held parts (WakeField::SampleParts()) add by the same rule, composed at the evaluation time with the live blend weight (R136).
Example usage:
| double marenv::wake::WakeAccumulator::Add | ( | const WakeField & | field, |
| double | t, | ||
| const double | pos[3] | ||
| ) |
Samples a registered field at pos and adds its deficit (momentum-flux rule).
| double marenv::wake::WakeAccumulator::Add | ( | const WakeSample & | sample | ) |
Adds the deficit and source velocity of a registered field sampled earlier (with Status::OK).
| double marenv::wake::WakeAccumulator::Add | ( | const WakeSampleParts & | parts, |
| double | t | ||
| ) |
Adds a registered field's parts held from an earlier sample, composed at t (owner ruling R136; WakeField::SampleParts()).
| double marenv::wake::WakeAccumulator::AddOwn | ( | const WakeField & | field, |
| double | t, | ||
| const double | pos[3] | ||
| ) |
Samples the own field at pos and multiplies its deficit onto the composition (product rule).
| std::logic_error | if an own field was added already. |
| double marenv::wake::WakeAccumulator::AddOwn | ( | const WakeSample & | sample | ) |
Adds the own field's deficit and source velocity sampled earlier (with Status::OK).
| std::logic_error | if an own field was added already. |
| double marenv::wake::WakeAccumulator::AddOwn | ( | const WakeSampleParts & | parts, |
| double | t | ||
| ) |
Adds the own field's parts held from an earlier sample, composed at t (owner ruling R136).
| std::logic_error | if an own field was added already. |