ANUGA- Installation and Testing of New Hydraulic Model

Final Report

ANUGA – installation and Testing of new hydraulic model

Industry Partner:Water Technology Pty Ltd

Industry Supervisor: Steve Clark (Director)

Student Name: Sachi Canning

Student Number:2562844

A report submitted in partial fulfillment of the degree of Bachelor of Civil Engineering

GriffithSchool of Engineering

GriffithUniversity

12/06/2009

The copyright on this report is held by the author and/or the IAP Industry Partner. Permission has been granted to the Griffith School of Engineering to keep a reference copy of this report.

Contents

Executive Summaryvii

1. Introduction1

2. background2

2.1 How ANUGA works3

3. Installation3

3.1 Installing ANUGA4

4. Running5

4.1 Example Program in ANUGA6

4.1.1 Import Modules7

4.1.2 Setting up the mesh7

4.1.3 Topography8

4.1.4 Initial Conditions10

4.1.5 Forcing Terms10

4.1.6 Boundary Conditions11

4.1.7 Runtime11

4.2 Post Processing Model Results12

4.2.1Depth Time Series12

4.2.2 Flowrate Time series13

4.2.3 Running the model14

4.3 Examining the output14

4.4 Running Advanced ANUGA models15

5. Testing and Validation of ANUGA Part I (Theoretical Testing)15

5.1 Simple Test Problem 1 (Uniform Filling of Channel)16

4.1.1 Simple test problem 1 – Results17

5.2 Simple Test Problem 2 (Steady Uniform Flow)18

5.2.1 Simple test problem 2 – Results19

5.3 Simple Test Problem 3 (Steady Non-Uniform Flow)19

5.3.1 Simple test problem 3 – Results21

5.4 Simple Test Problem 4 (Closed Estuary Response to Sinusoidal Tide)22

5.4.1 Simple test Problem 4 – Results24

5.4.2 Analysis of Results26

5.5 Conclusion of Theoretical Tests26

6. Testing and Validation of ANUGA Part II (Real World Tests)27

6.1 Geoscience Australia Validation28

6.2 ANUGA- WBNM Comparative Analysis29

6.3 Student ANUGA-MIKE21 Tsunami Comparison30

6.3.1 Model Set-up30

6.3.2 Results31

6.3.3 Discussion33

7. Limitations and Abilities of the ANUGA model33

7.1 Published Limitations34

7.2 Boundary Condition Limitations – Designating a flow across a boundary

condition 34

7.3 Boundary Conditions available in ANUGA35

7.4 Simulation Files36

7.5 Mesh setup 37

7.6 Processing times and file sizes38

7.7 Mesh size errors38

7.8 Graphical User Interface (GUI) 39

7.9 Wetting and Drying in ANUGA 40

7.10 Model Stability relating to cell size and timestep41

7.10.1 Cell Size41

7.10.2Timestep41

7.11 Free and Open Source Software (FOSS) and ongoing development 42

7.1.2Limitations and abilities Conclusion 43

8 General Project Issues43

8.1 Lack of Programming Experience43

8.2 Time Constraints43

9 Project Conclusion 44

9.1 Meeting Project Requirements45

Figures

Figure 1: Inputs needed to run an ANUGA model.6

Figure 2: The Right side of the channel created by the code9

Figure 3: The Left side of the channel created by the code9

Figure 4: Resulting cross section of the channel from the input code9

Figure 5: Depth Time series at Gauge 114

Figure 6: Flowrate Time series halfway down the channel15

Figure 7: Rate of water rise in Uniform Filling of a channel17

Figure 8 – Water Profile – Steady Uniform Flow19

Figure 9: Expected Water profile20

Figure 10: Water Profile – Steady Non-Uniform Flow 21

Figure 11 – Water depth profile 21

Figure 12: Theoretical Flow rate response to tide 23

Figure13: Theoretical Depth responses to tide 23

Figure 14: Depth response to tide: VALIDATED25

Figure 15: Flow rate response to Tide: VALIDATED 25

Figure 16: ANUGA prediction and observed water depth at gauge 5 (Okushiri Tsunami event) 28

