source: inundation/validation/run_merimbula.py @ 1725

Last change on this file since 1725 was 775, checked in by ole, 19 years ago

level -> stage

File size: 1.4 KB
Line 
1"""Validation study of Merimbula lake using Pyvolution.
2
3Existence of file 'merimbula_interpolated.tsh' is assumed.
4"""
5
6###############################
7# Setup Path and import modules
8import sys
9from os import sep, path
10sys.path.append('..'+sep+'pyvolution')
11
12from shallow_water import Domain, Reflective_boundary, File_boundary,\
13     Dirichlet_boundary, Wind_stress
14from pmesh2domain import pmesh_to_domain_instance
15from util import File_function
16
17######################
18# Domain
19filename = 'merimbula_interpolated.tsh'
20yieldstep = 10
21finaltime = 1000
22   
23print 'Creating domain from', filename
24domain = pmesh_to_domain_instance(filename, Domain)
25print "Number of triangles = ", len(domain)
26
27domain.default_order = 2
28domain.store = True
29domain.set_name('merimbula')
30
31domain.set_quantity('friction', 0.07)
32domain.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
38F = File_function('windstress_example.txt', domain)
39domain.forcing_terms.append(Wind_stress(F))
40
41
42######################
43# Boundary conditions
44
45Bf = File_boundary('tide_example.txt', domain)
46Br = Reflective_boundary(domain)
47domain.set_boundary({'external': Br, 'open': Bf}) 
48         
49######################
50#Evolution
51for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
52    domain.write_time()
53   
54print 'Done'
55
56   
Note: See TracBrowser for help on using the repository browser.