OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
SurfaceFluxCalculator.hpp
Go to the documentation of this file.
1
17
18#ifndef OPENSWMM_ENGINE_2D_SURFACE_FLUX_CALCULATOR_HPP
19#define OPENSWMM_ENGINE_2D_SURFACE_FLUX_CALCULATOR_HPP
20
21#include "../data/MeshData.hpp"
24
25namespace openswmm::twoD {
26
38 int nthreads = 1);
39
52 double epsilon, int nthreads = 1);
53
65void computeEdgeFluxes(const MeshData& mesh, SurfaceStateData& state,
66 const SolverOptions2D& opts);
67
81inline double evapSink(double rate, double depth, double dry_depth) noexcept {
82 if (rate <= 0.0 || depth <= 0.0) return 0.0;
83 if (depth >= dry_depth) return rate;
84 double t = depth / dry_depth;
85 return rate * t * t * (3.0 - 2.0 * t);
86}
87
101void assembleRHS(const MeshData& mesh, const SurfaceStateData& state,
102 const SolverOptions2D& opts, double* ydot);
103
117void assembleImplicitRHS(const MeshData& mesh, const SurfaceStateData& state,
118 const SolverOptions2D& opts, double* ydot);
119
134void assembleExplicitRHS(const MeshData& mesh, const SurfaceStateData& state,
135 const SolverOptions2D& opts, const double* y,
136 double* ydot);
137
158void computeCellContinuity(const MeshData& mesh, SurfaceStateData& state,
159 const SolverOptions2D& opts, double dt);
160
176void computeFaceVelocity(const MeshData& mesh, SurfaceStateData& state,
177 const SolverOptions2D& opts);
178
179} // namespace openswmm::twoD
180
181#endif // OPENSWMM_ENGINE_2D_SURFACE_FLUX_CALCULATOR_HPP
Structure-of-Arrays (SoA) storage for 2D triangular mesh geometry.
Configuration options for the 2D surface routing solver.
Structure-of-Arrays (SoA) storage for 2D surface routing state.
Definition NodeCoupling.cpp:15
void computeFaceVelocity(const MeshData &mesh, SurfaceStateData &state, const SolverOptions2D &opts)
Reconstruct cell-centred velocity (vx, vy) from edge fluxes (RT0).
Definition SurfaceFluxCalculator.cpp:463
void computeCellContinuity(const MeshData &mesh, SurfaceStateData &state, const SolverOptions2D &opts, double dt)
Compute the per-cell continuity residual (local mass-balance check).
Definition SurfaceFluxCalculator.cpp:426
void computeLimitedGradients(const MeshData &mesh, SurfaceStateData &state, double epsilon, int nthreads)
Apply Jawahar-Kamath slope limiter (Eq. [23]–[24]).
Definition SurfaceFluxCalculator.cpp:161
void assembleExplicitRHS(const MeshData &mesh, const SurfaceStateData &state, const SolverOptions2D &opts, const double *y, double *ydot)
Explicit half of the IMEX split: source/sink forcing (ARKODE F_E).
Definition SurfaceFluxCalculator.cpp:403
void computeUnlimitedGradients(const MeshData &mesh, SurfaceStateData &state, int nthreads)
Compute unlimited gradients for all triangles via Green-Gauss theorem.
Definition SurfaceFluxCalculator.cpp:117
double evapSink(double rate, double depth, double dry_depth) noexcept
Depth-limited evaporation sink rate (m/s) for one cell.
Definition SurfaceFluxCalculator.hpp:81
void assembleImplicitRHS(const MeshData &mesh, const SurfaceStateData &state, const SolverOptions2D &opts, double *ydot)
Implicit half of the IMEX split: the flux divergence only (ARKODE F_I).
Definition SurfaceFluxCalculator.cpp:383
void assembleRHS(const MeshData &mesh, const SurfaceStateData &state, const SolverOptions2D &opts, double *ydot)
Assemble the RHS of the ODE system: dψ/dt for each triangle.
Definition SurfaceFluxCalculator.cpp:347
void computeEdgeFluxes(const MeshData &mesh, SurfaceStateData &state, const SolverOptions2D &opts)
Compute edge fluxes for all triangles.
Definition SurfaceFluxCalculator.cpp:230
double * y
Definition odesolve.c:28
SoA storage for 2D triangular mesh geometry and topology.
Definition MeshData.hpp:34
Configuration for the 2D surface routing CVODE solver.
Definition SolverOptions2D.hpp:132
Definition SurfaceStateData.hpp:41