OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
SubsurfaceSections.hpp File Reference

G-step 1 — [2D_AQUIFER_OPTIONS], [2D_AQUIFER] and [2D_AQUIFER_NODE]: parsing, unit resolution and writing. More...

#include "SubsurfaceData.hpp"
#include "../../input/SectionRegistry.hpp"
#include <string>
#include <functional>
#include <limits>
#include <vector>
Include dependency graph for SubsurfaceSections.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  openswmm::twoD::MeshPolylineInterval
 
struct  openswmm::twoD::MeshPolylineMapping
 

Namespaces

namespace  openswmm
 
namespace  openswmm::twoD
 

Functions

std::string openswmm::twoD::parseAquiferOptionsLine (const std::vector< std::string > &tokens, GwOptions &opts)
 Apply one aquifer authoring option without initializing a physical column.
 
std::string openswmm::twoD::parseAquiferLine (const std::vector< std::string > &tokens, std::vector< GwAquiferRow > &rows)
 Parse a scoped aquifer hydraulic authoring row into a local candidate.
 
std::string openswmm::twoD::parseAquiferNodeLine (const std::vector< std::string > &tokens, std::vector< GwNodeBed > &beds, std::vector< std::string > &names)
 Parse one named native-node aquifer bed with explicit cell or deferred location.
 
std::string openswmm::twoD::parseAquiferLinkLine (const std::vector< std::string > &tokens, std::vector< GwLinkRow > &rows, std::vector< std::string > &names)
 Parse named conduit bed coefficient/path and exchange opt-out authoring row.
 
std::string openswmm::twoD::parseAquiferBoundaryLine (const std::vector< std::string > &t, std::vector< GwBoundaryRow > &rows)
 Parse a unique hydraulic aquifer exterior-edge prescription.
 
void openswmm::twoD::registerSubsurfaceSections (SubsurfaceConfig &cfg, std::vector< std::string > &node_names, std::vector< std::string > &link_names, input::SectionRegistry &registry)
 Register aquifer option/cell/node/link/boundary and surface-ownership authoring callbacks.
 
GwUnitFactors openswmm::twoD::gwUnitFactors (const SimulationContext &ctx) noexcept
 Resolve authored aquifer units into SI kernel conversion factors.
 
std::vector< std::string > openswmm::twoD::resolveSubsurface (SimulationContext &ctx, const MeshData &mesh, SubsurfaceConfig &cfg, std::vector< std::string > &names, double node_xy_to_mesh)
 Resolve native-node bed identity/location and optional coordinate-based automatic enrollment.
 
MeshPolylineMapping openswmm::twoD::mapMeshPolyline (const MeshData &mesh, const std::vector< double > &x, const std::vector< double > &y, const std::function< bool(int)> &progress, std::size_t first_interval, std::size_t max_intervals, bool count_contact_cells)
 Clip a polyline into exact convex-cell chainage intervals with local shared-edge ownership.
 
std::vector< GwLinkShare > openswmm::twoD::resolveLinkSeepage (SimulationContext &ctx, const MeshData &mesh, SubsurfaceConfig &cfg, std::vector< std::string > &link_names, double node_xy_to_mesh, int &n_conduits)
 Resolve conduit polylines into normalized aquifer cell shares and vertical contact reaches.
 
std::vector< GwSubcatchShare > openswmm::twoD::resolveSubcatchInfiltration (const SimulationContext &ctx, const MeshData &mesh, double node_xy_to_mesh, int &n_subcatch)
 Compute normalized polygon-area shares from every subcatchment footprint to mesh cells.
 
void openswmm::twoD::writeSubsurfaceSections (const SubsurfaceConfig &cfg, const std::vector< std::string > &node_names, const std::vector< std::string > &link_names, std::string &out, bool full_precision)
 Append retained aquifer/ownership/boundary authoring sections in project units.
 

Detailed Description

G-step 1 — [2D_AQUIFER_OPTIONS], [2D_AQUIFER] and [2D_AQUIFER_NODE]: parsing, unit resolution and writing.

One rule for units, not seven

Rows are authored in the project's own unit system and converted once, by the kernel, through GwUnitFactors (declared in SubsurfaceData.hpp). The rule is deliberately uniform so a user who has read one row can read them all:

quantity US SI
lengths — ZS, PSI_B, HG0, DC, WILTING_SUCTION ft m
rates — KS, C_LOSS, KC in/hr mm/hr
inverse lengths — ALPHA 1/ft 1/m
areas — AREA ft² m²
THETA_S, THETA_R, LAMBDA, N, L — —

The rates follow [INFILTRATION] and [AQUIFERS] (in/hr, mm/hr), which is what a SWMM user already expects for a conductivity. The lengths follow the project length unit rather than [INFILTRATION]'s inches, because ZS is a soil-column depth of metres, not a suction head of millimetres, and mixing the two in one section is how unit bugs are authored.

Syntax

[2D_AQUIFER_OPTIONS]
SOIL_CHAR RUSSO | GARDNER | BROOKS_COREY | VAN_GENUCHTEN
CLOSURE AUTO | CLOSED_FORM | ENSLAVED | SIGMA
M_LAYERS 8
CAPILLARY_DIFF NO
C_GW 0.5
C_COL 0.9
FORCE_CLOSED_FORM NO
MODE MESH | PER_SUBCATCH
DUNNE YES
GW_ET AUTO | NONE | CAPILLARY_RISE | BOUNDARY_ET | BOTH
WILTING_SUCTION AUTO | positive_project_length
LINK_SEEPAGE DEFAULT | ONE_WAY | TWO_WAY | NONE
;; GW_ET AUTO resolves BOTH on a mesh, NONE in PER_SUBCATCH.
;; LINK_SEEPAGE DEFAULT resolves TWO_WAY on a mesh; legacy AUTO
;; remains an accepted explicit ONE_WAY spelling.
;; Automatic wilting suction is 150 m in either project unit system.
[2D_AQUIFER]
;;scope KS ZS THETA_S THETA_R ALPHA [key value]…
* 0.5 5.0 0.45 0.10 2.0 C_LOSS 0.0 HG0 1.0
TAG clay 0.02 3.0 0.50 0.15 1.2 SOIL_CHAR VAN_GENUCHTEN N 1.3
CELL 42 1.0 6.0 0.42 0.08 3.0 CLOSURE SIGMA M_LAYERS 16
[2D_AQUIFER_NODE]
;;node cell [KC kc DC dc] [AREA a]
J1 17 KC 0.01 DC 0.5
@ BOTH
Based on both slope & Froude number.
Definition enums.h:709
@ NONE
None option.
Definition enums.h:1184
@ NO
No option.
Definition enums.h:1173
@ YES
Yes option.
Definition enums.h:1175

The five positional columns are the ones every law needs. Everything a particular law adds (PSI_B, LAMBDA, N, L) is a keyword, so adding a law later does not renumber anyone's file.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License
Apache-2.0