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

Major experimental changes to balanced_dev

Location:
trunk/anuga_work/development/gareth/tests
Files:
13 edited

Legend:

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

    r8446 r8547  
    1414#from anuga import *
    1515#from balanced_basic import *
    16 from balanced_dev import *
     16#from balanced_dev import *
     17from anuga_tsunami import *
    1718#from balanced_basic.swb2_domain import *
    1819#from balanced_basic.swb2_domain import Domain
  • trunk/anuga_work/development/gareth/tests/channel_floodplain/plotme.py

    r8446 r8547  
    44
    55# Time-index to plot outputs from
    6 index=60
     6index=1200
    77
    88#p2 = util.get_output('channel_floodplain1_bal_dev.sww', minimum_allowed_height=0.01)
  • trunk/anuga_work/development/gareth/tests/dam_break/dam_break.py

    r8353 r8547  
    1515from time import localtime, strftime, gmtime
    1616from balanced_dev import *
     17#from anuga_tsunami import *
    1718
    1819
  • trunk/anuga_work/development/gareth/tests/dam_break/plotme.py

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

    r8396 r8547  
    2929#from balanced_basic import *
    3030from balanced_dev import *
     31#from anuga_tsunami import *
    3132
    3233from anuga import Reflective_boundary
  • trunk/anuga_work/development/gareth/tests/okushiri/run_okushiri.py

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

    r8353 r8547  
    99
    1010from balanced_dev import *
     11#from anuga_tsunami import *
    1112#from balanced_basic import *
    1213#from anuga.shallow_water_balanced2.swb2_domain import Domain as Domain
     
    2122domain.set_datadir('.')                          # Use current folder
    2223domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
    23 domain.set_minimum_allowed_height(0.01)
     24domain.set_minimum_allowed_height(0.001)
    2425# Time stepping
    2526#domain.set_timestepping_method('euler') # Default
  • trunk/anuga_work/development/gareth/tests/runup/runup.py

    r8446 r8547  
    1919#from balanced_basic import *
    2020from balanced_dev import *
     21#from anuga_tsunami import *
    2122#---------
    2223#Setup computational domain
     
    4546domain.get_quantity('elevation').smooth_vertex_values() # Steve's fix -- without this, substantial artificial velcities are generated everywhere in the domain. With this fix, there are artificial velocities near the coast, but not elsewhere.
    4647
    47 domain.set_quantity('friction',0.00)             # Constant friction
     48domain.set_quantity('friction',0.10)             # Constant friction
    4849
    4950domain.set_quantity('stage', stagefun)              # Constant negative initial stage
     
    6162# Associate boundary tags with boundary objects
    6263#----------------------------------------------
    63 domain.set_boundary({'left': Br, 'right': Bw, 'top': Br, 'bottom':Br})
     64domain.set_boundary({'left': Br, 'right': Br, 'top': Br, 'bottom':Br})
    6465
    6566#------------------------------
  • 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'
  • trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_2plot.py

    r8466 r8547  
    1717
    1818#------------------
    19 # Select line
     19# Select line along which we plot
    2020#------------------
    2121#v=(y==2.5)
    22 v=(p2.y==p2.y[3])
     22tmp = abs(p2.y-50.)
     23n = tmp.argmin()
     24v=(p2.y==p2.y[n])
    2325
    2426#-------------------------------
  • trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py

    r8359 r8547  
    33"""
    44import sys
    5 
     5import numpy
    66#---------------
    77# I am having trouble with my environmental variables -- this is a
     
    2424from balanced_dev import *
    2525from balanced_dev import Domain as Domain
     26#from anuga_tsunami import *
     27#from anuga_tsunami import Domain as Domain
    2628#------------------------------------------------------------------------------
    2729# Setup computational domain
     
    3739#------------------------------------------------------------------------------
    3840def topography(x, y):
    39         return -x/10. #+abs(y-2.5)/10. # linear bed slope
     41        return -x/10. + numpy.sin(x/10.) +abs(y-50.)/100. # linear bed slope
    4042
    4143def stagetopo(x,y):
     
    4446    return stg#*(stg>topo) + topo*(stg<=topo)
    4547
    46 line1=[ [0.,0.], [0., 100.] ]
     48line1=[ [10.,0.], [10., 100.] ]
    4749Qin=20.
    4850Inlet_operator(domain, line1,Qin)
     
    6062
    6163def constant_water(t):
    62     return -9.936903
     64    return -8.936903
    6365
    64 #Bo= anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, constant_water) # Outflow for steady uniform flow with a depth integrated velocity of 0.1
    65 Bo = anuga.Transmissive_boundary(domain)
     66Bo= anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, constant_water) # Outflow for steady uniform flow with a depth integrated velocity of 0.1
     67#Bo = anuga.Transmissive_boundary(domain)
     68#Bd = anuga.Dirichlet_boundary([-20., 0., 0.])
    6669domain.set_boundary({'left': Br, 'right': Bo, 'top': Br, 'bottom': Br})
     70
    6771#------------------------------------------------------------------------------
    6872# Evolve system through time
  • trunk/anuga_work/development/gareth/tests/urban_flow/ideal_urban.py

    r8450 r8547  
    1212#from anuga.structures.inlet_operator import Inlet_operator
    1313
    14 from balanced_dev import *
    15 from balanced_dev import create_domain_from_regions as create_domain_from_regions
     14#from balanced_dev import *
     15#from balanced_dev import create_domain_from_regions as create_domain_from_regions
     16from anuga_tsunami import *
     17from anuga_tsunami import create_domain_from_regions as create_domain_from_regions
    1618#------------------------------------------------------------------------------
    1719# Useful parameters for controlling this case
  • trunk/anuga_work/development/gareth/tests/wave/run_wave.py

    r8446 r8547  
    1414#from anuga import Domain
    1515
    16 from balanced_dev import *
     16#from balanced_dev import *
     17from anuga_tsunami import *
    1718#from balanced_dev import Domain as Domain
    1819
     
    104105
    105106Bw2 = anuga.shallow_water.boundaries.Transmissive_n_momentum_zero_t_momentum_set_stage_boundary(domain, waveform)
    106 Bf_in = swb2_boundary_conditions.Characteristic_boundary(domain, waveform)
     107#Bf_in = swb2_boundary_conditions.Characteristic_boundary(domain, waveform)
    107108#Bw3 = swb2_boundary_conditions.Transmissive_momentum_nudge_stage_boundary(domain, waveform)
    108 Bf=swb2_boundary_conditions.Characteristic_boundary(domain,waveform2)
     109#Bf=swb2_boundary_conditions.Characteristic_boundary(domain,waveform2)
    109110                   
    110111
    111112
    112113# Associate boundary tags with boundary objects
    113 domain.set_boundary({'left': Bw2, 'right': Bf, 'top': Br, 'bottom': Br})
     114domain.set_boundary({'left': Bw2, 'right': Bt, 'top': Br, 'bottom': Br})
    114115
    115116
Note: See TracChangeset for help on using the changeset viewer.