OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::infil Namespace Reference

Native infiltration kernels with caller-managed accepted-step state. These methods mutate the supplied state immediately and provide no rollback, finite-input validation or failure status. Call once per accepted source step, or evaluate a private state copy for a trial. Internal rates/depths are ft/s/ft; initialization alone accepts project input units. Serialize shared state use. More...

Classes

struct  CurveNumState
 
struct  GreenAmptState
 
struct  HortonState
 

Functions

void horton_init (HortonState &state, double f0, double fmin, double decay, double regen, double Fmax, const SimulationOptions &opts)
 Convert authored Horton parameters and reset ordinary Horton history.
 
double horton_getInfil (HortonState &state, double precip, double depth, double dt)
 Integrate exponential Horton capacity over one step with dry recovery.
 
double modHorton_getInfil (HortonState &state, double precip, double depth, double dt)
 Advance the linear excess-infiltration Modified Horton model.
 
void grnampt_init (GreenAmptState &state, double S, double Ks, double IMD, const SimulationOptions &opts)
 Convert authored Green-Ampt parameters and initialize the upper zone.
 
double grnampt_getInfil (GreenAmptState &state, double precip, double depth, double dt, InfilModel model_type=InfilModel::GREEN_AMPT, double infil_factor=1.0, double recovery_factor=1.0)
 Advance saturated/unsaturated Green-Ampt history and compute actual infiltration.
 
void curvenum_init (CurveNumState &state, double CN, double regen)
 Initialize Curve Number retention and all event-history fields.
 
double curvenum_getInfil (CurveNumState &state, double precip, double depth, double dt, double recovery_factor=1.0)
 Advance SCS Curve Number event retention with ponded-water continuation.
 
double constant_getInfil (double rate_ftsec, double precip, double depth, double dt)
 Return a stateless capacity bounded by available water.
 

Detailed Description

Native infiltration kernels with caller-managed accepted-step state. These methods mutate the supplied state immediately and provide no rollback, finite-input validation or failure status. Call once per accepted source step, or evaluate a private state copy for a trial. Internal rates/depths are ft/s/ft; initialization alone accepts project input units. Serialize shared state use.

Function Documentation

◆ constant_getInfil()

double openswmm::infil::constant_getInfil ( double rate_ftsec,
double precip,
double depth,
double dt )

Return a stateless capacity bounded by available water.

Parameters
rate_ftsecFinite authored capacity ft/s, normally nonnegative.
precipFinite incoming rate ft/s, normally nonnegative.
depthFinite nonnegative available ponded feet.
dtFinite positive seconds; unchecked division occurs even if capacity is zero.
Returns
max(0,min(rate_ftsec,precip+depth/dt)) ft/s. No state is read/modified and no finite-value/error handling is added. This model has no legacy input token.

◆ curvenum_getInfil()

double openswmm::infil::curvenum_getInfil ( CurveNumState & state,
double precip,
double depth,
double dt,
double recovery_factor = 1.0 )

Advance SCS Curve Number event retention with ponded-water continuation.

Parameters
[in,out]stateInitialized finite CN retention/history; updates event P/F, remaining S/Se, inter-event T and previous rate f immediately.
precipFinite nonnegative rainfall ft/s; caller determines runon inclusion.
depthFinite nonnegative ponded feet. During no rain, depth>0.004167 ft can continue the preceding rate while retention remains.
dtFinite positive seconds, unchecked.
recovery_factorFinite nonnegative multiplier on dry capacity regeneration; zero suppresses that recovery. Applied after regen*Smax*dt in legacy arithmetic order.
Returns
Nonnegative supply-limited ft/s for valid inputs. New rainfall after Tmax resets event totals using current retention; positive regen depletes S with infiltration, otherwise it remains unchanged. No numeric validation/status/rollback.

◆ curvenum_init()

void openswmm::infil::curvenum_init ( CurveNumState & state,
double CN,
double regen )

Initialize Curve Number retention and all event-history fields.

Parameters
[out]stateReplaced with initialized Smax/S/Se/P/F/f/regen/T/Tmax values.
CNFinite authored curve number, clamped to [10,99] before the retention formula (1000/CN-10)/12 feet. Does not reject nonfinite input explicitly.
regenDrying time days (despite the parameter name); positive becomes 1/(days*86400), otherwise zero. Tmax=0.06/regen when positive, else 1e10 seconds. No project-unit conversion is needed for this empirical inch-based formula.
Here is the caller graph for this function:

◆ grnampt_getInfil()

double openswmm::infil::grnampt_getInfil ( GreenAmptState & state,
double precip,
double depth,
double dt,
InfilModel model_type = InfilModel::GREEN_AMPT,
double infil_factor = 1.0,
double recovery_factor = 1.0 )

Advance saturated/unsaturated Green-Ampt history and compute actual infiltration.

