Changeset 4351 for anuga_work/development/friction_UA_flume_2006
- Timestamp:
- Apr 3, 2007, 4:22:40 PM (18 years ago)
- Location:
- anuga_work/development/friction_UA_flume_2006
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/friction_UA_flume_2006/calc_norm.py
r4189 r4351 67 67 outputdir_name += '_test' 68 68 if pro_instance is None: 69 pro_instance = project.Project(['data','flumes','dam_200 6'],69 pro_instance = project.Project(['data','flumes','dam_2007'], 70 70 outputdir_name=outputdir_name) 71 71 … … 85 85 86 86 #print "flume_results['time']", flume_results['time'] 87 import sys; sys.exit()88 87 #Get a list of the files 89 88 files = os.listdir(pro_instance.outputdir) … … 144 143 'ensemble_average_h_smooth.csv', 145 144 #'ensemble_average_h_rough.csv', 146 is_trial_run = True, # adds _test to outputdir_name147 outputdir_name='friction_UA ',145 is_trial_run = False, # adds _test to outputdir_name 146 outputdir_name='friction_UA_new_meshII', 148 147 max_time=None) 149 148 -
anuga_work/development/friction_UA_flume_2006/create_mesh.py
r4047 r4351 7 7 8 8 9 def generate(mesh_filename, gate_position,is_coarse = False):9 def generate(mesh_filename, is_coarse = False): 10 10 """ 11 11 Generate mesh for University of Aberbeen dam break flume. … … 16 16 #Basic geometry 17 17 18 xright = gate_position 18 xright = 19.0 # web site says a 20 m long flume 19 #(http://www.eng.abdn.ac.uk/envhrg/facilities/swashrig.hti) 20 # Therefore 19 +1 (for reservoir)= 20 19 21 ybottom = 0 20 22 ytop = 0.45 21 23 xdam = 0.0 22 xleft = gate_position - 13.0 24 xleft = -1.0 25 xslope = 4.0 # note, get in gen meshparrallel run dam as well! 23 26 24 27 #Outline … … 32 35 point_dam_bottom = [xdam, ybottom] 33 36 37 # slope seperation (middle) 38 point_slope_top = [xslope, ytop] 39 point_slope_bottom = [xslope, ybottom] 40 34 41 m = Mesh() 35 42 … … 38 45 point_nw, 39 46 point_dam_top, 47 point_slope_top, 40 48 point_ne, 41 point_se, 49 point_se, 50 point_slope_bottom, 42 51 point_dam_bottom 43 52 ] 44 53 45 54 segments = [[0,1], [1,2], [2,3], 46 [3,4 ],[4,5], [5,0], #The outer border 47 [2,5]] #dam Separator 55 [3,4 ],[4,5], [5,6],[6,7],[7,0], #The outer border 56 [2,7], #dam Separator 57 [3,6]] # slope separator 48 58 49 segment_tags = {'wall':[0,1,2, 4,5],'edge':[3]} # '':[6]59 segment_tags = {'wall':[0,1,2,3,5,6,7],'edge':[4]} # '':[6] 50 60 51 61 m.add_points_and_segments(points, segments, segment_tags) 52 62 53 63 dam = m.add_region(-0.0000001,(ytop - ybottom)/2) 54 # this is the location of the re gion.64 # this is the location of the reservoir region. 55 65 dam.setTag("dam") 66 67 slope = m.add_region(xslope + 0.0000001,(ytop - ybottom)/2) 68 # this is the location of the slope region. 69 slope.setTag("slope") 56 70 57 71 if is_coarse: … … 65 79 #------------------------------------------------------------- 66 80 if __name__ == "__main__": 67 generate("aa.tsh", 0.75, is_course = True)81 generate("aa.tsh", is_coarse = True) -
anuga_work/development/friction_UA_flume_2006/parallel_run_dam.py
r4328 r4351 47 47 import create_mesh 48 48 49 def elevation_function(x,y): 50 from Numeric import zeros, size, Float 51 slope = 4 # note, get in gen mesh as well! 52 53 z = zeros(size(x), Float) 54 for i in range(len(x)): 55 if x[i] < slope: 56 z[i] = 0.0 57 else: 58 z[i] = (x[i]-slope)*0.1 59 return z 49 60 50 61 def main(friction, outputdir_name=None, is_trial_run=False): … … 76 87 # which checks if I dir is created, and if it isn't 77 88 #creates it. 78 for i in range(500 ):89 for i in range(5000): 79 90 pass 80 pro_instance = project.Project(['data','flumes','dam_200 6'],91 pro_instance = project.Project(['data','flumes','dam_2007'], 81 92 outputdir_name=outputdir_name) 82 93 … … 97 108 #------------------------------------------------------------------------- 98 109 99 gate_position = 12.0110 #gate_position = 12.0 100 111 create_mesh.generate(mesh_filename, 101 gate_position,102 112 is_coarse=is_trial_run) # this creates the mesh 103 113 … … 126 136 #------------------------------------------------------------------------- 127 137 128 domain.set_quantity('stage', 0.0 )138 domain.set_quantity('stage', 0.06) # initial 129 139 domain.set_quantity('friction', friction) 130 domain.set_quantity('elevation',0.0) 131 132 domain.set_quantity('elevation', filename = 'elevation.xya', 133 alpha = 10.0,verbose = True, use_cache = True) 140 domain.set_quantity('elevation', elevation_function) 141 134 142 135 143 print 'Available boundary tags', domain.get_boundary_tags() … … 190 198 0.016, 0.017, 0.018, 191 199 0.019, 0.02, 192 0.0225, 0.025, 0.03, 0.035, 0.04] 200 0.0225, 0.025, 0.03, 0.035, 0.04] # 17 processes 201 #frictions = [0.0] 193 202 for i, friction in enumerate(frictions): 194 203 if i%size == rank: 195 204 print "I am processor %d of %d on node %s" %(rank, size, node) 196 main(friction, is_trial_run = False, outputdir_name='friction_UA_still_water')205 main(friction, is_trial_run = True, outputdir_name='friction_UA_new_meshII') -
anuga_work/development/friction_UA_flume_2006/run_dam.py
r4328 r4351 9 9 10 10 """ 11 print "create mesh and parallel run dam have been updated. This has not." 12 import sys; sys.exit() 11 13 #---------------------------------------------------------------------------- 12 14 # Import necessary modules
Note: See TracChangeset
for help on using the changeset viewer.