source: anuga_validation/okushiri_2005/run_okushiri.py @ 3758

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

Trying other parameters for okushiri

File size: 3.3 KB
Line 
1"""Validation of the AnuGA implementation of the shallow water wave equation.
2
3This script sets up LWRU2 benchmark with initial condition stated
4
5See also
6
7http://www.cee.cornell.edu/longwave/index.cfm?page=benchmark&problem=2
8
9Depth at western boundary is d = 13.5 cm
10"""
11
12# Module imports
13from Numeric import array, zeros, Float, allclose
14
15from anuga.shallow_water import Domain
16from anuga.shallow_water import Reflective_boundary
17from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
18from anuga.abstract_2d_finite_volumes.util import file_function
19
20import project
21
22
23#-------------------------
24# Create Domain
25#-------------------------
26
27use_variable_mesh = True #Use large variable mesh generated by create_mesh.py
28#use_variable_mesh = False #Use small structured mesh for speed
29
30if use_variable_mesh is True:
31    print 'Creating domain from', project.mesh_filename
32
33    domain = Domain(project.mesh_filename, use_cache=True, verbose=True)
34else:
35    print 'Creating regular from regular mesh'
36    N = 150
37    points, vertices, boundary = rectangular_cross(N, N/5*3,
38                                                   len1=5.448, len2=3.402)
39    domain = Domain(points, vertices, boundary)
40
41domain.set_name('okushiri_old_limiters_smooth=0.03_maxA=0.00001')
42domain.set_default_order(2)
43domain.set_minimum_storable_height(0.001)
44
45# Set old (pre Sep 2006) defaults for limiters
46domain.beta_w      = 0.9
47domain.beta_w_dry  = 0.9
48domain.beta_uh     = 0.9
49domain.beta_uh_dry = 0.9
50domain.beta_vh     = 0.9
51domain.beta_vh_dry = 0.9
52
53domain.check_integrity()
54print domain.statistics()
55
56
57#-------------------------
58# Initial Conditions
59#-------------------------
60domain.set_quantity('friction', 0.0)
61domain.set_quantity('stage', 0.0)
62domain.set_quantity('elevation',
63                    filename=project.bathymetry_filename[:-4] + '.pts',
64                    #alpha=0.02, #This was the best one with setMaxArea(0.00002*base_resolution)
65                    alpha=0.03,                   
66                    verbose=True,
67                    use_cache=True)
68
69#-------------------------
70# Boundary Conditions
71#-------------------------
72Br = Reflective_boundary(domain)
73
74function = file_function(project.boundary_filename[:-4] + '.tms',
75                         domain,
76                         verbose=True)
77
78Bts = Transmissive_Momentum_Set_Stage_boundary(domain, function)
79
80if use_variable_mesh is True:
81    domain.set_boundary({'wave': Bts, 'wall': Br})
82else:
83    domain.set_boundary({'left': Bts, 'right': Br, 'bottom': Br, 'top': Br})
84
85
86#-------------------------
87# Evolve through time
88#-------------------------
89import time
90t0 = time.time()
91
92w_max = 0
93for t in domain.evolve(yieldstep = 0.05, finaltime = 22.5):
94    domain.write_time()
95
96    w = domain.get_maximum_inundation_elevation()
97    x, y = domain.get_maximum_inundation_location()
98    print '  Coastline elevation = %.2f at (x,y)=(%.2f, %.2f)' %(w, x, y)
99    print
100   
101    if w > w_max:
102        w_max = w
103        x_max = x
104        y_max = y
105
106
107print '**********************************************'
108print 'Max coastline elevation = %.2f at (%.2f, %.2f)' %(w_max, x_max, y_max)
109print '**********************************************'
110   
111   
112
113print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracBrowser for help on using the repository browser.