Line | |
---|
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 | |
---|
12 | from shallow_water import Domain, Reflective_boundary, Dirichlet_boundary |
---|
13 | from pmesh2domain import pmesh_to_domain_instance |
---|
14 | |
---|
15 | ###################### |
---|
16 | # Domain |
---|
17 | filename = 'merimbula_interpolated.tsh' |
---|
18 | yieldstep = 10 |
---|
19 | finaltime = 1000 |
---|
20 | |
---|
21 | print 'Creating domain from', filename |
---|
22 | domain = pmesh_to_domain_instance(filename, Domain) |
---|
23 | print "Number of triangles = ", len(domain) |
---|
24 | |
---|
25 | domain.default_order = 1 |
---|
26 | domain.filename = filename |
---|
27 | |
---|
28 | domain.set_quantity('friction', 0.07) |
---|
29 | |
---|
30 | ###################### |
---|
31 | # Boundary conditions |
---|
32 | inflow_stage = 20.0 |
---|
33 | Bd = Dirichlet_boundary([inflow_stage, 0.0, 0.0]) |
---|
34 | Br = Reflective_boundary(domain) |
---|
35 | domain.set_boundary({'external': Br, 'open': Bd}) |
---|
36 | |
---|
37 | ###################### |
---|
38 | #Evolution |
---|
39 | for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): |
---|
40 | domain.write_time() |
---|
41 | |
---|
42 | print 'Done' |
---|
43 | |
---|
44 | |
---|
Note: See
TracBrowser
for help on using the repository browser.