Figure 17 showing 5yr and 10 yr ARI hydrographs compared 29

Figure 18: Mid-ocean gauge reading 31

Figure 19: Boundary gauge reading32

Figure 19: CBD depth gauge readings32

Fig 20: Time series of Tsunami wave 36

Fig. 21: CosineTideHeights36

Fig. 22: ANUGA Tap model output37

Tables

Table 1: The Contents of the CSV file describing the locations of the Gauges.12

Table 2: Showing Expected and recorded maximums and minimums in proudmans theoretical estuary (Proudman, 1957) 26

Table 3: Resolution testing 38

Acknowledgements

I would like to acknowledge the following individuals and Organisations provided valuable expertise, information and support during this Program

Dr. Ole Nielson, Geoscience Australia, for his timely advice and assistance throughout the project.

Petar Milevski, Woolongong City Council, for his assistance in writing scripts.

The Online forums at sourceforge.net that helped me get past various problems.

Steve Clark, Water Technology, for giving me this opportunity and for help and assistance.

Everyone at the Water Technology Office in Brisbane, for helping me with small, yet numerous issues I would have, and especially Eoghain O’Hanlon for taking time out to answer my many modeling questions.

Damien McGarry, Maroochy Shire Council, for supplying the real world data for testing.

Hong Zhang, Academic Advisor, for taking time out of her busy schedule to assist with the content and writing of my report, as well as her support.

Executive Summary

As part of the Industrial Affiliates program (IAP) 2009, I accepted a project to install, run and test a new hydraulic model called ANUGA. The industry Partner, Water Technology put forward four expected outcomes, they were a functioning model, Procedures for preprocessing data and post processing model results, an assessment of the accuracy/performance of the model and some task procedures for other staff describing the models use.

These outcomes where incorporated into the following five Milestones:

  1. Installation ANUGA:
  2. Running ANUGA:
  3. Theoretical Testing:
  4. Limitations and Abilities:
  5. Real World testing:

These outcomes were completed by running ANUGA though a series of theoretical tests, as well as a real world model. This was done to learn how the model works, and to assess its capabilities as a hydraulic modeling tool.

The ANUGA model has been proven as an accurate model which could replicate simply theoretical tests as well as real world results. It is still very much under development, and as its capabilities and ease of use continue to grow, so will its recognition as a hydraulic model.

1

Sachi Canning S2562844

ANUGA- Installation and Testing of New Hydraulic Model

1Introduction

ANUGA is a free and open source software (FOSS) hydrodynamic modeling tool that simulates realistic flow problems in complex 2D geometries. It is currently in its initial development stages however it has shown already that is a very flexible and robust model.Its flexibility can be seen in its ability to simulate vastly differing scenarios, such as water flowing into a kitchen sink, a dam wall failure, or a storm surge or tsunami event.

ANUGA was tested to benchmark its accuracy and performance against a series of theoretical and real world applications. This was done with ANUGA to indicate whether the model can complete simulations of flow conditions to the desired level of accuracy.

This was done by running the model though a series of theoretical tests, which would assess its ability to solve fundamental equations of motion, and to reproduce phenomena observed in nature. These tests were:

  • Uniform Filling of a channel
  • Steady State Uniform Flow
  • Steady non-uniform Flow
  • Closed Estuary response to Sinusoidal Wave

These tests were chosen because in a paper titles “Towards Developing a Validation standard for Computational Models – Numerical Solutions to the 1D Dynamic Flow Equations” (Carr, 93), they were outlined as effective tests which could be used in the validation of new hydraulic models. He also stated:

‘Validation should test the ability of the model to solve the fundamental equations of motion in an accurate way which is robust to a wide variety of geometries and boundary conditions. Validation should also provide for a number of example applications which verify that when used in a responsible way, with suitable data sets, the model can reproduce observed phenomena.

By reproducing these physical phenomena and solving the fundamental equations of motion, the ANUGA model could be deemed accurate.

