source: trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py @ 8547

Last change on this file since 8547 was 8547, checked in by davies, 13 years ago

Major experimental changes to balanced_dev

File size: 2.8 KB
Line 
1"""Validation of the AnuGA implementation of the shallow water wave equation.
2
3This script sets up Okushiri Island benchmark as published at the
4
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/
10
11
12The validation data was downloaded and made available in this directory
13for convenience but the original data is available at
14http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
15where a detailed description of the problem is also available.
16
17
18Run create_okushiri.py to process the boundary condition and build a the
19mesh before running this script.
20
21"""
22
23# Module imports
24import anuga
25import project
26#from balanced_dev import *
27from anuga_tsunami import *
28
29def main(elevation_in_mesh=False):
30    #-------------------------
31    # Create Domain from mesh
32    #-------------------------
33    domain = Domain(project.mesh_filename, use_cache=False, verbose=True)
34    print domain.statistics()
35
36
37    #-------------------------
38    # Initial Conditions
39    #-------------------------
40    domain.set_quantity('friction', 0.0)
41    domain.set_quantity('stage', 0.0)
42    if elevation_in_mesh is False:
43        domain.set_quantity('elevation',
44                            filename=project.bathymetry_filename,
45                            alpha=0.02,                   
46                            verbose=True,
47                            use_cache=False)
48
49
50    #-------------------------
51    # Set simulation parameters
52    #-------------------------
53    domain.set_name(project.output_filename)  # Name of output sww file
54    domain.set_default_order(2)               # Apply second order scheme
55    #domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
56    domain.set_quantities_to_be_monitored('stage')
57
58    #-------------------------
59    # Boundary Conditions
60    #-------------------------
61
62    # Create boundary function from timeseries provided in file
63    function = anuga.file_function(project.boundary_filename,
64                             domain, verbose=True)
65
66    # Create and assign boundary objects
67    Bts = anuga.Transmissive_momentum_set_stage_boundary(domain, function)
68    Br = anuga.Reflective_boundary(domain)
69    domain.set_boundary({'wave': Bts, 'wall': Br})
70
71
72    #-------------------------
73    # Evolve through time
74    #-------------------------
75    import time
76    t0 = time.time()
77
78    for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
79        domain.write_time()
80        print domain.quantity_statistics(precision='%.12f')
81
82    print 'That took %.2f seconds' %(time.time()-t0)
83
84#-------------------------------------------------------------
85if __name__ == "__main__":
86    main()
Note: See TracBrowser for help on using the repository browser.