The qualrout.c
file in SWMM5 handles the water quality routing calculations within the model. It contains functions that update the concentration of pollutants in the water as it moves through the drainage system. The routing is performed for nodes, links, and storage units, and it accounts for various processes like evaporation, seepage, and pollutant decay.
Key Functions and Features of qualrout.c
:
1. qualrout_init()
:
- This function initializes the water quality concentrations in all nodes and links. Initially, each pollutant concentration is set to zero, except for wet nodes and links where the initial concentration is assigned based on the predefined concentration values in the model (e.g.,
Pollut[p].initConcen
).
2. qualrout_execute()
:
- This is the main function that routes water quality through the drainage system during each time step. It works by first calculating the mass flow of pollutants through links, then finding the quality of water at each node and link.
- It calls functions like
findLinkMassFlow()
to calculate how pollutants move through links, andfindNodeQual()
andfindLinkQual()
to update the concentrations in nodes and links.
3. getMixedQual()
:
- This function calculates the concentration of a pollutant in a completely mixed reactor (such as a node or link) by considering the inflow concentration and the existing concentration within the node or link. The new concentration is computed using mass balance, and it ensures that the concentration does not exceed the maximum of the two inflows (original or new).
4. findLinkMassFlow()
:
- This function calculates the mass flow of pollutants through a link and updates the total mass of pollutants in the downstream node. It accounts for the flow through the link, considering both the current and past concentrations of pollutants.
5. findNodeQual()
:
- For nodes with no storage volume, this function simply calculates the new quality concentration based on the mass inflow and outflow. If there is no inflow, the concentration is maintained from the previous time step, and if the node is dry, the concentration is set to zero.
6. findLinkQual()
:
- This function updates the concentration of pollutants in links based on the upstream node's quality and the link's flow conditions. For conduits, it computes pollutant concentrations by considering evaporation, seepage, and reaction losses, and applies first-order decay if needed. It adjusts the concentrations based on the inflow, outflow, and volume of the link.
7. findSFLinkQual()
:
- This is a special function used for steady flow routing. It adjusts the quality of pollutants in a link by applying pollutant decay and considering the effects of evaporation and seepage.
8. findStorageQual()
:
- For nodes with storage volume (e.g., storage nodes), this function computes the pollutant concentrations by considering evaporation, seepage losses, and inflows. It applies first-order decay to the pollutant concentrations, mixes the inflows with the existing concentrations, and ensures that the concentration is set to zero if the volume is too small or if there is no inflow.
9. updateHRT()
:
- This function calculates the hydraulic residence time (HRT), which is the average time that water remains in a storage node. It is updated based on the volume and inflow rate at the node. The HRT is important for pollutant treatment calculations and for determining how long pollutants stay in a storage area.
10. getReactedQual()
:
- This function computes the effect of first-order decay on the pollutant concentration over a given time step. The concentration is reduced according to the decay rate (
kDecay
), and the loss of pollutant mass due to the reaction is added to the mass balance.
Summary of Key Concepts:
- Pollutant Decay: Pollutants are subject to first-order decay, where their concentration decreases over time at a rate determined by
kDecay
. - Mass Flow: Pollutants move with the flow of water through links and nodes, and their mass is tracked in the system to ensure that the water quality is accurately routed.
- Evaporation and Seepage: Water quality is adjusted for evaporation (which increases concentration) and seepage (which removes pollutants).
- Mixed Qualities: At each node or link, the quality of water is determined by mixing the inflows and applying losses due to decay, evaporation, and seepage.
- Hydraulic Residence Time (HRT): The amount of time that water spends in a node or link, which affects how much pollutant is removed due to decay.
Overall, this file is crucial for maintaining accurate water quality routing in the SWMM5 model, ensuring that pollutants are properly tracked and accounted for as they move through the stormwater system.
No comments:
Post a Comment