wiki:ModellingQuestions

Version 7 (modified by rwilson, 16 years ago) (diff)

--

Modelling Questions

What type of problems is ANUGA good for?

General 2D waterflows in complex geometries such as dam breaks, flows among structures, coastal inundation etc.

What type of problems are beyond the scope of ANUGA?

See the chapter on "Restrictions and Limitations" in the User Manual.

Can I start the simulation at an arbitrary time?

Yes, using domain.set_time() you can specify an arbitrary starting time. This is for example useful in conjunction with a file_boundary, which may start hours before anything hits the model boundary. By assigning a later time for the model to start, computational resources aren't wasted.

Can I change values for any quantity during the simulation?

Yes, by using domain.set_quantity() inside the domain.evolve loop you can change values of any quantity. This is for example useful if you wish to let the system settle for a while before assigning an initial condition. Another example would be changing the values for elevation to model e.g. erosion.

Can I change boundary conditions during the simulation?

Yes, see the example in the section "Changing boundary conditions on the fly" in the User Manual.

How do I access model time during the simulation?

The variable t in the evolve for loop is the model time. For example to change the boundary at a particular time (instead of basing this on the state of the system as in the "Changing boundary conditions on the fly" section of the manual) one would write something like

for t in domain.evolve(yieldstep = 0.2, duration = 40.0):
    if Numeric.allclose(t, 15):
        print 'Changing boundary to outflow'
        domain.set_boundary({'right': Bo})

The model time can also be accessed through the public interface domain.get_time(), or changed (at your own peril) through domain.set_time().

Why does a file_function return a list of numbers when evaluated?

Currently, file_function works by returning values for the conserved quantities stage, xmomentum and ymomentum at a given point in time and space as a triplet. To access, or example, stage one must specify element 0 of the triplet returned by file_function, to access xmomentum one must specify element 1 of the triplet, etc.

How do I use a DEM in my simulation?

You use dem2pts to convert your DEM to the required .pts format. This .pts file is then called when setting the elevation data to the mesh in domain.set_quantity.

What sort of DEM resolution should I use?

Try and work with the best you have available. Onshore DEMs are typically available in 25m, 100m and 250m grids. Note, offshore data is often sparse, or non-existent.

Note that onshore DEMS can be much finer as the underlying datasets from which they are created often contain several datapoints per squate metre. It may be necessary to thin out the data so that it can be imported without exceeding available memory. One tool available on the net is called 'decimate'. (Need reference?).

What sort of mesh resolution should I use?

The mesh resolution should be commensurate with your DEM - it does not make sense to put in place a mesh which is finer than your DEM. As an example, if your DEM is on a 25m grid, then the cell resolution should be of the order of 315 square metres (this represents half the area of the square grid). Ideally, you need a fine mesh over regions where the DEM changes rapidly, and other areas of significant interest, such as the coast. If meshes are too coarse, discretisation errors in both stage and momentum may lead to unrealistic results. All studies should include sensitivity and convergence studies based on different resolutions.

How do I tag interior polygons?

At the moment create_mesh_from_regions does not allow interior polygons with symbolic tags. If tags are needed, the interior polygons must be created subsequently. For example, given a filename of polygons representing solid walls (in Arc Ungenerate format) can be tagged as such using the code snippet:

# Create mesh outline with tags
mesh = create_mesh_from_regions(bounding_polygon,
                                boundary_tags=boundary_tags)
# Add buildings outlines with tags set to 'wall'. This would typically
# bind to a Reflective boundary
mesh.import_ungenerate_file(buildings_filename, tag='wall')

# Generate and write mesh to file
mesh.generate_mesh(maximum_triangle_area=max_area)
mesh.export_mesh_file(mesh_filename)

Note that a mesh object is returned from create_mesh_from_regions when file name is omitted.

How often should I store the output?

This will depend on what you are trying to answer with your model and how much memory you have available on your machine. If you need to look in detail at the evolution, then you will need to balance your storage requirements and the duration of the simulation. If the SWW file exceeds 1Gb, another SWW file will be created until the end of the simulation. As an example, to store all the conserved quantities on a mesh with approximately 300000 triangles on a 2 min interval for 5 hours will result in approximately 350Mb SWW file (as for the run_sydney_smf.py example).

How can I set the friction in different areas in the domain?

The model area will typically be estimating the water height and momentum over varying topographies which will have different friction values. One way of assigning different friction values is to create polygons (say poly1, poly2 and poly3) describing each area and then set the corresponding friction values in the following way:

domain.set_quantity('friction',Polygon_function([(poly1,f1), (poly2,f2), (poly3,f3))]))

The values of f1, f2 and f3 could be constant or functions as determined by the user.