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