source: anuga_validation/automated_validation_tests/okushiri_tank_validation/run_okushiri.py @ 7144

Last change on this file since 7144 was 6046, checked in by ole, 16 years ago

Added the renamed boundary to okushiri scripts

File size: 2.9 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
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
28
29import project
30
31def main(elevation_in_mesh=False):
32    #-------------------------
33    # Create Domain from mesh
34    #-------------------------
35    domain = Domain(project.mesh_filename, use_cache=False, verbose=True)
36    print domain.statistics()
37
38
39    #-------------------------
40    # Initial Conditions
41    #-------------------------
42    domain.set_quantity('friction', 0.0)
43    domain.set_quantity('stage', 0.0)
44    if elevation_in_mesh is False:
45        domain.set_quantity('elevation',
46                            filename=project.bathymetry_filename,
47                            alpha=0.02,                   
48                            verbose=True,
49                            use_cache=False)
50
51
52    #-------------------------
53    # Set simulation parameters
54    #-------------------------
55    domain.set_name(project.output_filename)  # Name of output sww file
56    domain.set_default_order(2)               # Apply second order scheme
57    domain.set_minimum_storable_height(0.001) # Don't store w < 0.001m
58    domain.set_quantities_to_be_monitored('stage')
59
60    #-------------------------
61    # Boundary Conditions
62    #-------------------------
63
64    # Create boundary function from timeseries provided in file
65    function = file_function(project.boundary_filename,
66                             domain, verbose=True)
67
68    # Create and assign boundary objects
69    Bts = Transmissive_momentum_set_stage_boundary(domain, function)
70    Br = Reflective_boundary(domain)
71    domain.set_boundary({'wave': Bts, 'wall': Br})
72
73
74    #-------------------------
75    # Evolve through time
76    #-------------------------
77    import time
78    t0 = time.time()
79
80    for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
81        domain.write_time()
82        print domain.quantity_statistics(precision='%.12f')
83
84    print 'That took %.2f seconds' %(time.time()-t0)
85
86#-------------------------------------------------------------
87if __name__ == "__main__":
88    main()
Note: See TracBrowser for help on using the repository browser.