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

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

Played with wind stress + c-extension

File size: 1.0 KB
RevLine 
[519]1"""Example of shallow water wave equation.
2
[522]3Flat bed with constant wind stress
[519]4"""
5
6######################
7# Module imports
8from mesh_factory import rectangular
[522]9from shallow_water import Domain, Reflective_boundary, Constant_height, Wind_stress
[519]10
[522]11#Create basic mesh (100m x 100m)
[587]12N = 100     
[522]13len = 100
14points, vertices, boundary = rectangular(N, N, len, len)
[519]15
16#Create shallow water domain
17domain = Domain(points, vertices, boundary)
[587]18domain.default_order = 2
19domain.store = True
[519]20domain.set_name('wind_laminar')
21
22#Set initial conditions
[522]23domain.set_quantity('elevation', 0.0)
24domain.set_quantity('level', 1.0)
[614]25domain.set_quantity('friction', 0.03)
[519]26
[522]27#Constant (quite extreme :-) windfield: 9000 m/s, bearing 120 degrees
[614]28domain.forcing_terms.append( Wind_stress(s=9000, phi=120) )
[519]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.