source: inundation/ga/storm_surge/Merimbula/run_merimbula_lake.py @ 1599

Last change on this file since 1599 was 1393, checked in by steve, 19 years ago

Added ghosts to rectangle

File size: 3.1 KB
Line 
1"""Validation study of Merimbula lake using Pyvolution.
2
3   Copyright 2004
4   Christopher Zoppou, Stephen Roberts, Ole Nielsen, Duncan Gray
5   Geoscience Australia, ANU
6
7Specific methods pertaining to the 2D shallow water equation
8are imported from shallow_water
9for use with the generic finite volume framework
10
11Conserved quantities are h, uh and vh stored as elements 0, 1 and 2 in the
12numerical vector named conserved_quantities.
13
14Existence of file 'merimbula_interpolated.tsh' is assumed.
15"""
16
17#------------------------------
18# Setup Path and import modules
19import sys
20from os import sep, path
21sys.path.append('..'+sep+'pyvolution')
22
23from shallow_water import Domain, Reflective_boundary, File_boundary,\
24     Dirichlet_boundary, Wind_stress
25from pmesh2domain import pmesh_to_domain_instance
26from util import file_function, Polygon_function, read_polygon, inside_polygon
27from Numeric import zeros, Float, asarray
28from least_squares import Interpolation
29import time
30
31#-------
32# Domain
33filename = 'merimbula_interpolated_bathymetry.tsh'
34filename = 'merimbula_10834_bridge_refined_bathymetry.tsh'
35filename = 'merimbula_10785_1.tsh'
36print 'Creating domain from', filename
37domain = pmesh_to_domain_instance(filename, Domain)
38print "Number of triangles = ", len(domain)
39
40#------------------------------------------
41# Reduction operation for get_vertex_values
42from util import mean
43domain.reduction = mean
44
45
46domain.set_quantity('friction',0.03)
47#--------------------
48# Boundary conditions
49
50#---------------------------------------
51#   Tidal cycle recorded at Eden as open
52filename = 'Eden_tide_Sept03.dat'
53print 'Open sea boundary condition from ',filename
54Bf = File_boundary(filename, domain)
55
56#--------------------------------------
57#   All other boundaries are reflective
58Br = Reflective_boundary(domain)
59domain.set_boundary({'exterior': Br, 'open': Bf})
60
61#-----------
62# Wind field
63#   Format is time [DD/MM/YY hh:mm:ss], speed [m/s] direction (degrees)
64filename = 'Merimbula_Weather_data_Sept03_m_per_s.dat'
65print 'Wind field from ',filename
66F = file_function(filename, domain)
67domain.forcing_terms.append(Wind_stress(F))
68
69#--------------------------------
70# Initial water surface elevation
71domain.set_quantity('stage', -50.0)
72
73#----------------------------------------------------------
74# Decide which quantities are to be stored at each timestep
75domain.quantities_to_be_stored = ['stage', 'xmomentum', 'ymomentum']
76
77#-------------------------------------
78# Provide file name for storing output
79domain.store = True     #Store for visualisation purposes
80domain.format = 'sww'   #Native netcdf visualisation format
81from normalDate import ND
82domain.filename = 'Merimbula_2003_4days_dry_%s'%ND()
83
84print domain.filename
85
86#----------------------
87# Set order of accuracy
88domain.default_order = 1
89domain.smooth = True
90print domain.use_inscribed_circle
91
92#---------
93# Evolution
94t0 = time.time()
95domain.visualise = True
96yieldstep = 10
97finaltime = 588000*3
98for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime):
99    domain.write_time()
100
101print 'That took %.2f seconds' %(time.time()-t0)
Note: See TracBrowser for help on using the repository browser.