Ignore:
Timestamp:
Mar 7, 2012, 9:49:06 PM (13 years ago)
Author:
davies
Message:

Updates to balanced_dev and associated tests

File:
1 edited

Legend:

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

    r8309 r8353  
    1010import numpy
    1111from anuga.structures.inlet_operator import Inlet_operator
    12 
     12from anuga import *
     13#from swb_domain import domain
    1314#from anuga import *
    1415#from balanced_basic import *
     
    2324floodplain_width = 14.0 # Model domain width
    2425floodplain_slope = 1./300.
    25 chan_initial_depth = 0.8 # Initial depth of water in the channel
     26chan_initial_depth = 0.65 # Initial depth of water in the channel
    2627chan_bankfull_depth = 1.0 # Bankfull depth of the channel
    2728chan_width = 10.0 # Bankfull width of the channel
    2829bankwidth = 2. # Width of the bank regions -- note that these protrude into the channel
    2930man_n=0.03 # Manning's n
    30 l0 = 2.009 # Length scale associated with triangle side length in channel (min_triangle area = 0.5*l0^2)
     31l0 = 1.000 # Length scale associated with triangle side length in channel (min_triangle area = 0.5*l0^2)
    3132
    3233assert chan_width < floodplain_width, \
     
    8182
    8283
    83 domain.set_name('channel_floodplain1_test') # Output name
    84 domain.extrapolate_velocity_second_order=True
     84domain.set_name('channel_floodplain1_bal_dev_lowvisc') # Output name
     85#domain.set_store_vertices_uniquely(True)
     86#domain.use_edge_limiter=False
     87#domain.extrapolate_velocity_second_order=False
    8588#------------------------------------------------------------------------------
    8689#
     
    139142
    140143# Define inlet operator
     144flow_in_yval=100.0
    141145if True:
    142     line1 = [ [floodplain_width/2. - chan_width/2., 0.],\
    143               [floodplain_width/2. + chan_width/2., 0.] \
     146    line1 = [ [floodplain_width/2. - chan_width/2., flow_in_yval],\
     147              [floodplain_width/2. + chan_width/2., flow_in_yval] \
    144148              ]
    145149    Qin = 0.5*(floodplain_slope*(chan_width*chan_initial_depth)**2.*man_n**(-2.)\
     
    191195Br = anuga.Reflective_boundary(domain) # Solid reflective wall
    192196Bt = anuga.Transmissive_boundary(domain) # Transmissive boundary
    193 #Bout_sub = anuga.Dirichlet_boundary( \
    194 #        [-floodplain_length*floodplain_slope - chan_bankfull_depth + \
    195 #        chan_initial_depth, 0., 0.]) #An outflow boundary for subcritical steady flow
     197
     198
     199Bout_sub = anuga.Dirichlet_boundary( \
     200        [-floodplain_length*floodplain_slope - chan_bankfull_depth + \
     201        chan_initial_depth, 0., 0.]) #An outflow boundary for subcritical steady flow
    196202
    197203def outflow_stage_boundary(t):
     
    226232#------------------------------------------------------------------------------
    227233
    228 for t in domain.evolve(yieldstep=1.0, finaltime=800.0):
     234for t in domain.evolve(yieldstep=2.0, finaltime=3200.0):
    229235    print domain.timestepping_statistics()
     236    xx=domain.quantities['ymomentum'].centroid_values
     237    dd=(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values)
     238    dd=dd*(dd>0.)
     239
     240    tmp = xx/(dd+1.0e-06)*(dd>0.0)
     241    print tmp.max(), tmp.argmax(), tmp.min(),  tmp.argmin()
     242
     243    # Compute flow through cross-section -- check that the inflow boundary condition is doing its job
     244    # This also provides another useful steady-state check
     245    if( numpy.floor(t/100.) == t/100. ):
     246        print '#### COMPUTING FLOW THROUGH CROSS-SECTIONS########'
     247        s1 = domain.get_flow_through_cross_section([[0., floodplain_length-300.0], [floodplain_width, floodplain_length-300.0]])
     248        s2 = domain.get_flow_through_cross_section([[0., floodplain_length-1.0], [floodplain_width, floodplain_length-1.0]])
     249       
     250        print 'Cross sectional flows: ', s1, s2
     251        print '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'
     252
     253    #vv = domain.get_flow_through_cross_section
    230254    #print domain.quantities['ymomentum'].get_integral()
    231255    #print 'Qin = ', Qin
Note: See TracChangeset for help on using the changeset viewer.