Ignore:
Timestamp:
Mar 11, 2008, 8:43:22 PM (17 years ago)
Author:
steve
Message:

Updated some methods for quantity. Looks like we can use old
limiting system with larger values of beta.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/convergence_study/convergence_structured.py

    r4992 r5162  
    1717from anuga.shallow_water import Transmissive_boundary
    1818from anuga.shallow_water import Transmissive_Momentum_Set_Stage_boundary
    19 from anuga.geospatial_data.geospatial_data import *
     19#from anuga.geospatial_data.geospatial_data import *
    2020from math import cos
     21from Numeric import zeros, Float
    2122
    2223#------------------------------------------------------------------------------
    2324# Setup computational domain
    2425#------------------------------------------------------------------------------
    25 dx = 1000.
     26dx = 200.
    2627dy = dx
    2728L = 100000.
     
    3334domain = Domain(points, vertices, boundary)
    3435
    35 domain.set_timestepping_method('euler')
     36domain.set_timestepping_method('rk2')
    3637domain.set_default_order(2)
    3738domain.set_name('myexample9')               
    3839domain.set_datadir('.')                     # Use current directory for output
    3940
    40 domain.beta_w      = 1.0
    41 domain.beta_w_dry  = 0.2
    42 domain.beta_uh     = 1.0
    43 domain.beta_uh_dry = 0.2
    44 domain.beta_vh     = 1.0
    45 domain.beta_vh_dry = 0.2
    46 domain.beta_h      = 1.0
     41domain.set_all_limiters(0.9)
     42
     43print domain.beta_w
     44domain.use_old_limiter = False
     45domain.CFL = 1.0
    4746
    4847#------------------------------------------------------------------------------
     
    5049#------------------------------------------------------------------------------
    5150#domain.set_quantity('elevation', topography) # Use function for elevation
    52 domain.set_quantity('elevation',-100)
     51domain.set_quantity('elevation',0.0)
    5352domain.set_quantity('friction', 0.00)
    54 domain.set_quantity('stage', 0.0)           
     53
     54h0 = 10.0
     55h1 = 1.0
     56
     57def height(x,y):
     58    z = zeros(len(x),Float)
     59    for i in range(len(x)):
     60        if x[i]<=50000.0:
     61            z[i] = h0
     62        else:
     63            z[i] = h1
     64    return z
     65
     66
     67domain.set_quantity('stage', height)
     68#domain.set_quantity('stage', 0.0)           
    5569
    5670#-----------------------------------------------------------------------------
     
    6579Bw = Time_boundary(domain=domain,     # Time dependent boundary 
    6680## Sine wave
    67                    f=lambda t: [(-amplitude*sin((1./300.)*t*2*pi)), 0.0, 0.0])
     81#                   f=lambda t: [(-amplitude*sin((1./300.)*t*2*pi)), 0.0, 0.0])
     82## Single wave
     83                   f=lambda t: [h0, 0.0, 0.0])
    6884## Sawtooth?
    6985#                   f=lambda t: [(-8.0*(sin((1./180.)*t*2*pi))+(1./2.)*sin((2./180.)*t*2*pi)+(1./3.)*sin((3./180.)*t*2*pi)), 0.0, 0.0])
     
    92108#------------------------------------------------------------------------------
    93109
    94 for t in domain.evolve(yieldstep = 20.0, finaltime = 10*40*60.):
     110for t in domain.evolve(yieldstep = 50.0, finaltime = 10*40*60.):
    95111    domain.write_time()
    96112    vis.update()
Note: See TracChangeset for help on using the changeset viewer.