|
hydrobricks
|
#include <SolverSequential.h>
Public Member Functions | |
| void | InitializeContainers () override |
| bool | Solve (double timeStepInDays) final |
Public Member Functions inherited from Solver | |
| void | Connect (Processor *processor) |
Protected Member Functions | |
| virtual void | ComputeBrickRates (Brick *brick, double content, double inflow, double timeStepInDays, int iRateStart)=0 |
Static Protected Member Functions | |
| static double | TotalRateAt (Brick *brick, double *contentDelta, double offset) |
| static double | StoreRatesAndTotalAt (Brick *brick, double *contentDelta, double offset, vecDouble &rates) |
| static bool | SumAffineResponse (Brick *brick, double &rate, double &offset) |
Protected Attributes | |
| axd | _rates |
Protected Attributes inherited from Solver | |
| Processor * | _processor |
Additional Inherited Members | |
Static Public Member Functions inherited from Solver | |
| static std::unique_ptr< Solver > | Factory (const SolverSettings &solverSettings) |
Base class for the sequential solvers.
The bricks are processed one by one in declaration order (upstream before downstream). Each brick receives its inflows as a constant rate over the time step; the subclass computes the brick's average outflow rates over the step. The resulting rates go through the standard constraint and flux machinery, so water propagates through a cascade within the same step.
|
protectedpure virtual |
Compute the average outflow rates of the brick over the time step and store them in the _rates slice starting at iRateStart (one value per process connection, in process declaration order).
| brick | The brick to solve. |
| content | Start-of-step content [mm], including instantaneous deposits. |
| inflow | Inflows as a constant rate over the step [mm/d]. |
| timeStepInDays | The time step in days. |
| iRateStart | Index of the brick's first connection in _rates. |
Implemented in SolverAnalyticLinear, SolverCrankNicolson, SolverExponentialEuler, and SolverImplicitEuler.
|
overridevirtual |
|
finalvirtual |
Apply the solver.
| timeStepInDays | The time step in days. |
Implements Solver.
|
staticprotected |
Store the per-connection rates of the brick's processes, evaluated at the given content offset, and return their sum. The rates are computed once and used both for the total and for the per-connection values, which matters because this sits on the innermost solver loop.
| brick | The brick to evaluate. |
| contentDelta | Pointer to the container's dynamic content change. |
| offset | Content offset from the start-of-step content [mm]. |
| rates | The vector receiving the rates. |
|
staticprotected |
Sum the affine response coefficients of the brick's processes, evaluated at the current content: every process must report an affine response (rate = k S - offset) on a single connection for the sum to be meaningful.
A process may be affine only over part of the content range (a threshold outflow is simply off below its threshold, an empty store produces no outflow at all), so a solution built from these coefficients is a candidate that still has to be checked against the real process rates.
| brick | The brick to inspect. |
| rate | Receives the summed linear coefficient k [1/d]. |
| offset | Receives the summed offset [mm/d]. |
|
staticprotected |
Sum the rates of all processes of the brick, evaluated at the given content offset. Temporarily writes the offset into the container's dynamic change; the caller must restore it to zero before the constraint pass.
| brick | The brick to evaluate. |
| contentDelta | Pointer to the container's dynamic content change. |
| offset | Content offset from the start-of-step content [mm]. |