The next step is testing ANUGA was to run it through a real world test. This involved recreating a tsunami scenario which had been run on an already accepted model, MIKE21. By extracting the bathymetry data and wave information, the same setup could be remodeled in ANUGA. By comparing the results as assessment on its ability to model real world situations could be made. A literature review into others who have been validating ANUGA was carried out to gauge what their results concluded about the model.

To determine whether the model was one which may be useable by Water Technology a summary of ANUGA’s Limitations and Abilities were collated for their perusal. This was so that they could make an informed choice, to whether this new, free hydraulic model was a tool which they may choose to work with.

2Background

The model is based on a research prototype program developed by the Australian National University (ANU) during the nineties. Geoscience Australia (GA) acquired the model in 2004 for use as a risk analysis tool for hydrological natural disasters and has been redesigned and continually developed, as a collaborative effort between ANU and GA. Geoscience Australia started taking an interest after the Australian Government realized the need for a Tsunami modeling tool, following the Boxing Day tsunami which struck the Indian Ocean side of South East Asia, killing hundreds of thousands of people. This and other events, lead to a new policy being formed by the Australian Government, in which up to $75 million per year was put aside to nationally fund twelve reform commitments, two of them being Disaster Risk Assessments and disaster mitigation strategies. ANUGA was developed under this new scheme, as it aids in these two areas by showing the resulting inundation which can be caused by events such as tsunami as well as how the damage could be mitigated, by simulating the event with devices installed such as tsunami breakwater (See appendix). Another reason for ANUGA’s implementation was to fill the gaps, which were identified by GA, that were in the current models being used. By modeling of the effects of natural hazards such as tsunami, mitigation attempts can be made which will help with the social and economic impacts that these events can have.

2.1 How ANUGA works

ANUGA is made up of a number of modules and libraries which are written in python programming language. Python is built on Object-oriented programming, which is described as ‘a programming language, which is oriented around objects, thus taking advantage of Encapsulation, Polymorphism, and Inheritance to increase code reuse and decrease code maintenance’ (Tony Marston 2007), which generally means it is made up of objects which each have properties relating to how they interact with each other. The numerous modules in ANUGA and Python work with the main module called shallow.water, which is based on a finite-volume method for solving a conserved form of the 2D shallow water wave equation (See appendix A.1).

The conserved shallow wave equations are derived from equations of conservation mass and momentum, which hold true even when the assumptions of shallow water break down, such as during a shock, or hydraulic jump. The use of the conserved shallow water wave equation and the use of object-oriented programming help make ANUGA a flexible and robust model. Its flexibility allows the user to create many different scenarios with ease which would not be as easily recreated on more commonly used applications. One such example, can be demonstrated by the kitchen sink examples(Van Drie, R 2008)(appendices A.2)

3Installation

The ANUGA model is currently relatively different to commercial hydraulic modeling systems in a couple of ways, including its installation. Conventionally, to install a program there are a minimal number of procedures, with user friendliness being a priority. Firstly the user may need to download the program or insert a CD; then they would click on the ‘Install.exe’ or ‘Setup.exe’ files, or something similar, then following a few very simple steps it would go ahead and install automatically. ANUGA on the other hand is not a ‘stand-alone’ program. It requires many other applications and add-ons to be installed to allow the ANUGA model to function, and be able to output useable data. The developers at Geoscience Australia are planning on releasing a simpler installation process to make it easier to download and use.

3.1 Installing ANUGA

To install ANUGA there are 8 programs which are required:

Python 2.5: Dynamic object-oriented programming language that ANUGA is written in, it can be used for many kinds of software development

MinGW:Helps run the program in windows by creating virtual ports, and also contains some libraries used by ANUGA

Netcdf:A set of software libraries and self-describing data formats that support the creation, access, and sharing of object-oriented scientific data. This helps create the simulation output files

ANUGA Source Code:Collection of python files, the main being the shallow.water module.

Anuga Viewer:Application used to view the simulations output by ANUGA

Psyco:Application which decreases processing time by a claimed 30% (Not required)

Mapplotlib:Used to help create 2D plotting and post-processing

VTK:The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, image processing, and visualization used by thousands of researchers and developers around the world.

