source: trunk/anuga_validation/analytical_solutions/malpasset_new.py @ 7877

Last change on this file since 7877 was 7626, checked in by steve, 14 years ago

Cleaning up directory

File size: 2.0 KB
Line 
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
31filename = 'Malpasset_26000_merged.tsh'
32yieldstep = 1
33finaltime = 1000
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.smooth = True
41
42#------------------------------
43# Boundary Conditions
44tags = {}
45tags['external'] = Reflective_boundary(domain) 
46tags['open'] = Dirichlet_boundary([50.0, 0., 0.]) # replacing Transmissive_boundary(domain)
47domain.set_boundary(tags)
48
49#-----------------
50#Initial condition
51domain.set_quantity('stage', 0.)
52
53#-------------------------------------
54# Provide file name for storing output
55domain.store = True
56domain.format = 'sww'
57domain.set_name('Malpasset_second_order')
58
59#----------------------------
60# Friction
61domain.set_quantity('friction', 0.033)
62         
63######################
64#Evolution
65import time
66t0 = time.time()
67for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
68    domain.write_time()
69   
70print 'That took %.2f seconds' %(time.time()-t0)
71
72   
Note: See TracBrowser for help on using the repository browser.