Changeset 8751 for trunk/anuga_work/development/gareth/tests
- Timestamp:
- Mar 11, 2013, 8:17:49 PM (12 years ago)
- Location:
- trunk/anuga_work/development/gareth/tests
- Files:
-
- 10 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py
r8547 r8751 14 14 #from anuga import * 15 15 #from balanced_basic import * 16 #from balanced_dev import *17 from anuga_tsunami import *16 from balanced_dev import * 17 #from anuga_tsunami import * 18 18 #from balanced_basic.swb2_domain import * 19 19 #from balanced_basic.swb2_domain import Domain -
trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py
r8547 r8751 51 51 # Setup Algorithm 52 52 #------------------------------------------------------------------------------ 53 domain.set_timestepping_method('rk2')54 domain.set_default_order(2)53 #domain.set_timestepping_method('rk2') 54 #domain.set_default_order(2) 55 55 56 56 print domain.get_timestepping_method() 57 57 58 domain.use_edge_limiter = True58 #domain.use_edge_limiter = True 59 59 #domain.use_edge_limiter = False 60 domain.tight_slope_limiters = True61 domain.use_centroid_velocities = False60 #domain.tight_slope_limiters = True 61 #domain.use_centroid_velocities = False 62 62 63 domain.CFL = 1.063 #domain.CFL = 1.0 64 64 65 65 #domain.beta_w = 0.6 -
trunk/anuga_work/development/gareth/tests/dam_break/plotme.py
r8547 r8751 9 9 p2_st=util.get_centroids(p_st) 10 10 11 p_dev = util.get_output('dam_break_201 20831_172309/dam_break.sww', 0.001)11 p_dev = util.get_output('dam_break_20130219_202649/dam_break.sww', 0.001) 12 12 p2_dev=util.get_centroids(p_dev, velocity_extrapolation=True) 13 13 -
trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py
r8547 r8751 24 24 import anuga 25 25 import project 26 #from balanced_dev import *27 from anuga_tsunami import *26 from balanced_dev import * 27 #from anuga_tsunami import * 28 28 29 29 def main(elevation_in_mesh=False): -
trunk/anuga_work/development/gareth/tests/parabolic/parabolaplot.py
r8396 r8751 11 11 import util 12 12 13 p=util.get_output('parabola_v2.sww', 0.0 1)13 p=util.get_output('parabola_v2.sww', 0.001) 14 14 p2=util.get_centroids(p, velocity_extrapolation=True) 15 15 -
trunk/anuga_work/development/gareth/tests/runup/runup.py
r8547 r8751 56 56 Bt=anuga.Transmissive_boundary(domain) # Continue all values of boundary -- not used in this example 57 57 Bd=anuga.Dirichlet_boundary([-0.2,0.,0.]) # Constant boundary values -- not used in this example 58 Bw=anuga.Time_boundary(domain=domain,59 f=lambda t: [(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1,0.0,0.0]) # Time varying boundary -- get rid of the 0.0 to do a runup.58 #Bw=anuga.Time_boundary(domain=domain, 59 # f=lambda t: [(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1,0.0,0.0]) # Time varying boundary -- get rid of the 0.0 to do a runup. 60 60 61 61 #---------------------------------------------- -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r8607 r8751 14 14 #from swb2_domain import * 15 15 #from balanced_basic import * 16 #from balanced_dev import * 17 from anuga_tsunami import * 16 from balanced_dev import * 17 #from anuga_tsunami import * 18 18 19 #--------- 19 20 #Setup computational domain … … 23 24 domain=Domain(points,vertices,boundary) # Create Domain 24 25 domain.set_name('runup_sinusoid_v2') # Output to file runup.sww 25 domain.set_datadir('.') # Use current folder 26 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 27 #domain.set_store_vertices_uniquely(True) 26 28 27 #------------------ 29 28 # Define topography 30 29 #------------------ 31 30 scale_me=1.0 32 33 31 #domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave 34 32 … … 37 35 38 36 def stagefun(x,y): 39 stge=-0.2*scale_me #+0. 01*(x>0.9)37 stge=-0.2*scale_me #+0.1*(x>0.9) 40 38 #topo=topography(x,y) 41 39 return stge#*(stge>topo) + (topo)*(stge<=topo) … … 53 51 domain.get_quantity('stage').smooth_vertex_values() 54 52 53 #print domain.forcing_terms 54 #assert 0==1 55 55 # Experiment with rain. 56 56 # rainin = anuga.shallow_water.forcing.Rainfall(domain, rate=0.001) #, center=(0.,0.), radius=1000. ) … … 64 64 Bd=anuga.Dirichlet_boundary([-0.1*scale_me,0.,0.]) # Constant boundary values -- not used in this example 65 65 def waveform(t): 66 return (0.0*sin(t*2*pi)-0.1)*exp(-t)-0.166 return -0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1 67 67 Bt2=anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain,waveform) 68 68 #Bw=anuga.Time_boundary(domain=domain, … … 72 72 # Associate boundary tags with boundary objects 73 73 #---------------------------------------------- 74 domain.set_boundary({'left': Br, 'right': B d, 'top': Br, 'bottom':Br})74 domain.set_boundary({'left': Br, 'right': Bt2, 'top': Br, 'bottom':Br}) 75 75 76 76 #------------------------------ … … 78 78 #------------------------------ 79 79 80 for t in domain.evolve(yieldstep=0.2 ,finaltime=40.0):80 for t in domain.evolve(yieldstep=0.200,finaltime=40.00): 81 81 print domain.timestepping_statistics() 82 82 xx = domain.quantities['xmomentum'].centroid_values … … 84 84 dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values 85 85 dd_raw=1.0*dd 86 dd = (dd)*(dd>1.0e-03)+1.0e-0386 dd = dd*(dd>1.0e-03)+1.0e-03*(dd<=1.0e-03) 87 87 vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5 88 88 vv = vv*(dd>1.0e-03) -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py
r8353 r8751 15 15 #------------------ 16 16 #v=(p.y==0.5) 17 v=(p2.y==p2.y[80]) 17 myind=(abs(p2.y-0.5)).argmin() 18 v=(p2.y==p2.y[myind]) 18 19 19 20 #-------------------- -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py
r8549 r8751 29 29 # Setup computational domain 30 30 #------------------------------------------------------------------------------ 31 points, vertices, boundary = rectangular_cross(1 0, 10,32 len1=1 00.0, len2=100.0) # Mesh31 points, vertices, boundary = rectangular_cross(14, 10, 32 len1=140.0, len2=100.0) # Mesh 33 33 domain = Domain(points, vertices, boundary) # Create domain 34 34 domain.set_name('channel_SU_2_v2') # Output name 35 #domain.set_store_vertices_uniquely(True)36 #domain.CFL=1.037 35 #------------------------------------------------------------------------------ 38 36 # Setup initial conditions 39 37 #------------------------------------------------------------------------------ 40 38 def topography(x, y): 41 return -x/10. #+ numpy.sin(x/10.) +abs(y-50.)/100.# linear bed slope39 return -x/10. + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope 42 40 43 41 def stagetopo(x,y): 44 stg= -x/10. +0.06309625# Constant depth42 stg= topography(x,y) + 0.163 #-x/10. +0.06309625 -50.*(x>80.)# Constant depth 45 43 #topo=topography(x,y) 46 44 return stg#*(stg>topo) + topo*(stg<=topo) … … 68 66 #Bo = anuga.Transmissive_boundary(domain) 69 67 #Bd = anuga.Dirichlet_boundary([-20., 0., 0.]) 70 domain.set_boundary({'left': Br, 'right': B o, 'top': Br, 'bottom': Br})68 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br}) 71 69 72 70
Note: See TracChangeset
for help on using the changeset viewer.