[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,\ |
---|
[694] | 13 | Dirichlet_boundary, Wind_stress |
---|
[520] | 14 | from pmesh2domain import pmesh_to_domain_instance |
---|
[704] | 15 | from util import File_function |
---|
[520] | 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 | |
---|
[694] | 27 | domain.default_order = 2 |
---|
| 28 | domain.store = True |
---|
| 29 | domain.set_name('merimbula') |
---|
[520] | 30 | |
---|
| 31 | domain.set_quantity('friction', 0.07) |
---|
[775] | 32 | domain.set_quantity('stage', 0.5) |
---|
[520] | 33 | |
---|
[694] | 34 | |
---|
[704] | 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)) |
---|
[694] | 40 | |
---|
| 41 | |
---|
[520] | 42 | ###################### |
---|
| 43 | # Boundary conditions |
---|
[528] | 44 | |
---|
[704] | 45 | Bf = File_boundary('tide_example.txt', domain) |
---|
[520] | 46 | Br = Reflective_boundary(domain) |
---|
[528] | 47 | domain.set_boundary({'external': Br, 'open': Bf}) |
---|
[520] | 48 | |
---|
| 49 | ###################### |
---|
| 50 | #Evolution |
---|
| 51 | for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): |
---|
| 52 | domain.write_time() |
---|
| 53 | |
---|
| 54 | print 'Done' |
---|
| 55 | |
---|
| 56 | |
---|