Ignore:
Timestamp:
Sep 26, 2013, 11:27:01 AM (12 years ago)
Author:
davies
Message:

First-draft Audusse-type solver in anuga_work/gareth/development/experimental/bal_and

Location:
trunk/anuga_work/development/gareth/tests/channel_floodplain
Files:
2 edited

Legend:

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

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

    r8867 r8990  
    1 import util
     1#import util
     2from bal_and import plot_utils as util
    23from matplotlib import pyplot as pyplot
    34#import pylab
    45
    56# Time-index to plot outputs from
    6 index=900
     7index=150
     8#index=900
    79
    810#p2 = util.get_output('channel_floodplain1_bal_dev.sww', minimum_allowed_height=0.01)
     
    2830
    2931# Numerical results along a central channel 'slice'
    30 V1 = p.stage[index,v] - p.elev[v]
     32V1 = p.stage[index,v] - p.elev[index,v]
    3133V2 = p.yvel[index,v]
    3234V3 = p.xvel[index,v]
     
    9092
    9193pyplot.clf()
    92 analytical_stage = min(p.elev[v1]) + dc_analytical
    93 analytic_vel = ( (1./300.)*(analytical_stage-p.elev[v1])**(4./3.)*(1./0.03)**2.)**0.5
    94 analytic_vel = analytic_vel*(analytical_stage>p.elev[v1])
     94analytical_stage = min(p.elev[index,v1]) + dc_analytical
     95analytic_vel = ( (1./300.)*(analytical_stage-p.elev[index,v1])**(4./3.)*(1./0.03)**2.)**0.5
     96analytic_vel = analytic_vel*(analytical_stage>p.elev[index,v1])
    9597pyplot.figure(figsize=(12.,8.))
    9698pyplot.plot(p.x[v1], p.yvel[index,v1],'o', label='computed velocity (m/s)')
    9799pyplot.plot(p.x[v1], analytic_vel,'o', label='analytical velocity (m/s)')
    98 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation (m)')
     100pyplot.plot(p.x[v1],p.elev[index,v1],'o', label='bed elevation (m)')
    99101pyplot.plot(p.x[v1],p.stage[index,v1],'o', label='computed stage (m)')
    100102pyplot.plot(p.x[v1],p.stage[index,v1]*0. + analytical_stage,'o', label='analytical stage (m)')
     
    109111
    110112pyplot.clf()
    111 analytical_stage = min(p.elev[v1]) + dc_analytical
    112 analytic_vel = ( (1./300.)*(analytical_stage-p.elev[v1])**(4./3.)*(1./0.03)**2.)**0.5
    113 analytic_vel = analytic_vel*(analytical_stage>p.elev[v1])
     113analytical_stage = min(p.elev[index,v1]) + dc_analytical
     114analytic_vel = ( (1./300.)*(analytical_stage-p.elev[index,v1])**(4./3.)*(1./0.03)**2.)**0.5
     115analytic_vel = analytic_vel*(analytical_stage>p.elev[index,v1])
    114116pyplot.figure(figsize=(12.,8.))
    115117pyplot.plot(p.x[v1], p.yvel[index,v1],'o', label='computed velocity (m/s)')
    116118pyplot.plot(p.x[v1], analytic_vel,'o', label='analytical velocity (m/s)')
    117 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation (m)')
     119pyplot.plot(p.x[v1],p.elev[index,v1],'o', label='bed elevation (m)')
    118120pyplot.plot(p.x[v1],p.stage[index,v1],'o', label='computed stage (m)')
    119121pyplot.plot(p.x[v1],p.stage[index,v1]*0. + analytical_stage,'o', label='analytical stage (m)')
     
    127129
    128130pyplot.clf()
    129 analytical_stage = min(p.elev[v1]) + dc_analytical
    130 analytic_vel = ( (1./300.)*(analytical_stage-p.elev[v1])**(4./3.)*(1./0.03)**2.)**0.5
    131 analytic_vel = analytic_vel*(analytical_stage>p.elev[v1])
     131analytical_stage = min(p.elev[index,v1]) + dc_analytical
     132analytic_vel = ( (1./300.)*(analytical_stage-p.elev[index,v1])**(4./3.)*(1./0.03)**2.)**0.5
     133analytic_vel = analytic_vel*(analytical_stage>p.elev[index,v1])
    132134pyplot.figure(figsize=(12.,8.))
    133135pyplot.plot(p.x[v1], p.yvel[index,v1],'o', label='computed velocity (m/s)')
    134136pyplot.plot(p.x[v1], analytic_vel,'o', label='analytical velocity (m/s)')
    135 pyplot.plot(p.x[v1],p.elev[v1],'o', label='bed elevation (m)')
     137pyplot.plot(p.x[v1],p.elev[index,v1],'o', label='bed elevation (m)')
    136138pyplot.plot(p.x[v1],p.stage[index,v1],'o', label='computed stage (m)')
    137139pyplot.plot(p.x[v1],p.stage[index,v1]*0. + analytical_stage,'o', label='analytical stage (m)')
Note: See TracChangeset for help on using the changeset viewer.