transient modelling

23
River2D Two-Dimensional Depth Averaged Model of River Hydrodynamics and Fish Habitat R2D Tutorial – Transient Modelling by Kristel Unterschultz and Julia Blackburn University of Alberta September, 2002

Upload: jorgepita

Post on 02-Jan-2016

36 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Transient Modelling

River2D

Two-Dimensional Depth Averaged Model of River

Hydrodynamics and Fish Habitat

R2D Tutorial – Transient Modelling

by

Kristel Unterschultz and Julia Blackburn

University of Alberta

September, 2002

Page 2: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

1

1.0 Introduction The purpose of this tutorial is to provide direction in the use of River2D for unsteady flow simulations. This document is intended as a supplement to the tutorial entitled “The Basics,” which covers the fundamentals of using River 2D. For this reason, it is assumed that you have a basic understanding of and are familiar with the functions and interface of River2D. If this is not the case, you are advised to consult the program User’s manuals and perhaps step through “the Basics” tutorial before starting this tutorial.

To learn about transient simulations with River2D, the site from “the Basics” tutorial will be used. This is the Fortress site along the Kananaskis River in Alberta. All of the files that you will need to complete this tutorial should be found in the folder entitled “R2D_Transient”.

The normal steps involved in modelling transient flow with River2D are as follows:

1 Calibrate the model for a given flow scenario by adjusting the roughness values (bed values for open water, bed and ice values for ice covered events) until model results agree with observed data.

2 Specify initial conditions for the transient flow simulation.

3 Set the boundary conditions for the domain. These usually take the form of discharge hydrographs at inflow sections and stage (water surface elevation) hydrographs at outflow sections.

4 Set model parameters.

5 Select the type and frequency of transient output for the simulation (if any is desired).

For this tutorial, we will be simulating an open water event. We will assume the bed roughness heights have been previously calibrated. So we will start at step 2.

Page 3: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

2

2.0 Initial Conditions For any transient simulation, initial conditions must be specified at every computational node within the domain. When using River2D to obtain a steady state solution, we use somewhat arbitrary initial conditions. This is because we are not concerned with the path the model takes to get to the final steady state. In a transient simulation, the path is the solution, so the initial conditions should represent the flow conditions in the domain at the time the transient phenomenon enters the domain. Because it is unlikely that initial conditions will be available from field data, it is common practice to use the model to obtain initial conditions. This is accomplished by running the model to steady state with constant boundary conditions that are equivalent to the boundary conditions just prior to the transient event. Alternatively, the model can be run in transient mode from an arbitrary initial condition with appropriate boundary conditions to the point in time when the desired simulation is to start. Our transient event is a theoretical one. Over a period of time, we will increase the discharge flowing into the domain from 2 m3/s to 10 m3/s. For our transient simulation, we will use a steady state solution with an inflow of 2 m3/s as our initial condition. This initial condition has already been obtained and saved in fortsteady.cdg.

Once initial conditions are set, the next step is to specify the boundary conditions for the transient simulation.

Page 4: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

3

3.0 Boundary Conditions

Unsteady boundary conditions for subcritical flow usually take the form of discharge hydrographs at inflow boundaries and stage (water surface elevation) hydrographs at outflow boundaries. River reaches modelled with 2D models are typically around 10 channel widths in length. Therefore, it is unlike that hydrographs will be available at the location of model boundaries when simulating historical events. In these cases, a 1D flow model could be used to obtain the necessary hydrographs. The 1D model could be developed such that it incorporates the 2D reach and boundaries for the 1D model could be chosen to coincide with gauging stations.

The Fortress site has one inflow and one outflow that require boundary conditions. An inflow hydrograph has been developed that will increase the inflow to the reach from 2 m3/s to 10 m3/s over a period of 1 hour. Since we do not know how the outflow boundary will react over time to the changing flow in the domain, it’s difficult to create a reasonable hypothetical stage hydrograph for this boundary. For this reason we will use a depth-unit discharge relationship at our outflow boundary. This type of boundary condition will allow the water level at the outflow to react to the discharge flowing through the boundary. When available, a stage hydrograph is probably a more appropriate choice as it provides the model with the correct stage for that boundary at a particular point in time. The depth-unit discharge is a ‘reaction’ type of condition. The outflow water level at a given point in time is based on the discharge along the outflow at the previous time step.

