Ignore:
Timestamp:
Mar 11, 2013, 8:17:49 PM (12 years ago)
Author:
davies
Message:

Updates to gd in-development algorithms

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  
    1414#from anuga import *
    1515#from balanced_basic import *
    16 #from balanced_dev import *
    17 from anuga_tsunami import *
     16from balanced_dev import *
     17#from anuga_tsunami import *
    1818#from balanced_basic.swb2_domain import *
    1919#from balanced_basic.swb2_domain import Domain
  • trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py

    r8547 r8751  
    5151# Setup Algorithm
    5252#------------------------------------------------------------------------------
    53 domain.set_timestepping_method('rk2')
    54 domain.set_default_order(2)
     53#domain.set_timestepping_method('rk2')
     54#domain.set_default_order(2)
    5555
    5656print domain.get_timestepping_method()
    5757
    58 domain.use_edge_limiter = True
     58#domain.use_edge_limiter = True
    5959#domain.use_edge_limiter = False
    60 domain.tight_slope_limiters = True
    61 domain.use_centroid_velocities = False
     60#domain.tight_slope_limiters = True
     61#domain.use_centroid_velocities = False
    6262
    63 domain.CFL = 1.0
     63#domain.CFL = 1.0
    6464
    6565#domain.beta_w      = 0.6
  • trunk/anuga_work/development/gareth/tests/dam_break/plotme.py

    r8547 r8751  
    99p2_st=util.get_centroids(p_st)
    1010
    11 p_dev = util.get_output('dam_break_20120831_172309/dam_break.sww', 0.001)
     11p_dev = util.get_output('dam_break_20130219_202649/dam_break.sww', 0.001)
    1212p2_dev=util.get_centroids(p_dev, velocity_extrapolation=True)
    1313
  • trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py

    r8547 r8751  
    2424import anuga
    2525import project
    26 #from balanced_dev import *
    27 from anuga_tsunami import *
     26from balanced_dev import *
     27#from anuga_tsunami import *
    2828
    2929def main(elevation_in_mesh=False):
  • trunk/anuga_work/development/gareth/tests/parabolic/parabolaplot.py

    r8396 r8751  
    1111import util
    1212
    13 p=util.get_output('parabola_v2.sww', 0.01)
     13p=util.get_output('parabola_v2.sww', 0.001)
    1414p2=util.get_centroids(p, velocity_extrapolation=True)
    1515
  • trunk/anuga_work/development/gareth/tests/runup/runup.py

    r8547 r8751  
    5656Bt=anuga.Transmissive_boundary(domain)          # Continue all values of boundary -- not used in this example
    5757Bd=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.
    6060
    6161#----------------------------------------------
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r8607 r8751  
    1414#from swb2_domain import *
    1515#from balanced_basic import *
    16 #from balanced_dev import *
    17 from anuga_tsunami import *
     16from balanced_dev import *
     17#from anuga_tsunami import *
     18
    1819#---------
    1920#Setup computational domain
     
    2324domain=Domain(points,vertices,boundary)    # Create Domain
    2425domain.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
    2827#------------------
    2928# Define topography
    3029#------------------
    3130scale_me=1.0
    32 
    3331#domain.minimum_allowed_height=domain.minimum_allowed_height*scale_me # Seems needed to make the algorithms behave
    3432
     
    3735
    3836def 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)
    4038    #topo=topography(x,y)
    4139    return stge#*(stge>topo) + (topo)*(stge<=topo)
     
    5351domain.get_quantity('stage').smooth_vertex_values()
    5452
     53#print domain.forcing_terms
     54#assert 0==1
    5555# Experiment with rain.
    5656# rainin = anuga.shallow_water.forcing.Rainfall(domain, rate=0.001) #, center=(0.,0.), radius=1000. )
     
    6464Bd=anuga.Dirichlet_boundary([-0.1*scale_me,0.,0.])       # Constant boundary values -- not used in this example
    6565def waveform(t):
    66     return (0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
     66    return -0.1 #(0.0*sin(t*2*pi)-0.1)*exp(-t)-0.1
    6767Bt2=anuga.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain,waveform)
    6868#Bw=anuga.Time_boundary(domain=domain,
     
    7272# Associate boundary tags with boundary objects
    7373#----------------------------------------------
    74 domain.set_boundary({'left': Br, 'right': Bd, 'top': Br, 'bottom':Br})
     74domain.set_boundary({'left': Br, 'right': Bt2, 'top': Br, 'bottom':Br})
    7575
    7676#------------------------------
     
    7878#------------------------------
    7979
    80 for t in domain.evolve(yieldstep=0.2,finaltime=40.0):
     80for t in domain.evolve(yieldstep=0.200,finaltime=40.00):
    8181    print domain.timestepping_statistics()
    8282    xx = domain.quantities['xmomentum'].centroid_values
     
    8484    dd = domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values
    8585    dd_raw=1.0*dd
    86     dd = (dd)*(dd>1.0e-03)+1.0e-03
     86    dd = dd*(dd>1.0e-03)+1.0e-03*(dd<=1.0e-03)
    8787    vv = ( (xx/dd)**2 + (yy/dd)**2)**0.5
    8888    vv = vv*(dd>1.0e-03)
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py

    r8353 r8751  
    1515#------------------
    1616#v=(p.y==0.5)
    17 v=(p2.y==p2.y[80])
     17myind=(abs(p2.y-0.5)).argmin()
     18v=(p2.y==p2.y[myind])
    1819
    1920#--------------------
  • trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py

    r8549 r8751  
    2929# Setup computational domain
    3030#------------------------------------------------------------------------------
    31 points, vertices, boundary = rectangular_cross(10, 10,
    32                                 len1=100.0, len2=100.0) # Mesh
     31points, vertices, boundary = rectangular_cross(14, 10,
     32                                len1=140.0, len2=100.0) # Mesh
    3333domain = Domain(points, vertices, boundary) # Create domain
    3434domain.set_name('channel_SU_2_v2') # Output name
    35 #domain.set_store_vertices_uniquely(True)
    36 #domain.CFL=1.0
    3735#------------------------------------------------------------------------------
    3836# Setup initial conditions
    3937#------------------------------------------------------------------------------
    4038def topography(x, y):
    41         return -x/10. #+ numpy.sin(x/10.) +abs(y-50.)/100. # linear bed slope
     39        return -x/10. + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope
    4240
    4341def stagetopo(x,y):
    44     stg= -x/10. +0.06309625 # Constant depth
     42    stg= topography(x,y) + 0.163 #-x/10. +0.06309625 -50.*(x>80.)# Constant depth
    4543    #topo=topography(x,y)
    4644    return stg#*(stg>topo) + topo*(stg<=topo)
     
    6866#Bo = anuga.Transmissive_boundary(domain)
    6967#Bd = anuga.Dirichlet_boundary([-20., 0., 0.])
    70 domain.set_boundary({'left': Br, 'right': Bo, 'top': Br, 'bottom': Br})
     68domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom': Br})
    7169
    7270
Note: See TracChangeset for help on using the changeset viewer.