Changeset 8206
- Timestamp:
- Sep 2, 2011, 7:57:03 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_core/source/anuga/shallow_water_balanced/swb_domain.py
r8203 r8206 68 68 self.set_centroid_transmissive_bc(True) 69 69 self.set_CFL(1.0) 70 self.set_beta(1. 0)71 self.quantities['height'].set_beta(1. 0)70 self.set_beta(1.5) 71 self.quantities['height'].set_beta(1.5) 72 72 73 73 #-------------------------------------------- -
trunk/anuga_work/development/2010-projects/anuga_1d/base/quantity.py
r7884 r8206 1162 1162 if __name__ == "__main__": 1163 1163 #from domain import Domain 1164 from generic_domain import Generic_domain as Domain 1164 1165 from anuga_1d.base.generic_domain import Generic_domain as Domain 1165 1166 1166 1167 … … 1172 1173 g.xlabel('x') 1173 1174 g.ylabel('y') 1175 g.show() 1174 1176 1175 1177 … … 1177 1179 import pylab as g 1178 1180 g.plot(x.flat,y.flat) 1181 g.show() 1179 1182 1180 1183 … … 1184 1187 1185 1188 1186 1189 import pylab as g 1190 1187 1191 points1 = [0.0, 1.0, 2.0, 3.0] 1188 1192 vertex_values = [[1.0,2.0],[4.0,5.0],[-1.0,2.0]] … … 1266 1270 Qc = Q2.vertex_values 1267 1271 linePlot(Xc,Qc) 1272 g.show() 1268 1273 raw_input('press return') 1269 1274 -
trunk/anuga_work/development/2010-projects/anuga_1d/base/test_quantity_1d.py
r7930 r8206 560 560 limit_minmod_kurganov_ext(quantity) 561 561 562 assert allclose(quantity.vertex_values, [[ -2.4, 2.4], 563 [ 4.2, 7.8], 564 [ 10.8, 11.2], 565 [ 11.4, 14.6]]) 562 566 563 567 #print quantity.vertex_values … … 607 611 608 612 609 print quantity.vertex_values613 #print quantity.vertex_values 610 614 611 615 assert allclose(quantity.vertex_values, [[ -2.4, 2.4 ], … … 620 624 limit_vanalbada_ext(quantity) 621 625 622 print quantity.vertex_values626 #print quantity.vertex_values 623 627 624 628 -
trunk/anuga_work/development/2010-projects/anuga_1d/compile_all.py
r8191 r8206 17 17 18 18 19 os.chdir('..')20 os.chdir('sww-sudi')21 execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')22 23 os.chdir('..')24 os.chdir('avalanche-sudi')25 execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py')19 #os.chdir('..') 20 #os.chdir('sww-sudi') 21 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py') 22 # 23 #os.chdir('..') 24 #os.chdir('avalanche-sudi') 25 #execfile('..' + os.sep + 'utilities' + os.sep + 'compile.py') 26 26 27 27 os.chdir('..') -
trunk/anuga_work/development/2010-projects/anuga_1d/sww/run_dry_dam.py
r8204 r8206 12 12 13 13 h1 = 10.0 14 h0 = 0. 114 h0 = 0.0 15 15 16 16 def analytical_sol(C,t): … … 94 94 domain.set_CFL(1.0) 95 95 domain.set_limiter("minmod_kurganov") 96 domain.set_beta(1.5) 96 97 #domain.h0=0.0001 97 98 … … 136 137 137 138 pylab.plot(X.flat,VelocityV.flat) 138 plot2.set_ylim([- 15,15])139 plot2.set_ylim([-20,20]) 139 140 140 141 pylab.xlabel('Position') -
trunk/anuga_work/development/2010-projects/anuga_1d/sww/run_tsunami_model.py
r8205 r8206 9 9 10 10 11 print " JakirTest"11 print "Tsunami Test" 12 12 13 depth = -200 13 depth1 = -100 14 depth2 = -5 15 cliff = 0 16 shelf_width = 10000 17 14 18 def sea_floor(x): 15 19 y = np.zeros_like(x) 16 20 for i in range(len(x)): 17 if x[i]<500: 18 y[i]= depth 19 else : 20 y[i]= depth + 0.5*(x[i] - 500) 21 if x[i]<cliff: 22 y[i]= depth1 23 elif x[i]<cliff+shelf_width : 24 y[i]= depth1 + (depth2-depth1)*(x[i] - cliff)/shelf_width 25 else: 26 y[i] = depth2 21 27 return y 22 28 29 tsunami_centre = -200000 30 tsunami_radius = 100000 31 tsunami_height = 2.0 23 32 def stage(x): 24 33 y = np.zeros_like(x) 25 34 for i in range(len(x)): 26 if x[i]> 100 and x[i]<200:27 y[i]= 2.035 if x[i]>tsunami_centre-tsunami_radius and x[i]<tsunami_centre+tsunami_radius: 36 y[i]= tsunami_height 28 37 return y 29 38 … … 32 41 33 42 # Set final time and yield time for simulation 34 finaltime = 10.043 finaltime = 60*10 35 44 yieldstep = finaltime 36 45 37 46 # Length of channel (m) 38 L = 1000 .047 L = 100000.0 39 48 # Define the number of cells 40 #N = 20 41 #print "Evaluating domain with %d cells" %N 42 #domain = Domain(*uniform_mesh(N, x_0 = -2.0*L, x_1 = 2.0*L)) 49 N = 1000 43 50 44 51 45 46 47 48 # Define the number of cells 49 number_of_cells = [20] 50 51 # Define cells for finite volume and their size 52 N = int(number_of_cells[0]) 53 54 55 points0, boundary0 = uniform_mesh(N, x_0 = 0.0, x_1 = L) 56 57 58 print "Evaluating domain with %d cells" %N 59 cell_len = L/N # Origin = 0.0 60 points = np.zeros(N+1,np.float) 61 62 # Define the centroid points 63 for j in range(N+1): 64 points[j] = j*cell_len 65 66 67 print points0-points 52 #points = points - L 68 53 69 54 # Create domain with centroid points as defined above 70 domain = Domain( points0)55 domain = Domain(*uniform_mesh(N, x_0 = -10.0*L, x_1 = 3*L)) 71 56 72 73 57 #print uniform_mesh(N, x_0 = -L, x_1 = 2*L) 58 #print domain.boundary 74 59 75 60 … … 82 67 #domain.set_boundary({'exterior': Dirichlet_boundary([14,20,0,1.4,20/14,9])}) 83 68 Br = Reflective_boundary(domain) 84 #domain.set_boundary({'left': Br, 'right' : Br })85 domain.set_boundary({'exterior': Br})69 domain.set_boundary({'left': Br, 'right' : Br }) 70 #domain.set_boundary({'exterior': Br}) 86 71 87 72 #domain.set_boundary({'exterior': Transmissive_boundary(domain)}) … … 89 74 domain.set_timestepping_method('rk2') 90 75 domain.set_CFL(1.0) 91 domain.set_limiter(" vanleer")76 domain.set_limiter("minmod_kurganov") 92 77 #domain.h0=0.0001 93 78 … … 95 80 t0 = time.time() 96 81 97 finaltime= 0.082 finaltime= 60*60*8 98 83 99 84 #=================================================================== -
trunk/anuga_work/development/2010-projects/anuga_1d/sww/sww_domain.py
r8204 r8206 92 92 self.__doc__ = 'sww_domain' 93 93 94 self.set_spatial_order(2) 95 self.set_timestepping_method('rk2') 96 self.set_CFL(1.0) 97 self.set_limiter("minmod_kurganov") 98 self.set_beta(1.5) 99 94 100 95 101 def set_quantities_to_be_stored(self, q): … … 239 245 240 246 241 u_C[:] = uh_C/(h_C + h0/ h_C)247 u_C[:] = uh_C/(h_C + h0/(h_C + h0)) 242 248 243 249 #print 'domain.order', domain.order … … 299 305 # 300 306 # 301 #stage_V[:,:] = bed_V + h_V307 stage_V[:,:] = bed_V + h_V 302 308 #bed_V[:,:] = stage_V - h_V 303 309 xmom_V[:,:] = u_V * h_V
Note: See TracChangeset
for help on using the changeset viewer.