At this point, will learn how to specify transient boundary conditions.

1 Launch River2D.

2 Choose File > Open and navigate to the R2D_Transient folder.

3 Open the .cdg file for the Fortress site (called fortsteady.cdg).

At this point, you should see the following in you River2D display.

Page 5: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

4

We will start by setting the boundary condition at the inflow.

4 Choose Flow > Edit Flow Boundary…

5 Using your mouse, click on the inflow boundary (green line).

This will open the Edit Flow Boundary dialog box, shown as follows.

Page 6: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

5

As you can see, this boundary is indeed an inflow boundary and it is specified with a fixed inflow discharge of 2 m3/s. We will modify this inflow so that its boundary condition is a discharge hydrograph.

Page 7: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

6

6 Click on the radio button beside “Time Varying Discharge”.

7 Click on the active Browse button below this radio button. This will open the following File Open dialog box.

8 Navigate to the R2D_Transient folder, select the file named

“2to10cms.bcq”, and then click ‘Open’.

This file contains the discharge hydrograph for our hypothetical event. If you were to open this file in a text editor, you would see the following.

2 to 10 cms (

0 2 100 2.348955 200 2.697246 300 3.04421 400 3.389185 500 3.731517 600 4.070552 700 4.405646 800 4.736161 900 5.061467

1000 5.380946 1100 5.693989 1200 6 1300 6.298397 1400 6.588611 1500 6.870091 1600 7.142301 1700 7.404722

Page 8: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

7

1800 7.656854 1900 7.898219 2000 8.128356 2100 8.346827 2200 8.553216 2300 8.747132 2400 8.928203 2500 9.096087 2600 9.250462 2700 9.391036 2800 9.517541 2900 9.629736 3000 9.727407 3100 9.810368 3200 9.878462 3300 9.931559 3400 9.969558 3500 9.992386 3600 10

)

The left column is time in seconds in ascending order and the right column is the corresponding discharge in m3/s. Note that the table is enclosed in round braces. Any number of lines of descriptive text can be added to the file provided such that it does not fall within the braces and that it does not include braces. If the model time exceeds the defined hydrograph, then the model will use the value at the maximum time in the table. In this case, the inflow discharge will be 10 m3/s after then model time exceeds 3600 s.

Next, we will have a look at the boundary condition at the outflow…

9 Choose Flow > Edit Flow Boundary…

10 Click on the outflow boundary (yellow line).

This will open the Edit Flow Boundary dialog box as shown.

Page 9: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

8

As you can see, a depth-unit discharge relationship has already been specified. We will leave the parameters that define this relationship as is (default values). If we had a stage hydrograph for this boundary we would select the radio button called ‘Time Varying Elevation’ and specify the location of the file containing the hydrograph as was done for the inflow boundary. A stage

Page 10: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

9

hydrograph file has the same format as a discharge hydrograph file except that the second column contains the corresponding water surface elevation in metres. Another main difference it that stage hydrographs have the file extension bch rather than bcq.

As indicated by the dialog, another possible boundary condition that can be applied at an outflow boundary is a rating curve. Rating curves are specified in a text file with the extension bcr. Rating curve files have the same format to hydrograph files except that the first column is discharge and the second column is the corresponding stage. If we had a rating curve for our outflow, we could have used this instead of the depth-unit discharge relationship. The rating curve condition is also a ‘reaction’ type of boundary condition. At a given point in time, the stage across the outflow boundary is based on total discharge across that boundary at the previous time step. For this reason, a stage hydrograph is a better choice for a boundary condition than a rating curve, if a hydrograph is available.

At this point we are ready to set the model parameters for the transient simulation.

Page 11: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

10

