OpenSWMM Engine  6.0.0-alpha.3
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.3)
Loading...
Searching...
No Matches
openswmm_xsect.h File Reference

OpenSWMM Engine — standalone cross-section geometry C API. More...

#include "openswmm_engine.h"
#include "openswmm_links.h"
Include dependency graph for openswmm_xsect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef void * SWMM_XSect
 Opaque handle to a standalone cross-section. Free with swmm_xsect_free().
 
typedef enum SWMM_UnitSystem SWMM_UnitSystem
 Unit system for a standalone cross-section.
 

Enumerations

enum  SWMM_UnitSystem {
  SWMM_UNITS_US = 0 ,
  SWMM_UNITS_SI = 1
}
 Unit system for a standalone cross-section. More...
 

Functions

SWMM_ENGINE_API int swmm_xsect_create (int shape, double geom1, double geom2, double geom3, double geom4, int unit_system, SWMM_XSect *out)
 Create a cross-section from a shape code and its geometry parameters.
 
SWMM_ENGINE_API int swmm_xsect_create_irregular (const double *stations, const double *elevations, int n_pts, double x_left_bank, double x_right_bank, double n_left, double n_channel, double n_right, double length_factor, int unit_system, SWMM_XSect *out)
 Create an irregular (natural channel) cross-section from a transect.
 
SWMM_ENGINE_API int swmm_xsect_create_custom (double y_full, const double *curve_depths, const double *curve_widths, int n_pts, int unit_system, SWMM_XSect *out)
 Create a custom cross-section from a normalized shape curve.
 
SWMM_ENGINE_API int swmm_xsect_create_street (double width, double curb_height, double slope, double roughness, double gutter_depression, double gutter_width, int sides, double back_width, double back_slope, double back_roughness, int unit_system, SWMM_XSect *out)
 Create a street cross-section.
 
SWMM_ENGINE_API int swmm_link_create_xsect (SWMM_Engine engine, int link_idx, SWMM_XSect *out)
 Create a cross-section from a link of an open model.
 
SWMM_ENGINE_API int swmm_xsect_free (SWMM_XSect xsect)
 Release a cross-section handle.
 
SWMM_ENGINE_API int swmm_xsect_get_shape (SWMM_XSect xsect, int *shape)
 Get the shape code of a cross-section.
 
SWMM_ENGINE_API int swmm_xsect_get_units (SWMM_XSect xsect, int *unit_system, int *flow_units)
 Get the unit system and flow units a handle reports its results in.
 
SWMM_ENGINE_API const char * swmm_xsect_shape_name (int shape)
 Get the name of a cross-section shape code.
 
SWMM_ENGINE_API int swmm_xsect_area_of_depth (SWMM_XSect xsect, double depth, double *area)
 Flow area at a given depth.
 
SWMM_ENGINE_API int swmm_xsect_width_of_depth (SWMM_XSect xsect, double depth, double *width)
 Top width of the water surface at a given depth.
 
SWMM_ENGINE_API int swmm_xsect_hydrad_of_depth (SWMM_XSect xsect, double depth, double *hydrad)
 Hydraulic radius (area / wetted perimeter) at a given depth.
 
SWMM_ENGINE_API int swmm_xsect_depth_of_area (SWMM_XSect xsect, double area, double *depth)
 Depth of flow for a given area — the inverse of swmm_xsect_area_of_depth().
 
SWMM_ENGINE_API int swmm_xsect_hydrad_of_area (SWMM_XSect xsect, double area, double *hydrad)
 Hydraulic radius for a given area.
 
SWMM_ENGINE_API int swmm_xsect_sectfactor_of_area (SWMM_XSect xsect, double area, double *sf)
 Section factor (A·R^(2/3)) for a given area.
 
SWMM_ENGINE_API int swmm_xsect_area_of_sectfactor (SWMM_XSect xsect, double sf, double *area)
 Flow area for a given section factor — the inverse of swmm_xsect_sectfactor_of_area(), used to solve for normal depth.
 
SWMM_ENGINE_API int swmm_xsect_dsda (SWMM_XSect xsect, double area, double *dsda)
 Derivative of the section factor with respect to area, dS/dA.
 
