- Timestamp:
- May 12, 2013, 8:11:11 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.