Changeset 4750 for anuga_validation/UQ_runup_2006/run_dam.py
- Timestamp:
- Oct 23, 2007, 4:00:41 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/UQ_runup_2006/run_dam.py
r4748 r4750 25 25 import create_mesh 26 26 27 import project 28 29 27 30 # Application specific imports 28 31 … … 34 37 inital_depths = [0.2] #can enter multiple initial depths eg [0.1, 0.2] 35 38 gate_positions = [0.75] 36 flume_lengths = [3] #can enter multiple flume lengths eg [3.0, 5.0] 37 # NOTE flume_lengths is not used. It's hardcoded into create_mesh 38 39 for slope in slopes: 40 for friction in frictions: 41 for inital_depth in inital_depths: 42 for flume_length in flume_lengths: 43 for gate_position in gate_positions: 44 scenario(slope, friction, inital_depth, gate_position, flume_length) 39 40 scenario(0, 0.01, 0.02, 0.75) 45 41 46 42 47 def scenario(slope, friction, inital_depth, gate_position, flume_length): 48 49 import project # Definition of file names and polygons 50 51 #------------------------------------------------------------------------- 52 # Setup archiving of simulations 53 #------------------------------------------------------------------------- 54 55 id = 'd'+ str(inital_depth) + '_s'+str(slope)+'_g'+ str(gate_position)+ '_n'+ str(friction) 56 copy (project.codedirname, project.outputtimedir + 'project.py') 57 run_name = 'run_dam.py' 58 run_name_out = 'run_dam'+id+'.py' 59 60 copy (project.codedir + run_name, project.outputtimedir + run_name_out) 61 copy (project.codedir + 'create_mesh.py', 62 project.outputtimedir + 'create_mesh.py') 63 print'output dir', project.outputtimedir 43 def scenario(slope, friction, inital_depth, gate_position): 64 44 65 45 #------------------------------------------------------------------------- … … 68 48 69 49 create_mesh.generate(project.mesh_filename, 70 gate_position, flume_length,71 #is_course=True) # this creates the mesh72 is_course=False) # this creates the mesh50 gate_position, 51 is_course=True) # this creates the mesh 52 #is_course=False) # this creates the mesh 73 53 74 54 head,tail = path.split(project.mesh_filename) 75 copy (project.mesh_filename,76 project.outputtimedir + tail )77 55 #------------------------------------------------------------------------- 78 56 # Setup computational domain … … 86 64 87 65 88 domain.set_name(project.basename + id)89 domain.set_datadir( project.outputtimedir)66 domain.set_name(project.basename) 67 domain.set_datadir('.') 90 68 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 91 69 domain.set_minimum_storable_height(0.001) … … 123 101 print 'finished' 124 102 125 points = [[gate_position - 0.65,0.2], 126 [gate_position - 0.55,0.2], 127 [gate_position - 0.45,0.2], 128 [gate_position - 0.35,0.2], 129 [0.45,0.2], 130 [gate_position - 0.25,0.2] 131 ] 103 points = [[0.4,0.2]] 132 104 #------------------------------------------------------------------------- 133 105 # Calculate gauge info 134 106 #------------------------------------------------------------------------- 135 print "name", project.outputtimedir + project.basename \ 136 + id+".sww" 137 interpolate_sww2csv(project.outputtimedir + project.basename \ 138 + id+".sww", 107 print "name",project.basename +".sww" 108 interpolate_sww2csv( project.basename +".sww", 139 109 points, 140 project.depth_filename + id +'.csv',141 project.velocity_x_filename + id +'.csv',142 project.velocity_y_filename + id +'.csv')110 project.depth_filename + '.csv', 111 project.velocity_x_filename + '.csv', 112 project.velocity_y_filename + '.csv') 143 113 144 114
Note: See TracChangeset
for help on using the changeset viewer.