source: anuga_validation/okushiri_2005/run_okushiri.py @ 5424

Last change on this file since 5424 was 5424, checked in by ole, 15 years ago

1 -> True

File size: 3.1 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
31
32#-------------------------
33# Create Domain from mesh
34#-------------------------
35domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
36print domain.statistics()
37
38
39#-------------------------
40# Initial Conditions
41#-------------------------
42domain.set_quantity('friction', 0.0)
43domain.set_quantity('stage', 0.0)
44domain.set_quantity('elevation',
45                    filename=project.bathymetry_filename,
46                    alpha=0.02,                   
47                    verbose=True,
48                    use_cache=True)
49
50
51#-------------------------
52# Set simulation parameters
53#-------------------------
54domain.set_name(project.output_filename)  # Name of output sww file
55domain.set_default_order(2)               # Apply second order scheme
56domain.set_all_limiters(0.9)              # Max second order scheme (old lim)
57domain.set_minimum_storable_height(0.001) # Don't store h < 0.001m
58domain.tight_slope_limiters = True
59domain.beta_h = 0.0
60
61#Timings on AMD64-242 (beta_h=0)
62#  tight_slope_limiters = 0:
63#    3035s - 3110s
64#  tight_slope_limiters = 1:
65#    3000s - 3008s
66#
67# beta_h>0: In the order of 3200s
68
69#-------------------------
70# Boundary Conditions
71#-------------------------
72
73# Create boundary function from timeseries provided in file
74function = file_function(project.boundary_filename,
75                         domain, verbose=True)
76
77# Create and assign boundary objects
78Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
79Br = Reflective_boundary(domain)
80domain.set_boundary({'wave': Bts, 'wall': Br})
81
82
83# Select triangle containing ch5 for diagnostic output
84# around known gauge
85triangle_id = domain.get_triangle_containing_point([4.521, 1.196])
86# This should get triangle id 32833 with centroid (4.5244, 1.1972)
87
88
89#-------------------------
90# Evolve through time
91#-------------------------
92import time
93t0 = time.time()
94
95for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
96    print domain.timestepping_statistics(track_speeds=False,
97                                         triangle_id=triangle_id)
98
99print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracBrowser for help on using the repository browser.