46 bool reference =
false) {
48 if (row.link == link_element && row.element == e)
50 if (!link_element || e < 0 || e >= c.
n_links())
63 const double length = r < int(conduits.true_length.size()) && conduits.
true_length[r] > 0
64 ? conduits.true_length[r]
66 return area / radius * length * std::max(1, conduits.barrels[r]) *
80 return volume > .0353147 ?
reactionWallArea(c, link_element, e) / (volume * 28.317) : 0.;
94 std::vector<double>& scales) {
97 const double active = volume > .0353147 ?
reactionWallArea(c, link_element, e) : 0;
100 scales[s] = reference > 0 ? std::clamp(active / reference, 0., 1.) : 0.;
Link hydraulics — velocity, Froude, Manning conveyance, settings.
The central, reentrant simulation context for the new engine.
Cross-section geometry — unified batch + per-element API.
XSectParams buildXSectParams(const LinkData &links, std::size_t uj, const std::vector< transect::TransectData > *transects)
Build XSectParams from LinkData SoA arrays.
Definition Link.cpp:206
Definition ExplicitFvSolver.hpp:53
double reactionAreaFactor(ReactionAreaUnits units)
Convert native square feet to configured reaction wall/dry-store area units.
Definition ReactionGeometry.hpp:24
double reactionWallArea(const SimulationContext &c, bool link_element, int e, bool reference=false)
Resolve explicit or hydraulic wetted reaction wall area for an element.
Definition ReactionGeometry.hpp:45
void reactionWallScales(const SimulationContext &c, bool link_element, int e, double volume, std::vector< double > &scales)
Build per-species active-to-reference wall coverage multipliers.
Definition ReactionGeometry.hpp:93
double reactionAreaVolume(const SimulationContext &c, bool link_element, int e, double volume)
Compute active wetted reaction wall area per litre of water.
Definition ReactionGeometry.hpp:78
double getRofY(const XSectParams &xs, double y)
Query native hydraulic radius from depth through the shared host evaluator.
Definition XSection.cpp:256
double getAofY(const XSectParams &xs, double y)
Query native wetted area from depth through the shared host evaluator.
Definition XSection.cpp:250
ReactionAreaUnits
Definition ReactionData.hpp:55
@ CM2
Definition ReactionData.hpp:55
@ M2
Definition ReactionData.hpp:55
double * y
Definition odesolve.c:37
std::vector< double > true_length
Definition LinkSubtypes.hpp:89
std::vector< double > xsect_y_full
Full depth of cross-section (project length units).
Definition LinkData.hpp:172
std::vector< double > depth
Current water depth at midpoint (project length units).
Definition LinkData.hpp:348
ConduitData conduits
Definition LinkSubtypes.hpp:682
int conduit_row(int i) const noexcept
Resolve a base link key into the conduit side table.
Definition LinkSubtypes.hpp:895
std::vector< WallArea > wall_areas
Definition ReactionData.hpp:128
ReactionAreaUnits area_units
Definition ReactionData.hpp:90
int n_species() const noexcept
Count authored reaction species.
Definition ReactionData.hpp:348
std::vector< uint8_t > species_is_wall
0 = BULK, 1 = WALL
Definition ReactionData.hpp:104
Central, reentrant simulation context.
Definition SimulationContext.hpp:390
LinkSubtypes link_subtypes
Relational per-subtype link side-tables (Phase 6) — the link analogue of node_subtypes....
Definition SimulationContext.hpp:588
ReactionData reactions
Multispecies reaction system (EPANET-MSX conventions), parsed from the reactions component's config f...
Definition SimulationContext.hpp:624
LinkData links
All link state and properties.
Definition SimulationContext.hpp:580
int n_links() const noexcept
Number of links.
Definition SimulationContext.hpp:2360
std::vector< transect::TransectData > transect_tables
Built transect geometry tables (indexed same as transects).
Definition SimulationContext.hpp:792