source: inundation/ga/storm_surge/analytical solutions/Malpasset_new.py @ 668

Last change on this file since 668 was 619, checked in by ole, 20 years ago
File size: 1.7 KB
RevLine 
[615]1"""Validation study of Merimbula lake using Pyvolution.
2Example of shallow water wave equation applied to
3Malpasset dam break simulation.
4
5   Copyright 2004
6   Christopher Zoppou, Stephen Roberts
7   Australian National University
8   
9Specific methods pertaining to the 2D shallow water equation
10are imported from shallow_water
11for use with the generic finite volume framework
12
13Conserved quantities are h, uh and vh stored as elements 0, 1 and 2 in the
14numerical vector named conserved_quantities.
15
16Existence of file 'Malpasset_26000.tsh' is assumed.
17"""
18
19###############################
20# Setup Path and import modules
21import sys
22from os import sep, path
23sys.path.append('..'+sep+'pyvolution')
24
25from shallow_water import Domain, Reflective_boundary, File_boundary,\
26     Dirichlet_boundary, Transmissive_boundary
27from pmesh2domain import pmesh_to_domain_instance
28
29######################
30# Domain
[617]31filename = 'Malpasset_26000_merged.tsh'
[615]32yieldstep = 1
33finaltime = 10
34   
35print 'Creating domain from', filename
36domain = pmesh_to_domain_instance(filename, Domain)
37print "Number of triangles = ", len(domain)
38
39domain.default_order = 1
40domain.filename = filename
41domain.smooth = True
[619]42domain.store = True
[615]43
44domain.set_quantity('friction', 0.07)
45
46#------------------------------
47# Boundary Conditions
48tags = {}
49tags['external'] = Reflective_boundary(domain) 
50tags['open'] = Transmissive_boundary(domain)
51domain.set_boundary(tags)
52
53#-----------------
54#Initial condition
55domain.set_quantity('level', 20.)
56         
57######################
58#Evolution
59import time
60t0 = time.time()
61for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
62    domain.write_time()
63   
64print 'That took %.2f seconds' %(time.time()-t0)
65
66   
Note: See TracBrowser for help on using the repository browser.