4.0 Setting River2D Model Parameters for Transient Simulations

River2D’s transient mode is accessed through the Run Transient dialog box. At this point, we will open the Run Transient dialog so that we may review the contents of the box and specify appropriate values for model parameters.

1 Choose Flow > Run Transient. The follow dialog should appear.

As you can see, the Run Transient dialog box is quite similar to the Run Steady dialog box. However, there are enough differences that a discussion of the different fields in this dialog is warranted.

The "Present time" value is the point in time at which the model is currently running or has stopped at. In contrast to steady mode,

Page 12: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

11

time cannot be loosely specified when using the model in transient mode. The present time is used to set the model boundary conditions based on input hydrographs (discharge and/or elevation) and to generate output at appropriate times. It is recommended that the time only be reset at the beginning of a simulation. Since our input hydrograph is defined starting at a time of 0 seconds, the present time should also be set to 0.

"Final time" is the time at which execution of the hydrodynamic model will be stopped. As in steady mode, execution is halted once the present time equals or exceeds the final time. Our inflow hydrograph is defined from t = 0 s to t = 3600 s. We will run the hydrodynamic model until 5000 s. This will ensure that the transient phenomenon has passed through the domain before we stop the simulation.

"Time step increment, ∆t " is the size of the current time step. It may be set at the start of a run, provided that it does not exceed the Goal time step increment. The program will automatically adjust it downward or upward as necessary in order keep the solution within the specified tolerance after every time step. If the model is running smoothly it should remain at the value of the Goal time step increment.

"Goal ∆t” is the user specified time step increment for the simulation. It is also the maximum time step that the model will allow. This value is also used in defining when file output from the analyses will be generated. For example, if the model is run with a goal ∆t = 2, then the model will ensure that a solution is produced at t = 2, 4, 6, 8…etc, even if the actual time step increment must be less than 2 to maintain stability. We will address how to set this parameter later in this discussion.

At every time step, River2D solves a system of non-linear equations. This non-linear system is solved by approximating it as a linear system and then iterating to a solution, with a specified level of accuracy, using the Newton-Raphson technique.

Page 13: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

12

“# iterations per ∆t” is simply an indicator of how many Newton-Raphson iterations were required to achieve model convergence at the last time step.

“Max # of iterations per ∆t” is a user specified setting that limits the number of Newton-Raphson iterations for each time step. If the actual number of iterations reaches this value before the solution change is within the tolerance criterion, then the time step will be rejected and the time step increment will be reduced to half its current value. We will leave this parameter at a value of 9.

"Solution tolerance" is a user specified value that controls the amount of solution convergence required at every time step. At the end of each Newton-Raphson iteration, the value of each solution variable (3 for each node) is compared to their respective values from the previous iteration. If the change in all of the variables is less than the user specified solution tolerance, then the time step is accepted. A larger value of tolerance will result in fewer Newton Raphson iterations per time step. However, accuracy may be compromised and numerical instabilities may occur. Testing has suggested that a value of 0.01 is appropriate. We will use this default value in our simulation.

“Implicitness, θ” is a user specified value that controls the way in which the model solves the system of governing equations. A value of 0 indicates fully explicit while a value of 1 specifies fully implicit. The solution to the governing equations is most accurate when the model is run semi-implicit, that is θ = 0.5. However, the solution is more stable with θ = 1.0. The model should not be run with θ less than 0.5 as it will become unstable. The rule of thumb for setting θ is as follows. If you are modeling small scale flow transients then you will probably want to set the goal time step increment such that the Courant number is one and set θ = 0.5, where Courant number is defined as

xtVC w

r ∆∆

=

Page 14: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

13

