skip to main content
Dispatch Methods
The controller for water quality currently has a dispatch method for each constituent and solution approach combination. They assume the mass balance has already solved and therefore mass balance slots are also required slots.
The following water quality dispatch methods exist on all reservoirs. In order for the method to be executed for each timestep, both the known and unknown slot lists must be satisfied. Each dispatch method represents a possible combination of constituent and solution approach choices made at the global level.
* Solve 2 Layer Temperature
This dispatch method is available for the Layered Temp method.
Required Known Slots
• Diversion
• Outflow
• Hydrologic Inflow
• Return Flow
• Inflow
• Storage
• Inflow Heat
Required Unknown Slots
• Outflow Heat
This method calls the following utility methods:
* Solve 2 Layer Salt
This dispatch method is available for the Layered Salt method.
Required Known Slots
• Diversion
• Outflow
• Hydrologic Inflow
• Return Flow
• Inflow
• Storage
• Inflow Salt Concentration
Required Unknown Slots
• Inflow Salt Mass
• Outflow Salt Mass,
• Outflow Salt Concentration
This method calls the following utility methods:
* Solve 2 Layer Temp and Salt
This dispatch method is available for the Layered Temp and Salt method.
Required Known Slots
• Diversion
• Inflow Salt Mass
• Hydrologic Inflow
• Outflow
• Inflow
• Return Flow
• Inflow Heat
• Storage
Required Unknown Slots
• Outflow Heat
• Outflow Salt Mass
This method calls the following utility methods:
* Solve 2 Layer Temp and DO
This dispatch method is available for the Layered Temp and DO method.
Required Known Slots
• Diversion
• Inflow Dissolved Oxygen Mass
• Hydrologic Inflow
• Inflow Heat
• Inflow
• Outflow
• Inflow Ammonia Mass
• Return Flow
• Inflow Detritus Mass
• Storage
• Inflow Dissolved Organics Mass
Required Unknown Slots
• Outflow Ammonia Mass
• Outflow Dissolved Oxygen Mass
• Outflow Detritus Mass,
• Outflow Heat
• Outflow Dissolved Organics Mass
This method calls the following utility methods:
* Solve 2 Layer Temp Salt and DO
This dispatch method is available for the Layered Temp Salt and DO method.
Required Known Slots
• Diversion
• Inflow Dissolved Oxygen Mass
• Hydrologic Inflow
• Inflow Heat
• Inflow
• Inflow Salt Mass
• Inflow Ammonia Mass
• Outflow
• Inflow Detritus Mass
• Return Flow
• Inflow Dissolved Organics Mass
• Storage
Required Unknown Slots
• Outflow Ammonia Mass
• Outflow Dissolved Oxygen Mass
• Outflow Detritus Mass,
• Outflow Heat
• Outflow Dissolved Organics Mass
• Outflow Salt Mass
This method calls the following utility methods:
* Solve Segmented 2 Layer Salt
This dispatch method is available for the Segmented 2 Layer Salt method.
Required Known Slots
• Storage
• Inflow
• Outflow
• Inflow Salt Concentration
Required Unknown Slots
• Outflow Salt Concentration
• Outflow Salt Mass
This method calls the following utility Method
* Solve Weight Factor Salt Given In
This dispatch method is available for the Well Mixed Salt method when the Weighting Factor Salt method is selected from the WQ Reservoir Routing category. It solves for Outflow Salt Concentration given Inflow Salt Concentration.
Required Known Slots
• Inflow
• Outflow
• Inflow Salt Concentration
• Storage
Required Unknown Slots
• Outflow Salt Concentration
• Reservoir Salt Concentration
Method Details  
First, the massBalanceSaltInit utility function is called to set up local variables and verify that there are the necessary data (see “massBalanceSaltInit”). Next, the getAvgSaltConcIn function is called to determine the weighted average inflowSaltConcentration (see getAvgSaltConcIn).
If Storage is not valid or the reservoir’s previous and current storage are less than or equal to 5.0 acre-feet, set the Reservoir Salt Concentration equal to the Previous Reservoir Concentration and Outflow Salt Concentration to Inflow Salt Concentration then exit the method.
Next, calculate the local variable storSum as follows:
(14.7)    
Calculate the weightingFactor:
(14.8)    
StorSum is then recalculated as follows:
(14.9)    
If storSum is equal to 0.0 then set Reservoir Salt Concentration equal to Previous Reservoir Salt Concentration. Otherwise, Reservoir Salt Concentration equals Outflow Salt Concentration.
(14.10)    
The Previous Reservoir Salt Concentration is set one time step forward to put the reservoir on the queue for the next time step. The Reservoir Outflow Salt Concentration is calculated as follows:
(14.11)    
Finally, Inflow Salt Mass, Outflow Salt Mass, Diversion Salt Mass and Hydrologic Inflow Salt Mass are set by multiplying their respective volumes and concentrations.
* Solve Weight Factor Salt Given Out
This dispatch method is available for the Well Mixed Salt method when the Weighting Factor Salt method is selected from the WQ Reservoir Routing category. It solves for Inflow Salt Concentration given Outflow Salt Concentration.
Required Known Slots
• Inflow
• Outflow Salt Concentration
• Outflow
• Storage
Required Unknown Slots
• Inflow Salt Concentration
• Reservoir Salt Concentration
Method Details  
First, the massBalanceSaltInit utility function is called to set up local variables and verify that there are the necessary data. See massBalanceSaltInit for details.
If Storage is not valid or the reservoir’s previous and current storage are less than or equal to 5.0 Acre-feet, set the Reservoir Salt Concentration equal to the Previous Reservoir Concentration and Inflow Salt Concentration to Outflow Salt Concentration then exit the method.
Next, calculate the local variable storSum as follows:
(14.12)    
Calculate the weightingFactor:
(14.13)    
StorSum is then recalculated as follows:
(14.14)    
If storSum is equal to 0.0 then set Reservoir Salt Concentration equal to Previous Reservoir Salt Concentration. Otherwise, Reservoir Salt Concentration equals Outflow Salt Concentration.
(14.15)    
The Previous Reservoir Salt Concentration is set one time step forward to put the reservoir on the queue for the next time step. The Reservoir Inflow Salt Concentration is calculated as follows:
(14.16)    
Finally, Inflow Salt Mass, Outflow Salt Mass, Diversion Salt Mass and Hydrologic Inflow Salt Mass are set by multiplying their respective volumes and concentrations.
* Solve Pred-Corr Salt Given In
This dispatch method is available for the Well Mixed Salt method when the Predictor-Corrector Salt method is selected from the WQ Reservoir Routing category. It solves for Outflow Salt Concentration given Inflow Salt Concentration.
Required Known Slots
• Inflow
• Outflow
• Inflow Salt Concentration
• Storage
Required Unknown Slots
• Outflow Salt Concentration
• Reservoir Salt Concentration
Method Details  
First, the massBalanceSaltInit utility function is called to set up local variables and verify that there are the necessary data (see massBalanceSaltInit). Next, the getAvgSaltConcIn function is called to determine the weighted average inflowSaltConcentration (see getAvgSaltConcIn).
Next, the local variable storSum is calculated as Storage plus Dead Storage.
(14.17)    
If storSum is equal to 0.0 then set Reservoir Salt Concentration equal to ‑1.0 (the Reservoir Salt Concentration is recalculated in Equation 14.23. Otherwise, solve for the predictor (in units of salt mass):
(14.18)    
The local variable intermediateReservoirSaltConc is computed as follows:
(14.19)    
Solve for the corrector (in units of salt mass):
(14.20)    
The local variable slope is the average of the predictor and the corrector
(14.21)    
The Reservoir Salt Concentration is calculated as follows:
(14.22)    
If the calculated Reservoir Salt Concentration is negative (i.e. the calculation failed to find a valid concentration because there is very little storage in the reservoir) or if storage and previous storage are less than or equal to 5.0 acre-feet, the Reservoir Salt Concentration is reset to the weighted average of the salt concentrations of the inflows.
(14.23)    
The Previous Reservoir Salt Concentration is set one time step forward to put reservoir on the queue for the next time step. Finally, the Outflow Salt Concentration is set equal to the Reservoir Salt Concentration and Inflow Salt Mass, Outflow Salt Mass, Diversion Salt Mass and Hydrologic Inflow Salt Mass are set by multiplying their respective volumes and concentrations.
* Solve Pred-Corr Salt Given Out
This dispatch method is available for the Well Mixed Salt when the Predictor-Corrector Salt method is selected from the WQ Reservoir Routing category. It solves for Inflow Salt Concentration given Outflow Salt Concentration.
Required Known Slots
• Inflow
• Outflow Salt Concentration
• Outflow
• Storage
Required Unknown Slots
• Inflow Salt Concentration
• Reservoir Salt Concentration
Method Details  
First, the massBalanceSaltInit utility function is called to set up local variables and verify that there are the necessary data. See massBalanceSaltInit.
Next, calculate the local variable storSum as Storage plus Dead Storage.
(14.24)    
If Storage is not valid or the reservoir’s previous and current storage are less than or equal to 5.0 Acre-feet, set the Reservoir Salt Concentration equal to the Previous Reservoir Concentration and Inflow Salt Concentration to Outflow Salt Concentration then exit the method.
If storSum is equal to 0.0 then set Reservoir Salt Concentration equal to Previous Reservoir Salt Concentration. Otherwise, Reservoir Salt Concentration equals Outflow Salt Concentration.
(14.25)    
The Previous Reservoir Salt Concentration is set one time step forward to put the reservoir on the queue for the next time step. If inVol equals zero then inflowSaltConc is set equal to zero, otherwise the Reservoir Inflow Salt Concentration is calculated as follows:
(14.26)    
Finally, Inflow Salt Mass, Outflow Salt Mass, Diversion Salt Mass and Hydrologic Inflow Salt Mass are set by multiplying their respective volumes and concentrations.
* Solve Reservoir TDG Outflow
This dispatch method computes the physical and optimization slots based on the actual slot values.
Required Known Slots
• Regulated Spill
• Tailwater Elevation
• Turbine Release
• Inflow TDG Concentration
Required Unknown Slots
• Spill TDG Concentration
• Outflow TDG Concentration
This dispatch method executes the Outflow TDG using Tailwater Depth method and then the selected method in the Optimization Total Dissolved Gas. See “Total Dissolved Gas Methodology” for details on these methods.
Revised: 11/11/2019