OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::fv::PressurizedHeadSolver Class Reference

#include <PressurizedHeadSolver.hpp>

Collaboration diagram for openswmm::fv::PressurizedHeadSolver:

Public Types

enum  : std::uint8_t {
  kNone = 0 ,
  kFull = 1 ,
  kDelta = 2
}
 

Public Member Functions

bool classify (const PressurizedView &v)
 Rebuild pressure membership, implicit face ownership and union-find connectivity.
 
void solve (const PressurizedView &v, double dt)
 Predict fully pressurized face discharges with an implicit head system.
 
NonlinearPressureStorage::Result solveCandidate (const PressurizedView &v, double dt, const NonlinearPressureStorage::Controls &controls)
 Try a guarded nonlinear SLOT-storage pressure predictor.
 
bool verifyCandidateEndpoint (const PressurizedView &v, double dt, const NonlinearPressureStorage::Controls &controls)
 Check the actual post-update endpoint against the last nonlinear candidate equations.
 
void finalizeCells (const PressurizedView &v)
 Replace pressure-cell discharge with its solved face through-flow after conservative update.
 
const std::vector< std::uint8_t > & foldedNodes () const noexcept
 Borrow the last classification folded-node mask.
 
bool anyImplicit () const noexcept
 Report whether the last classification contains any fully implicit face.
 

Static Public Member Functions

static bool cellPressurized (const NetworkMeshData &mesh, const NetworkStateData &state, int cell)
 Test pressure membership shared by classification and timestep census.
 
static std::uint8_t faceModeOf (const NetworkMeshData &mesh, const NetworkStateData &state, int f)
 Classify one face as explicit, full pressure or a pressure/free transition.
 
static bool ghostPressurized (const NetworkMeshData &mesh, const NetworkStateData &state, int f)
 Test the node-side ghost pressure state in the adjacent cell geometry.
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum : std::uint8_t

Face treatment decided by classify(). Values are load-bearing for the assembly switch; kNone faces are untouched. kFull — both sides pressurized: Casulli form (steady state reduces to ΔH/L = −S_f exactly — the head-loss invariance gate). kDelta — a transition face (exactly one side pressurized, with a pressurized CELL side). CLASSIFICATION ONLY in R2a: the face stays fully explicit — Godunov flux and census bound. Folding transitions in was built and MEASURED before being cut: every memoryless fold (frozen-ghost delta form, free cell as a soft unknown, free-side depth thresholds at 0.05 and 0.5·y_full) re-times an ADVANCING fill — bore arrival 65/345 s, 60/545 s, 75/1320 s at c = 150/660 against the 42 s quasi-steady analytic — because any instantaneous threshold is swept through transiently while a cell fills. A STANDING transition (backwater below an internal jump) is only distinguishable by cadence, so releasing its census throttle belongs to the LTS composition (R2b), which can put the front on its own fine tier. kNone — everything else: gated/culvert faces (their laws stand), closed ends, and faces with no pressurized CELL side (a pressurized ghost against a free cell is the classic manhole bore).

Enumerator
kNone 
kFull 
kDelta 

Member Function Documentation

◆ anyImplicit()

bool openswmm::fv::PressurizedHeadSolver::anyImplicit ( ) const
inlinenoexcept

Report whether the last classification contains any fully implicit face.

Returns
True when imp_faces_ is nonempty; this does not certify solve convergence or endpoint validity.

◆ cellPressurized()

static bool openswmm::fv::PressurizedHeadSolver::cellPressurized ( const NetworkMeshData & mesh,
const NetworkStateData & state,
int cell )
inlinestatic

Test pressure membership shared by classification and timestep census.

When TPA flags exist they must contain every cell; this predicate does not also check the geometry is closed. No flags or history are changed.

Parameters
[in]meshBorrowed immutable aligned FV topology/geometry; index arrays are unchecked.
[in]stateBorrowed current cell depths/regime flags and node heads aligned to mesh.
[in]cellValid nonnegative mesh cell index.
Returns
Nonzero cell_tpa flag when that vector is nonempty; otherwise a closed geometry with depth>=y_crown.
Here is the caller graph for this function:

◆ classify()

bool openswmm::fv::PressurizedHeadSolver::classify ( const PressurizedView & v)

Rebuild pressure membership, implicit face ownership and union-find connectivity.

Resets pressure/fold masks and implicit faces. SLOT membership uses closed cells at/above y_crown; nonempty cell_tpa instead supplies history flags. Only kFull faces are implicit; kDelta remains explicit. An eligible algebraic node folds only when every incident face is full, no fixed head applies, and no real pond demotes it. Builds unknown maps and union-find roots; component CSR is built later during solve. Changes internal scratch only, can allocate/throw, and invalidates previous masks/candidate preparation. Calls on one solver instance require serialization.

Parameters
[in]vBorrowed fully aligned mesh/state, active face/cell lists, algebraic-node mask/full-volume arrays and optional forcing. Required pointers are non-null; referenced topology indices are valid.
Returns
True if at least one active kFull face exists; false if no active pressure cell or no eligible full face.
Here is the call graph for this function:

◆ faceModeOf()

static std::uint8_t openswmm::fv::PressurizedHeadSolver::faceModeOf ( const NetworkMeshData & mesh,
const NetworkStateData & state,
int f )
inlinestatic

Classify one face as explicit, full pressure or a pressure/free transition.

Any nonzero gate mask, any culvert assignment, or a closed end excludes implicit treatment regardless of current flux direction. Node pressure comes from ghostPressurized. This predicate ignores active timestep masks; classify applies those separately.

