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, File_boundary,\ |
---|
13 | Dirichlet_boundary, Wind_stress |
---|
14 | from pmesh2domain import pmesh_to_domain_instance |
---|
15 | from util import File_function |
---|
16 | |
---|
17 | ###################### |
---|
18 | # Domain |
---|
19 | filename = 'merimbula_interpolated.tsh' |
---|
20 | yieldstep = 10 |
---|
21 | finaltime = 1000 |
---|
22 | |
---|
23 | print 'Creating domain from', filename |
---|
24 | domain = pmesh_to_domain_instance(filename, Domain) |
---|
25 | print "Number of triangles = ", len(domain) |
---|
26 | |
---|
27 | domain.default_order = 2 |
---|
28 | domain.store = True |
---|
29 | domain.set_name('merimbula') |
---|
30 | |
---|
31 | domain.set_quantity('friction', 0.07) |
---|
32 | domain.set_quantity('stage', 0.5) |
---|
33 | |
---|
34 | |
---|
35 | #Add time dependent wind field from file |
---|
36 | #Format is time [DD/MM/YY hh:mm:ss], speed [m/s] direction (degrees) |
---|
37 | #See also README.txt |
---|
38 | F = File_function('windstress_example.txt', domain) |
---|
39 | domain.forcing_terms.append(Wind_stress(F)) |
---|
40 | |
---|
41 | |
---|
42 | ###################### |
---|
43 | # Boundary conditions |
---|
44 | |
---|
45 | Bf = File_boundary('tide_example.txt', domain) |
---|
46 | Br = Reflective_boundary(domain) |
---|
47 | domain.set_boundary({'external': Br, 'open': Bf}) |
---|
48 | |
---|
49 | ###################### |
---|
50 | #Evolution |
---|
51 | for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): |
---|
52 | domain.write_time() |
---|
53 | |
---|
54 | print 'Done' |
---|
55 | |
---|
56 | |
---|