Changeset 9217


Ignore:
Timestamp:
Jun 24, 2014, 11:51:04 AM (10 years ago)
Author:
steve
Message:

Clean up of numerical script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/validation_tests/analytical_exact/trapezoidal_channel/numerical_channel_floodplain.py

    r9216 r9217  
    1010import anuga
    1111import numpy
    12 from anuga import Inlet_operator
    1312from anuga import myid, finalize, distribute
    1413
     
    2019alg = args.alg
    2120
    22 from project import *
     21#--------------------------------
     22# See project file for definitions of these
     23# variables
     24#--------------------------------
     25from project import \
     26          floodplain_length, floodplain_width, floodplain_slope,\
     27          chan_initial_depth, chan_bankfull_depth, chan_width, bankwidth, \
     28          man_n, l0
    2329
    24 # floodplain_length = 800.0 # Model domain length
    25 # floodplain_width = 14.0    # Model domain width
    26 # floodplain_slope = 1./300.
    27 # chan_initial_depth = 0.65  # Initial depth of water in the channel
    28 # chan_bankfull_depth = 1.0  # Bankfull depth of the channel
    29 # chan_width = 10.0          # Bankfull width of the channel
    30 # bankwidth = 2.             # Width of the bank regions -- note that these protrude into the channel
    31 # man_n=0.03                 # Manning's n
    32 # l0 = 1.00 # Length scale associated with triangle side length in channel (min_triangle area = 0.5*l0^2)
     30#l0 = 2.0
    3331
    3432assert chan_width < floodplain_width, \
     
    135133Qin = 0.5*(floodplain_slope*(chan_width*chan_initial_depth)**2.*man_n**(-2.)\
    136134            *chan_initial_depth**(4./3.) )**0.5
    137 Inlet_operator(domain, line1, Qin)
     135anuga.Inlet_operator(domain, line1, Qin)
    138136
    139137if myid == 0 and verbose : print 'Discharge in = ', Qin
     
    152150# or incorrect more generally if there are numerical problems. But, in the central regions of
    153151# the channel, this shouldn't prevent us reaching steady, uniform flow.
    154 Bout_tmss = anuga.shallow_water.boundaries.Transmissive_momentum_set_stage_boundary(domain, function = outflow_stage_boundary)
     152Bout_tmss = anuga.Transmissive_momentum_set_stage_boundary(domain, function = outflow_stage_boundary)
    155153
    156154domain.set_boundary({'left': Br,
     
    162160                     'chan_out': Bout_tmss,
    163161                     'chan_in': Br})
    164 
    165 # Set up file to record computations of discharge at several points.
    166 #discharge_outfile=open('discharge_outputs.txt', 'w')
    167 #discharge_outfile.write('Time (s)'+","+ 'Discharge@10' + ","+ 'Discharge@700'+","+ 'Discharge@1000' + "\n")
    168162
    169163
     
    185179    if myid == 0 and verbose: print domain.timestepping_statistics()
    186180
    187 ##     xx=domain.quantities['ymomentum'].centroid_values
    188 ##     dd=(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values)
    189 ##     dd=dd*(dd>0.)
    190 
    191 ##     tmp = xx/(dd+1.0e-06)*(dd>0.0)
    192 ##     print tmp.max(), tmp.argmax(), tmp.min(),  tmp.argmin()
    193 
    194 ##     # Compute flow through cross-section -- check that the inflow boundary condition is doing its job
    195 ##     # This also provides another useful steady-state check
    196 ##     if( numpy.floor(t/100.) == t/100. ):
    197 ##         print '#### COMPUTING FLOW THROUGH CROSS-SECTIONS########'
    198 ##         s0 = domain.get_flow_through_cross_section([[0., 10.0], [floodplain_width, 10.0]])
    199 ##         s1 = domain.get_flow_through_cross_section([[0., floodplain_length-300.0], [floodplain_width, floodplain_length-300.0]])
    200 ##         s2 = domain.get_flow_through_cross_section([[0., floodplain_length-1.0], [floodplain_width, floodplain_length-1.0]])
    201        
    202 ##         print 'Cross sectional flows: ',s0, s1, s2
    203 ##         print '$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$'
    204 ##         discharge_outfile.write(str(t) + "," +str(s0) + ","+ str(s1) +"," + str(s2) + "\n")
    205 
    206 ## discharge_outfile.close()
    207 
    208181domain.sww_merge(delete_old=True)
    209182
Note: See TracChangeset for help on using the changeset viewer.