60#ifndef OPENSWMM_XSECT_H
61#define OPENSWMM_XSECT_H
122 double geom3,
double geom4,
153 const double* stations,
const double* elevations,
int n_pts,
154 double x_left_bank,
double x_right_bank,
155 double n_left,
double n_channel,
double n_right,
double length_factor,
176 double y_full,
const double* curve_depths,
const double* curve_widths,
204 double width,
double curb_height,
double slope,
double roughness,
205 double gutter_depression,
double gutter_width,
int sides,
206 double back_width,
double back_slope,
double back_roughness,
416 double* a_full,
double* r_full,
417 double* w_max,
double* s_full,
441 const double* depth,
int n,
445 const double* depth,
int n,
449 const double* depth,
int n,
453 const double* area,
int n,
457 const double* area,
int n,
465 const double* sf,
int n,
469 int n,
double* dsda);
472 const double* flow,
int n,
#define SWMM_ENGINE_API
Definition openswmm_2d.h:53
void * SWMM_Engine
Opaque handle to an OpenSWMM Engine instance.
Definition openswmm_callbacks.h:51
OpenSWMM Engine — primary transparent C API (master header).
OpenSWMM Engine — Link (conduit/pump/orifice/weir/outlet) C API.
SWMM_ENGINE_API const char * swmm_xsect_shape_name(int shape)
Get the name of a cross-section shape code.
Definition openswmm_xsect_impl.cpp:470
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().
Definition openswmm_xsect_impl.cpp:497
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().
Definition openswmm_xsect_impl.cpp:589
SWMM_ENGINE_API int swmm_xsect_hydrad_of_area(SWMM_XSect xsect, double area, double *hydrad)
Hydraulic radius for a given area.
Definition openswmm_xsect_impl.cpp:503
SWMM_ENGINE_API int swmm_xsect_critical_depth(SWMM_XSect xsect, double flow, double *ycrit)
Critical depth for a given flow.
Definition openswmm_xsect_impl.cpp:528
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:207
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.
Definition openswmm_xsect_impl.cpp:387
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().
Definition openswmm_xsect_impl.cpp:603
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.
Definition openswmm_xsect_impl.cpp:253
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.
Definition openswmm_xsect_impl.cpp:521
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().
Definition openswmm_xsect_impl.cpp:561
void * SWMM_XSect
Opaque handle to a standalone cross-section. Free with swmm_xsect_free().
Definition openswmm_xsect.h:71
SWMM_UnitSystem
Unit system for a standalone cross-section.
Definition openswmm_xsect.h:81
@ SWMM_UNITS_US
Definition openswmm_xsect.h:82
@ SWMM_UNITS_SI
Definition openswmm_xsect.h:83
SWMM_ENGINE_API int swmm_xsect_free(SWMM_XSect xsect)
Release a cross-section handle.
Definition openswmm_xsect_impl.cpp:445
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.
Definition openswmm_xsect_impl.cpp:509
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.
Definition openswmm_xsect_impl.cpp:340
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().
Definition openswmm_xsect_impl.cpp:617
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.
Definition openswmm_xsect_impl.cpp:302
SWMM_ENGINE_API int swmm_xsect_area_of_depth(SWMM_XSect xsect, double depth, double *area)
Flow area at a given depth.
Definition openswmm_xsect_impl.cpp:479
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.
Definition openswmm_xsect_impl.cpp:491
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.
Definition openswmm_xsect_impl.cpp:485
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(),...
Definition openswmm_xsect_impl.cpp:515
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().
Definition openswmm_xsect_impl.cpp:582
SWMM_ENGINE_API int swmm_xsect_dsda_array(SWMM_XSect xsect, const double *area, int n, double *dsda)
Array form of swmm_xsect_dsda().
Definition openswmm_xsect_impl.cpp:610
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().
Definition openswmm_xsect_impl.cpp:575
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.
Definition openswmm_xsect_impl.cpp:534
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.
Definition openswmm_xsect_impl.cpp:461
SWMM_ENGINE_API int swmm_xsect_get_shape(SWMM_XSect xsect, int *shape)
Get the shape code of a cross-section.
Definition openswmm_xsect_impl.cpp:454
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().
Definition openswmm_xsect_impl.cpp:568
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().
Definition openswmm_xsect_impl.cpp:596
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.
Definition openswmm_xsect_impl.cpp:550