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  kernels
 

Classes

class  ExplicitFvSolver
 
struct  FvGeometry
 Cross-section closure for one conduit's cell chain. More...
 
struct  FvOptions
 Knobs for FLOW_ROUTING FV. More...
 
struct  FvStepForcing
 
class  INetworkSolver
 Abstract time integrator for the explicit FV 1D network. More...
 
struct  MeshBuildReport
 
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  PressurizedHeadSolver
 
struct  PressurizedView
 

Enumerations

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

void buildGeometry (const XSectParams &xs, bool is_open, double slot_celerity, FvGeometry &g, int barrels=1)
 Populate one conduit's cross-section closure, including the tapered Preissmann slot and the first-moment table.
 
MeshBuildReport buildNetworkMesh (SimulationContext &ctx, const FvOptions &opts, NetworkMeshData &mesh)
 Build the cell/face mesh and the per-conduit geometry closures.
 
std::unique_ptr< INetworkSolvermakeNetworkSolver (const FvOptions &opts, std::string *chosen, int n_cells)
 Construct the FV network solver for opts and a mesh of n_cells.
 
double limitSlope (double a, double b, Limiter lim)
 

Variables

constexpr int kMaxLtsTiers = 8
 
constexpr int kI1Samples = 129
 
constexpr int kNodeVolSamples = 129
 Samples in a STORAGE node's flattened depth→volume table.
 

Enumeration Type Documentation

◆ 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

◆ buildGeometry()

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

Populate one conduit's cross-section closure, including the tapered Preissmann slot and the first-moment table.

Exposed for the unit tests, which exercise the closure directly (continuity of dA/dh through the crown, A↔h round-trip, the analytic I₁ extension).

Parameters
barrelsparallel identical barrels; area and top width are scaled by it so a cell is their aggregate section (hydraulic radius is per barrel and stays unscaled).
Here is the call graph for this function:
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 the FV network solver for opts and a mesh of n_cells.

Parameters
optsSolver options — backend and min_parallel_cells drive the choice. The OPENSWMM_FV_BACKEND environment variable (cpu|auto|omp|cuda|hip|sycl) overrides backend, matching the 2D module's OPENSWMM_2D_BACKEND.
chosen[out, optional] Human-readable label of the selected backend.
n_cellsMesh size for the small-problem gate; 0 = unknown ⇒ no gate.
Returns
Never null — falls back to the CPU solver on any failure.

Variable Documentation

◆ kI1Samples

int openswmm::fv::kI1Samples = 129
inlineconstexpr

Samples in the per-geometry first-moment (I₁) table over [0, y_full]. I₁ is the antiderivative of A(h); above the crown the closure is exactly linear in h so the table is extended analytically rather than sampled (see FvKernels::i1OfDepth), which is what keeps deep surcharge accurate with a small table.

◆ 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.