"""Validation study of Merimbula lake using Pyvolution. Existence of file 'merimbula_interpolated.tsh' is assumed. """ ############################### # Setup Path and import modules import sys from os import sep, path sys.path.append('..'+sep+'pyvolution') from shallow_water import Domain, Reflective_boundary, File_boundary,\ Dirichlet_boundary, Wind_stress from pmesh2domain import pmesh_to_domain_instance from util import File_function ###################### # Domain filename = 'merimbula_interpolated.tsh' yieldstep = 10 finaltime = 1000 print 'Creating domain from', filename domain = pmesh_to_domain_instance(filename, Domain) print "Number of triangles = ", len(domain) domain.default_order = 2 domain.store = True domain.set_name('merimbula') domain.set_quantity('friction', 0.07) domain.set_quantity('stage', 0.5) #Add time dependent wind field from file #Format is time [DD/MM/YY hh:mm:ss], speed [m/s] direction (degrees) #See also README.txt F = File_function('windstress_example.txt', domain) domain.forcing_terms.append(Wind_stress(F)) ###################### # Boundary conditions Bf = File_boundary('tide_example.txt', domain) Br = Reflective_boundary(domain) domain.set_boundary({'external': Br, 'open': Bf}) ###################### #Evolution for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): domain.write_time() print 'Done'