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

Cross-section geometry and hydraulic property evaluation. More...

#include <math.h>
#include "headers.h"
#include "findroot.h"
#include "xsect.dat"
Include dependency graph for xsect.c:

Classes

struct  TXsectStar
 

Macros

#define _CRT_SECURE_NO_DEPRECATE
 
#define RECT_ALFMAX   0.97
 
#define RECT_TRIANG_ALFMAX   0.98
 
#define RECT_ROUND_ALFMAX   0.98
 

Functions

int xsect_isOpen (int type)
 Determines if a xsection type is open or closed.
 
int xsect_setParams (TXsect *xsect, int type, double p[], double ucf)
 Assigns parameters to a cross section's data structure.
 
void xsect_setIrregXsectParams (TXsect *xsect)
 Assigns transect parameters to an irregular shaped cross section.
 
void xsect_setStreetXsectParams (TXsect *xsect)
 Assigns transect parameters to a street cross section.
 
void xsect_setCustomXsectParams (TXsect *xsect)
 Assigns parameters to a custom-shaped cross section.
 
double xsect_getAmax (TXsect *xsect)
 Finds xsection area at maximum flow depth.
 
double xsect_getSofA (TXsect *xsect, double a)
 Computes xsection's section factor at a given area.
 
double xsect_getYofA (TXsect *xsect, double a)
 Computes xsection's depth at a given area.
 
double xsect_getAofY (TXsect *xsect, double y)
 Computes xsection's area at a given depth.
 
double xsect_getWofY (TXsect *xsect, double y)
 Computes xsection's top width at a given depth.
 
double xsect_getRofY (TXsect *xsect, double y)
 Computes xsection's hydraulic radius at a given depth.
 
double xsect_getRofA (TXsect *xsect, double a)
 Computes xsection's hydraulic radius at a given area.
 
double xsect_getAofS (TXsect *xsect, double s)
 Computes xsection's area at a given section factor.
 
double xsect_getdSdA (TXsect *xsect, double a)
 Computes xsection's derivative of its section factor with respect to area at a given area.
 
double xsect_getYcrit (TXsect *xsect, double q)
 Computes critical depth at a specific flow rate.
 

Variables

double Amax []
 

Detailed Description

Cross-section geometry and hydraulic property evaluation.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com (OpenSWMM maintenance and extensions)
License
Apache-2.0 for OpenSWMM contributions; original EPA SWMM provenance is retained.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

◆ RECT_ALFMAX

#define RECT_ALFMAX   0.97

◆ RECT_ROUND_ALFMAX

#define RECT_ROUND_ALFMAX   0.98

◆ RECT_TRIANG_ALFMAX

#define RECT_TRIANG_ALFMAX   0.98

Function Documentation

◆ xsect_getAmax()

double xsect_getAmax ( TXsect * xsect)

Finds xsection area at maximum flow depth.

Parameters
xsectPtr. to a cross section data structure.
Returns
Area (ft2).

◆ xsect_getAofS()

double xsect_getAofS ( TXsect * xsect,
double s )

Computes xsection's area at a given section factor.

Parameters
xsectPtr. to a cross section data structure.
[in]sSection factor (ft^(8/3)).
Returns
Area (ft2).
Here is the caller graph for this function:

◆ xsect_getAofY()

double xsect_getAofY ( TXsect * xsect,
double y )

Computes xsection's area at a given depth.

Parameters
xsectPtr. to a cross section data structure.
[in]yDepth (ft).
Returns
Area (ft2).
Here is the caller graph for this function:

◆ xsect_getdSdA()

double xsect_getdSdA ( TXsect * xsect,
double a )

Computes xsection's derivative of its section factor with respect to area at a given area.

Parameters
xsectPtr. to a cross section data structure.
[in]aArea (ft2).
Returns
Derivative of section factor w.r.t. area (ft^2/3).

◆ xsect_getRofA()

double xsect_getRofA ( TXsect * xsect,
double a )

Computes xsection's hydraulic radius at a given area.

Parameters
xsectPtr. to a cross section data structure.
[in]aArea (ft2).
Returns
Hydraulic radius (ft).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xsect_getRofY()

double xsect_getRofY ( TXsect * xsect,
double y )

Computes xsection's hydraulic radius at a given depth.

Parameters
xsectPtr. to a cross section data structure.
[in]yDepth (ft).
Returns
Hydraulic radius (ft).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xsect_getSofA()

double xsect_getSofA ( TXsect * xsect,
double a )

Computes xsection's section factor at a given area.

Parameters
xsectPtr. to a cross section data structure.
[in]aArea (ft2).
Returns
Section factor (ft^(8/3)).
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xsect_getWofY()

double xsect_getWofY ( TXsect * xsect,
double y )

Computes xsection's top width at a given depth.

Parameters
xsectPtr. to a cross section data structure.
[in]yDepth ft).
Returns
Top width (ft).
Here is the caller graph for this function:

◆ xsect_getYcrit()

double xsect_getYcrit ( TXsect * xsect,
double q )

Computes critical depth at a specific flow rate.

Parameters
xsectPtr. to a cross section data structure.
[in]qFlow rate (cfs).
Returns
Critical depth (ft).
Here is the caller graph for this function:

◆ xsect_getYofA()

double xsect_getYofA ( TXsect * xsect,
double a )

Computes xsection's depth at a given area.

Parameters
xsectPtr. to a cross section data structure.
[in]aArea (ft2).
Returns
Depth (ft).
Here is the caller graph for this function:

◆ xsect_isOpen()

int xsect_isOpen ( int type)

Determines if a xsection type is open or closed.

Parameters
[in]typeType of xsection shape.
Returns
1 if xsection is open, 0 if not.
Here is the caller graph for this function:

◆ xsect_setCustomXsectParams()

void xsect_setCustomXsectParams ( TXsect * xsect)

Assigns parameters to a custom-shaped cross section.

Parameters
xsectPtr. to a cross section data structure.

◆ xsect_setIrregXsectParams()

void xsect_setIrregXsectParams ( TXsect * xsect)

Assigns transect parameters to an irregular shaped cross section.

Parameters
xsectPtr. to a cross section data structure.

◆ xsect_setParams()

int xsect_setParams ( TXsect * xsect,
int type,
double p[],
double ucf )

Assigns parameters to a cross section's data structure.

Parameters
xsectPtr. to a cross section data structure.
[in]typeXsection shape type.
pVector of xsection parameters.
[in]ucfUnits correction factor.
Returns
TRUE if successful, FALSE if not.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xsect_setStreetXsectParams()

void xsect_setStreetXsectParams ( TXsect * xsect)

Assigns transect parameters to a street cross section.

Parameters
xsectPtr. to a cross section data structure.

Variable Documentation

◆ Amax

double Amax[]
Initial value:
= {1.0,
0.9756,
0.9756,
0.97,
1.0,
1.0,
1.0,
1.0,
1.0,
0.98,
0.98,
0.96,
0.96,
0.96,
0.92,
0.96,
0.96,
0.96,
0.98,
0.98,
0.96,
0.96,
1.0,
0.96,
0.9756,
1.0}