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

Phase H3 — shortwave and longwave radiation at the water surface (heat plan §2.2; RHEComponent §6). More...

Include dependency graph for RadiativeExchange.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::netShortwave (double incoming_wm2, double albedo, double shade_factor) noexcept
 Net absorbed shortwave [W/m²], INTO the water.
 
double openswmm::transport::heat::backLongwave (double t_water_c, double emiss_water) noexcept
 Back longwave emitted by the water [W/m²], OUT of the water.
 
double openswmm::transport::heat::atmosphericEmissivity (double e_a_kpa, double atm_emiss_coeff, double cloud_factor) noexcept
 
double openswmm::transport::heat::atmosphericLongwave (double t_air_c, double humidity_pct, double atm_emiss_coeff, double lw_reflection, double sky_view, double cloud_factor=1.0) noexcept
 Atmospheric longwave [W/m²], INTO the water.
 
double openswmm::transport::heat::landCoverLongwave (double t_air_c, double emiss_landcover, double sky_view) noexcept
 Land-cover longwave [W/m²], INTO the water.
 
double openswmm::transport::heat::netRadiativeFluxOut (double t_water_c, double t_air_c, double humidity_pct, const RadiativeConfig &cfg, double jin_wm2, double cloud_factor) noexcept
 
double openswmm::transport::heat::radiativeFluxOut (const SimulationContext &ctx, const HeatElement &elem, double t_w) noexcept
 

Variables

constexpr double openswmm::transport::heat::kStefanBoltzmann = 5.67e-8
 Stefan–Boltzmann constant, W/m²/K⁴ (rhemodel.cpp:46).
 
constexpr double openswmm::transport::heat::kKelvinOffset = 273.15
 Celsius → Kelvin offset.
 

Detailed Description

Phase H3 — shortwave and longwave radiation at the water surface (heat plan §2.2; RHEComponent §6).

Four terms, each a pure function so it can be gated against the reference implementation rather than against this engine's own output:

  • Net shortwave Jsn = (1 − Rs) Jin (1 − fs) — absorbed solar.
  • Back longwave Jbr = εw σ Tw⁴ — emitted by the water.
  • Atmospheric longwave Jan = εatm σ Ta⁴ (1 − RL) fsky, Brunt (1932) εatm = Aa + 0.0027 √(e_a in PASCALS).
  • Land-cover longwave Jlc = εlc σ Ta⁴ (1 − fsky).
Two corrections to the plan text, taken from the reference
The plan's §2.2 summary omits both, and either would have been a silent error (RHEComponent/src/element.cpp:106-135):
  1. The sky-view factor splits the longwave budget. Jan is multiplied by fsky and Jlc by (1 − fsky); they are complementary shares of the same hemisphere, not independent terms. Written without it, an open-sky element would double-count and a fully shaded one would receive atmospheric longwave through a canopy.
  2. Brunt's square root takes PASCALS, not the kPa the vapour pressure is computed in — 0.0027 √(e_a · 1000). Feeding kPa understates the emissivity term by √1000 ≈ 31.6.
Sign convention
This module returns POSITIVE = leaving the water, matching SurfaceExchange, so the two modules can be summed. The reference uses the opposite sign (its netMCRadiation is positive into the water, with backLWRadiation pre-negated); netRadiativeFluxOut performs the flip in one named place.
Not carried over from the reference: the sediment split
RHE splits absorbed shortwave into a water share and a bed share with exp(−extinction · depth) and hands the latter to the sediment column. There is no sediment column until H4, so H3 keeps all absorbed shortwave in the water. That is a deliberate difference, not an omission: routing bed-bound energy into the water column overestimates warming in shallow, clear water, and H4 is where the receiving state appears.
See also
plans/transport/HEAT_TRANSPORT_PLAN.md §2.2, §6 H3
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n Apache-2.0