Changeset 5395 for anuga_work/development/Hinwood_2008/run_dam.py
- Timestamp:
- Jun 6, 2008, 5:33:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/Hinwood_2008/run_dam.py
r5392 r5395 57 57 58 58 def main(boundary_file, 59 boundary_location, 60 slope, 59 metadata_dic, 61 60 boundary_path=None, 62 61 friction=0.01, … … 65 64 66 65 67 basename = 'zz ' + str(friction)66 basename = 'zz_' + metadata_dic['scenario_id'] 68 67 if run_type == 1: 69 68 outputdir_name += '_test' … … 71 70 finaltime = 15. 72 71 maximum_triangle_area=0.01 72 73 73 elif run_type == 2: 74 outputdir_name += '_test_ good_time'75 yieldstep = 0. 176 finaltime = 50.074 outputdir_name += '_test_long_time' 75 yieldstep = 0.5 76 finaltime = None 77 77 maximum_triangle_area=0.01 78 78 79 maximum_triangle_area=0.00180 79 elif run_type == 3: 81 80 outputdir_name += '_test_good_time_mesh' 82 81 yieldstep = 0.1 83 finaltime = 50.082 finaltime = None 84 83 maximum_triangle_area=0.001 85 84 elif run_type == 4: 85 outputdir_name += '_good_A' 86 86 # this is not a test 87 87 # Output will go to a file 88 88 # The sww file will be interpolated 89 yieldstep = 0. 190 finaltime = 50.089 yieldstep = 0.01 90 finaltime = None 91 91 maximum_triangle_area=0.001 92 92 93 metadata_dic = set_z_origin_to_water_depth(metadata_dic) 93 94 94 95 pro_instance = project.Project(['data','flumes','Hinwood_2008'], … … 103 104 pro_instance.outputdir + 'create_mesh.py') 104 105 105 prepare_time_boundary(slope,pro_instance.raw_data_dir, 106 pro_instance.boundarydir) 106 boundary_final_time = prepare_time_boundary(metadata_dic, 107 pro_instance.raw_data_dir, 108 pro_instance.boundarydir) 109 if finaltime is None: 110 finaltime = boundary_final_time 107 111 108 112 # Boundary file manipulation … … 125 129 126 130 # creates copy of code in output dir 127 if run_type >= 4: 128 start_screen_catcher(pro_instance.outputdir, rank, pypar.size()) 131 if run_type >= 2: 132 #start_screen_catcher(pro_instance.outputdir, rank, pypar.size()) 133 start_screen_catcher(pro_instance.outputdir) 129 134 130 135 print 'USER: ', pro_instance.user … … 135 140 # this creates the mesh 136 141 #gate_position = 12.0 137 create_mesh.generate(mesh_filename, slope,142 create_mesh.generate(mesh_filename, metadata_dic, 138 143 maximum_triangle_area=maximum_triangle_area) 139 144 … … 162 167 #------------------------------------------------------------------------- 163 168 164 domain.set_quantity('stage', 0. 4)169 domain.set_quantity('stage', 0.) #the origin is the still water level 165 170 domain.set_quantity('friction', friction) 166 elevation_function = Elevation_function( slope)171 elevation_function = Elevation_function(metadata_dic) 167 172 domain.set_quantity('elevation', elevation_function) 168 173 … … 185 190 Bts = Time_boundary(domain, function) 186 191 domain.set_boundary( {'wall': Br, 'wave': Bts} ) 187 domain.set_boundary( {'wall': Br, 'wave': Bd} )192 #domain.set_boundary( {'wall': Br, 'wave': Bd} ) 188 193 189 194 #------------------------------------------------------------------------- … … 200 205 201 206 flume_y_middle = 0.225 202 points = [[2.8,flume_y_middle], #-1.8m from SWL 203 [5.1,flume_y_middle], #0.5m from SWL 204 [6.6,flume_y_middle], #2m from SWL 205 [6.95,flume_y_middle], #2.35m from SWL 206 [7.6,flume_y_middle], #3m from SWL 207 [8.2,flume_y_middle], #3.5m from SWL 208 [9.2,flume_y_middle] #4.5m from SWL 209 ] 207 points = [] 208 for gauge_x in metadata_dic['gauge_x']: 209 points.append([gauge_x, flume_y_middle]) 210 print "points",points 210 211 211 212 … … 214 215 #------------------------------------------------------------------------- 215 216 216 if run_type >= 4: 217 if run_type >= 2: 218 id = metadata_dic['scenario_id'] 217 219 interpolate_sww2csv(pro_instance.outputdir + basename +".sww", 218 220 points, 219 pro_instance.outputdir + "depth_ manning_"+str(friction)+".csv",220 pro_instance.outputdir + "velocity_x .csv",221 pro_instance.outputdir + "velocity_y .csv")221 pro_instance.outputdir + "depth_" + id + ".csv", 222 pro_instance.outputdir + "velocity_x_" + id + ".csv", 223 pro_instance.outputdir + "velocity_y_" + id + ".csv") 222 224 223 225 return pro_instance … … 232 234 if __name__ == "__main__": 233 235 #slopes = [[-4.5,0.0],[0.0,0.0],[1.285,0.090],[16.1,.960]] 234 run_data_T1R5 = {'xleft':[-4.5,0.0], 236 # Note, gauge A has been removed, since it is used as the 237 # boundary. 238 run_type = 2 239 240 # T1R5 241 run_data = {'xleft':[-3.106,0.0], # Av' of ADV and Gauge A 235 242 'xtoe':[0.0,0.0], 236 243 'xbeach':[1.285,0.090], 237 244 'xright':[16.1,.960], 238 245 'offshore_water_depth':.4, 239 'scenario_id':'T1R5'} 240 run_data_T1R5 = set_z_origin_to_water_depth(run_data_T1R5) 241 #print "run_data_T1R5", run_data_T1R5 242 #prepare_time_boundary(run_data_T1R5) 243 main( 'T1R5_boundary.tsm', 8, run_data_T1R5, 244 run_type = 2, 245 outputdir_name='Hinwood_T1R5_draft') 246 'scenario_id':'T1R5', 247 'gauge_names':['B','1','2','3','4','5','6','7','8', 248 '9','10','11','12','13','14'], 249 'gauge_x':[-0.68, 1.572, 2.572, 3.572, 4.572, 5.572, 250 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 251 12.572, 13.572, 14.572], 252 'gauge_bed_elevation':[-0.400000, -0.293158, 253 -0.234473, -0.175788, -0.117104, -0.058419, 0.000266, 254 0.058950, 0.117635, 0.176320, 0.235004, 0.293689, 255 0.352374, 0.411058, 0.469743] 256 } 257 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 258 run_type = run_type, 259 outputdir_name=run_data['scenario_id']) 260 261 # T1R3 262 run_data['scenario_id'] = 'T1R3' 263 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 264 run_type = run_type, 265 outputdir_name=run_data['scenario_id']) 266 267 # #T2R7 268 # xleft is different 269 run_data = {'xleft':[-4.586,0.0], # Av' of ADV and Gauge A 270 'xtoe':[0.0,0.0], 271 'xbeach':[1.285,0.090], 272 'xright':[16.1,.960], 273 'offshore_water_depth':.4, 274 'scenario_id':'T2R7', 275 'gauge_names':['B','1','2','3','4','5','6','7','8', 276 '9','10','11','12','13','14'], 277 'gauge_x':[-0.68, 1.572, 2.572, 3.572, 4.572, 5.572, 278 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 279 12.572, 13.572, 14.572], 280 'gauge_bed_elevation':[-0.400000, -0.293158, 281 -0.234473, -0.175788, -0.117104, -0.058419, 0.000266, 282 0.058950, 0.117635, 0.176320, 0.235004, 0.293689, 283 0.352374, 0.411058, 0.469743] 284 } 285 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 286 run_type = run_type, 287 outputdir_name=run_data['scenario_id']) 288 289 # #T2R8 290 # xleft is different 291 run_data = {'xleft':[-4.586,0.0], # Av' of ADV and Gauge A 292 'xtoe':[0.0,0.0], 293 'xbeach':[1.285,0.090], 294 'xright':[16.1,.960], 295 'offshore_water_depth':.4, 296 'scenario_id':'T2R8', 297 'gauge_names':['B','1','2','3','4','5','6','7','8', 298 '9','10','11','12','13','14'], 299 'gauge_x':[-0.68, 1.572, 2.572, 3.572, 4.572, 5.572, 300 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 301 12.572, 13.572, 14.572], 302 'gauge_bed_elevation':[-0.400000, -0.293158, 303 -0.234473, -0.175788, -0.117104, -0.058419, 0.000266, 304 0.058950, 0.117635, 0.176320, 0.235004, 0.293689, 305 0.352374, 0.411058, 0.469743] 306 } 307 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 308 run_type = run_type, 309 outputdir_name=run_data['scenario_id']) 310 311 # #T3R29 312 # xleft is different 313 run_data = {'xleft':[-3.875,0.0], # Av' of ADV and Gauge A 314 'xtoe':[0.0,0.0], 315 'xbeach':[1.285,0.090], 316 'xright':[16.1,.440], 317 'offshore_water_depth':.336, 318 'scenario_id':'T3R29', 319 'gauge_names':['1','2','3','4','5','6','7','8', 320 '9','10','11','12','13','14','B'], 321 'gauge_x':[1.572, 2.572, 3.572, 4.572, 5.572, 322 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 323 12.572, 13.572, 14.572, -0.325], 324 'gauge_bed_elevation':[-0.237263, -0.213789, -0.190315, 325 -0.166841, -0.143368, -0.119894, 326 -0.096420, -0.072946, -0.049472, 327 -0.025998, -0.002524, 0.020949, 328 0.044423, 0.067897, -0.336000] 329 } 330 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 331 run_type = run_type, 332 outputdir_name=run_data['scenario_id']) 333 334 # #T3R28 335 run_data = {'xleft':[-3.875,0.0], # Av' of ADV and Gauge A 336 'xtoe':[0.0,0.0], 337 'xbeach':[1.285,0.090], 338 'xright':[16.1,.440], 339 'offshore_water_depth':.336, 340 'scenario_id':'T3R28', 341 'gauge_names':['1','2','3','4','5','6','7','8', 342 '9','10','11','12','13','14','B'], 343 'gauge_x':[1.572, 2.572, 3.572, 4.572, 5.572, 344 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 345 12.572, 13.572, 14.572, -0.325], 346 'gauge_bed_elevation':[-0.237263, -0.213789, -0.190315, 347 -0.166841, -0.143368, -0.119894, 348 -0.096420, -0.072946, -0.049472, 349 -0.025998, -0.002524, 0.020949, 350 0.044423, 0.067897, -0.336000] 351 } 352 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 353 run_type = run_type, 354 outputdir_name=run_data['scenario_id']) 355 356 # #T4R31 357 # xleft is different 358 run_data = {'xleft':[-2.43,0.0], # Av' of ADV and Gauge A 359 'xtoe':[0.0,0.0], 360 'xbeach':[1.285,0.090], 361 'xright':[16.1,.440], 362 'offshore_water_depth':.336, 363 'scenario_id':'T4R31', 364 'gauge_names':['1','2','3','4','5','6','7','8', 365 '9','10','11','12','13','14','B'], 366 'gauge_x':[1.572, 2.572, 3.572, 4.572, 5.572, 367 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 368 12.572, 13.572, 14.572, -0.325], 369 'gauge_bed_elevation':[-0.237263, -0.213789, -0.190315, 370 -0.166841, -0.143368, -0.119894, 371 -0.096420, -0.072946, -0.049472, 372 -0.025998, -0.002524, 0.020949, 373 0.044423, 0.067897, -0.336000] 374 } 375 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 376 run_type = run_type, 377 outputdir_name=run_data['scenario_id']) 378 379 # #T4R32 380 run_data = {'xleft':[-2.43,0.0], # Av' of ADV and Gauge A 381 'xtoe':[0.0,0.0], 382 'xbeach':[1.285,0.090], 383 'xright':[16.1,.440], 384 'offshore_water_depth':.336, 385 'scenario_id':'T4R32', 386 'gauge_names':['1','2','3','4','5','6','7','8', 387 '9','10','11','12','13','14','B'], 388 'gauge_x':[1.572, 2.572, 3.572, 4.572, 5.572, 389 6.572, 7.572, 8.572, 9.572, 10.572, 11.572, 390 12.572, 13.572, 14.572, -0.325], 391 'gauge_bed_elevation':[-0.237263, -0.213789, -0.190315, 392 -0.166841, -0.143368, -0.119894, 393 -0.096420, -0.072946, -0.049472, 394 -0.025998, -0.002524, 0.020949, 395 0.044423, 0.067897, -0.336000] 396 } 397 main( run_data['scenario_id'] + '_boundary.tsm' , run_data, 398 run_type = run_type, 399 outputdir_name=run_data['scenario_id'])
Note: See TracChangeset
for help on using the changeset viewer.