source: trunk/anuga_work/development/Busselton/BP3Hydro/project.py @ 8449

Last change on this file since 8449 was 8449, checked in by martins, 13 years ago

Checking in Busselton NCI code

  • Property svn:executable set to *
File size: 16.9 KB
Line 
1"""
2This file contains all your file and directory definitions
3for elevation, meshes and outputs.
4"""
5
6import os
7import sys
8import glob
9import anuga
10from os.path import join, exists
11from time import localtime, strftime, gmtime
12from anuga.utilities.system_tools import get_user_name, get_host_name
13
14event = 'BP3Hydro'
15
16SLR = 0.9
17ARI = 0.0 
18
19stsName = "CutDownWorst.sts"
20scenario_name = 'Busselton'
21
22setup = 'final'                 # This can be one of three values (defined in setup.py)
23                                #    trial - coarsest mesh, fast
24                                #    basic - coarse mesh
25                                #    final - fine mesh, slowest
26                               
27UseCheckRestore = True
28UseFlooding = False
29
30np = [8]
31home = '/home/547/sfm547/Busselton'  # Absolute path for data folder
32ParScript = join(home,event,'run_model_parallel.py')
33outFolder = r'/short/w85/Shane/Output'
34
35if UseCheckRestore:
36    restoreFolderName = 'RestorePts_' + setup + "_" + event
37 
38#------------------------------------------------------------------------------
39# Initial Conditions and Internal Variables
40#------------------------------------------------------------------------------
41
42bounding_polygon_maxarea = 10   # Mesh size (m2) within the hydraulic boundary i.e. model domain
43minimum_storable_height = 0.10  # Minimum water depth (m) which is stored for visualisation
44tide = SLR                                      # Mean Sea Level = 0. GEMS model includes tide.  # Busselton Chart Datum is 0.786m below AHD (Section 3.3 "Locke Estate Busselton Investigation of Beach Stabilisation - Department for Planning and Infrastructure 2004.pdf" in the original reference/reports folder)
45friction = 0.03                 # 0.01: Very Low    0.025-0.04: "Standard" natural channel    0.04-0.06: Pretty rough
46alpha = 0.1                                             # Smoothing of mesh; 1 is smoothest
47zone = 50                       # Specify UTM zone of model
48
49starttime= 0                     # Start time for simulation           
50yieldstep = 720                 # 12 minute timesteps
51finaltime =  140400             # Final time for simulation
52
53if UseCheckRestore:
54    restPtInt = 12*yieldstep     # Save a restore point every x timesteps, must be an even number
55                                               
56#-------------------------------------------------------------------------------
57# Input Filenames
58#-------------------------------------------------------------------------------
59
60# ELEVATION DATA
61# Used in build_elevation.py
62# Format for points: easting,northing, elevation (AHD) Header: x,y
63ascii_grid_filenames = []
64
65#point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv"]
66#point_filenames = ['busselton25mpoints.csv',"Busselton1mDEM_VDD_Pts.csv",\
67#                   "Busselton1mDEM_Sab_Pts.csv","Busselton1mDEM_Abb_Pts.csv"]
68point_filenames = ['busselton25mpoints.csv']
69
70# Output filename for elevation
71# this is a combination of all the data generated in build_elevation.py
72combined_elevation_basename = scenario_name + '_combined_elevation'
73
74# BOUNDING POLYGON - for data clipping and estimate of triangles in mesh
75# Used in build_elevation.py
76# Format for points: easting,northing (no header)
77bounding_polygon_filename = 'ANUGA_Domain2.xyz' # Maximum size of area modelled
78bounding_polygon_maxarea = 10000 # Max area (m2) in any one triangle
79
80# INTERIOR REGIONS - for designing the mesh
81# Used in run_model.py
82# Format for points: easting,northing (no header)       
83
84interior_regions_data = [['CoastPoly.xyz', 100]]#,   # Areas (polygons) which have been refined, max area of triangles inside polygon)                         ['Vasse_River_1.xyz', 2],
85#                         ['Vasse_River.xyz', 2],                   
86#                         ['Sabina_River.xyz', 50],
87#                         ['Abba_River.xyz', 50]] 
88
89# LAND - used to set the initial stage/water to be offcoast only
90# Used in run_model.py.  Format for points easting,northing (no header)
91Land = 'ANUGA_Land.xyz'
92
93InitialStages = [[Land, 0.0],
94                 ['The_Broadwater.csv', 0.4],    #Values from JDA's Busselton Regional Flood Study Review Volume 2 Appendices
95                 ['New_River.csv', 0.2],
96                 ['Vasse_Estuary.csv', 0.4],
97                 ['Wonnerup_Estuary.csv', 0.4]]
98
99VasseDDLine = [[347893.7127, 6271596.0586], [347901.9453, 6271603.7542]]
100SabinaLine = [[353132.7757,6274869.5972], [353137.009,6274871.2906]]
101AbbaLine =  [[354860.7323,6276575.6181], [354864.4365,6276577.4172]]
102
103if ARI == 25:
104    VasseDD = 'VasseDD25_2.tms' #From Vasse July 97 prelim report
105    Sab = "Sabina25_2.tms" #Constructed from 29.0 peak: From Busselton Regional Flood Study Review 1998 DA
106    Abb = "Abba25_2.tms" #Constructed from 67.0 peak: From Busselton Regional Flood Study Review 1998 DA
107
108if ARI == 100:       
109    VasseDD ="VasseDD100_2.tms" #Constructed from 190.0 peak: From Busselton Regional Flood Study Review 1998 DA
110    Sab = "Sabina100_2.tms" #Constructed from 35.0 peak: From Busselton Regional Flood Study Review 1998 DA
111    Abb = "Abba100_2.tms" #Constructed from 86.0 peak: From Busselton Regional Flood Study Review 1998 DA
112
113if UseFlooding:
114    riversHydro = [[VasseDD,VasseDDLine],[Sab,SabinaLine],[Abb,AbbaLine]]         
115else:
116    riversHydro = []
117
118       
119PriorityArea_filename = None
120
121# GEMS order filename - should be in same direction as landward boundary points ie clockwise or anti-clockwise
122# Format is northing, easting (without header)
123gems_order_filename = 'GEMS_Boundary_pts.xyz'
124
125# GAUGES - for creating timeseries at a specific point
126# Used in get_timeseries.py. 
127# Format easting,northing,name,elevation (with header)
128gauges_filename = 'gauges.csv' #'tsunamipointsMGA.csv'
129
130#-------------------------------------------------------------------------------
131# Locations for extracting time series (for outputs)
132#-------------------------------------------------------------------------------
133#gauges=["Marina,351040,6277403", 'Jetty,345960,6277593', "Hospital,344131,6274965"]
134# Order of gauges is Marina, Jetty, Hospital
135
136# BUILDINGS EXPOSURE - for identifying inundated houses
137# Used in run_building_inundation.py
138# Format latitude,longitude etc (geographic)
139building_exposure_filename = '' # from NEXIS
140
141# AREA OF IMAGES - Extent of each image to find out highest runup
142# Header - easting,northing,id,value
143# Used in get_runup.py
144images_filename = ''
145
146# Landward bounding points
147# Format easting,northing (no header)
148landward_boundary_filename = 'ANUGA_Land_pts.xyz'
149
150#------------------------------------------------------------------------------
151#  ADD ROUGHNESS INFORMATION HERE
152#------------------------------------------------------------------------------
153
154# mannings value for different landuses, defined by polygons. Have replicated order of materials applied in TUFLOW.
155# Set the default materials value to 208 (sugarcane).
156    # i.e. the area of the whole hydraulic model is sugarcane unless stated otherwise below.
157    # Does not make sense though why TUFLOW model still defined some areas as 208!
158    # NEED TO CHECK THAT THIS ACTUALLY WORKS IN ANUGA
159    # i.e. THAT ROUHGNESS IN LATER SMALLER POLYGONS OVERRIDES THE DEFAULT ROUGHNESS APPLIED HERE TO THE WHOLE HYDRAULIC MODEL
160    # IF NOT, THEN THIS WON'T WORK PROPERLY!!!!!!
161#ManningDictionary = {join(polygons_folder, 'mannings', 'historical', 'bounding_polygon.csv'): 0.150,
162#                     # Read materials values taken from 2d_mat_tw_422.mif
163#    join(polygons_folder, 'mannings', 'historical', '201_0.csv'):  0.03, #2D river/waterways
164#    join(polygons_folder, 'mannings', 'historical', '202_1.csv'):  0.026,  # 2D tidal waterways
165#    join(polygons_folder, 'mannings', 'historical', '203_0.csv'):     0.090, # 2D river banks
166#    join(polygon:xs_folder, 'mannings', 'historical', '204_1.csv'):     0.100, # 2D dense forest
167#    join(polygons_folder, 'mannings', 'historical', '205_0.csv'):  0.080, # 2D vegetated islands in river
168#    join(polygons_folder, 'mannings', 'historical', '206_25.csv'):  0.060, # 2D cleared / grazing / bare land     
169#    join(polygons_folder, 'mannings', 'historical', '207_0.csv'):     0.040, # 2D parks
170#    join(polygons_folder, 'mannings', 'historical', '208_0a.csv'):  0.150, # 2D sugarcane
171#    join(polygons_folder, 'mannings', 'historical', '209_0.csv'):     1.000, # 2D urban
172#    join(polygons_folder, 'mannings', 'historical', '210_0a.csv'):  0.025} # 2D highway/roads
173
174
175################################################################################
176################################################################################
177####         NOTE: NOTHING WOULD NORMALLY CHANGE BELOW THIS POINT.          ####
178################################################################################
179################################################################################
180
181# Get system user and host names.
182# These values can be used to distinguish between two similar runs by two
183# different users or runs by the same user on two different machines.
184user = anuga.get_user_name()
185host = anuga.get_host_name()
186
187# Environment variable names.
188# The inundation directory, not the data directory.
189#ENV_INUNDATIONHOME = 'INUNDATIONHOME'
190
191#-------------------------------------------------------------------------------
192# Output Elevation Data
193#-------------------------------------------------------------------------------
194
195## Output filename for elevation
196## this is a combination of all the data generated in build_elevation.py
197#combined_elevation_basename = scenario_name_init + '_combined_elevation'
198
199# Output filename for elevation
200# this is a combination of all the data generated in build_elevation.py
201combined_elevation_basename = scenario_name + '_combined_elevation'
202
203#-------------------------------------------------------------------------------
204# Directory Structure
205#-------------------------------------------------------------------------------
206
207# determines time for setting up output directories
208time = strftime('%Y%m%d_%H%M%S', localtime()) 
209gtime = strftime('%Y%m%d_%H%M%S', gmtime()) 
210build_time = time + '_build'
211run_time = time + '_run_'
212
213# check various directories/files that must exist
214anuga_folder = join(home, 'anuga')
215topographies_folder = join(anuga_folder, 'topographies')
216polygons_folder = join(anuga_folder, 'polygons')
217boundaries_folder = join(anuga_folder, 'boundaries')
218gauges_folder = join(anuga_folder, 'gauges')
219event_folder = join(boundaries_folder, str(event))
220hydrographs_folder = join(anuga_folder, 'hydrographs') 
221meshes_folder = join(anuga_folder, 'meshes')
222
223output_folder = join(outFolder,event)
224
225if UseCheckRestore:
226    restore_folder = join(output_folder,restoreFolderName)
227
228#if not os.path.exists(output_folder):
229#    os.makedirs(output_folder)
230   
231#-------------------------------------------------------------------------------
232# Location of input and output data
233#-------------------------------------------------------------------------------
234
235# OCEAN INPUT
236# The absolute pathname for the .sts file.
237event_sts = join(boundaries_folder, stsName)
238
239#-------------------------------------------------------------------------------
240# Output filename
241#
242# Your output filename should be unique between different runs on different data.
243# The list of items below will be used to create a file in your output directory.
244# Your user name and time+date will be automatically added.  For example,20101017_090339_run_storm_surge_final_worse_case_0408_current20m_gate_0.0_sextoj
245
246#     [setup, event, which_elevation, gate, SLR]
247# will result in a filename like
248#     20090212_091046_run_final_20100527_gcom_12min_current_gate_0_jsexton
249#-------------------------------------------------------------------------------
250
251output_comment = [setup, event] 
252
253# Convert the user output_comment to a string for run_model.py
254output_comment = ('_'.join([str(x) for x in output_comment if x != user])
255                  + '_' + user)
256 
257# The absolute pathname of the all elevation, generated in build_elevation.py
258combined_elevation = join(topographies_folder, combined_elevation_basename)
259
260# The pathname for the GEMS order points
261if gems_order_filename:
262    gems_order = join(boundaries_folder, gems_order_filename)
263
264# The absolute pathname for the landward points of the bounding polygon,
265# Used within run_model.py)
266if landward_boundary_filename:
267    landward_boundary = join(boundaries_folder, landward_boundary_filename)
268
269# The absolute pathname for the output folder names
270# Used for build_elevation.py
271output_build = join(output_folder, build_time) + '_' + str(user) 
272# Used for run_model.py
273output_run = join(output_folder, output_comment) 
274# Used by post processing
275output_run_time = join(output_run, scenario_name) 
276 
277# The absolute pathname of the mesh, generated in run_model.py
278#meshes = join(output_run, scenario_name + "_" + setup) + '.msh'
279meshes = join(output_run, scenario_name) + '.msh'
280
281# Log file name
282#log.log_filename = join(output_run, scenario_name) + '.log'
283
284## The absolute pathname for the storm gate file
285## Used for run_model.py
286#if storm_gate_filename:
287#    storm_gate = join(polygons_folder, storm_gate_filename) 
288
289# The absolute pathname for the gauges file
290# Used for get_timeseries.py
291if gauges_filename:
292    gauges = join(gauges_folder, gauges_filename)       
293
294# The absolute pathname for the building file
295# Used for run_building_inundation.py
296if building_exposure_filename:
297    building_exposure = join(gauges_folder, building_exposure_filename)
298
299## Areas for export of results
300## Used in export_results_max.py
301#xminBunbury = 371838
302#xmaxBunbury = 379640
303#yminBunbury = 6309741
304#ymaxBunbury = 6316293
305#
306## Storm gate area:
307#xminStorm_gate=373515
308#xmaxStorm_gate=373582
309#yminStorm_gate=6312314
310#ymaxStorm_gate=6312358
311
312#
313##-------------------------------------------------------------------------------
314## Absolute Path Definitions. (This should not change)
315##-------------------------------------------------------------------------------
316#
317## determines time for setting up output directories
318#time = strftime('%Y%m%d_%H%M%S', localtime())
319#gtime = strftime('%Y%m%d_%H%M%S', gmtime())
320#build_time = time + '_build'
321#run_time = time + '_run_'
322#
323##-------------------------------------------------------------------------------
324## Output filename
325##
326## Your output filename should be unique between different runs on different data.
327## The list of items below will be used to create a file in your output directory.
328## Your user name and time+date will be automatically added.  For example,
329##     [setup, tide, event_number]
330## will result in a filename like
331##     20090212_091046_run_final_0_27283_rwilson
332##-------------------------------------------------------------------------------
333#
334#output_comment = [setup, tide, radius, event]
335#output_comment = ('_'.join([str(x) for x in output_comment if x != user])
336#                  + '_' + user)
337#
338## The absolute pathname for the output folder names
339## Used for build_elevation.py
340#output_build = join(output_folder, build_time) + '_' + str(user)
341## Used for run_model.py
342#output_run = join(output_folder, run_time) + output_comment
343## Used by post processing
344#output_run_time = join(output_run, scenario_name)
345#
346#
347## The absolute pathname of the mesh, generated in run_model.py
348##meshes = join(output_run, scenario_name) + '.msh'
349#meshes = join(os.getcwd(), scenario_name) + '.msh'
350#
351## The absolute pathname for the gauges file
352## Used for get_timeseries.py
353#if gauges_filename:
354#    gauges = join(gauges_folder, gauges_filename)       
355#
356## The absolute pathname for the building file
357## Used for run_building_inundation.py
358#if building_exposure_filename:
359#    building_exposure = join(gauges_folder, building_exposure_filename)
360#
361## The absolute pathname for the image file
362## Used for get_runup.py
363#if images_filename:
364#    images = join(polygons_folder, images_filename)
365#
366#
367## full path to where MUX files (or meta-files) live
368##mux_input = join(event_folder, mux_input_filename)
369#
370##Multiple polygons in one CSV file to make internal polygons
371#if not PriorityArea_filename == None:
372#    PriorityAreas = join(polygons_folder, PriorityArea_filename) 
373#
374##friction_list = read_polygon_dir(ManningDictionary, join(polygons_folder,'mannings','historical'))
375#
376##interior_regions = read_polygon_dir(CatchmentDictionary, join(polygons_folder,'bdy'))
377#
378## The absolute pathname of the all elevation, generated in build_elevation.py
379#combined_elevation = join(topographies_folder, combined_elevation_basename)
380#
381## The pathname for the urs order points, used within build_urs_boundary.py
382##if urs_order_filename:
383##    urs_order = join(boundaries_folder, urs_order_filename)
384#
385## The absolute pathname for the landward points of the bounding polygon,
386## Used within run_model.py)
387##if landward_boundary_filename:
388##    landward_boundary = join(boundaries_folder, landward_boundary_filename)
389#
390## The absolute pathname for the .sts file, generated in build_boundary.py
391##event_sts = join(event_folder, scenario_name)
392#
393##elevation_name = join(topographies_folder, elevation_filename)      # directory location and DEM name. This has been triangulated using 2d_zpts_tw_803.mid as the base.
394#meshname = join(output_run, scenario_name) + '.msh'
395#
396##ocean_hydrograph_filename=join(ocean_folder, ocean_hydrograph_basename)
Note: See TracBrowser for help on using the repository browser.