Parameters
[in,out]stateInitialized unscaled Ks/Lu/suction/moisture state. Updates T, F, Fu, IMD and saturated status; base Ks/Lu are not scaled in place. Caller provides physically valid finite state and owns trial/accepted-step copying.
precipFinite nonnegative rainfall plus included runon ft/s.
depthFinite nonnegative ponded depth feet.
dtFinite positive seconds; decrements T before choosing the branch.
model_typeGREEN_AMPT resets event F in the low-rain timer branch; MOD_GREEN_AMPT skips that particular reset. Dry-zone emptying/reset logic is shared; other enum values also follow the non-GREEN_AMPT branch.
infil_factorConductivity multiplier: ks=Ks*factor and lu=Lu*sqrt(factor). Positive finite factor is needed for nonzero finite lu in division branches; zero/negative/nonfinite factors receive no protective guard.
recovery_factorDimensionless dry-recovery multiplier, normally positive finite; zero can produce an infinite inter-event timer and is not special-cased.
Returns
Infiltration ft/s from the state-dependent supply/capacity solve. Factors are applied locally, upper-zone drainage/event resets follow the legacy algorithm, and no finite-output check, convergence status or rollback is supplied.
Here is the caller graph for this function:

◆ grnampt_init()

void openswmm::infil::grnampt_init ( GreenAmptState & state,
double S,
double Ks,
double IMD,
const SimulationOptions & opts )

Convert authored Green-Ampt parameters and initialize the upper zone.

Parameters
[out]stateReceives S/Ks/IMD/IMDmax, F=Fu=0, derived Lu/Fumax and saturated=false. Existing inter-event T is retained; caller initializes it for new simulation state. Invalid values are not rejected or clamped.
SSuction depth in project inches/mm, normally nonnegative.
KsPositive saturated conductivity in project in/hr or mm/hr, converted first to ft/s; Lu is derived from conductivity expressed in in/hr in all systems.
IMDInitial moisture-deficit fraction, physically in [0,1].
optsValid project unit options used by rainfall/depth conversions. No forcing factors or accepted water-store changes occur here.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ horton_getInfil()

double openswmm::infil::horton_getInfil ( HortonState & state,
double precip,
double depth,
double dt )

Integrate exponential Horton capacity over one step with dry recovery.

Parameters
[in,out]stateInitialized parameters/history; normally finite f0>=fmin>=0, nonnegative decay/regen/Fmax and meaningful cumulative tp/Fe. Caller applies any conductivity/recovery multipliers before calling. Updates tp and, when capped, Fe; Fmh is not used. No rollback if an intermediate becomes nonfinite.
precipRainfall plus included runon rate ft/s, normally finite nonnegative.
depthPonded feet available over this interval, normally finite nonnegative.
dtFinite positive seconds; no zero/negative-step guard.
Returns
Actual ft/s bounded by available precip+depth/dt for valid state. Negative capacity difference/decay/regen returns zero unchanged. Equal f0/fmin or zero decay uses constant capacity without advancing history or enforcing Fmax. Wet regular steps solve equivalent cumulative time (up to twenty Newton iterations); dry steps recover time and capped infiltration. Numerical failure has no diagnostic.

◆ horton_init()

void openswmm::infil::horton_init ( HortonState & state,
double f0,
double fmin,
double decay,
double regen,
double Fmax,
const SimulationOptions & opts )

Convert authored Horton parameters and reset ordinary Horton history.

Parameters
[out]stateReceives parameters plus tp=Fe=0. Existing Fmh is retained; use a fresh/default state or explicitly reset it before Modified Horton reuse.
f0Initial capacity in project rainfall units (in/hr or mm/hr).
fminUltimate capacity in the same units, normally 0<=fmin<=f0.
decayFinite nonnegative exponential/linear decay constant per hour, converted to per second.
regenDrying time in days, not a regeneration rate; positive becomes -log(0.02)/(regen*86400), nonpositive disables recovery.
FmaxCumulative infiltration depth in inches/mm; positive converts to feet, nonpositive stores zero (unlimited). No validity/finite checks are performed.
optsCompatible valid flow-unit selection for rainfall/rain-depth conversions. Does not apply monthly/pattern conductivity/recovery factors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ modHorton_getInfil()

double openswmm::infil::modHorton_getInfil ( HortonState & state,
double precip,
double depth,
double dt )

Advance the linear excess-infiltration Modified Horton model.

Parameters
[in,out]stateCompatible initialized Horton parameters with finite f0>=fmin>=0 and nonnegative decay/regen. Fe drives capacity f0-decay*Fe; Fmh tracks total infiltration against positive Fmax. Caller resets Fmh when starting a new simulation because horton_init does not do so. Updates Fe/Fmh, not tp.
precipFinite nonnegative incoming rate ft/s including caller-supplied runon.
depthFinite nonnegative ponded depth feet.
dtFinite positive step seconds; unchecked.
Returns
Capacity/supply-limited ft/s. Invalid negative parameter relationships return zero unchanged; constant-capacity branches bypass cumulative state/cap. Dry periods exponentially reduce Fe and Fmh. No finite validation/error status or trial rollback is supplied.