- Timestamp:
- Mar 11, 2008, 8:43:22 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/convergence_study/convergence_structured.py
r4992 r5162 17 17 from anuga.shallow_water import Transmissive_boundary 18 18 from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary 19 from anuga.geospatial_data.geospatial_data import *19 #from anuga.geospatial_data.geospatial_data import * 20 20 from math import cos 21 from Numeric import zeros, Float 21 22 22 23 #------------------------------------------------------------------------------ 23 24 # Setup computational domain 24 25 #------------------------------------------------------------------------------ 25 dx = 1000.26 dx = 200. 26 27 dy = dx 27 28 L = 100000. … … 33 34 domain = Domain(points, vertices, boundary) 34 35 35 domain.set_timestepping_method(' euler')36 domain.set_timestepping_method('rk2') 36 37 domain.set_default_order(2) 37 38 domain.set_name('myexample9') 38 39 domain.set_datadir('.') # Use current directory for output 39 40 40 domain.beta_w = 1.0 41 domain.beta_w_dry = 0.2 42 domain.beta_uh = 1.0 43 domain.beta_uh_dry = 0.2 44 domain.beta_vh = 1.0 45 domain.beta_vh_dry = 0.2 46 domain.beta_h = 1.0 41 domain.set_all_limiters(0.9) 42 43 print domain.beta_w 44 domain.use_old_limiter = False 45 domain.CFL = 1.0 47 46 48 47 #------------------------------------------------------------------------------ … … 50 49 #------------------------------------------------------------------------------ 51 50 #domain.set_quantity('elevation', topography) # Use function for elevation 52 domain.set_quantity('elevation', -100)51 domain.set_quantity('elevation',0.0) 53 52 domain.set_quantity('friction', 0.00) 54 domain.set_quantity('stage', 0.0) 53 54 h0 = 10.0 55 h1 = 1.0 56 57 def height(x,y): 58 z = zeros(len(x),Float) 59 for i in range(len(x)): 60 if x[i]<=50000.0: 61 z[i] = h0 62 else: 63 z[i] = h1 64 return z 65 66 67 domain.set_quantity('stage', height) 68 #domain.set_quantity('stage', 0.0) 55 69 56 70 #----------------------------------------------------------------------------- … … 65 79 Bw = Time_boundary(domain=domain, # Time dependent boundary 66 80 ## Sine wave 67 f=lambda t: [(-amplitude*sin((1./300.)*t*2*pi)), 0.0, 0.0]) 81 # f=lambda t: [(-amplitude*sin((1./300.)*t*2*pi)), 0.0, 0.0]) 82 ## Single wave 83 f=lambda t: [h0, 0.0, 0.0]) 68 84 ## Sawtooth? 69 85 # f=lambda t: [(-8.0*(sin((1./180.)*t*2*pi))+(1./2.)*sin((2./180.)*t*2*pi)+(1./3.)*sin((3./180.)*t*2*pi)), 0.0, 0.0]) … … 92 108 #------------------------------------------------------------------------------ 93 109 94 for t in domain.evolve(yieldstep = 20.0, finaltime = 10*40*60.):110 for t in domain.evolve(yieldstep = 50.0, finaltime = 10*40*60.): 95 111 domain.write_time() 96 112 vis.update()
Note: See TracChangeset
for help on using the changeset viewer.