Parameters
[in]meshBorrowed immutable aligned FV topology/geometry; index arrays are unchecked.
[in]stateBorrowed current cell depths/regime flags and node heads aligned to mesh.
[in]fValid global face index; all incident cells/nodes must be valid or use the documented -1 boundary sentinel.
Returns
kFull when both sides are pressure and at least one cell is pressure; kDelta for exactly one pressure side with a pressure cell; kNone otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ finalizeCells()

void openswmm::fv::PressurizedHeadSolver::finalizeCells ( const PressurizedView & v)

Replace pressure-cell discharge with its solved face through-flow after conservative update.

For classified pressurized cells owning an unknown, transforms the two current face mass fluxes into the cell axis, averages them into state.cell_q and refreshes cell_u=q/A (zero velocity at dry area). Leaves area/depth/node state unchanged. Empty implicit set is a no-op. Run after updateCells/updateNodes, using the same classified geometry and current face flux ledger.

Parameters
[in,out]vBorrowed aligned view matching the last successful classify, with fresh explicit face states/fluxes, current old-state heads/areas and node carry/source arrays. All required pointers and ranges remain live for the call; no view pointer is retained.
Here is the call graph for this function:

◆ foldedNodes()

const std::vector< std::uint8_t > & openswmm::fv::PressurizedHeadSolver::foldedNodes ( ) const
inlinenoexcept

Borrow the last classification folded-node mask.

Consumers skip their explicit algebraic relaxation. Contents/storage can change on the next classify; the reference is valid only while this solver object lives.

Returns
Const node-indexed mask reference; entries with value one own a pressure continuity row.

◆ ghostPressurized()

static bool openswmm::fv::PressurizedHeadSolver::ghostPressurized ( const NetworkMeshData & mesh,
const NetworkStateData & state,
int f )
inlinestatic

Test the node-side ghost pressure state in the adjacent cell geometry.

Sealed means positive node_sur_depth, allowing sub-atmospheric TPA pressure. No physical head floor or branch mutation is applied.

Parameters
[in]meshBorrowed immutable aligned FV topology/geometry; index arrays are unchecked.
[in]stateBorrowed current cell depths/regime flags and node heads aligned to mesh.
[in]fValid face index; a missing node or adjacent cell returns false.
Returns
False for open geometry; otherwise true for a sealed node adjoining a flagged TPA cell, or node_head-face_zb>=y_crown.
Here is the caller graph for this function:

◆ solve()

void openswmm::fv::PressurizedHeadSolver::solve ( const PressurizedView & v,
double dt )

Predict fully pressurized face discharges with an implicit head system.

Prepares friction/conveyance coefficients, solves each pressure component, and demotes out-of-range folded heads to Dirichlet values for at most four passes per solve. Uses Thomas on paths and bounded Jacobi-CG elsewhere; no convergence status is exposed. Applies up to three storage secant corrections by default (process-cached atoi(OPENSWMM_FV_PRESS_SECANT_PASSES) overrides); this Picard correction need not converge for stiff crown transitions. Publishes f_mass, f_flux.mass/sstar, f_sstar and folded node heads; cell A/Q/volume update remains the caller responsibility. Allocations can throw; no rollback guarantee is supplied. Call finalizeCells after the conservative cell/node update.

Parameters
[in,out]vBorrowed aligned view matching the last successful classify, with fresh explicit face states/fluxes, current old-state heads/areas and node carry/source arrays. All required pointers and ranges remain live for the call; no view pointer is retained.
[in]dtPositive substep duration in seconds; <=0 or an empty implicit face set is a no-op.
Here is the call graph for this function:

◆ solveCandidate()

NonlinearPressureStorage::Result openswmm::fv::PressurizedHeadSolver::solveCandidate ( const PressurizedView & v,
double dt,
const NonlinearPressureStorage::Controls & controls )

Try a guarded nonlinear SLOT-storage pressure predictor.

Requires prior classify against the same state. Uses actual old conserved areas, closed SLOT geometry and zero-storage algebraic nodes; pondable or storage folded nodes and nonpositive/nonfinite conductances are rejected. Only after convergence publishes pressure face ledgers and folded heads. Other state remains caller-owned; failed attempts can change internal candidate scratch but do not publish these ledgers. Allocation exceptions propagate.

Parameters
[in,out]vBorrowed aligned view matching the last successful classify, with fresh explicit face states/fluxes, current old-state heads/areas and node carry/source arrays. All required pointers and ranges remain live for the call; no view pointer is retained.
[in]dtFinite positive substep duration in seconds.
[in]controlsNonlinear residual/iteration/workspace controls passed to NonlinearPressureStorage.
Returns
Nonlinear diagnostics/status; a default non-converged result for an empty set, invalid dt, TPA state or unsupported folded-node/face configuration.
Here is the call graph for this function:

◆ verifyCandidateEndpoint()

bool openswmm::fv::PressurizedHeadSolver::verifyCandidateEndpoint ( const PressurizedView & v,
double dt,
const NonlinearPressureStorage::Controls & controls )

Check the actual post-update endpoint against the last nonlinear candidate equations.

Call only after a successful solveCandidate, real limiter/cell/node update, and matching unchanged topology/classification. Reads published state/fluxes and updates diagnostic scratch; never repairs the endpoint. A candidate-free call can vacuously pass, so this is not an independent solver validity test. Allocation errors propagate.

Parameters
[in,out]vBorrowed aligned view matching the last successful classify, with fresh explicit face states/fluxes, current old-state heads/areas and node carry/source arrays. All required pointers and ranges remain live for the call; no view pointer is retained.
[in]dtSame positive substep seconds used for candidate preparation/update.
[in]controlsResidual budgets matching the candidate solve: absolute_volume ft3 and relative_volume dimensionless.
Returns
True if bounded finite heads, original volume/continuity residuals, folded carry and every implicit face law meet their volume budgets.
Here is the call graph for this function:

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