After downloading these programs, the ANUGA installation manual can be used as a guide to have the model installed correctly. This guide must be followed exactly to ensure that the model will run.

After the model has been installed, and ANUGA has been compiled, tested and validated (See ANUGA installation guide) there are a number of demo files which come with ANUGA which can be run. By reading the scripts of these programs and running them, you will begin to get a basic understanding of how the model works. A good way of exploring the model is to change some of the code to see how it alters the results.

4Running

In ANUGA the domain area is represented by a triangular mesh, and as the simulation evolves, the model solves the governing equations in each triangular cell. The conserved quantities of stage, and horizontal momentum are used with the shallow water wave equation to continually update the model . This method allows ANUGA to model situations, where other may fail, such as during the wetting and drying process, or where there are rapidly changing flow speeds (transition from sub-critical to super-critical flows). ANUGA can proficiently model these flows, such as water running up a beach or water flowing onto dry land. ANUGA also has an advantage over other modeling programs as its output is considered as being more visually rich (Van Drie 2008) and can clearly show fluid dynamics.

One of the demo files bundled with the ANUGA source code contains the Cairns example. This example has, and is expected to be used as the model which people will use to copy loosely when running their first tsunami examples. When the real world data became available theruncairns.py example and other files which are used by this program, such as the project.py, were altered to accommodate the data which was being used. Sections which were altered such as topography, bathymetry, wave size, regions of high resolutions, extents and many more were changed. It is a great example with many areas of the program being easily altered, this is partly due to the simple Python language as well as the helpful notes supplied in the code by its author.

To get a model running there are five data requirements to input, as shown below in figure 1.

The five inputs are:

  • Mesh
  • Topography
  • Initial Conditions
  • Forcing Conditions
  • Boundary Conditions

These data sets are input into the model to create the simulation. This is done through the Python interface, and can be done in a number of ways.

Figure 1: Inputs needed to run an ANUGA model.

4.1 Example Program

Below is a summary of how each of the five sections of data can be input. This script describes how to create a model with the result being a trapezoidal channel, with a designated inflow and slope. There are two obstructions along the channel, and could be en example of a practical model where the resulting flow depths need to be measured when two bridge supports are placed in an overflow channel. The depth at various points will be recorded as well as the cross sectional flow and speed at points in the channel. This example will demonstrate the basic ideas involved in setting up a scenario.

Full code is contained in the appendix(B.1)

4.1.1Import Modules

The first step to consider when using ANUGA is to import the required modules into the model. Here are the modules used in this scenario. (see appendix B.1 (I & II))

Import rectangular_cross: Rectangular cross section mesh with variable width and length to be input

Import DomainDomain is the working area

Import Reflective_boundary: Type of boundary used which reflects the conserved quantities back

Import Dirichlet_boundary:Type of boundary which returns constant values for each conserved quantity

Import Inflow:Used as the module to input water onto the grid

4.1.2Setting up the mesh

After the modules have been loaded, the computational domain can now be specified.

This script will create a simple mesh.

Length = 200

Width = 30

points, vertices, boundary = rectangular_cross(int(length/dx), int(width/dy),

len1=length, len2=width)

domain = Domain(points, vertices, boundary)

After setting the width, length and dx/dy, this code would create a rectangular cross triangular mesh, with a length of 200 and a width of 30. The dy/dx section describes the resolution. In this example dx = dy = 1, therefore there will be 200 triangles along the length and 30 along the width. If dx/dy = 2, there would be half that amount, 100 along the length and 15 along the width.

4.1.3 Topography

Once the domain is set up, the Topography of the model can be specified.

def topography(x,y):

z=0.1*x

N = len(x)

for i in range(N):

#slop

#if 0 < y[i] < 5000:

# z[i] += -0.2*y[i]+20

if 20< y[i] < 31:

z[i] += (0.2 * y[i]) - 4

if y[i] <10:

z[i] += (-0.2 * y[i]) + 2

return z

In this section the topography is being defined in terms of their location (x,y) and their height (z). The first step in the def loop is to given an initial condition (z=0.01*x). This creates a slope of 1 in 100 along the whole rectangular grid.