- 04 Aug 2022
- 7 Minutes to read
- Print
Running a Water Quality Simulation
- Updated on 04 Aug 2022
- 7 Minutes to read
- Print
Basic information
To run a Water Quality simulation, it is assumed that the user already has created or obtained a hydraulic model filename.dat and a correspondent water quality filename.con.
When opening the .dat file, a .con file is loaded in automatically.
To run the 1D Water Quality Solver, first you need to run a 1D simulation. This can be done by creating or loading a simulation file (.ief) by going to Simulation Tab and selecting New 1D Simulation or Load Simulations. Clicking on the New 1D Simulation button will create a new .ief file, which you will need to fill in with the run parameters as described in the Flood Modeller manual. Clicking on the Load Simulation button will allow you to select a previously created .ief file.
When creating a .ief file you should first select a type of run - either steady or unsteady (currently only the unsteady run is implemented for Water quality runs). Following selection of one of the run types, the appropriate time parameters for the type of run selected should be entered. Under the 'options' tab, check the box adjacent to 'Write Water Quality File'.
In order to save disk space and speed up the simulation time you should set the Save interval to be as large as acceptable. For example, if the time step is 60 seconds and results are only required at hourly intervals then set the Save interval to 3600.
Click 'Run'. After this a box will appear containing information on the progress of the run. When the run is complete a further window will appear, which may provide additional information on the simulation. Once the simulation has finished you can exit by closing the run time information windows.
The 1D simulation is now complete. The 1D Water Quality Solver can now be run. Before you can run a 1D Water Quality Simulation, you need to either create a new Water Quality Simulation file or load it from your hard drive. You can create a new Quality Simulation file by going to Simulation tab > New 1D Simulation button. You can load a previously created Quality Simulation file by going to Simulation Tab > Load Simulation button and then browsing to the file on your hard drive and loading it into Flood Modeller.
When creating a new Quality Simulation file, enter all the necessary Water Quality Simulation parameters and then click run. Once the simulation has finished you can exit by closing the run time information windows.
Selection of Time Step
The selection of a time step depends on the method of solution.
Upwinding provides a very simple algorithm with no overshooting or undershooting and is always bounded when the Courant number is less than or equal to unity, so choose
QUICK does not guarantee boundedness but for accuracy choose the Courant number as small as possible.
For the stability of the SMART scheme the time step should be chosen such that the Courant number, Cr, is less than one third. i.e
Further considerations are needed when the diffusion term is considered. For stability of the numerical representation of the diffusion term in the advection-diffusion equation, choose the diffusion parameter, DΔ t/(Δ x), such that it is less than one half. If a time step which is too large is chosen, the software will warn the user. The most accurate simulation results will be produced as both Δ x and Δ t be as close to 0 as possible but practically the choice of Δ x and Δ t will result from a compromise between computational cost and accuracy.
One method for quickly obtaining an estimate of the optimum time step is to run the 1D Water Solver for a short time at a large time step (e.g. 1 hour at 1000 seconds) and then let the software provide you with a better estimate of the time step as advised by the run details of the simulation (run log).
Please note that by default the SMART algorithm is used by the 1D Water Quality Solver, however it is possible to switch to another algorithm. Please contact CH2M HILL Software Support for the details on how to do this.
Files
The 1D Water Quality Solver requires a number of datafiles; some from the 1D simulation and one user-defined. There are a number of subsidiary files that may be created. The files most relevant to the 1D Water Quality Solver on are listed below for reference.
Filename extension | Contents |
---|---|
.zzn | The output from an unsteady run of a 1D simulation containing the flow, stage, Froude number, velocity, unit mode and unit state at each saved time step. The latter two are used to store supplementary output such as sluice gate control parameters and weir modes. For the simulations of the 1D Water Quality Solver the unit mode contains the flow area at river nodes. This is an input file for the 1D Water Quality Solver (This is a binary file). |
.zzl | The file produced during an unsteady run of the 1D Solver to store general run parameters and a list of labels. If the tickbox ”Write Water Quality file” has been ticked as shown on Figure 11, then the extra data will be appended to the file. This is an input file for the 1D Water Quality Solver (This is a binary file). |
.con | The user prepared datafile which contains pollutant concentration information, which includes boundary and initial conditions and pollutant parameters (ASCII). |
.zzc | The 1D Water Quality Solver concentration output file (This is a binary file). |
.zzq | The output file of the 1D Water Quality direct steady simulation, which contains the concentrations of each pollutant at each node (This is an ASCII file). |
.zzg | Diagnostic output file. This file is displayed when a simulation is completed (This is an ASCII file). |
Run Time Problems
This section discusses the problems which can occur during a run and describes the actions that can be taken to overcome the problems. The program has been designed so that the majority of problems are detected by the software which then displays error or warning messages explaining the likely cause of the problem. In addition, it is preferable to use the Forms Editor to build and edit datafiles, which will avoid many of the errors arising from incorrectly entered data and inconsistent node labelling.
When problems do occur there are three main types of symptoms by which they are detected:
Type 1 problems with the display of the 1D error or warning messages
Type 2 problems with the display of FORTRAN compiler messages or operating system messages
Type 3 problems with the calculation of incorrect results
The first step in overcoming a problem is therefore to determine which type of problem has occurred and then to follow the recommendations from the appropriate section below.
Type 1 problems are those where a 1D error or warning message is displayed. Most messages have code numbers (eg E1004, W2011, N3030) and these are listed along with suggested remedial action in Appendix A.
Type 2 problems are detected by error messages produced by the FORTRAN compiler or the operating system. The form of the error message is determined by the make of FORTRAN compiler and model of computer and therefore only typical messages can be discussed here. Messages such as 'Attempt to divide by zero', 'floating exception' and 'illegal instruction'; are usually caused by model instabilities and the user should refer to the remedial action detailed in the description of the Type 3 problems described below. If a message such as 'core dumped' is displayed then the core should be deleted as it is usually a very large file and would otherwise waste disk space. The error message 'NaN (Not a Number)' can be generated by some compilers. This is usually attributable to datafile formatting problems such as having a zero in the first column of the format fields within the datafile (particularly the initial conditions).
Type 3 problems are those detected by inspection of the model results. The following list gives symptoms and suggested remedial action:
Oscillating results
Oscillating results may be caused by model instabilities or may be a true simulation of oscillations in the physical system. One possible reason for instabilities could be the result of using the QUICK algorithm (which is unbounded) as apposed to SMART. Otherwise the time step may be too large.
Numerical diffusion
This is noticed as an unreasonable decrease in the gradient of a sharp concentration incline. A possible cause of this is using upwinding. More realistic results would be obtained by using the algorithm SMART instead.
Predicted results do not match observed results
Could be due to an oversimplification of the modelling process (i.e. other factors may be important such as another unnoticed reactive pollutant in the river system). It is wise to check that the 1D Solver's predictions are correct before running the 1D Water Quality Solver. Otherwise some of the pollutants parameters or general model parameters may be incorrect (e.g. the diffusion coefficient).