source: inundation/ga/storm_surge/pyvolution/wind_example_scalar.py @ 614

Last change on this file since 614 was 614, checked in by ole, 20 years ago

Played with wind stress + c-extension

File size: 1.0 KB
Line 
1"""Example of shallow water wave equation.
2
3Flat bed with constant wind stress
4"""
5
6######################
7# Module imports
8from mesh_factory import rectangular
9from shallow_water import Domain, Reflective_boundary, Constant_height, Wind_stress
10
11#Create basic mesh (100m x 100m)
12N = 100     
13len = 100
14points, vertices, boundary = rectangular(N, N, len, len)
15
16#Create shallow water domain
17domain = Domain(points, vertices, boundary)
18domain.default_order = 2
19domain.store = True
20domain.set_name('wind_laminar')
21
22#Set initial conditions
23domain.set_quantity('elevation', 0.0)
24domain.set_quantity('level', 1.0)
25domain.set_quantity('friction', 0.03)
26
27#Constant (quite extreme :-) windfield: 9000 m/s, bearing 120 degrees
28domain.forcing_terms.append( Wind_stress(s=9000, phi=120) )
29
30######################
31# Boundary conditions
32Br = Reflective_boundary(domain)
33domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
34
35######################
36#Evolution
37for t in domain.evolve(yieldstep = 0.5, finaltime = 1000):
38    domain.write_time()
39
40print 'Done'   
41
Note: See TracBrowser for help on using the repository browser.