The shape.c module in the EPA SWMM5 source code is responsible for handling custom cross-sectional shapes used in conduit (link) modeling. Specifically, it is used to compute geometric properties of custom user-defined shapes for the flow paths in the drainage system. These properties are crucial for flow routing and are used in the calculation of flow rates, velocities, and hydraulic radii.
Key Functions in the shape.c
Module:
-
shape_validate
:- This function validates and computes the necessary geometric properties of a custom cross-section shape. It checks if the shape is valid and then computes the shape's geometry using the supplied width vs. height curve.
-
computeShapeTables
:- This function generates the tables of geometric properties for a custom cross-section shape. It computes the area, perimeter, and hydraulic radius for each height interval in the shape’s curve and stores them in the respective geometry tables.
-
normalizeShapeTables
:- After computing the tables, this function normalizes them to the full height of the cross-section. This is done by dividing the values by the total area and hydraulic radius, ensuring consistency and correct scaling.
-
getSmax
:- This function calculates the maximum section factor (a value related to the hydraulic efficiency of the shape) for the custom cross-section. It also calculates the maximum area for the shape.
-
getNextInterval
:- This function handles the transitions between height intervals in the custom shape curve and calculates the width of the shape at different heights using linear interpolation.
-
getWidth
:- This function interpolates the width of the custom cross-section at a given height based on the width vs. height curve provided by the user.
-
getArea
:- This function calculates the area of the trapezoidal section formed by two points in the width vs. height curve. It is used for calculating the area of the cross-section at different height intervals.
-
getPerim
:- This function computes the perimeter (wetted perimeter) of the cross-section for the given height interval. This is important for calculating the flow and hydraulic radius.
Workflow:
-
Validate and Compute Geometry:
- The first step in using this module is to validate and compute the geometric properties of the custom shape using the
shape_validate
function. This involves reading the shape's width vs. height curve and using it to calculate the area, perimeter, and hydraulic radius at various intervals of height.
- The first step in using this module is to validate and compute the geometric properties of the custom shape using the
-
Normalize Geometry Tables:
- Once the tables are computed, they are normalized to the full height of the cross-section (using
normalizeShapeTables
) to ensure that all values are relative to the maximum dimensions of the shape.
- Once the tables are computed, they are normalized to the full height of the cross-section (using
-
Hydraulic Calculations:
- The computed geometric properties (area, perimeter, hydraulic radius, etc.) are then used in hydraulic calculations to determine flow rates and other hydraulic characteristics for the conduits in the drainage network.
-
Custom Cross-Section Support:
- The module supports custom cross-sections defined by the user. These custom shapes are important for modeling irregular or non-standard conduits in the drainage system.
Summary of Key Concepts:
- Shape Curve: A user-defined table that describes the width of the cross-section at various heights. This is essential for calculating the flow area and wetted perimeter, which in turn affect flow and velocity calculations.
- Hydraulic Radius: This is the ratio of the cross-sectional area of flow to the wetted perimeter. It is used in the Manning’s equation for flow calculation.
- Section Factor: A dimensionless number that characterizes the efficiency of the cross-section in conveying flow. It is calculated from the area and hydraulic radius.
Summary:
The shape.c module is an important part of SWMM5’s flexibility, allowing for custom user-defined conduit shapes. It computes the geometric properties of these custom shapes, which are then used in flow calculations. The module supports irregular conduit shapes that are not easily modeled using standard circular or trapezoidal shapes.
No comments:
Post a Comment