skip to main content
Rulebased Simulation
Model Run Analysis Information
RiverWare now has the ability to save and load the Model Run Analysis Data. This option is automatically activated when Save Run Results (Output Values) is selected when saving a model. When the model is subsequently loaded, the user may view this information (located in the Model Run Analysis -- Rulebased Simulation dialog) without running the model first.
Yearly Units for Rule Expressions
Annual units are now available for use in rule expressions. RiverWare takes into account whether the year is a leap year or not when converting to standard units.
Function Type Name Change
Internal Function and External Function
The menu items for adding a function to a ruleset have changed. Previously, a function was added to a policy group by selecting Ruleset Add Internal Function if the user wanted to create a function in the RiverWare rule language or Ruleset Add External Function if the user wanted to create a function using the Tool Command Language (Tcl). The menu items have been changed to Ruleset Add Function and Ruleset Add Tcl Function, respectively.
Predefined Function Modifications
All predefined functions are described in detail in the Rulebased Simulation Documentation online.
GetMaxOutflowGivenInflow and GetMaxReleaseGivenInflow
The convergence routine used to solve for the maximum Outflow or Release (Turbine Release) has been re-designed to increase robustness. This routine is used for the GetMaxOutflowGivenInflow or GetMaxReleaseGivenInflow rules functions. The nature of the convergence routine is such that the maximum and minimum possible pool elevations for the reservoir are computed in order to bracket the solution. This could effect old model files by causing a table interpolation error if the maximum or minimum pool elevation falls outside of the range given in table slots. This problem is remedied by adding additional data to the table slots that cause the problem. It is possible that the pool elevation values are not realistic values in respect to the physical system (i. e. a pool elevation that is below the bottom of the reservoir). Since these calculations are only performed to bracket the final solution, they are not recorded and will not affect the model results. The overall result of the new convergence technique is increased robustness so that the method now converges in cases where convergence was not possible previously. However, more iterations may be required before convergence is reached. The value in the Max Iterations slot may have to be increased if the user notices a brown warning message which states, “An internal iterative loop reached the maximum iterations of ‘(value in Max Iterations slot)’ when solving for ‘(Outflow or Release)’”. Increasing the value to 40 should be sufficient.
NetSubBasinDiversionRequirement
The NetSubBasinDiversionRequirement function has been enhanced. The method now includes Seepage and GainLoss effects (on reach objects) in the diversion requirement calculations. Also, Water User requests are now included in the diversion requirement.
SolveSubBasinDiversions
This is a new predefined function that performs the same calculations as NetSubBasinDiversionRequirement. However, this function also calculates the outflow at the bottom of the subbasin that results from the calculated diversion requirement. The function returns a LIST of two variables where the first is the diversion requirement and the second is the resulting outflow.
Predefined Functions
Four predefined functions have been added to the Rulebased Simulation Palette. The new functions, as well as all of the existing functions, are described in the Rulebased Simulation Documentation online. Following is a list of new predefined functions:
GetMinSpillGivenInflowRelease (OBJECT, NUMERIC, MUMERIC DATETIME)
This function evaluates to the minimum spill from a StorageReservoir, LevelPowerReservoir, or SlopePowerReservoir with the given inflow and release at the specified timestep. The OBJECT argument is the reservoir on which to perform the calculations, the first STRING is the average inflow into the reservoir over the timestep, the second STRING is the average release from the reservoir over the timestep and the DATETIME is the timestep at which to perform the calculations.
SolveShortage (OBJECT, NUMERIC, DATETIME)
This function is used to solve for the shortage on an AggDiversionSite or a Water User object. It returns a LIST of two NUMERIC values where the first value is the diversion shortage and the second is the depletion shortage. The OBJECT argument is the object on which to perform the calculations, the NUMERIC argument is the water available for diversion, and the DATETIME is the timestep at which to perform the calculations.
SolveSubBasinDiversions (LIST, DATETIME)
This function performs the same calculations as the NetSubBasinDiversionRequirement function. This function differs, however, in the fact that it returns a LIST of two NUMERICS. The first NUMERIC is the diversion requirement and the second is the resulting outflow at the bottom of the subbasin.
SumAccountSlotsByWaterType (OBJECT, STRING, STRING, DATETIME)
This function sums the values of all accounting slots of a given name on accounts of a given water type. The OBJECT represents the object on which the accounts exist, the first STRING is the water type, the second STRING is the name of the slots to sum, and the DATETIME is the timestep at which to perform the summation.
Important Bug Fixes
Copy/Paste in ForEach Statements
Several bugs were fixed (2430, 2454, 2455) to enable copying and pasting within a ForEach statement. A complete list of the bugs closed for this release is given under the Closed Bug Reports heading at the bottom of the release notes.
Copy/Paste of Parenthesized Expressions
Several bugs were closed to fix the copying and pasting of expressions in parenthesis (2388, 2389, 2391). A complete list of the bugs closed for this release is given under the Closed Bug Reports heading at the bottom of the release notes.
Revised: 07/05/2022