Qual2K: a modeling Framework for Simulating River and Stream Water Quality (Version 11)



Yüklə 1,65 Mb.
səhifə2/11
tarix18.05.2018
ölçüsü1,65 Mb.
#44519
1   2   3   4   5   6   7   8   9   10   11

GETTING STARTED

As presently configured, an Excel workbook serves as the interface for QUAL2K. That is, all input and output as well as model execution are implemented from within Excel. All interface functions are programmed in Excel’s macro language: Visual Basic for Applications (VBA). All numerical calculations are implemented in Fortran 90 for speed of execution. The following material provides a step-by-step description of how the model can be set up on your computer and used to perform a simulation.


Step 1: Copy the file, Q2Kv2_11.zip, to a directory (e.g., C:\). When this file is unzipped, it will set up a subdirectory, Q2Kv2_11 which includes an Excel file (Q2KMasterv2_11.xls), and an executable file (Q2KFortran2_11.exe). The first is the Q2K interface that allows you to run Q2K and display its results. The second is the Fortran executable that actually performs the model computations. These two files must always be in the same directory for the model to run properly. Note that after you run the model, some assisting files will be automatically created by the Fortran executable file to exchange information with Excel.
NOTE: DO NOT DELETE THE .zip file. If for some reason, you modify Q2K in a way that makes it unusable, you can always use the zip file to reinstall the model.
Step 2: Create a subdirectory off of C:\Q2Kv2_11 called DataFiles.
Step 3: Open Excel and make sure that your macro security level is set to medium (Figure ). This can be done using the menu commands: Tools ? Macro ? Security. Make certain that the Medium radio button is selected.

Figure The Excel Macro Security Level dialogue box. In order to run Q2K, the Medium level of security should be selected.
Step 4: Open Q2KMasterFortranv2_11.xls. When you do this, the Macro Security Dialogue Box will be displayed (Figure ).

Figure The Excel Macro security dialogue box. In order to run Q2K, the Enable Macros button must be selected.
Click on the Enable Macros button.
Step 5: On the QUAL2K Worksheet, go to cell B10 and enter the path to the DataFiles directory: C:\QUAL2K\DataFiles as shown in Figure .

Figure The QUAL2K Worksheet showing the entry of the file path into cell B10.
Step 6: Click on the Run Fortran button.
If the program does not work correctly…
There are two primary reasons why the program would not work properly. First, you may be using an old version of Microsoft Office. Although Excel is downwardly compatible for some earlier versions, Q2K will not work with very old versions.
Second, you may have made a mistake in implementing the preceding steps. A common mistake is to have mistyped the file path that you entered in cell B10. For example, suppose that you mistyped the path as C:\Q2KFortranv2_11\DataFles. If this is the case, you will receive an error message (Figure ).

Figure An error message that will occur if you type the incorrect file path into cell B10 on the QUAL2K Worksheet.
If this occurs, click OK. This will terminate the run and bring you back to the QUAL2K Worksheet where you can correct the file path entry.
If the program works correctly…
QUAL2K will begin to execute. A window will open showing the progress of the Fortran computations (Figure ).

Figure This window is displayed showing the progress of the model computations as executed in Fortran. It allows you to follow the progress of a model run.
The program is set up to simulate a fictitious river with a mainstem along with two tributaries. If the program works properly, the following dialogue box will appear when the run is completed:

Press OK and the following dialogue box will be displayed:

This box allows you to choose the parts of the system that you want to plot. As shown, it defaults to the river’s Mainstem. Press OK to see the travel time for the Mainstem. Note that all plots are updated when you press OK.
To switch to see the plots for one of the tributaries, you would press the button on the upper left of the screen

This causes the plot options dialogue box to be displayed. The pulldown can then be used to select another tributary.
Step 7: On the QUAL2K Worksheet click on the Open Old File button. Browse to get to the directory: C:\Q2KFortranv2_11\DataFiles. You should see that a new file has been created with the name that was specified in cell B9 (in the case of the example in Figure , BogusExample.q2k). Click on the Cancel button to return to Q2K.
Note that every time that Q2K is run, a data file will be created with the file name specified in cell B9 on the QUAL2K Worksheet (Figure ). The program automatically affixes the extension .q2k to the file name. Since this will overwrite previous versions of the file, make certain to change the file name when you perform a new application.
Now that you have successfully run Q2K on your computer, the following pages are devoted to documenting the science that underlies the model.

  1. SEGMENTATION AND HYDRAULICS

The model represents a river as a series of reaches. These represent stretches of river that have constant hydraulic characteristics (e.g., slope, bottom width, etc.). As depicted in Figure , the reaches are numbered in ascending order starting from the headwater of the river’s main stem. Notice that both point and non-point sources and point and non-point withdrawals (abstractions) can be positioned anywhere along the channel’s length.



Figure QUAL2K segmentation scheme for a river with no tributaries.
For systems with tributaries (Figure ), the reaches are numbered in ascending order starting at reach 1 at the headwater of the main stem. When a junction with a tributary is reached, the numbering continues at that tributary’s headwater. Observe that both the headwaters and the tributaries are also numbered consecutively following a sequencing scheme similar to the reaches. Note also that the major branches of the system (that is, the main stem and each of the tributaries) are referred to as segments. This distinction has practical importance because the software provides plots of model output on a segment basis. That is, the software generates individual plots for the main stem as well as each of the tributaries.


Figure QUAL2K segmentation scheme for (a) a river with tributaries. The Q2K reach representation in (b) illustrates the reach, headwater and tributary numbering schemes.
Finally, any model reach can be further divided into a series of equally-spaced elements. As in Figure , this is done by merely specifying the number of elements that are desired.

Figure If desired, any model reach can be further subdivided into a series of n equal-length elements.
In summary, the nomenclature used to describe the way in which Q2K organizes river topology is as follows:


  • Reach. A length of river with constant hydraulic characteristics.

  • Element. The model’s fundamental computational unit which consists of an equal length subdivision of a reach.

  • Segment. A collection of reaches representing a branch of the system. These consist of the main stem as well as each tributary.

  • Headwater. The upper boundary of a model segment.




    1. Yüklə 1,65 Mb.

      Dostları ilə paylaş:
1   2   3   4   5   6   7   8   9   10   11




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə