95#ifndef OPENSWMM_ENGINE_FV_PRESSURIZED_HEAD_SOLVER_HPP
96#define OPENSWMM_ENGINE_FV_PRESSURIZED_HEAD_SOLVER_HPP
139 const std::vector<std::uint8_t>*
node_alg =
nullptr;
208 const auto uc =
static_cast<std::size_t
>(cell);
212 return !g.is_open && state.
cell_h[uc] >= g.y_crown;
223 const auto uf =
static_cast<std::size_t
>(f);
226 const int cl = mesh.
face_cl[uf];
227 const int cr = mesh.
face_cr[uf];
229 if (nd < 0 && (cl < 0 || cr < 0))
return kNone;
231 bool pl =
false, pr =
false, cell_side_press =
false;
234 cell_side_press = cell_side_press || pl;
238 cell_side_press = cell_side_press || pr;
245 if (!cell_side_press)
return kNone;
252 const auto uf =
static_cast<std::size_t
>(f);
254 if (nd < 0)
return false;
257 if (other < 0)
return false;
259 mesh.
cell_geom[
static_cast<std::size_t
>(other)])];
260 if (g.is_open)
return false;
269 state.
cell_tpa[
static_cast<std::size_t
>(other)] != 0 &&
274 return hg >= g.y_crown;
280 std::uint8_t mode =
kNone;
297 std::vector<std::uint8_t> cell_press_;
298 std::vector<std::uint8_t> node_fold_;
299 std::vector<int> cell_unk_;
300 std::vector<int> node_unk_;
301 std::vector<ImpFace> imp_faces_;
306 std::vector<int> unk_entity_;
307 std::vector<double> unk_eta0_;
308 std::vector<double> unk_store_;
309 std::vector<double> unk_rhs_ext_;
310 std::vector<int> unk_comp_;
311 std::vector<double> unk_head_;
314 std::vector<int> uf_parent_;
316 void ufUnion(
int a,
int b);
319 std::vector<int> comp_ptr_, comp_unks_;
320 std::vector<double> thom_a_, thom_b_, thom_c_, thom_d_;
321 std::vector<int> path_order_, degree_, adj_ptr_, adj_idx_;
322 std::vector<double> adj_c_;
323 std::vector<double> cg_r_, cg_p_, cg_ap_, cg_z_;
325 void buildComponents();
326 void assembleRhs(
const PressurizedView& v,
double dt);
327 void solveComponent(
int comp,
const PressurizedView& v,
double dt);
328 void backSubstitute(
const PressurizedView& v);
333 void linearSolve(
const std::vector<int>& unks,
334 const std::vector<double>& diag,
335 const std::vector<double>& rhs);
338 std::vector<double> diag_, rhs_;
339 std::vector<std::uint8_t> unk_dirichlet_;
340 std::vector<double> unk_dirvalue_;
Single-source scalar kernels for the explicit FV 1D network solver.
Backend-neutral interface for the explicit FV 1D network integrator.
SoA storage for the 1D finite-volume network mesh and its state.
Definition PressurizedHeadSolver.hpp:145
void solve(const PressurizedView &v, double dt)
Definition PressurizedHeadSolver.cpp:250
static bool cellPressurized(const NetworkMeshData &mesh, const NetworkStateData &state, int cell)
Definition PressurizedHeadSolver.hpp:206
@ kDelta
Definition PressurizedHeadSolver.hpp:169
@ kNone
Definition PressurizedHeadSolver.hpp:169
@ kFull
Definition PressurizedHeadSolver.hpp:169
bool classify(const PressurizedView &v)
Definition PressurizedHeadSolver.cpp:136
void finalizeCells(const PressurizedView &v)
Definition PressurizedHeadSolver.cpp:805
const std::vector< std::uint8_t > & foldedNodes() const noexcept
Definition PressurizedHeadSolver.hpp:192
bool anyImplicit() const noexcept
Definition PressurizedHeadSolver.hpp:196
static std::uint8_t faceModeOf(const NetworkMeshData &mesh, const NetworkStateData &state, int f)
Definition PressurizedHeadSolver.hpp:221
static bool ghostPressurized(const NetworkMeshData &mesh, const NetworkStateData &state, int f)
Is the node-side ghost of face f pressurized?
Definition PressurizedHeadSolver.hpp:250
Definition ExplicitFvSolver.cpp:25
Cross-section closure for one conduit's cell chain.
Definition NetworkMeshData.hpp:77
Knobs for FLOW_ROUTING FV.
Definition FvOptions.hpp:123
Definition INetworkSolver.hpp:53
SoA mesh geometry and topology for the FV network solver.
Definition NetworkMeshData.hpp:176
std::vector< int > cell_geom
index into geom
Definition NetworkMeshData.hpp:182
std::vector< double > node_sur_depth
SURCHARGE_DEPTH above the rim (ft)
Definition NetworkMeshData.hpp:392
std::vector< double > face_zb
bed elevation at the interface (ft)
Definition NetworkMeshData.hpp:272
std::vector< int > face_cr
right cell (-1 ⇒ node on the right)
Definition NetworkMeshData.hpp:215
std::vector< int > face_cl
left cell (-1 ⇒ node on the left)
Definition NetworkMeshData.hpp:214
std::vector< int > face_node
coupled node (-1 for interior faces)
Definition NetworkMeshData.hpp:216
std::vector< int > face_culvert
Definition NetworkMeshData.hpp:271
std::vector< uint8_t > face_gate
Definition NetworkMeshData.hpp:266
std::vector< FvGeometry > geom
Definition NetworkMeshData.hpp:432
Mutable solver state — the conserved variables and the node volumes.
Definition NetworkMeshData.hpp:489
std::vector< double > node_head
water-surface elevation (ft)
Definition NetworkMeshData.hpp:503
std::vector< double > cell_h
depth (ft)
Definition NetworkMeshData.hpp:497
std::vector< uint8_t > cell_tpa
Definition NetworkMeshData.hpp:525
Definition PressurizedHeadSolver.hpp:110
const std::vector< int > * active_faces
Definition PressurizedHeadSolver.hpp:133
kernels::FaceState * f_state_r
Definition PressurizedHeadSolver.hpp:120
NetworkStateData * state
Definition PressurizedHeadSolver.hpp:112
const std::vector< std::uint8_t > * node_lat_div
Definition PressurizedHeadSolver.hpp:141
const std::vector< double > * uf_grad
Definition PressurizedHeadSolver.hpp:131
const double * cell_eta
Definition PressurizedHeadSolver.hpp:124
const std::vector< double > * cell_qlat
Definition PressurizedHeadSolver.hpp:142
const FvStepForcing * forcing
Definition PressurizedHeadSolver.hpp:114
const FvOptions * opts
Definition PressurizedHeadSolver.hpp:113
const NetworkMeshData * mesh
Definition PressurizedHeadSolver.hpp:111
const std::vector< double > * node_qstruct
Definition PressurizedHeadSolver.hpp:137
kernels::FaceFlux * f_flux
Definition PressurizedHeadSolver.hpp:121
std::vector< double > * node_carry
Definition PressurizedHeadSolver.hpp:138
double * cell_u
Definition PressurizedHeadSolver.hpp:125
const std::vector< std::uint8_t > * node_alg
Definition PressurizedHeadSolver.hpp:139
const std::vector< double > * node_vfull
Definition PressurizedHeadSolver.hpp:140
double * f_sstar
Definition PressurizedHeadSolver.hpp:118
kernels::FaceState * f_state_l
Definition PressurizedHeadSolver.hpp:119
double * f_mass
Definition PressurizedHeadSolver.hpp:117
const std::vector< char > * cell_active
Definition PressurizedHeadSolver.hpp:134
Result of a face flux evaluation.
Definition FvKernels.hpp:407
One side of a face after hydrostatic reconstruction.
Definition FvKernels.hpp:398