Changeset 5175
- Timestamp:
- Mar 19, 2008, 8:02:05 PM (17 years ago)
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_core/source/anuga/config.py
r5162 r5175 176 176 optimise_dry_cells = True # Exclude dry and still cells from flux computation 177 177 optimised_gradient_limiter = True # Use hardwired gradient limiter 178 use_edge_limiter = False # The edge limiter is better, but most runs have been using vertex limiting 178 179 179 180 points_file_block_line_size = 500 # Number of lines read in from a points file -
anuga_core/source/anuga/shallow_water/shallow_water_domain.py
r5162 r5175 104 104 from anuga.config import optimise_dry_cells 105 105 from anuga.config import optimised_gradient_limiter 106 from anuga.config import use_edge_limiter 106 107 107 108 #--------------------- … … 179 180 180 181 # Limiters 181 self.use_ old_limiter = True182 self.use_edge_limiter = use_edge_limiter 182 183 183 184 self.optimised_gradient_limiter = optimised_gradient_limiter … … 395 396 # Call correct module function 396 397 # (either from this module or C-extension) 397 if self.use_old_limiter: 398 distribute_to_vertices_and_edges(self) 399 else: 398 if self.use_edge_limiter: 400 399 for name in self.conserved_quantities: 401 400 Q = self.quantities[name] … … 404 403 elif self._order_ == 2: 405 404 Q.extrapolate_second_order_and_limit() 406 if name == 'stage':407 Q.bound_vertices_below_by_quantity(self.quantities['elevation'])408 405 else: 409 406 raise 'Unknown order' 410 407 balance_deep_and_shallow(self) 408 409 #Compute edge values by interpolation 410 for name in self.conserved_quantities: 411 Q = self.quantities[name] 412 Q.interpolate_from_vertices_to_edges() 413 else: 414 distribute_to_vertices_and_edges(self) 415 411 416 412 417 … … 871 876 # 872 877 from shallow_water_ext import balance_deep_and_shallow as balance_deep_and_shallow_c 873 878 879 880 #print 'calling balance depth and shallow' 874 881 # Shortcuts 875 882 wc = domain.quantities['stage'].centroid_values -
anuga_core/source/anuga/shallow_water/shallow_water_ext.c
r5162 r5175 589 589 // Calculate minimal depth across all three vertices 590 590 hmin = min(hv[0], min(hv[1], hv[2])); 591 592 //if (hmin < 0.0 ) { 593 // printf("hmin = %f\n",hmin); 594 //} 591 595 592 596 … … 647 651 } 648 652 649 653 //printf("alpha=%f, tight_slope_limiters=%d\n", alpha, tight_slope_limiters); 654 650 655 /* 651 656 // Experimental code for controlling velocities at vertices. … … 704 709 705 710 // Update momentum at vertices 706 if (tight_slope_limiters == 1) { 707 // FIXME(Ole): Here's what I think (as of 17 Nov 2007) 711 712 713 // Update momentum at vertices 714 // Update momentum as a linear combination of 715 // xmomc and ymomc (shallow) and momentum 716 // from extrapolator xmomv and ymomv (deep). 717 718 719 //xmomv[k3+i] = (1-alpha)*xmomc[k] + alpha*xmomv[k3+i]; 720 //ymomv[k3+i] = (1-alpha)*ymomc[k] + alpha*ymomv[k3+i]; 721 722 if (tight_slope_limiters == 1) { 723 // FIXME(Ole): Here's what I think (as of 17 Nov 2007) 708 724 // we need to do. Simple and efficient: 709 725 … … 721 737 hv[i] = wv[k3+i] - zv[k3+i]; // Recompute (balanced) vertex depth 722 738 xmomv[k3+i] = uc*hv[i]; 723 ymomv[k3+i] = vc*hv[i]; 739 ymomv[k3+i] = vc*hv[i]; 724 740 } else { 725 741 // Update momentum as a linear combination of 726 742 // xmomc and ymomc (shallow) and momentum 727 743 // from extrapolator xmomv and ymomv (deep). 728 // FIXME (Ole): Is this really needed? Could we use the above 744 // FIXME (Ole): Is this really needed? Could we use the above 729 745 // instead? 730 746 … … 1189 1205 1190 1206 hfactor = 0.0; 1191 if (hmin > 0. 1 ) {1192 hfactor = (hmin-0. 1)/(hmin+0.4);1207 if (hmin > 0.001 ) { 1208 hfactor = (hmin-0.001)/(hmin+0.004); 1193 1209 } 1194 1210 -
anuga_core/source/anuga/shallow_water/test_data_manager.py
r5162 r5175 244 244 # Get the variables 245 245 range = fid.variables['stage_range'][:] 246 #print range 246 247 assert allclose(range,[-0.93519, 0.15]) or\ 247 allclose(range,[-0.9352743, 0.15]) # Old slope limiters 248 allclose(range,[-0.9352743, 0.15]) or\ 249 allclose(range,[-0.93522203, 0.15000001]) # Old slope limiters 248 250 249 251 range = fid.variables['xmomentum_range'][:] 250 251 252 252 #print range 253 253 assert allclose(range,[0,0.4695096]) or \ 254 254 allclose(range,[0,0.47790655]) or\ 255 allclose(range,[0,0.46941957]) 255 allclose(range,[0,0.46941957]) or\ 256 allclose(range,[0,0.47769409]) 257 256 258 257 259 range = fid.variables['ymomentum_range'][:] 258 # assert allclose(range,[0,0.02174380])259 260 assertallclose(range,[0,0.02174439]) or\260 #print range 261 assert allclose(range,[0,0.02174380]) or\ 262 allclose(range,[0,0.02174439]) or\ 261 263 allclose(range,[0,0.02283983]) or\ 262 allclose(range,[0,0.0217342]) # Old slope limiters 264 allclose(range,[0,0.0217342]) or\ 265 allclose(range,[0,0.0227564]) # Old slope limiters 263 266 264 267 fid.close() … … 330 333 331 334 extrema = fid.variables['xmomentum.extrema'][:] 332 assert allclose(extrema,[-0.06062178, 0.47873023]) 335 assert allclose(extrema,[-0.06062178, 0.47873023]) or allclose(extrema, [-0.06062178, 0.47847986]) 333 336 334 337 extrema = fid.variables['ymomentum.extrema'][:] 335 assert allclose(extrema,[0.00, 0.0625786]) 338 assert allclose(extrema,[0.00, 0.0625786]) or allclose(extrema,[0.00, 0.06062178]) 336 339 337 340 time_interval = fid.variables['extrema.time_interval'][:] -
anuga_core/source/anuga/shallow_water/test_shallow_water_domain.py
r5119 r5175 2518 2518 #print L[1] 2519 2519 assert allclose(L[1], [4.23370103, 16.06529897, 20.001]) or\ 2520 allclose(L[1], [4.18944138, 16.10955862, 20.001]) # old limiters 2520 allclose(L[1], [4.18944138, 16.10955862, 20.001]) or\ 2521 allclose(L[1], [4.19351461, 16.10548539, 20.001]) # old limiters 2521 2522 2522 2523 for i in range(len(L)): -
anuga_validation/convergence_study/dam_break.py
r5162 r5175 41 41 # Setup domain 42 42 #------------------------------------------------------------------------------ 43 dx = 2 50.43 dx = 200. 44 44 dy = dx 45 45 L = 100000. 46 W = dx46 W = 10*dx 47 47 48 48 # structured mesh … … 62 62 print domain.get_timestepping_method() 63 63 64 domain.use_old_limiter = True 64 domain.use_old_limiter = False 65 domain.tight_slope_limiters = True 66 65 67 domain.CFL = 1.0 66 68 67 domain.beta_w = 1.7 68 domain.beta_w_dry = 0.0 69 domain.beta_uh = 1.7 70 domain.beta_uh_dry = 0.0 71 domain.beta_vh = 1.7 72 domain.beta_vh_dry = 0.0 73 69 domain.beta_w = 0.6 70 domain.beta_uh = 0.6 71 domain.beta_vh = 0.6 72 domain.beta_h = 0.0 74 73 75 74 … … 120 119 #------------------------------------------------------------------------------ 121 120 122 for t in domain.evolve(yieldstep = 20.0, finaltime = 60*60.):123 domain.write_time()121 for t in domain.evolve(yieldstep = 100.0, finaltime = 60*60.): 122 print domain.timestepping_statistics(track_speeds=True) 124 123 vis.update() 125 124 -
anuga_validation/convergence_study/wave.py
r5162 r5175 42 42 # Setup domain 43 43 #------------------------------------------------------------------------------ 44 dx = 500.44 dx = 200. 45 45 dy = dx 46 46 L = 100000. … … 58 58 # Setup Algorithm 59 59 #------------------------------------------------------------------------------ 60 #domain.set_timestepping_method('euler') 60 domain.set_timestepping_method('rk2') 61 domain.set_default_order(2) 61 62 62 #domain.set_default_order(2) 63 #domain.set_timestepping_method('euler') 64 #domain.set_all_limiters(2.0) 65 #domain.use_old_limiter = True 66 #domain.CFL = 1.0 63 print domain.get_timestepping_method() 67 64 65 domain.use_edge_limiter = True 66 domain.tight_slope_limiters = True 68 67 69 domain.set_default_order(2) 70 #domain.set_timestepping_method('euler') 68 domain.CFL = 1.0 71 69 72 domain.use_old_limiter = True 73 74 domain.beta_w = 2.0 75 domain.beta_w_dry = 0.5 76 domain.beta_uh = 2.0 77 domain.beta_uh_dry = 0.5 78 domain.beta_vh = 2.0 79 domain.beta_vh_dry = 0.5 70 domain.beta_w = 0.6 71 domain.beta_w_dry = 0.0 72 domain.beta_uh = 0.6 73 domain.beta_uh_dry = 0.0 74 domain.beta_vh = 0.6 75 domain.beta_vh_dry = 0.0 76 domain.beta_h = 0.0 80 77 81 78 -
anuga_work/development/attenuation_near_shore/run_beach_structured.py
r5166 r5175 140 140 domain.set_datadir(pro_instance.outputdir) 141 141 domain.set_default_order(2) # Use second order spatial scheme 142 142 143 domain.set_timestepping_method('rk2') 143 domain.beta_w = 2.0 144 domain.beta_uh = 2.0 145 domain.beta_vh = 2.0 146 domain.beta_h = 2.0 144 domain.set_default_order(2) 145 domain.use_old_limiter = False 146 domain.tight_slope_limiters = True 147 148 domain.beta_w = 0.6 149 domain.beta_uh = 0.6 150 domain.beta_vh = 0.6 151 domain.beta_h = 0.0 152 153 147 154 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 148 155 domain.set_minimum_storable_height(0.001)
Note: See TracChangeset
for help on using the changeset viewer.