Changeset 8865 for trunk/anuga_work/development/gareth/tests
- Timestamp:
- May 12, 2013, 8:11:11 PM (12 years ago)
- Location:
- trunk/anuga_work/development/gareth/tests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/tests/dam_break/plotme.py
r8774 r8865 9 9 p2_st=util.get_centroids(p_st) 10 10 11 p_dev = util.get_output('dam_break_20130 320_001049/dam_break.sww', 0.001)11 p_dev = util.get_output('dam_break_20130504_145918/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/runup/runup.py
r8772 r8865 34 34 #------------------ 35 35 36 scale_me=100.0 37 36 38 def topography(x,y): 37 return -x/2 #+0.05*numpy.sin((x+y)*50.0) #+0.1*(numpy.random.rand(len(x)) -0.5) # Linear bed slope + small random perturbation39 return -x/2*scale_me #+0.05*numpy.sin((x+y)*50.0) #+0.1*(numpy.random.rand(len(x)) -0.5) # Linear bed slope + small random perturbation 38 40 39 41 def stagefun(x,y): 40 stg=-0.2*(x<0.5) -0.1*(x>=0.5)41 #stg=-0.2# Stage42 #stg=(-0.2*(x<0.5) -0.1*(x>=0.5))*scale_me 43 stg=-0.2*scale_me # Stage 42 44 #topo=topography(x,y) #Bed 43 45 return stg #*(stg>topo) + topo*(stg<=topo) … … 55 57 Br=anuga.Reflective_boundary(domain) # Solid reflective wall 56 58 Bt=anuga.Transmissive_boundary(domain) # Continue all values of boundary -- not used in this example 57 Bd=anuga.Dirichlet_boundary([-0.2 ,0.,0.]) # Constant boundary values -- not used in this example59 Bd=anuga.Dirichlet_boundary([-0.2*scale_me,0.,0.]) # Constant boundary values -- not used in this example 58 60 #Bw=anuga.Time_boundary(domain=domain, 59 61 # 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. -
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r8772 r8865 24 24 domain=Domain(points,vertices,boundary) # Create Domain 25 25 domain.set_name('runup_sinusoid_v2') # Output to file runup.sww 26 26 #domain.set_timestepping_method('euler') 27 27 #------------------ 28 28 # Define topography 29 29 #------------------ 30 30 scale_me=1.0 31 boundary_ws=-0.1 32 init_ws=-0.2 33 bumpiness=10. # Higher = shorter wavelength oscillations in topography 31 34 #domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave 32 35 33 36 def topography(x,y): 34 return (-x/2.0 +0.05*numpy.sin((x+y)* 50.0))*scale_me37 return (-x/2.0 +0.05*numpy.sin((x+y)*bumpiness))*scale_me 35 38 36 39 def stagefun(x,y): 37 stge= -0.2*scale_me #+0.1*(x>0.9)40 stge=init_ws*scale_me# +0.1*(x>0.9)*scale_me 38 41 #topo=topography(x,y) 39 42 return stge#*(stge>topo) + (topo)*(stge<=topo) … … 41 44 domain.set_quantity('elevation',topography) # Use function for elevation 42 45 domain.get_quantity('elevation').smooth_vertex_values() 43 domain.set_quantity('friction',0.0 3) # Constant friction46 domain.set_quantity('friction',0.00) # Constant friction 44 47 45 48 #def frict_change(x,y): … … 64 67 Bd=anuga.Dirichlet_boundary([-0.1*scale_me,0.,0.]) # Constant boundary values -- not used in this example 65 68 def waveform(t): 66 return -0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1 69 return boundary_ws*scale_me 70 #return -0.2*scale_me #-0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1 67 71 Bt2=anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain,waveform) 68 72 #Bw=anuga.Time_boundary(domain=domain, … … 78 82 #------------------------------ 79 83 80 for t in domain.evolve(yieldstep=0.2 00,finaltime=40.00):84 for t in domain.evolve(yieldstep=0.2,finaltime=120.00): 81 85 print domain.timestepping_statistics() 82 print domain.boundary_flux_integral86 #print domain.boundary_flux_integral 83 87 xx = domain.quantities['xmomentum'].centroid_values 84 88 yy = domain.quantities['ymomentum'].centroid_values … … 88 92 vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5 89 93 vv = vv*(dd>1.0e-03) 90 print 'Peak velocity is: ', vv.max(), vv.argmax() 94 print 'Peak velocity is: ', vv.max(), vv.argmax(), dd[vv.argmax()] 91 95 print 'Volume is', sum(dd_raw*domain.areas) 92 print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral96 #print 'Volume less flux int', sum(dd_raw*domain.areas) - domain.boundary_flux_integral 93 97 94 98 -
trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py
r8772 r8865 36 36 #------------------------------------------------------------------------------ 37 37 def topography(x, y): 38 return -x/10. #+ 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope38 return -x/10. + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope 39 39 40 40 def stagetopo(x,y):
Note: See TracChangeset
for help on using the changeset viewer.