SWMM_ENGINE_API int swmm_xsect_critical_depth (SWMM_XSect xsect, double flow, double *ycrit)
 Critical depth for a given flow.
 
SWMM_ENGINE_API int swmm_xsect_full_properties (SWMM_XSect xsect, double *y_full, double *a_full, double *r_full, double *w_max, double *s_full, double *a_max)
 Full-depth (bank-full) properties of the cross-section.
 
SWMM_ENGINE_API int swmm_xsect_is_open (SWMM_XSect xsect, int *is_open)
 Whether the cross-section is open to the atmosphere at its top.
 
SWMM_ENGINE_API int swmm_xsect_area_of_depth_array (SWMM_XSect xsect, const double *depth, int n, double *area)
 Array form of swmm_xsect_area_of_depth().
 
SWMM_ENGINE_API int swmm_xsect_width_of_depth_array (SWMM_XSect xsect, const double *depth, int n, double *width)
 Array form of swmm_xsect_width_of_depth().
 
SWMM_ENGINE_API int swmm_xsect_hydrad_of_depth_array (SWMM_XSect xsect, const double *depth, int n, double *hydrad)
 Array form of swmm_xsect_hydrad_of_depth().
 
SWMM_ENGINE_API int swmm_xsect_depth_of_area_array (SWMM_XSect xsect, const double *area, int n, double *depth)
 Array form of swmm_xsect_depth_of_area().
 
SWMM_ENGINE_API int swmm_xsect_hydrad_of_area_array (SWMM_XSect xsect, const double *area, int n, double *hydrad)
 Array form of swmm_xsect_hydrad_of_area().
 
SWMM_ENGINE_API int swmm_xsect_sectfactor_of_area_array (SWMM_XSect xsect, const double *area, int n, double *sf)
 Array form of swmm_xsect_sectfactor_of_area().
 
SWMM_ENGINE_API int swmm_xsect_area_of_sectfactor_array (SWMM_XSect xsect, const double *sf, int n, double *area)
 Array form of swmm_xsect_area_of_sectfactor().
 
SWMM_ENGINE_API int swmm_xsect_dsda_array (SWMM_XSect xsect, const double *area, int n, double *dsda)
 Array form of swmm_xsect_dsda().
 
SWMM_ENGINE_API int swmm_xsect_critical_depth_array (SWMM_XSect xsect, const double *flow, int n, double *ycrit)
 Array form of swmm_xsect_critical_depth().
 

Detailed Description

OpenSWMM Engine — standalone cross-section geometry C API.

Exposes the engine's canonical cross-section geometry kernels as a reference implementation usable without a model. Construct a cross-section from shape + geometry parameters (or from transect, shape-curve or street data), then query area / top width / hydraulic radius / section factor / critical depth and their inverses. The same functions the routing solvers use answer these queries, so results agree with a simulation bit-for-bit.

A handle can also be taken from a link of an open model (swmm_link_create_xsect), using the geometry the engine actually built — including transect tables. Such a handle owns a deep copy and stays valid after the engine is closed.

double a;
swmm_xsect_area_of_depth(xs, 0.5, &a); // half-full 1 m pipe
void * SWMM_XSect
Opaque handle to a standalone cross-section. Free with swmm_xsect_free().
Definition openswmm_xsect.h:55
@ SWMM_UNITS_SI
Definition openswmm_xsect.h:67
SWMM_ENGINE_API int swmm_xsect_create(int shape, double geom1, double geom2, double geom3, double geom4, int unit_system, SWMM_XSect *out)
Create a cross-section from a shape code and its geometry parameters.
Definition openswmm_xsect_impl.cpp:191
SWMM_ENGINE_API int swmm_xsect_free(SWMM_XSect xsect)
Release a cross-section handle.
Definition openswmm_xsect_impl.cpp:428
SWMM_ENGINE_API int swmm_xsect_area_of_depth(SWMM_XSect h, double depth, double *area)
Flow area at a given depth.
Definition openswmm_xsect_impl.cpp:462
Units
Every geometry value crossing this API is in the handle's display units, matching the rest of the C API: lengths in ft (US) or m (SI), areas in ft² / m², section factors in ft^(8/3) / m^(8/3). Flows (for swmm_xsect_critical_depth) are in the handle's flow units — CFS for a standalone US handle, CMS for a standalone SI handle, and the model's own flow units for a handle taken from a link. Query them with swmm_xsect_get_units().
See also
openswmm_links.hSWMM_XSectShape shape codes and per-link geometry.
Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
License\n MIT License

