OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
GroundPorewater.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2
11
12#pragma once
13#include "PorousHeat.hpp"
14#include "SigmaPorewaterMap.hpp"
15#include <utility>
16namespace openswmm::twoD {
17// Species-major canonical mass in the existing fixed physical soil layers.
18// Water and geometry are borrowed from the thermal/hydraulic owner. Bulk
19// SAT/UNSAT masses become derived views, never an additional reservoir.
21 int n_species = 0, age_row = -1, temp_row = -1;
22 // `reserved_out` is a non-inventory overlay for accepted face packets
23 // that have not yet reached this cell's gather. Finite contacts may use
24 // only mass - reserved_out; the canonical mass still owns the queued
25 // packet until its existing gather consumes it.
43 std::string publishSigma(SubsurfaceTransportState&, int cell);
52 void refreshSigmaView();
57 bool active() const noexcept { return n_species > 0; }
85 std::string initialize(const PorousHeatColumn&, const std::vector<double>& saturated_water,
86 const std::vector<double>& saturated_mass,
87 const std::vector<double>& unsaturated_mass,
88 const std::vector<double>& kd, int age, int temperature);
102 std::pair<std::vector<double>, std::vector<double>>
103 zoneMasses(const PorousHeatColumn&, const std::vector<double>& saturated_water) const;
120 std::pair<double, double> zoneMass(const PorousHeatColumn&,
121 const std::vector<double>& saturated_water,
122 int species) const noexcept;
135 bool generateAge(const PorousHeatColumn&, double seconds) noexcept;
148 double contactAvailableMass(int species, std::size_t layer) const noexcept;
160 bool canReserveOutgoing(int species, std::size_t layer, double amount) const noexcept;
172 bool reserveOutgoing(int species, std::size_t layer, double amount) noexcept;
187 bool settleOutgoingReservation(int species, std::size_t layer, double amount) noexcept;
199 bool canApplyContactMassIncrement(int species, std::size_t layer,
200 double increment) const noexcept;
215 bool applyContactMassIncrement(int species, std::size_t layer, double increment) noexcept;
216};
217} // namespace openswmm::twoD
Local thermal equilibrium in porous ground layers.
Derived overlap mapping for canonical sigma-layer porewater chemistry.
Definition ExchangeLaw.hpp:60
Definition GroundPorewater.hpp:20
bool settleOutgoingReservation(int species, std::size_t layer, double amount) noexcept
Release a queued outgoing reservation after its owning gather has consumed the packet.
Definition GroundPorewater.cpp:280
bool canReserveOutgoing(int species, std::size_t layer, double amount) const noexcept
Preflight an outgoing reservation against unreserved canonical mass.
Definition GroundPorewater.cpp:244
SigmaPorewaterMap sigma
Definition GroundPorewater.hpp:27
std::vector< double > reserved_out
Definition GroundPorewater.hpp:26
void refreshSigmaView()
Rebuild physical-layer mass and reservation views from an active SIGMA overlap map.
Definition GroundPorewater.cpp:344
int temp_row
Definition GroundPorewater.hpp:21
bool generateAge(const PorousHeatColumn &, double seconds) noexcept
Add elapsed water age to every physical layer and its generation ledger.
Definition GroundPorewater.cpp:192
std::vector< double > initial_mass
Definition GroundPorewater.hpp:26
std::pair< std::vector< double >, std::vector< double > > zoneMasses(const PorousHeatColumn &, const std::vector< double > &saturated_water) const
Derive saturated and unsaturated totals without creating another inventory.
Definition GroundPorewater.cpp:140
std::pair< double, double > zoneMass(const PorousHeatColumn &, const std::vector< double > &saturated_water, int species) const noexcept
Derive one species' saturated/unsaturated split from physical-layer mass.
Definition GroundPorewater.cpp:164
bool canApplyContactMassIncrement(int species, std::size_t layer, double increment) const noexcept
Preflight a signed contact receipt without spending reserved outgoing inventory.
Definition GroundPorewater.cpp:301
bool active() const noexcept
Test whether at least one species row is configured.
Definition GroundPorewater.hpp:57
std::vector< double > retention
Definition GroundPorewater.hpp:26
double contactAvailableMass(int species, std::size_t layer) const noexcept
Read unreserved physical-layer inventory available to a finite contact.
Definition GroundPorewater.cpp:221
std::string initialize(const PorousHeatColumn &, const std::vector< double > &saturated_water, const std::vector< double > &saturated_mass, const std::vector< double > &unsaturated_mass, const std::vector< double > &kd, int age, int temperature)
Seed canonical physical-layer species inventories from saturated/unsaturated totals.
Definition GroundPorewater.cpp:63
int n_species
Definition GroundPorewater.hpp:21
std::vector< double > contact_mass
Definition GroundPorewater.hpp:26
std::vector< double > mass
Definition GroundPorewater.hpp:26
std::string publishSigma(SubsurfaceTransportState &, int cell)
Publish pending SIGMA contact receipts and refresh the derived physical-layer views.
Definition GroundPorewater.cpp:368
int age_row
Definition GroundPorewater.hpp:21
bool applyContactMassIncrement(int species, std::size_t layer, double increment) noexcept
Apply a signed finite-contact receipt to the physical layer and optional SIGMA view.
Definition GroundPorewater.cpp:324
bool reserveOutgoing(int species, std::size_t layer, double amount) noexcept
Reserve accepted outgoing inventory without subtracting its canonical mass.
Definition GroundPorewater.cpp:261
std::vector< double > generated_age
Definition GroundPorewater.hpp:26
Definition PorousHeat.hpp:148
Definition SigmaPorewaterMap.hpp:20
Species mass in both aquifer zones, and where mass crossed a boundary.
Definition SubsurfaceTransportState.hpp:69