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

Namespaces

namespace  implicit_wet
 
namespace  kernels
 
namespace  secgeom
 

Classes

struct  AcceptedWaterVolumes
 
class  ExplicitFvSolver
 
struct  FvClosure
 One section's closure. Fixed-size POD: inline arrays, no pointers. More...
 
struct  FvGeometry
 Cross-section closure for one conduit's cell chain. More...
 
struct  FvOptions
 Knobs for FLOW_ROUTING FV. More...
 
struct  FvStepForcing
 
class  ImplicitNetworkSolver
 
class  ImplicitReachSolver
 
class  INetworkSolver
 Abstract time integrator for the explicit FV 1D network. More...
 
struct  MeshBuildReport
 
class  NativeGmres
 
struct  NetworkMeshData
 SoA mesh geometry and topology for the FV network solver. More...
 
struct  NetworkStateData
 Mutable solver state — the conserved variables and the node volumes. More...
 
class  NonlinearPressureStorage
 
class  PressurizedHeadSolver
 
struct  PressurizedView
 

Enumerations

enum  : uint8_t {
  kClosureTabulated = 0 ,
  kClosurePolynomial = 1
}
 The closure's representation class. More...
 
enum class  RiemannSolver : int {
  HLL = 0 ,
  HLLC = 1
}
 
enum class  Limiter : int {
  MINMOD = 0 ,
  VANLEER = 1 ,
  SUPERBEE = 2
}
 Slope limiter used by the second-order (MUSCL) reconstruction. More...
 
enum class  ScalarScheme : int {
  UPWIND = 0 ,
  MUSCL = 1 ,
  QUICKEST_ULTIMATE = 2
}
 Reconstruction used for the advected scalar field. More...
 
enum class  TimeIntegration : int {
  EULER = 0 ,
  RK2 = 1
}
 Temporal integrator. More...
 
enum class  StructureCoupling : int {
  SUBSTEP = 0 ,
  ROUTING_STEP = 1
}
 When pump/orifice/weir/outlet structure equations are re-evaluated. More...
 
enum class  Backend : int {
  CPU = 0 ,
  AUTO = 1 ,
  OMP = 2 ,
  CUDA = 3 ,
  HIP = 4 ,
  SYCL = 5
}
 Backend selection for the solver kernels. More...
 
enum  : uint8_t {
  kNodeJunction = 0 ,
  kNodeVirtual = 1 ,
  kNodeStorage = 2 ,
  kNodeOutfall = 3
}
 Node kind codes stored in NetworkMeshData::node_kind. More...
 

Functions

double advanceNetworkChecked (INetworkSolver &solver, double start, double target, const FvStepForcing &forcing)
 Advance an FV backend and verify it reached the full requested time window.
 
void buildGeometry (const XSectParams &xs, bool is_open, double slot_celerity, FvGeometry &g, int barrels=1)
 Construct an aggregate-barrel FV section and its tapered slot/closure.
 
MeshBuildReport buildNetworkMesh (SimulationContext &ctx, const FvOptions &opts, NetworkMeshData &mesh)
 Build the cell/face mesh and the per-conduit geometry closures.
 
std::unique_ptr< INetworkSolver > makeNetworkSolver (const FvOptions &opts, std::string *chosen, int n_cells)
 Construct an uninitialized CPU or compatible plugin network solver.
 
double limitSlope (double a, double b, Limiter lim)
 

Variables

constexpr int kClosurePanels = 128
 Panels of the closure table, uniform in depth on [0, y_full].
 
constexpr int kMaxLtsTiers = 8
 
constexpr int kNodeVolSamples = 129
 Samples in a STORAGE node's flattened depth→volume table.
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum : uint8_t

The closure's representation class.

Enumerator
kClosureTabulated 
kClosurePolynomial 

◆ anonymous enum

anonymous enum : uint8_t

Node kind codes stored in NetworkMeshData::node_kind.

Enumerator
kNodeJunction 
kNodeVirtual 
kNodeStorage 
kNodeOutfall 

◆ Backend

enum class openswmm::fv::Backend : int
strong

Backend selection for the solver kernels.

Enumerator
CPU 
AUTO 

default: try plugins above the parallel gate, else CPU

OMP 
CUDA 
HIP 
SYCL 

◆ Limiter

enum class openswmm::fv::Limiter : int
strong

Slope limiter used by the second-order (MUSCL) reconstruction.

Enumerator
MINMOD 

most diffusive, most robust (default)

VANLEER 
SUPERBEE 

sharpest; can artificially steepen smooth profiles

◆ RiemannSolver

enum class openswmm::fv::RiemannSolver : int
strong

Face flux function. HLLC is the default and HLL exists only as a debugging/comparison baseline — see plan §3.2: the contact wave HLL averages away is exactly the wave that carries an advected scalar, so HLL is not a legitimate production choice once transport is on the same mesh.

Enumerator
HLL 

baseline / debug only

HLLC 

default

◆ ScalarScheme

enum class openswmm::fv::ScalarScheme : int
strong

Reconstruction used for the advected scalar field.

Enumerator
UPWIND 

1st-order upwind — monotone, diffusive

MUSCL 

2nd-order TVD, one-cell stencil (default)

QUICKEST_ULTIMATE 

3rd-order, two-cell upstream stencil

◆ StructureCoupling

enum class openswmm::fv::StructureCoupling : int
strong

When pump/orifice/weir/outlet structure equations are re-evaluated.

Enumerator
SUBSTEP 

