Changeset 5190
- Timestamp:
- Apr 2, 2008, 3:17:30 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_work/development/near_shore_PMD/run_beach.py
r5162 r5190 33 33 from anuga.abstract_2d_finite_volumes.util import copy_code_files, \ 34 34 file_function 35 from anuga.abstract_2d_finite_volumes.mesh_factory import rectangular_cross 36 35 37 36 38 from anuga.shallow_water.data_manager import start_screen_catcher … … 70 72 return z 71 73 72 def main(friction=0.01, outputdir_name=None, is_trial_run=False): 73 basename = 'zz' + str(friction) 74 def main(friction=0.01, outputdir_name=None, 75 is_structured=False, 76 is_trial_run=False): 77 78 # Structured mesh variables 79 dx = 5. 80 dy = dx 81 L = 2080. 82 W = dx 83 outputdir_name += '_dx' + str(dx) 84 85 basename = 'dx_' + str(dx) 74 86 if is_trial_run is True: 75 87 outputdir_name += '_test' … … 81 93 yieldstep = 1. 82 94 finaltime = 1600 83 finaltime = 10084 95 maximum_triangle_area = 100 85 96 thinner=True … … 116 127 # this creates the mesh 117 128 #gate_position = 12.0 118 create_mesh.generate(mesh_filename, 119 maximum_triangle_area=maximum_triangle_area, 120 thinner=thinner) 121 122 head,tail = path.split(mesh_filename) 123 copy (mesh_filename, 124 pro_instance.outputdir + tail ) 129 if is_structured is True: 130 131 # Original struc mesh values 132 # dx = 10. 133 # dy = dx 134 # L = 2080. 135 # W = dx 136 137 # structured mesh 138 points, vertices, boundary = rectangular_cross( 139 int(L/dx), int(W/dy), L, W, (-80.0, -W*0.5)) 140 141 domain = Domain(points, vertices, boundary) 142 else: 143 create_mesh.generate(mesh_filename, 144 maximum_triangle_area=maximum_triangle_area, 145 thinner=thinner) 146 147 head,tail = path.split(mesh_filename) 148 copy (mesh_filename, 149 pro_instance.outputdir + tail ) 150 domain = Domain(mesh_filename, use_cache = False, verbose = True) 151 domain = Domain(points, vertices, boundary) 125 152 #------------------------------------------------------------------------- 126 153 # Setup computational domain 127 154 #------------------------------------------------------------------------- 128 domain = Domain(mesh_filename, use_cache = False, verbose = True)129 155 130 156 … … 137 163 domain.set_datadir(pro_instance.outputdir) 138 164 domain.set_default_order(2) # Use second order spatial scheme 165 domain.set_timestepping_method('rk2') 166 domain.set_default_order(2) 167 #domain.use_edge_limiter = True 168 #domain.tight_slope_limiters = True 169 170 #domain.beta_w = 0.6 171 #domain.beta_uh = 0.6 172 #domain.beta_vh = 0.6 173 #domain.beta_h = 0.0 174 139 175 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 140 176 domain.set_minimum_storable_height(0.001) … … 165 201 lambda t: [1.2*sin(2*t*pi/10)+1.0*sin(2*t*pi/9.5), 166 202 0.0, 0.0]) 167 domain.set_boundary( {'wall': Br, 'wave': Bwp_velocity} ) 203 204 if is_structured is True: 205 domain.set_boundary( {'top': Br, 206 'bottom': Br , 207 'left' : Br , 208 'right' : Bwp } ) 209 else: 210 domain.set_boundary( {'wall': Br, 'wave': Bwp} ) 168 211 169 212 … … 179 222 print 'finished' 180 223 181 points = [[2.8,0.5], #-1.8m from SWL 182 [5.1,0.5], #0.5m from SWL 183 [6.6,0.5], #2m from SWL 184 [6.95,0.5], #2.35m from SWL 185 [7.6,0.5], #3m from SWL 186 [8.2,0.5], #3.5m from SWL 187 [9.2,0.5] #4.5m from SWL 224 points = [[-2,0.0], #-1.8m from SWL 225 [0,0.0], #0.5m from SWL 226 [2,0.0], #2m from SWL 188 227 ] 189 228 … … 193 232 #------------------------------------------------------------------------- 194 233 195 if False:234 if True: 196 235 interpolate_sww2csv(pro_instance.outputdir + basename +".sww", 197 236 points, 198 pro_instance.outputdir + "depth_ manning_"+str(friction)+".csv",199 pro_instance.outputdir + "velocity_x .csv",200 pro_instance.outputdir + "velocity_y .csv")237 pro_instance.outputdir + "depth_dx_"+str(dx)+".csv", 238 pro_instance.outputdir + "velocity_x_dx_"+str(dx)+".csv", 239 pro_instance.outputdir + "velocity_y_dx_"+str(dx)+".csv") 201 240 202 241 return pro_instance … … 204 243 #------------------------------------------------------------- 205 244 if __name__ == "__main__": 206 main( is_trial_run = False, friction=0.0, 207 outputdir_name='Velocity_wave_thinner_100_0_friction_ft1600_2nd_order') 245 main( 246 is_trial_run=False, 247 friction=0.0, 248 is_structured=True, 249 outputdir_name='structured_old_limiters')
Note: See TracChangeset
for help on using the changeset viewer.