The node.c
file in SWMM5 (Storm Water Management Model) handles the functions related to the nodes in the conveyance system. Nodes represent junctions, outfalls, storage units, and dividers in the drainage system. This file defines how these nodes behave, how their properties are initialized, how water flows through them, and how they interact with other parts of the model. The file also manages the mass balance of water, including inflows, outflows, evaporation, and infiltration for each node.
Key Features of the Code:
1. Node Types and Properties:
- Junction: A node where multiple links (pipes, conduits, etc.) meet.
- Outfall: A discharge point where water flows out of the system, either at a fixed stage, tidal, time series, or free outfall.
- Storage: A node that stores water, such as a detention pond or a reservoir.
- Divider: A node that splits flow into two or more links based on specific conditions (like weir flow or cutoff flow).
2. Functions for Node Handling:
node_readParams()
: Reads the parameters for a specific node (junction, outfall, storage, or divider) from an input line and assigns values to the corresponding node properties.node_setParams()
: Sets the properties of a node, including its type, invert elevation, depth, and volume.node_validate()
: Validates the properties of a node, ensuring that depths, volumes, and other parameters are within acceptable ranges.node_initState()
: Initializes the state variables of a node, such as its depth, volume, and water quality levels at the start of the simulation.node_setOldHydState()
: Updates the old hydraulic state values of a node at the end of a time step.node_setOldQualState()
: Updates the old water quality state values of a node at the end of a time step.node_initFlows()
: Initializes the inflows, outflows, and overflow at a node at the start of each time step.
3. Node-Specific Methods:
- Junction:
- For junction nodes, the method assigns values for maximum depth, initial depth, surcharge depth, and ponded area.
- Outfall:
- Outfall nodes can have different types:
FIXED
,TIDAL
,TIMESERIES
, andFREE
. The method reads parameters based on the outfall type and handles different flow conditions accordingly.
- Outfall nodes can have different types:
- Storage:
- Storage nodes represent detention areas or reservoirs. These nodes store water up to a certain depth and volume. The depth is calculated based on the volume of stored water, and the method also handles exfiltration losses.
- Divider:
- Divider nodes control the distribution of flow between different links. The method handles different types of dividers like
CUTOFF
,OVERFLOW
,WEIR
, andTABULAR
.
- Divider nodes control the distribution of flow between different links. The method handles different types of dividers like
4. Water Flow and Volume Calculations:
node_getDepth()
: Computes the depth of water in a node based on its volume.node_getVolume()
: Computes the volume of water in a node based on its depth.node_getSurfArea()
: Computes the surface area of water in a node based on its depth.node_getOutflow()
: Computes the flow out of a node, either through a connected link or as discharge at an outfall.node_getMaxOutflow()
: Computes the maximum outflow from a node, considering storage and overflow.node_getSystemOutflow()
: Computes the total outflow from a node, including overflow and routing to other parts of the system.node_getLosses()
: Computes the losses from a node, including evaporation and infiltration.
5. Hydraulic and Water Quality State Management:
- The code keeps track of both hydraulic (water depth and volume) and water quality (pollutant concentrations) states for each node. This is crucial for maintaining the system's mass balance and ensuring the proper routing of water and pollutants through the system.
6. Outfall and Storage Node Handling:
- Outfall Nodes:
- Different types of outfalls are handled, each with a different discharge behavior. For example, a
TIDAL
outfall uses a tidal curve to determine the stage (water level), while aTIMESERIES
outfall uses a time series of stage data. - The water depth at the outfall node is computed based on the outfall stage, critical depth, and normal flow depth.
- Different types of outfalls are handled, each with a different discharge behavior. For example, a
- Storage Nodes:
- Storage nodes can have various shapes, such as cylindrical, conical, or pyramidal. The depth and volume of water in the storage node are calculated based on the shape and the water level.
7. Error Handling and Warnings:
- The code includes error checks for invalid node properties, such as negative volumes or depths that exceed the maximum allowable values.
- Warnings are generated if the node's depth is increased to accommodate a conduit crown or if the volume curve for a storage node produces negative volumes.
Summary:
The node.c
file defines the behavior of different types of nodes in the SWMM5 model, including junctions, outfalls, storage nodes, and dividers. It handles the initialization, validation, and update of node properties and computes key hydraulic and water quality parameters such as depth, volume, inflows, outflows, and losses. The file also includes error handling and warnings to ensure the consistency and accuracy of the model's behavior, making it a crucial component of the SWMM5 system for modeling stormwater runoff and drainage systems.
No comments:
Post a Comment