where Vw is the speed of the phenomenon, ∆t is the time step increment, and ∆x is the mesh spacing. If, on the other hand, you are only interested in the general trend of the solution, that is a large scale phenomenon such as a flood wave, then you can get away with using a larger goal time step increment and should set θ = 1.0. This is because the use of a larger time step increment will obscure any accuracy improvements provided by using θ = 0.5. Since this simulation is for illustrative purposes only, an accurate solution is not essential. For this reason, we will run the model in fully implicit mode. Due to the fact that we are already compromising the accuracy by using θ = 1.0, we do not have to be too concerned with the chosen Goal Time Step. We will use a Goal ∆t of 10 s. The model should run relatively smoothly at this goal time step and provide us with a reasonably detailed solution through time.

"Log file name" is the name of the text file to which a record of the program execution is written. The record that is produced is essentially the same as the one produced in steady mode except that it includes the number of Newton-Raphson iterations performed at every time step. Its default name is “transient.log” and it resides in the same directory as the current .cdg file. We will use the default file name for the log file.

"Total Inflow" and “Total Outflow” represent the total discharge flowing into and out of the model, respectively. In a transient analysis these will change according to the transient boundary conditions.

"Update display every ____ time steps" is used to set how often the display updates. As drawing the display takes some processor time away from the computations, it may be advisable to limit the number of times that the screen is redrawn. We will use the default value of 1 for this parameter.

The “Output Options” button simply opens the Transient Output Options Dialog box. This dialog allows the user to select and customize output from the transient analysis.

Page 15: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

14

2 If you have not done so already, edit the Transient Run dialog so that it appears as follows.

There is one last parameter that should be set. This is the upwinding coefficient in the finite element scheme. It is recommended that this coefficient be to a value of 0.25 for transient simulations.

3 Select Options > Flow Options…This will open the Flow Options dialog box. Set the upwinding coefficient to 0.25 and press “OK”.

Now that all of the model parameters are set, we will now look at generating output from our transient simulation.

Page 16: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

15

5.0 Generating Output

River2D is equipped to generate various types of output when running the model in transient mode. Transient model output is specified and formatted using the Transient Output Options dialog box. This dialog can be accessed either by clicking on the Output Options button in the Run Transient dialog box or by selecting “Transient Output Options” in the Options menu. We will now have a look at the various output formats and specify some output for our simulation.

Page 17: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

16

1 Click on the “Output Options” button in the Run Transient dialog box. This will open the following dialog.

Page 18: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

17

As you can see, there are three possible types of transient output available to the user: video output, point output, and cdg output.

We will get River2D to generate a video output for our simulation.

2 Put a check beside “Video Output”. This will enable the video output options.

3 Click on the “Browse” button to save the video under an appropriate name. This will open a “Save As” dialog box. Save the video as fortvideo.avi in the R2D_Transient folder.

The option “Output frame every ___ goal time steps” allows the user to specify the frequency of the video output.

4 Enter a value of 10 for this parameter. This means that a frame will be added after every 100 seconds of model time from when the simulation starts.

5 Enter a value of 2 for the playback rate.

6 Select any one of the three options for the video resolution, keeping in mind that the larger the resolution the larger the resulting video file.

We will also specify point output from our simulation.

7 Put a check beside “Point Output”. This will enable the point output options. This option allows the user to output transient model results at specified points. These output points must be specified in a csv (Comma Separated Values) file

8 Click on the first “Browse” button after the “Point Output” check point to locate the csv file that contains the coordinates of the output points.

9 Navigate to the R2D_Transient folder, select the file entitled longsection.csv, and press “OK”. The points in this file defined a transverse section through the reach. If you wish, open this file in a text editor to see the input file format.

Page 19: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

18

10 Place a check beside “Water Surface Elevation” in the “Select output variables” group box.

11 In the “Variable output file prefix” edit box, type in “fort”.

12 Click on the second “Browse” button in this section of the dialog to select a folder to place our point output file. Locate the R2D_Transient folder and press “OK”.

13 Specify a value of 10 in the edit box for “Output variable data every ___ goal time steps”.

Steps 7 through 13 will result in a file called fort_wse.csv. This file will contain the water surface elevation at 100 model seconds for every point defined in longsection.csv.

14 Now that the output options have been selected, click on the “Initialize Output” button and then click on the “Close”.

