Changeset 4023
- Timestamp:
- Nov 21, 2006, 3:54:12 PM (18 years ago)
- Location:
- anuga_core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/documentation/user_manual/demos/cairns/runcairns.py
r4021 r4023 1 """Script for running a tsunami inundation scenario for Broome, WA,Australia.1 """Script for running a tsunami inundation scenario for Cairns, QLD Australia. 2 2 3 3 Source data such as elevation and boundary data is assumed to be available in 4 4 directories specified by project.py 5 The output sww file is stored in project.outputtimedir 5 The output sww file is stored in directory named after the scenario, i.e 6 slump or fixed_wave. 6 7 7 8 The scenario is defined by a triangular mesh created from project.polygon, 8 the elevation data and a tsunami wave generated by MOST.9 10 Ole Nielsen and Duncan Gray, GA - 2005 and Nick Bartzis, GA - 20069 the elevation data and a tsunami wave generated by a submarine mass failure. 10 11 Ole Nielsen and Duncan Gray, GA - 2005 and Jane Sexton and Nick Bartzis, GA - 2006 11 12 """ 12 13 … … 35 36 # Define scenario as either slump or fixed_wave. 36 37 #------------------------------------------------------------------------------- 37 #scenario = 'slump' # OR38 #scenario = 'slump' 38 39 scenario = 'fixed_wave' 39 40 if access(scenario,F_OK) == 0: … … 89 90 # Setup computational domain 90 91 #------------------------------------------------------------------------------- 92 91 93 domain = Domain(meshname, use_cache = True, verbose = True) 92 94 … … 117 119 # Setup information for slump scenario (to be applied 1 min into simulation 118 120 #------------------------------------------------------------------------------- 121 119 122 if scenario == 'slump': 120 123 from anuga.shallow_water.smf import slump_tsunami # Function for submarine slump … … 135 138 # Setup boundary conditions 136 139 #------------------------------------------------------------------------------- 140 137 141 print 'Available boundary tags', domain.get_boundary_tags() 138 142 … … 156 160 # Evolve system through time 157 161 #------------------------------------------------------------------------------- 162 158 163 import time 159 164 t0 = time.time() … … 168 173 domain.write_boundary_statistics(tags = 'ocean_east') 169 174 170 # add slump 171 thisstagestep = domain.get_quantity('stage') 172 if allclose(t, 60): 173 slump = Quantity(domain) 174 slump.set_values(tsunami_source) 175 domain.set_quantity('stage', slump + thisstagestep) 176 177 # save every two mins leading up to wave approaching land 178 for t in domain.evolve(yieldstep = 120, finaltime = 1000, 179 skip_initial_step = True): 180 domain.write_time() 181 domain.write_boundary_statistics(tags = 'ocean_east') 182 183 # save every 30 secs as wave starts inundating ashore 184 for t in domain.evolve(yieldstep = 30, finaltime = 10000, 185 skip_initial_step = True): 186 domain.write_time() 187 domain.write_boundary_statistics(tags = 'ocean_east') 188 189 if scenario == 'fixed_wave': 175 # add slump 176 thisstagestep = domain.get_quantity('stage') 177 if allclose(t, 60): 178 slump = Quantity(domain) 179 slump.set_values(tsunami_source) 180 domain.set_quantity('stage', slump + thisstagestep) 190 181 191 182 # save every two mins leading up to wave approaching land 192 for t in domain.evolve(yieldstep = 120, finaltime = 1000): 193 domain.write_time() 194 domain.write_boundary_statistics(tags = 'ocean_east') 183 for t in domain.evolve(yieldstep = 120, finaltime = 1000, 184 skip_initial_step = True): 185 domain.write_time() 186 domain.write_boundary_statistics(tags = 'ocean_east') 195 187 196 188 # save every 30 secs as wave starts inundating ashore … … 199 191 domain.write_time() 200 192 domain.write_boundary_statistics(tags = 'ocean_east') 193 194 if scenario == 'fixed_wave': 195 196 # save every two mins leading up to wave approaching land 197 for t in domain.evolve(yieldstep = 120, finaltime = 1000): 198 domain.write_time() 199 domain.write_boundary_statistics(tags = 'ocean_east') 200 201 # save every 30 secs as wave starts inundating ashore 202 for t in domain.evolve(yieldstep = 30, finaltime = 10000, 203 skip_initial_step = True): 204 domain.write_time() 205 domain.write_boundary_statistics(tags = 'ocean_east') 201 206 202 207 print 'That took %.2f seconds' %(time.time()-t0) -
anuga_core/source/anuga/shallow_water/smf.py
r4021 r4023 91 91 * (1 - exp(-2.2*(gamma-1))) 92 92 a3D = a2D / (1 + (15.5*sqrt(depth/(length*sint)))) 93 94 if verbose is True:95 93 96 94 #a few temporary print statements … … 113 111 print '\t2D amplitude: ', a2D 114 112 print '\t3D amplitude: ', a3D 115 print '\t HELLO', a0, ut, s0, t0, w, a2D, a3D116 113 117 114 #keep an eye on some of the assumptions built into the maths … … 120 117 if verbose is True: 121 118 print 'WARNING: slope out of range (5 - 30 degrees) ', slope 122 print 'hello'123 119 if ((depth/length < 0.06) or (depth/length > 1.5)): 124 120 if verbose is True: … … 342 338 343 339 am = self.a3D 344 am2 = self.a2D 340 am2 = 1.0 341 #am2 = self.a2D 345 342 wa = self.wavelength 346 343 wi = self.width
Note: See TracChangeset
for help on using the changeset viewer.