Typedef Documentation

◆ SWMM_UnitSystem

Unit system for a standalone cross-section.

Matches the engine's internal 0=US / 1=SI coding (see swmm_get_unit_system()). Selects both the length units (ft vs m) and the default flow unit used by swmm_xsect_critical_depth() (CFS vs CMS).

◆ SWMM_XSect

typedef void* SWMM_XSect

Opaque handle to a standalone cross-section. Free with swmm_xsect_free().

Enumeration Type Documentation

◆ SWMM_UnitSystem

Unit system for a standalone cross-section.

Matches the engine's internal 0=US / 1=SI coding (see swmm_get_unit_system()). Selects both the length units (ft vs m) and the default flow unit used by swmm_xsect_critical_depth() (CFS vs CMS).

Enumerator
SWMM_UNITS_US 

Feet, ft², ft^(8/3), CFS.

SWMM_UNITS_SI 

Metres, m², m^(8/3), CMS.

Function Documentation

◆ swmm_link_create_xsect()

SWMM_ENGINE_API int swmm_link_create_xsect ( SWMM_Engine engine,
int link_idx,
SWMM_XSect * out )

Create a cross-section from a link of an open model.

Deep-copies the geometry the engine actually built for the link, including any transect / shape-curve / street tables, so the handle remains valid after the engine is closed or destroyed. The handle inherits the model's unit system and flow units.

Note
Requires resolved geometry. A model still under programmatic construction has only the raw geoms stored, not the derived full-flow properties, so this returns SWMM_ERR_LIFECYCLE until swmm_finalize_model() (or swmm_engine_open()) has run.
Parameters
engineEngine handle with geometry resolved (OPENED or later).
link_idxZero-based link index.
[out]outReceives the new handle on success.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE for a NULL engine; SWMM_ERR_BADINDEX if link_idx is out of range; SWMM_ERR_LIFECYCLE if the model is still in the BUILDING state; SWMM_ERR_BADPARAM if out is NULL or the link has no cross-section (e.g. a pump).
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_area_of_depth()

SWMM_ENGINE_API int swmm_xsect_area_of_depth ( SWMM_XSect xsect,
double depth,
double * area )

Flow area at a given depth.

Parameters
xsectCross-section handle.
depthDepth of flow, display units. Depths above the full depth of a closed shape are clamped, as in the routing solvers.
[out]areaReceives the area, display units squared.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if area is NULL or depth is negative or not finite.
Since
6.0

◆ swmm_xsect_area_of_depth_array()

SWMM_ENGINE_API int swmm_xsect_area_of_depth_array ( SWMM_XSect xsect,
const double * depth,
int n,
double * area )

Array form of swmm_xsect_area_of_depth().

Since
6.0

◆ swmm_xsect_area_of_sectfactor()

SWMM_ENGINE_API int swmm_xsect_area_of_sectfactor ( SWMM_XSect xsect,
double sf,
double * area )

Flow area for a given section factor — the inverse of swmm_xsect_sectfactor_of_area(), used to solve for normal depth.

Parameters
xsectCross-section handle.
sfSection factor, display units^(8/3).
[out]areaReceives the area, display units squared.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if area is NULL or sf is negative or not finite.
Since
6.0

◆ swmm_xsect_area_of_sectfactor_array()

SWMM_ENGINE_API int swmm_xsect_area_of_sectfactor_array ( SWMM_XSect xsect,
const double * sf,
int n,
double * area )

Array form of swmm_xsect_area_of_sectfactor().

Since
6.0

◆ swmm_xsect_create()

SWMM_ENGINE_API int swmm_xsect_create ( int shape,
double geom1,
double geom2,
double geom3,
double geom4,
int unit_system,
SWMM_XSect * out )

Create a cross-section from a shape code and its geometry parameters.

Handles every self-contained shape — i.e. all of SWMM_XSectShape except SWMM_XSECT_IRREGULAR, SWMM_XSECT_CUSTOM and SWMM_XSECT_STREET, whose geometry comes from tabulated data and which have their own constructors below.