At this point we are just about ready to start our simulation. The last thing we need to do, before clicking the “Run” button, is to set the display parameters. The video frame generator uses the same display settings as the screen (% zoom, display parameter, annotations, etc). For this reason, it is important to set the display options to reflect what we want to see in the video and then leave them the same for the duration of the simulation.

15 Using the Contour/Colour command, display water surface elevation using a colour map that is clipped to the water’s edge. Specify a user-defined range for the map of 198 to 201m.

16 Open the Annotation Options dialog box and place a check beside Colour Legend, Inflow Discharge, Outflow Discharge, and Time.

6.0 Running in Transient Mode We are now ready to start the simulation.

17 Click on the “Run” button in the Run Transient dialog box.

The time to complete this simulation will be computer dependent. For example, it will take about 45 minutes to complete using a computer with the following specs: 850 MHz Pentium III with 256 MB of RAM.

Page 20: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

19

You can minimize the screen while the model is running but, be sure not to change the display settings in any way, as these changes will affect the video output. This includes changing the model scale by using the zooming commands.

7.0 Model Results Once the simulation is complete, we can have a look at the generated output. We will first have a look at the video we created. Most media players will open AVI (Audio Visual Interface) files. For example, the Windows Media Player, which is shipped with Windows, should open and play our video file.

1 Open and play fortvideo.avi using the media software of your choice.

You should see the channel being flooded as time progresses. We chose to display a colour map of water surface elevation, but we could have created a video using of any one of the display parameter available in the Contour/Colour dialog box. We could have also displayed velocities vectors. We have captured our simulation on video, but unfortunately the resulting AVI file is very large. This is due to the fact that River2D produces uncompressed videos. For this reason, a command is provided in River2D that allows the user to compress AVI videos to more manageable file sizes.

2 Select File > Compress Video…

3 This will open a standard File Open dialog which prompts the user to choose a video file to be compressed. Navigate the R2D_Transient folder, select fortvideo.avi, and press “OK”.

4 This will open another dialog that prompts the user to choose a folder and filename for the compressed video. Navigate to the R2D_Transient folder and save the compressed version as fort_comp.avi.

Note that you must always start with the uncompressed version of a video to create a compressed version. The Compress Video command cannot be used to take a video compressed with algorithm X and convert it to a video compressed with algorithm

Page 21: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

20

Y. Also the compressed video cannot overwrite the uncompressed video file.

5 At this point, the Video Compression dialog box should open as shown below.

The pull down list box should provide any number of different compressors. Those available to you will be dependent on your computer. Each compressor has various settings. You should probably try out a few different ones with different settings to get the results that you want in terms of compressed file size and video quality. A couple compressed videos are provided in the R2D_Transient folder. One was compressed using Microsoft Video 1 (fort_MV1.avi) and the other was compressed with Microsoft RLE (fort_RLE.avi).

If you open our point output file (fort_wse.csv) in a spreadsheet program such as Microsoft Excel, the first few rows and columns should appear as follows.

Page 22: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

21

The first four rows of the file show the path of the cdg file that was used to generate this transient data, the parameter (here it is water surface elevation) that was output at the specified points, the date when this csv file was created, and the time when this csv file was initialized. The fifth and sixth rows are the x and y coordinates of the specified points respectively. Each subsequent row contains the model time in the first cell followed by the values of the output parameter at that time for the specified points. For example, at t = 300s the water surface elevation at the point x = 5180.78 and y = 4701.92 is 200.579m.

Page 23: Transient Modelling

River2D Tutorial – Transient Modelling – September 30, 2002

22

This output format is provided so that transient output data can be brought into software packages such as Matlab for further analyses.

8.0 Concluding Remarks At this point we will conclude the “Transient Modelling” tutorial. This tutorial was intended to give you an overview of the available features and the steps involved when performing transient simulations with River2D. For more information on the topics covered in this tutorial, please consult the River2D User Manual. If you have any comments or questions regarding this tutorial, please contact:

Julia Blackburn Email: [email protected]