source: anuga_validation/okushiri_2005/run_okushiri.py @ 3878

Last change on this file since 3878 was 3878, checked in by ole, 17 years ago

Okushiri mesh using new mesh interface

File size: 2.6 KB
RevLine 
[2229]1"""Validation of the AnuGA implementation of the shallow water wave equation.
2
[3845]3This script sets up Okushiri Island benchmark as published at the
[2229]4
[3845]5THE THIRD INTERNATIONAL WORKSHOP ON LONG-WAVE RUNUP MODELS
6June 17-18 2004
7Wrigley Marine Science Center
8Catalina Island, California
9http://www.cee.cornell.edu/longwave/
[2229]10
[3845]11
12The validation data was downloaded and made available in this directory
13for convenience but the original data is available at
[2229]14http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
[3845]15where a detailed description of the problem is also available.
[2229]16
[3845]17
18Run create_okushiri.py to process the boundary condition and build a the
19mesh before running this script.
20
[2229]21"""
22
[3647]23# Module imports
24from anuga.shallow_water import Domain
25from anuga.shallow_water import Reflective_boundary
26from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
27from anuga.abstract_2d_finite_volumes.util import file_function
[2229]28
29import project
30
31
[3647]32#-------------------------
[3845]33# Create Domain from mesh
[3647]34#-------------------------
[3845]35domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
[3859]36print domain.statistics()
[2229]37
[3845]38#-------------------------
39# Initial Conditions
40#-------------------------
41domain.set_quantity('friction', 0.0)
42domain.set_quantity('stage', 0.0)
43domain.set_quantity('elevation',
[3850]44                    filename=project.bathymetry_filename,
45                    alpha=0.02,                   
46                    verbose=True,
47                    use_cache=True)
[2229]48
49
[3845]50#-------------------------
51# Domain parameters
52#-------------------------
[3850]53domain.set_name(project.output_filename)  # Name of output sww file
54domain.set_default_order(2)               # Apply second order scheme
[3878]55domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
[3850]56domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
57domain.set_maximum_allowed_speed(0.1)     # Allow a little runoff (0.1 is OK)
[3716]58
59
[3647]60#-------------------------
[2229]61# Boundary Conditions
[3647]62#-------------------------
[2229]63
[3845]64# Create boundary function from timeseries provided in file
[3850]65function = file_function(project.boundary_filename,
[3845]66                         domain, verbose=True)
[3647]67
[3845]68# Create and assign boundary objects
[2229]69Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
[3845]70Br = Reflective_boundary(domain)
71domain.set_boundary({'wave': Bts, 'wall': Br})
[2229]72
73
[3647]74#-------------------------
75# Evolve through time
76#-------------------------
[2229]77import time
78t0 = time.time()
79
80for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
81    domain.write_time()
82
83print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracBrowser for help on using the repository browser.