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

Functions

double circTheta (double r, double y)
 Evaluate the central angle of a circular water segment.
 
double circArea (double r, double y)
 Evaluate the exact wetted area of a circular segment.
 
double circWidth (double r, double y)
 Evaluate the exact circular free-surface chord width.
 
double circPerim (double r, double y)
 Evaluate the exact submerged circular arc length.
 
template<class F>
double simpsonStep (F &f, double a, double b, double fa, double fm, double fb, double whole, double eps, int depth)
 Recursively refine a cached Simpson panel to an absolute error target.
 
template<class F>
double integrate (F f, double a, double b, double eps=1.0e-12, int depth=40)
 Integrate a scalar function with adaptive Simpson quadrature.
 
double ellipsePerim (double ax, double by, double y)
 Integrate the submerged arc of a mathematical ellipse.
 

Function Documentation

◆ circArea()

double openswmm::fv::secgeom::detail::circArea ( double r,
double y )
inline

Evaluate the exact wetted area of a circular segment.

Uses the exact segment formula between invert and crown, without a lookup table.

Parameters
[in]rPositive circle radius in ft.
[in]yFinite water depth from the invert in ft.
Returns
Area in ft2; zero at/below the invert and full pi*r*r at/above the crown.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ circPerim()

double openswmm::fv::secgeom::detail::circPerim ( double r,
double y )
inline

Evaluate the exact submerged circular arc length.

The chord/free surface is excluded from wetted perimeter.

Parameters
[in]rPositive circle radius in ft.
[in]yFinite water depth from the invert in ft.
Returns
Wetted perimeter in ft; zero at/below the invert and full circumference at/above the crown.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ circTheta()

double openswmm::fv::secgeom::detail::circTheta ( double r,
double y )
inline

Evaluate the central angle of a circular water segment.

Clamps 1-y/r to [-1,1]; positive finite radius is required and NaN is not diagnosed.

Parameters
[in]rPositive circle radius in ft.
[in]yFinite water depth from the invert in ft.
Returns
Angle in radians in [0,2*pi].
Here is the caller graph for this function:

◆ circWidth()

double openswmm::fv::secgeom::detail::circWidth ( double r,
double y )
inline

Evaluate the exact circular free-surface chord width.

Uses 2*sqrt(y*(2*r-y)) only in the wet sub-crown interval.

Parameters
[in]rPositive circle radius in ft.
[in]yFinite water depth from the invert in ft.
Returns
Width in ft; zero at/below the invert or at/above the crown.
Here is the caller graph for this function:

◆ ellipsePerim()

double openswmm::fv::secgeom::detail::ellipsePerim ( double ax,
double by,
double y )
inline

Integrate the submerged arc of a mathematical ellipse.

Uses adaptive angular quadrature with absolute target 1e-12*(ax+by). This mathematical ellipse helper is not the table-defined SWMM HORIZ_ELLIPSE/VERT_ELLIPSE profile evaluator.

Parameters
[in]axPositive horizontal semi-axis in ft.
[in]byPositive vertical semi-axis in ft.
[in]yFinite depth from the bottom in ft; <=0 returns zero and depths above 2*by saturate.
Returns
Both wetted side arcs in ft, excluding the free-surface chord.
Here is the call graph for this function:

◆ integrate()

template<class F>
double openswmm::fv::secgeom::detail::integrate ( F f,
double a,
double b,
double eps = 1.0e-12,
int depth = 40 )

Integrate a scalar function with adaptive Simpson quadrature.

No heap workspace is used by the quadrature itself. Callable copy/evaluation exceptions propagate; numerical error bounds are not certified for singular or nonfinite integrands.

Parameters
[in]fIntegrand copied for this call and invoked synchronously; no callable is retained.
[in]aLower finite integration coordinate.
[in]bUpper finite coordinate; b<=a returns zero without evaluating f.
[in]epsPositive absolute integral error target; defaults to 1e-12.
[in]depthMaximum recursive refinement depth; default 40. Exhaustion accepts the latest corrected estimate.
Returns
Estimated integral in integrand-units times coordinate-units; no error/status object.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ simpsonStep()

template<class F>
double openswmm::fv::secgeom::detail::simpsonStep ( F & f,
double a,
double b,
double fa,
double fm,
double fb,
double whole,
double eps,
int depth )

Recursively refine a cached Simpson panel to an absolute error target.

Samples two quarter points per call; stops when abs(delta)<=15*eps or the depth budget is exhausted. No convergence status or nonfinite check is returned. Recursion uses stack storage, and integrand exceptions propagate.

Parameters
[in,out]fSynchronous scalar integrand callable, borrowed by reference; its own side effects/exceptions are permitted.
[in]aLower finite integration coordinate.
[in]bUpper finite coordinate, greater than a.
[in]faCached f(a).
[in]fmCached f((a+b)/2).
[in]fbCached f(b).
[in]wholeSimpson estimate over [a,b], in integral units.
[in]epsPositive absolute error target in integral units; halved on each recursive child.
[in]depthRemaining subdivision depth; <=0 accepts the next refined estimate regardless of error.
Returns
Sum of refined Simpson panels plus delta/15 correction.
Here is the call graph for this function:
Here is the caller graph for this function: