Ignore:
Timestamp:
Aug 31, 2012, 8:38:25 PM (13 years ago)
Author:
davies
Message:

Major experimental changes to balanced_dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r8466 r8547  
    1515#from balanced_basic import *
    1616from balanced_dev import *
     17#from anuga_tsunami import *
    1718#---------
    1819#Setup computational domain
     
    2526domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
    2627#domain.set_store_vertices_uniquely(True)
    27 domain.minimum_allowed_height=0.001
    28 
    2928#------------------
    3029# Define topography
     
    3837
    3938def 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)
    4140    #topo=topography(x,y)
    4241    return stge#*(stge>topo) + (topo)*(stge<=topo)
     
    4443domain.set_quantity('elevation',topography)     # Use function for elevation
    4544domain.get_quantity('elevation').smooth_vertex_values()
    46 
    47 domain.set_quantity('friction',0.00)             # Constant friction
     45domain.set_quantity('friction',0.03)             # Constant friction
    4846
    4947#def frict_change(x,y):
     
    7472# Associate boundary tags with boundary objects
    7573#----------------------------------------------
    76 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom':Br})
     74domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br})
    7775
    7876#------------------------------
     
    8078#------------------------------
    8179
    82 for t in domain.evolve(yieldstep=0.1,finaltime=20.0):
     80for t in domain.evolve(yieldstep=0.2,finaltime=20.0):
    8381    print domain.timestepping_statistics()
    8482    xx = domain.quantities['xmomentum'].centroid_values
    8583    yy = domain.quantities['ymomentum'].centroid_values
    8684    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
    8988    vv = vv*(dd>1.0e-03)
    9089    print 'Peak velocity is: ', vv.max(), vv.argmax()
     90    print 'Volume is', sum(dd_raw*domain.areas)   
     91
     92
     93vel_final_inds=(vv>1.0e-01).nonzero()
     94print 'vel_final_inds', vel_final_inds
    9195
    9296print 'Finished'
Note: See TracChangeset for help on using the changeset viewer.