Changeset 9056


Ignore:
Timestamp:
Mar 3, 2014, 9:58:02 AM (11 years ago)
Author:
davies
Message:

Minor updates to validation tests

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga/config.py

    r8974 r9056  
    126126#flow_algorithm = '2_0'    # 2nd order TVD scheme and more aggressive piecewise linear spatial reconstruction
    127127#flow_algorithm = '2.5'  # 3rd order TVD scheme and more aggressive piecewise linear spatial reconstruction
    128 
     128#flow_algorithm = 'tsunami' # 2nd order space and time, well balanced inc at wet-dry fronts, porosity-type alg
     129#flow_algorithm = 'DE1' # 2nd order space and time, discontinuous elevation, well balanced + better shallow flows than 'tsunami'
    129130
    130131
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/rundown_mild_slope_coarse/numerical_rundown_channel_coarse.py

    r9038 r9056  
    4141
    4242def init_stage(x,y):
    43     stg= -x/10.+0.01 # Constant depth: 1 cm.
     43    stg= -x/10.+0.10 # Constant depth: 10 cm.
    4444    return stg
    4545#line0=[ [0.,0.], [0., 100.] ]
     
    7979# Evolve system through time
    8080#------------------------------------------------------------------------------
    81 for t in domain.evolve(yieldstep=10.0, finaltime=800.0):
     81for t in domain.evolve(yieldstep=10.0, finaltime=2000.0):
    8282    print domain.timestepping_statistics()
    8383    print (domain.areas*(domain.quantities['stage'].centroid_values - domain.quantities['elevation'].centroid_values)).sum()
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/rundown_mild_slope_coarse/plot_results.py

    r9038 r9056  
    3131
    3232ll=p2.vel.shape[0]-1
     33
    3334#-------------------------------
    3435# Define variables of case study
     
    5556line.set_label('numerical')
    5657pyplot.plot( (0,100),(dana,dana), 'r',label='analytical' )
     58pyplot.yscale('log')
    5759pyplot.legend()
    5860#pyplot.plot(x[v],elev[v],'green')
     
    8486pyplot.title('Final Xvelocity around the line x=50.')
    8587pyplot.legend(loc='best')
     88pyplot.ylim((0,1.5*uana))
    8689pyplot.savefig('x_velocity.png')
    8790
  • trunk/anuga_core/source/anuga_validation_tests/case_studies/patong/project.py

    r8922 r9056  
    3535finaltime = 15000       # final time for simulation
    3636
     37nameFlag='xxNameFlagxx'
     38
    3739use_buildings = False   # FIXME: 6/6/2013 -- Code needs to be edited to support 'True'
    3840setup = 'basic'         # This can be one of three values
     
    5355#------------------------------------------------------------------------------
    5456
    55 output_comment = [setup, tide, event_number, 'final']
     57output_comment = [setup, tide, event_number, nameFlag]
    5658
    5759#------------------------------------------------------------------------------
  • trunk/anuga_core/source/anuga_validation_tests/case_studies/patong/run_model.py

    r8944 r9056  
    118118    domain.set_datadir(project.output_run)
    119119    domain.set_flow_algorithm('tsunami')
    120     domain.minimum_allowed_height=0.001
     120    #domain.set_flow_algorithm('DE1')
    121121
    122122    #-------------------------------------------------------------------------------
  • trunk/anuga_core/source/anuga_validation_tests/saved_parameters.tex

    r9038 r9056  
    33\newcommand{\majorR}{\UScore{1.3.0-beta}}
    44\newcommand{\minorR}{\UScore{9003}}
    5 \newcommand{\timeR}{{Thu Dec  5 15:39:13 2013}}
     5\newcommand{\timeR}{{Sun Feb 16 20:16:29 2014}}
  • trunk/anuga_work/development/gareth/experimental/bal_and/swb2_domain.py

    r9039 r9056  
    7373
    7474        self.beta_w=1.0
    75         self.beta_w_dry=0.4
     75        self.beta_w_dry=0.0
    7676        self.beta_uh=1.0
    7777        self.beta_uh_dry=0.0
  • trunk/anuga_work/development/gareth/experimental/bal_and/swb2_domain_ext.c

    r9039 r9056  
    242242      if(i==0) edgeflux[i] += (s_max*s_min)*(max(q_right_rotated[i],ze) - max(q_left_rotated[i],ze));
    243243      //if(i==0) edgeflux[i] += (s_max*s_min)*(hre - hle);
    244       if(i==1) edgeflux[i] += (s_max*s_min)*(uh_right - uh_left);
    245       if(i==2) edgeflux[i] += (s_max*s_min)*(vh_right - vh_left);
     244      if((i==1)) edgeflux[i] += (s_max*s_min)*(uh_right - uh_left);
     245      //if((i==1)) edgeflux[i] += (s_max*s_min)*(uh_right/(h_right+1.0e-08)*hre - uh_left/(h_left+1.0e-08)*hle);
     246      if((i==2)) edgeflux[i] += (s_max*s_min)*(vh_right - vh_left);
     247      //if((i==2)) edgeflux[i] += (s_max*s_min)*(vh_right/(h_right+1.0e-08)*hre - vh_left/(h_left+1.0e-08)*hle);
    246248
    247249      edgeflux[i] *= inverse_denominator;
     
    538540    for(k=0; k<number_of_elements; k++){
    539541        hc = max(stage_centroid_values[k] - bed_centroid_values[k],0.);
    540         stage_explicit_update[k]=0.;
    541         xmom_explicit_update[k]=0.;
    542         ymom_explicit_update[k]=0.;
     542        //stage_explicit_update[k]=0.;
     543        //xmom_explicit_update[k]=0.;
     544        //ymom_explicit_update[k]=0.;
    543545
    544546        for(i=0;i<3;i++){
     
    751753  double dx1, dx2, dy1, dy2, dxv0, dxv1, dxv2, dyv0, dyv1, dyv2, dq0, dq1, dq2, area2, inv_area2, dpth,momnorm;
    752754  double dqv[3], qmin, qmax, hmin, hmax, bedmax,bedmin, stagemin;
    753   double hc, h0, h1, h2, beta_tmp, hfactor, xtmp, ytmp, weight, tmp;
     755  double hc, h0, h1, h2, beta_tmp, hfactor, xtmp, ytmp, weight, tmp, v0, v1, v2, vmax,vmin, vc;
    754756  double dk, dv0, dv1, dv2, de[3], demin, dcmax, r0scale, vel_norm, l1, l2, a_tmp, b_tmp, c_tmp,d_tmp;
    755757 
     
    845847  // condition) set its momentum to zero too. Aim is to prevent local 'pits'
    846848  // with a non-zero water surface gradient building up momentum over time
    847   for (k=0; k<number_of_elements;k++){
    848 
    849       k3=k*3;
    850       k0 = surrogate_neighbours[k3];
    851       k1 = surrogate_neighbours[k3 + 1];
    852       k2 = surrogate_neighbours[k3 + 2];
    853 
    854       if((height_centroid_values[k0] < minimum_allowed_height | k0==k) &
    855          (height_centroid_values[k1] < minimum_allowed_height | k1==k) &
    856          (height_centroid_values[k2] < minimum_allowed_height | k2==k)){
    857               xmom_centroid_store[k] = 0.;
    858               xmom_centroid_values[k] = 0.;
    859               ymom_centroid_store[k] = 0.;
    860               ymom_centroid_values[k] = 0.;
    861 
    862       }
    863   }
     849  //for (k=0; k<number_of_elements;k++){
     850  //
     851  //    k3=k*3;
     852  //    k0 = surrogate_neighbours[k3];
     853  //    k1 = surrogate_neighbours[k3 + 1];
     854  //    k2 = surrogate_neighbours[k3 + 2];
     855  //
     856  //    if((height_centroid_values[k0] < minimum_allowed_height | k0==k) &
     857  //       (height_centroid_values[k1] < minimum_allowed_height | k1==k) &
     858  //       (height_centroid_values[k2] < minimum_allowed_height | k2==k)){
     859  //            xmom_centroid_store[k] = 0.;
     860  //            xmom_centroid_values[k] = 0.;
     861  //            ymom_centroid_store[k] = 0.;
     862  //            ymom_centroid_values[k] = 0.;
     863
     864  //    }
     865  //}
    864866
    865867  // Begin extrapolation routine
     
    10521054      hmin = min(min(h0, min(h1, h2)), hc);
    10531055      hmax = max(max(h0, max(h1, h2)), hc);
     1056
     1057      //vc = sqrt(xmom_centroid_values[k]*xmom_centroid_values[k]+
     1058      //          ymom_centroid_values[k]*ymom_centroid_values[k]);
     1059      //v0 = sqrt(xmom_centroid_values[k0]*xmom_centroid_values[k0]+
     1060      //          ymom_centroid_values[k0]*ymom_centroid_values[k0]);
     1061      //v1 = sqrt(xmom_centroid_values[k1]*xmom_centroid_values[k1]+
     1062      //          ymom_centroid_values[k1]*ymom_centroid_values[k1]);
     1063      //v2 = sqrt(xmom_centroid_values[k2]*xmom_centroid_values[k2]+
     1064      //          ymom_centroid_values[k2]*ymom_centroid_values[k2]);
     1065      //vmax=max(max(v0*h0,max(v1*h1,v2*h2)),vc*hc);
     1066      //vmin=min(min(v0*h0,min(v1*h1,v2*h2)),vc*hc);
    10541067
    10551068      // Look for strong changes in cell depth as an indicator of near-wet-dry
     
    10751088      // Set hfactor to 0 smoothly as hmin --> minumum_allowed_height
    10761089      hfactor=min( 1.2*max(hmin-minimum_allowed_height,0.)/(max(hmin,0.)+1.*minimum_allowed_height), hfactor);
     1090
     1091      //hfactor=min(1.5*max(vmin,0.)/(max(vmax,0.)+1.0e-06), hfactor);
    10771092      //hfactor=min( 1.2*max(hc-minimum_allowed_height,0.)/(max(hc,0.)+1.*minimum_allowed_height), hfactor);
    10781093
     
    12521267
    12531268      // Limit the gradient
    1254       limit_gradient(dqv, qmin, qmax, beta_tmp);
     1269       limit_gradient(dqv, qmin, qmax, beta_tmp);
    12551270     
    12561271      for (i=0;i<3;i++)
  • trunk/anuga_work/development/gareth/tests/channel_floodplain/channel_floodplain1.py

    r9053 r9056  
    8888domain.set_name('channel_floodplain1') # Output name
    8989#domain.set_store_vertices_uniquely(True)
     90domain.set_flow_algorithm('DE1')
    9091#domain.use_edge_limiter=False
    9192#domain.extrapolate_velocity_second_order=False
  • trunk/anuga_work/development/gareth/tests/channel_floodplain/plotme.py

    r9022 r9056  
    11#import util
    2 from bal_and import plot_utils as util
     2#from bal_and import plot_utils as util
     3from anuga.utilities import plot_utils as util
    34from matplotlib import pyplot as pyplot
    45#import pylab
     
    78#index=40
    89index=570
     10#index=225
    911
    1012#p2 = util.get_output('channel_floodplain1_bal_dev.sww', minimum_allowed_height=0.01)
     
    1315
    1416#p2 = util.get_output('channel_floodplain1_bal_dev_lowvisc.sww', 0.01)
    15 p2 = util.get_output('channel_floodplain1.sww', 0.01)
     17p2 = util.get_output('channel_floodplain1.sww', 0.001)
    1618p=util.get_centroids(p2, velocity_extrapolation=True)
    1719
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoid.py

    r9053 r9056  
    2828#domain.set_store_centroids(True)
    2929#domain.set_timestepping_method('euler')
    30 domain.set_flow_algorithm('DE1')
     30#domain.set_flow_algorithm('DE1')
     31domain.set_flow_algorithm('tsunami')
    3132domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2,
    3233         'ymomentum': 2, 'elevation': 2})
    33 domain.minimum_storable_height=1.0e-03
     34#domain.minimum_storable_height=1.0e-03
    3435domain.set_store_vertices_uniquely()
    3536#------------------
  • trunk/anuga_work/development/gareth/tests/runup_sinusoid/runup_sinusoidplot.py

    r9022 r9056  
    55#---------------
    66#import util
    7 from bal_and import plot_utils as util
     7#from bal_and import plot_utils as util
     8from anuga.utilities import plot_utils as util
    89from matplotlib import pyplot as pyplot
    910import numpy
  • trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_2plot.py

    r9031 r9056  
    99import scipy
    1010from matplotlib import pyplot as pyplot
    11 #from anuga.utilities import plot_utils as util
    12 from bal_and import plot_utils as util
     11from anuga.utilities import plot_utils as util
     12#from bal_and import plot_utils as util
    1313#--------------
    1414# Get variables
     
    6161    pyplot.ylabel('depth (m)')
    6262
    63 pyplot.title('Flow depth at 400s -- there should be a central region with steady uniform flow ' )
     63pyplot.title('Flow depth at end of simulation -- there should be a central region with steady uniform flow ' )
    6464pyplot.savefig('final_depth_v2.png')
    6565
     
    8383v=(p2.x==p2.x[tmp])
    8484
     85ll=p2.vel.shape[0]-1
    8586#--------------------------------------------------
    8687# Check if y velocity is zero everywhere (it should be)
    8788#--------------------------------------------------
    8889pyplot.clf()
    89 pyplot.plot(p2.y[v],p2.yvel[100,v],'o', label='Numerical')
     90pyplot.plot(p2.y[v],p2.yvel[ll,v],'o', label='Numerical')
    9091pyplot.plot((0,100),(0.0, 0.0),label='Analytical')
    9192pyplot.xlabel('Distance along the line x==50 (across the slope) (m)')
     
    9798
    9899pyplot.clf()
    99 pyplot.plot(p2.y[v],p2.xvel[100,v], 'o', label='Numerical')
     100pyplot.plot(p2.y[v],p2.xvel[ll,v], 'o', label='Numerical')
    100101pyplot.plot((0,100),(uana,uana),label='Analytical')
    101102#pyplot.ylim([1.0,3.0])
  • trunk/anuga_work/development/gareth/tests/shallow_steep_slope/channel_SU_sparse.py

    r9051 r9056  
    3737#------------------------------------------------------------------------------
    3838def topography(x, y):
    39         return -x/10.  + 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope
     39        return -x/10.  #+ 1.*(numpy.sin(x/10.) +abs(y-50.)/10.) -0.*(x>80.) # linear bed slope
    4040
    4141def stagetopo(x,y):
  • trunk/anuga_work/development/gareth/tests/wave_runup/plotme.py

    r8867 r9056  
    6666for i in range(len(model_shore_x)):
    6767    # Compute index of shoreline
    68     vtmp = p2.stage[i,:]>p2.elev+shoreline_depth_thresh1
     68    #vtmp = p2.stage[i,:]>p2.elev+shoreline_depth_thresh1
     69    #model_shore_x[i]=p2.x[vtmp].min()
    6970   
    70     model_shore_x[i]=p2.x[vtmp].min()
     71    vtmp = p2.stage[i,:]<p2.elev+shoreline_depth_thresh1
     72    model_shore_x[i]=p2.x[vtmp].max()
     73    vtmp2=(p2.x>model_shore_x[i])
     74    model_shore_x[i]=p2.x[vtmp2].min()
    7175    #v_ind=(p2.stage[i,vtmp]-p2.elev[vtmp]).argmin()
    7276    # Store x and xvel
     
    7680    # Extract shoreline velocity. It is tricky, to avoid getting
    7781    # zero velocity points -- might be a better way to do it?
    78     vtmp2= (p2.stage[i,:]>p2.elev+shoreline_depth_thresh1)*\
    79            (p2.stage[i,:]<p2.elev+shoreline_depth_thresh2)
    80     mloc=abs(p2.xvel[i,vtmp2]).argmax()
     82    #vtmp2= (p2.stage[i,:]>p2.elev+shoreline_depth_thresh1)*\
     83    #       (p2.stage[i,:]<p2.elev+shoreline_depth_thresh2)
     84    #mloc=abs(p2.xvel[i,vtmp2]).argmax()
     85
    8186    #print abs(p2.xvel[i,vtmp2]).max(), mloc
    82     model_shore_u[i]=p2.xvel[i,vtmp2][mloc]
     87    #model_shore_u[i]=p2.xvel[i,vtmp2][mloc]
    8388    #vtmp2 = (p2.stage[i,:]>p2.elev+0.01)
    8489    #mloc= (vtmp2*(p2.stage[i,:]-p2.elev)).argmin()
    8590    #model_shore_u[i] = p2.xvel[i,mloc]
     91   
     92    vtmp2=vtmp
     93    mloc=model_shore_x[i]
     94    model_shore_u[i] = p2.xvel[i,p2.x==model_shore_x[i]].max()
    8695
    8796pyplot.plot(p2.time, model_shore_x-200.,'-o')
  • trunk/anuga_work/development/gareth/tests/wave_runup/runup.py

    r9038 r9056  
    1010
    1111from math import sin, pi, exp
    12 from bal_and import *
    13 #from anuga import Domain as Domain
     12#from bal_and import *
     13from anuga import Domain as Domain
    1414
    1515#from anuga_tsunami import *
     
    3232domain.set_datadir('.')                          # Use current folder
    3333#domain.set_quantities_to_be_stored({'stage': 2, 'xmomentum': 2, 'ymomentum': 2, 'elevation': 1})
    34 #domain.set_flow_algorithm('DE1')
     34domain.set_flow_algorithm('DE1')
    3535#------------------
    3636# Define topography
Note: See TracChangeset for help on using the changeset viewer.