geom1–geom4 carry the same meaning as the [XSECTIONS] Geom1–Geom4 columns; see the per-shape notes on SWMM_XSectShape. Unused parameters may be passed as 0.

Note
SWMM_XSECT_FORCE_MAIN is geometrically identical to SWMM_XSECT_CIRCULAR; it differs only in its friction law (its section factor uses the Hazen-Williams exponent), so its geometric queries match a circular pipe of the same diameter.
SWMM_XSECT_DUMMY has no geometry: it constructs successfully and every query returns 0.
Parameters
shapeA SWMM_XSectShape code.
geom1Full depth / diameter, in display units (see units).
geom2Second geometry parameter, or 0.
geom3Third geometry parameter, or 0.
geom4Fourth geometry parameter, or 0.
unit_systemA SWMM_UnitSystem value.
[out]outReceives the new handle on success.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM if out is NULL, shape is not a valid self-contained shape, unit_system is out of range, or the geometry is degenerate (e.g. non-positive depth).
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_create_custom()

SWMM_ENGINE_API int swmm_xsect_create_custom ( double y_full,
const double * curve_depths,
const double * curve_widths,
int n_pts,
int unit_system,
SWMM_XSect * out )

Create a custom cross-section from a normalized shape curve.

Mirrors a SHAPE-type [CURVES] entry scaled to y_full: curve_depths are y/yFull in [0,1] and curve_widths are the corresponding width/wMax.

Parameters
y_fullFull depth of the section, display units (> 0).
curve_depthsNormalized depths (y/yFull), ascending.
curve_widthsNormalized widths (w/wMax) at each depth.
n_ptsNumber of curve points (>= 2).
unit_systemA SWMM_UnitSystem value.
[out]outReceives the new handle on success.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM on a NULL pointer, n_pts < 2, y_full <= 0, or an out-of-range unit_system.
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_create_irregular()

SWMM_ENGINE_API int swmm_xsect_create_irregular ( const double * stations,
const double * elevations,
int n_pts,
double x_left_bank,
double x_right_bank,
double n_left,
double n_channel,
double n_right,
double length_factor,
int unit_system,
SWMM_XSect * out )

Create an irregular (natural channel) cross-section from a transect.

Mirrors an [TRANSECTS] entry: stations/elevations are the GR station-elevation pairs, and the Manning's n triple is the NC line. The roughness values are load-bearing, not decorative — the hydraulic-radius table is conveyance-weighted across the left overbank / channel / right overbank subsections, so passing the wrong n changes the geometry this handle reports.

Parameters
stationsStation (horizontal) coordinates, display units, ascending.
elevationsElevation at each station, display units.
n_ptsNumber of station/elevation pairs (>= 2).
x_left_bankStation where the left overbank ends. Pass the same value as x_right_bank for a channel with no overbanks.
x_right_bankStation where the right overbank begins.
n_leftManning's n, left overbank. 0 → use n_channel.
n_channelManning's n, main channel. Must be > 0.
n_rightManning's n, right overbank. 0 → use n_channel.
length_factorMain-channel / flood-plain length ratio. 0 → 1.0.
unit_systemA SWMM_UnitSystem value.
[out]outReceives the new handle on success.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM on a NULL pointer, n_pts < 2, n_channel <= 0, an out-of-range unit_system, or a transect whose stations yield no wetted area.
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_create_street()

SWMM_ENGINE_API int swmm_xsect_create_street ( double width,
double curb_height,
double slope,
double roughness,
double gutter_depression,
double gutter_width,
int sides,
double back_width,
double back_slope,
double back_roughness,
int unit_system,
SWMM_XSect * out )

Create a street cross-section.

Mirrors a [STREETS] entry; parameters match swmm_street_set_params(). Slopes are percentages, as in the input file.

Parameters
widthDistance from curb to crown, display units.
curb_heightCurb height, display units.
slopeTransverse road slope, percent.
roughnessManning's n of the road surface (> 0).
gutter_depressionDepressed-gutter depth, display units.
gutter_widthDepressed-gutter width, display units.
sides1 = half street, 2 = full street.
back_widthBacking width, display units (0 if none).
back_slopeBacking slope, percent.
back_roughnessBacking Manning's n.
unit_systemA SWMM_UnitSystem value.
[out]outReceives the new handle on success.
Returns
SWMM_OK, or SWMM_ERR_BADPARAM on a NULL out, a non-positive width/curb height/roughness, sides outside {1,2}, or an out-of-range unit_system.
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_critical_depth()

