Last change
on this file since 528 was
528,
checked in by ole, 20 years ago
|
Added file boundary to Merimbula validation
|
File size:
1.2 KB
|
Rev | Line | |
---|
[520] | 1 | """Validation study of Merimbula lake using Pyvolution. |
---|
| 2 | |
---|
| 3 | Existence of file 'merimbula_interpolated.tsh' is assumed. |
---|
| 4 | """ |
---|
| 5 | |
---|
| 6 | ############################### |
---|
| 7 | # Setup Path and import modules |
---|
| 8 | import sys |
---|
| 9 | from os import sep, path |
---|
| 10 | sys.path.append('..'+sep+'pyvolution') |
---|
| 11 | |
---|
[528] | 12 | from shallow_water import Domain, Reflective_boundary, File_boundary,\ |
---|
| 13 | Dirichlet_boundary |
---|
[520] | 14 | from pmesh2domain import pmesh_to_domain_instance |
---|
| 15 | |
---|
| 16 | ###################### |
---|
| 17 | # Domain |
---|
| 18 | filename = 'merimbula_interpolated.tsh' |
---|
| 19 | yieldstep = 10 |
---|
| 20 | finaltime = 1000 |
---|
| 21 | |
---|
| 22 | print 'Creating domain from', filename |
---|
| 23 | domain = pmesh_to_domain_instance(filename, Domain) |
---|
| 24 | print "Number of triangles = ", len(domain) |
---|
| 25 | |
---|
| 26 | domain.default_order = 1 |
---|
| 27 | domain.filename = filename |
---|
| 28 | |
---|
| 29 | domain.set_quantity('friction', 0.07) |
---|
| 30 | |
---|
| 31 | ###################### |
---|
| 32 | # Boundary conditions |
---|
[528] | 33 | |
---|
| 34 | filename = 'Eden_Australia_31082004.txt' |
---|
| 35 | Bf = File_boundary(domain, filename) |
---|
| 36 | |
---|
[520] | 37 | inflow_stage = 20.0 |
---|
| 38 | Bd = Dirichlet_boundary([inflow_stage, 0.0, 0.0]) |
---|
| 39 | Br = Reflective_boundary(domain) |
---|
[528] | 40 | domain.set_boundary({'external': Br, 'open': Bf}) |
---|
[520] | 41 | |
---|
| 42 | ###################### |
---|
| 43 | #Evolution |
---|
| 44 | for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): |
---|
| 45 | domain.write_time() |
---|
| 46 | |
---|
| 47 | print 'Done' |
---|
| 48 | |
---|
| 49 | |
---|
Note: See
TracBrowser
for help on using the repository browser.