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

Plan D-H5e — the single node/link surface-flux binding. More...

Include dependency graph for HeatFluxes.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  openswmm
 
namespace  openswmm::transport
 
namespace  openswmm::transport::heat
 

Functions

double openswmm::transport::heat::netFluxOut (const SimulationContext &ctx, const HeatElement &elem, double t_w) noexcept
 Net outward surface flux at t_w, summed over every enabled module [W/m²].
 
void openswmm::transport::heat::applyHeatFluxes (SimulationContext &ctx, double dt)
 Apply one step of surface heat exchange to every exchanging node and link.
 

Detailed Description

Plan D-H5e — the single node/link surface-flux binding.

One traversal, one net flux, one relaxation. Every enabled flux family contributes to J(T); the element is then stepped once.

The defect this exists to make unrepresentable
H2 and H3 each owned a binding: applySurfaceExchange then applyRadiativeExchange, called back to back from routeLegacyHeat. Under forward Euler that was harmless — the two increments were linear and added exactly. D-H5d replaced the step with an exponential relaxation, and relaxations do not commute: each sub-step relaxes FULLY toward its own module's equilibrium, so the pair overshoots the true combined one and the result depends on which module ran last. Measured, two equal modules with equilibria at 30 °C and 10 °C, true combined 20 °C, from 5 °C:
k·dt split combined
4.1e-3 5.061317 5.061359
0.41 9.700850 10.044256
39.4 10.000000 20.000000

At large k·dt the split lands exactly on the last module's equilibrium — the first module's contribution has been erased.

The general lesson, worth more than this instance: replacing an integrator underneath an existing operator split silently changes what the split means. Forward Euler's linearity was load-bearing and nobody had written that down.

Why a separate file
The traversal belongs to neither module. It lived in both — H2's copy and H3's near-identical copy — which is also how H3 came to carry H2's divergence through a different spelling. A SURFACE flux family is one line in netFluxOut here and cannot acquire a binding of its own — but that sentence once claimed H6's SEDIMENT_EXCHANGE too, and it was wrong: the bed acts on the wetted perimeter (a different area, nonzero exactly when the free surface is zero) and adds a SECOND state variable, so relaxT's fixed equilibrium does not exist for it. H6b therefore steps the water/bed pair as ONE coupled relaxation (BedExchange.hpp) inside this file's link loop — coupled rather than sequential for exactly the D-H5e reason above.
See also
plans/transport/HEAT_TRANSPORT_PLAN.md §6.2 D-H5d, §6.3 D-H5e
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0