SWMM_ENGINE_API int swmm_xsect_critical_depth ( SWMM_XSect xsect,
double flow,
double * ycrit )

Critical depth for a given flow.

Parameters
xsectCross-section handle.
flowFlow, in the handle's flow units (see swmm_xsect_get_units()).
[out]ycritReceives the critical depth, display units.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if ycrit is NULL or flow is negative or not finite.
Since
6.0

◆ swmm_xsect_critical_depth_array()

SWMM_ENGINE_API int swmm_xsect_critical_depth_array ( SWMM_XSect xsect,
const double * flow,
int n,
double * ycrit )

Array form of swmm_xsect_critical_depth().

Since
6.0

◆ swmm_xsect_depth_of_area()

SWMM_ENGINE_API int swmm_xsect_depth_of_area ( SWMM_XSect xsect,
double area,
double * depth )

Depth of flow for a given area — the inverse of swmm_xsect_area_of_depth().

Parameters
xsectCross-section handle.
areaFlow area, display units squared.
[out]depthReceives the depth, display units.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if depth is NULL or area is negative or not finite.
Since
6.0

◆ swmm_xsect_depth_of_area_array()

SWMM_ENGINE_API int swmm_xsect_depth_of_area_array ( SWMM_XSect xsect,
const double * area,
int n,
double * depth )

Array form of swmm_xsect_depth_of_area().

Since
6.0

◆ swmm_xsect_dsda()

SWMM_ENGINE_API int swmm_xsect_dsda ( SWMM_XSect xsect,
double area,
double * dsda )

Derivative of the section factor with respect to area, dS/dA.

Parameters
xsectCross-section handle.
areaFlow area, display units squared.
[out]dsdaReceives dS/dA, display units^(2/3).
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if dsda is NULL or area is negative or not finite.
Since
6.0

◆ swmm_xsect_dsda_array()

SWMM_ENGINE_API int swmm_xsect_dsda_array ( SWMM_XSect xsect,
const double * area,
int n,
double * dsda )

Array form of swmm_xsect_dsda().

Since
6.0

◆ swmm_xsect_free()

SWMM_ENGINE_API int swmm_xsect_free ( SWMM_XSect xsect)

Release a cross-section handle.

Parameters
xsectHandle from any swmm_xsect_create* / swmm_link_create_xsect. NULL is accepted and ignored.
Returns
SWMM_OK.
Since
6.0

◆ swmm_xsect_full_properties()

SWMM_ENGINE_API int swmm_xsect_full_properties ( SWMM_XSect xsect,
double * y_full,
double * a_full,
double * r_full,
double * w_max,
double * s_full,
double * a_max )

Full-depth (bank-full) properties of the cross-section.

Every out-parameter is optional — pass NULL for any value not wanted.

Parameters
xsectCross-section handle.
[out]y_fullFull depth, display units.
[out]a_fullArea when full, display units squared.
[out]r_fullHydraulic radius when full, display units.
[out]w_maxWidth at the widest point, display units.
[out]s_fullSection factor when full, display units^(8/3).
[out]a_maxArea at which flow is a maximum, display units squared.
Returns
SWMM_OK or SWMM_ERR_BADHANDLE.
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_get_shape()

SWMM_ENGINE_API int swmm_xsect_get_shape ( SWMM_XSect xsect,
int * shape )

Get the shape code of a cross-section.

Parameters
xsectCross-section handle.
[out]shapeReceives a SWMM_XSectShape code.
Returns
SWMM_OK, SWMM_ERR_BADHANDLE, or SWMM_ERR_BADPARAM if shape is NULL.
Since
6.0

◆ swmm_xsect_get_units()

SWMM_ENGINE_API int swmm_xsect_get_units ( SWMM_XSect xsect,
int * unit_system,
int * flow_units )

Get the unit system and flow units a handle reports its results in.

flow_units matters only for swmm_xsect_critical_depth(); every other query is governed by unit_system alone.