every explicit substep (default; physically exact)

ROUTING_STEP 

once per routing step (matches DW-scale control cadence)

◆ TimeIntegration

enum class openswmm::fv::TimeIntegration : int
strong

Temporal integrator.

Enumerator
EULER 

forward Euler (default)

RK2 

SSP-RK2 (Heun) — strong-stability-preserving.

Function Documentation

◆ advanceNetworkChecked()

double openswmm::fv::advanceNetworkChecked ( INetworkSolver & solver,
double start,
double target,
const FvStepForcing & forcing )
inline

Advance an FV backend and verify it reached the full requested time window.

Throws invalid_argument for unordered/nonfinite times, runtime_error for nonfinite/backward/partial reached time; backend exceptions propagate. Does not roll back backend state or publish Router means/receipts.

Parameters
[in,out]solverBorrowed initialized backend; advance may mutate it even if reached-time validation later fails.
[in]startFinite accepted elapsed start seconds.
[in]targetFinite target elapsed seconds>=start.
[in]forcingBorrowed boundary/source forcing valid for the requested window; lifetime covers advance.
Returns
Backend reached seconds after checking target agreement within16*epsilon*max(1,abs(start),abs(target)).
Here is the call graph for this function:

◆ buildGeometry()

void openswmm::fv::buildGeometry ( const XSectParams & xs,
bool is_open,
double slot_celerity,
FvGeometry & g,
int barrels = 1 )

Construct an aggregate-barrel FV section and its tapered slot/closure.

Depth/radius remain per-barrel, area/width multiply max(1,barrels). Closed slot uses g*A/c^2, caps at5% full width (fallback width1ft) and floors nonpositive result1e-6ft; crown uses SLOT_CROWN_CUTOFF. Calls buildClosure to replace provisional crown area/integral. No complete finite/physical validation or ownership transfer.

Parameters
[in]xsBorrowed initialized native scalar section; optional table pointers copy as non-owning references and must remain live.
[in]is_openTrue extends the open section above full depth with vertical-wall width; false creates a pressurization slot.
[in]slot_celerityDesign speed ft/s; closed-section calculation floors nonpositive/<=1/NaN to1 through comparison.
[in,out]gBorrowed destination overwritten with copied geometry, barrel-scaled area/width and constructed closure; unrelated fields not assigned here retain prior values.
[in]barrelsParallel barrel count; <=0 becomes1.
Here is the caller graph for this function:

◆ buildNetworkMesh()

MeshBuildReport openswmm::fv::buildNetworkMesh ( SimulationContext & ctx,
const FvOptions & opts,
NetworkMeshData & mesh )

Build the cell/face mesh and the per-conduit geometry closures.

Parameters
ctxModel context — links, nodes and conduit side-table must be fully resolved, and Router::init must already have computed mod_length/rough_factor (the mesh reuses the Courant lengthening as its Δx floor).
optsFV options (cell length, min cells, slot celerity).
mesh[out] Cleared and filled.
Returns
Build report; a non-empty errors list means the mesh is unusable.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ limitSlope()

double openswmm::transport::fvkernels::limitSlope ( double a,
double b,
Limiter lim )
inline

limitSlope moved to transport/fvkernels/SpeciesTransportKernels.hpp (phase E0) — shared between the species kernels and the hydrodynamic second-order reconstruction below.

◆ makeNetworkSolver()

std::unique_ptr< INetworkSolver > openswmm::fv::makeNetworkSolver ( const FvOptions & opts,
std::string * chosen,
int n_cells )

Construct an uninitialized CPU or compatible plugin network solver.

OPENSWMM_FV_BACKEND overrides opts.backend after lowercasing; unknown names fall back to CPU. pressurized_implicit forces CPU even for an explicit plugin request. AUTO tries cuda, hip, sycl, omp in order unless below min_parallel_cells (overridden by atol(OPENSWMM_FV_MIN_PARALLEL_CELLS)). Plugin absence, load/probe/ABI/device/factory failures fall through to CPU. Filesystem/string/allocation errors and plugin-thrown exceptions can propagate; this is not a no-throw factory. Loaded modules remain mapped for process lifetime.

Parameters
[in]optsOptions used synchronously for backend, minimum cell count and CPU-only pressurized_implicit selection; not retained.
[out]chosenOptional writable backend label, or nullptr; receives a CPU label or backend/device label before successful return.
[in]n_cellsMesh cell count for AUTO gating; <=0 disables that gate. Explicit backend requests bypass it.
Returns
An owning non-null solver on normal return; caller initializes it against the actual mesh/state/options.

Variable Documentation

◆ kClosurePanels

int openswmm::fv::kClosurePanels = 128
inlineconstexpr

Panels of the closure table, uniform in depth on [0, y_full].

◆ kMaxLtsTiers

int openswmm::fv::kMaxLtsTiers = 8
inlineconstexpr

Hard ceiling on LTS tiers. Tier k advances at 2^k·dt₀, so 8 tiers already span a 128× stiffness ratio — beyond that the coarse tier's lag behind a moving front stops being a bounded integration-path difference. (A 14-tier cap was trialled for the MIN_SURFAREA-junction stiffness on macdonald-long-sub and did not help: the stiff set there is every junction, and the scheduler's base-step count is the cost floor. The remedy is the algebraic junction interface, which removes the bound.)

◆ kNodeVolSamples

int openswmm::fv::kNodeVolSamples = 129
inlineconstexpr

Samples in a STORAGE node's flattened depth→volume table.