- Timestamp:
- Aug 31, 2012, 8:38:25 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py
r8466 r8547 15 15 #from balanced_basic import * 16 16 from balanced_dev import * 17 #from anuga_tsunami import * 17 18 #--------- 18 19 #Setup computational domain … … 25 26 domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1}) 26 27 #domain.set_store_vertices_uniquely(True) 27 domain.minimum_allowed_height=0.00128 29 28 #------------------ 30 29 # Define topography … … 38 37 39 38 def stagefun(x,y): 40 stge=-0.2*scale_me # -0.1*(x>0.5) -0.2*(x<=0.5)39 stge=-0.2*scale_me # +0.01*(x>0.9) 41 40 #topo=topography(x,y) 42 41 return stge#*(stge>topo) + (topo)*(stge<=topo) … … 44 43 domain.set_quantity('elevation',topography) # Use function for elevation 45 44 domain.get_quantity('elevation').smooth_vertex_values() 46 47 domain.set_quantity('friction',0.00) # Constant friction 45 domain.set_quantity('friction',0.03) # Constant friction 48 46 49 47 #def frict_change(x,y): … … 74 72 # Associate boundary tags with boundary objects 75 73 #---------------------------------------------- 76 domain.set_boundary({'left': Br, 'right': B d, 'top': Br, 'bottom':Br})74 domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br}) 77 75 78 76 #------------------------------ … … 80 78 #------------------------------ 81 79 82 for t in domain.evolve(yieldstep=0. 1,finaltime=20.0):80 for t in domain.evolve(yieldstep=0.2,finaltime=20.0): 83 81 print domain.timestepping_statistics() 84 82 xx = domain.quantities['xmomentum'].centroid_values 85 83 yy = domain.quantities['ymomentum'].centroid_values 86 84 dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values 87 dd = (dd)*(dd>1.0e-06)+1.0e-03 88 vv = ( (xx/dd)**2 + (yy/dd)**2 )**0.5 85 dd_raw=1.0*dd 86 dd = (dd)*(dd>1.0e-03)+1.0e-03 87 vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5 89 88 vv = vv*(dd>1.0e-03) 90 89 print 'Peak velocity is: ', vv.max(), vv.argmax() 90 print 'Volume is', sum(dd_raw*domain.areas) 91 92 93 vel_final_inds=(vv>1.0e-01).nonzero() 94 print 'vel_final_inds', vel_final_inds 91 95 92 96 print 'Finished'
Note: See TracChangeset
for help on using the changeset viewer.