Parameters
xsectCross-section handle.
[out]unit_systemReceives a SWMM_UnitSystem value (may be NULL).
[out]flow_unitsReceives the flow-unit code (may be NULL): 0=CFS, 1=GPM, 2=MGD, 3=CMS, 4=LPS, 5=MLD. A standalone handle reports CFS (US) or CMS (SI); a handle from a link reports its model's units.
Returns
SWMM_OK or SWMM_ERR_BADHANDLE.
Since
6.0

◆ swmm_xsect_hydrad_of_area()

SWMM_ENGINE_API int swmm_xsect_hydrad_of_area ( SWMM_XSect xsect,
double area,
double * hydrad )

Hydraulic radius for a given area.

Parameters
xsectCross-section handle.
areaFlow area, display units squared.
[out]hydradReceives the hydraulic radius, display units.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if hydrad is NULL or area is negative or not finite.
Since
6.0

◆ swmm_xsect_hydrad_of_area_array()

SWMM_ENGINE_API int swmm_xsect_hydrad_of_area_array ( SWMM_XSect xsect,
const double * area,
int n,
double * hydrad )

Array form of swmm_xsect_hydrad_of_area().

Since
6.0

◆ swmm_xsect_hydrad_of_depth()

SWMM_ENGINE_API int swmm_xsect_hydrad_of_depth ( SWMM_XSect xsect,
double depth,
double * hydrad )

Hydraulic radius (area / wetted perimeter) at a given depth.

Parameters
xsectCross-section handle.
depthDepth of flow, display units.
[out]hydradReceives the hydraulic radius, display units.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if hydrad is NULL or depth is negative or not finite.
Since
6.0

◆ swmm_xsect_hydrad_of_depth_array()

SWMM_ENGINE_API int swmm_xsect_hydrad_of_depth_array ( SWMM_XSect xsect,
const double * depth,
int n,
double * hydrad )

Array form of swmm_xsect_hydrad_of_depth().

Since
6.0

◆ swmm_xsect_is_open()

SWMM_ENGINE_API int swmm_xsect_is_open ( SWMM_XSect xsect,
int * is_open )

Whether the cross-section is open to the atmosphere at its top.

Parameters
xsectCross-section handle.
[out]is_openReceives 1 for an open channel, 0 for a closed conduit.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if is_open is NULL.
Since
6.0
Here is the call graph for this function:

◆ swmm_xsect_sectfactor_of_area()

SWMM_ENGINE_API int swmm_xsect_sectfactor_of_area ( SWMM_XSect xsect,
double area,
double * sf )

Section factor (A·R^(2/3)) for a given area.

Parameters
xsectCross-section handle.
areaFlow area, display units squared.
[out]sfReceives the section factor, display units^(8/3).
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if sf is NULL or area is negative or not finite.
Since
6.0

◆ swmm_xsect_sectfactor_of_area_array()

SWMM_ENGINE_API int swmm_xsect_sectfactor_of_area_array ( SWMM_XSect xsect,
const double * area,
int n,
double * sf )

Array form of swmm_xsect_sectfactor_of_area().

Since
6.0

◆ swmm_xsect_shape_name()

SWMM_ENGINE_API const char * swmm_xsect_shape_name ( int shape)

Get the name of a cross-section shape code.

Useful for reporting, and for checking a code at runtime after the 6.0 SWMM_XSectShape renumbering (see openswmm_links.h).

Parameters
shapeA SWMM_XSectShape code.
Returns
A static, never-freed string such as "CIRCULAR", or NULL if shape is not a valid code.
Since
6.0

◆ swmm_xsect_width_of_depth()

SWMM_ENGINE_API int swmm_xsect_width_of_depth ( SWMM_XSect xsect,
double depth,
double * width )

Top width of the water surface at a given depth.

Parameters
xsectCross-section handle.
depthDepth of flow, display units.
[out]widthReceives the top width, display units.
Returns
SWMM_OK; SWMM_ERR_BADHANDLE; SWMM_ERR_BADPARAM if width is NULL or depth is negative or not finite.
Since
6.0

◆ swmm_xsect_width_of_depth_array()

SWMM_ENGINE_API int swmm_xsect_width_of_depth_array ( SWMM_XSect xsect,
const double * depth,
int n,
double * width )

Array form of swmm_xsect_width_of_depth().

Since
6.0