Changeset 8921


Ignore:
Timestamp:
Jun 15, 2013, 5:50:23 PM (12 years ago)
Author:
steve
Message:

Adding in validation tests for carrier_greenspan_periodic and transient

Location:
trunk/anuga_core/source/anuga_validation_tests/analytical_exact
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/avalanche_dry/validate_avalanche_dry.py

    r8919 r8921  
    9999            print indent+'Errors in xmomentum: ',euh10, euh30
    100100
    101         print euh10
    102101
    103102        assert euh10 < 0.025,  'L^1 error %g greater than 2.5 percent'% euh10
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/carrier_greenspan_periodic/analytical_carrier_greenspan.py

    r8768 r8921  
    4545            jac = zeros((n,n))
    4646            if 1.0+q[0]-x<0.0:
    47                 print "Problem occurs i=",i
    48                 print "PROBLEM OCCURS.......... 1.0+q[0]-x=",1.0+q[0]-x
     47                #print "Problem occurs i=",i
     48                #print "PROBLEM OCCURS.......... 1.0+q[0]-x=",1.0+q[0]-x
    4949                q[0] = x-1.0 + 0.0001
    50                 print "NOW problem is fixed as  1.0+q[0]-x=",1.0+q[0]-x
     50                #print "NOW problem is fixed as  1.0+q[0]-x=",1.0+q[0]-x
    5151            f0 = f(q)
    5252            for i in range(n):
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/carrier_greenspan_periodic/plot_results_cross_section.py

    r8768 r8921  
    1313v2=(p2_st.y==v)
    1414
    15 W1, P1, Z1, H1, U1 = analytic_cg(p2_st.x[v2], p2_st.time[288], h0=5e2, L=5e4, a=1.0, Tp=900.0)
    16 W2, P2, Z2, H2, U2 = analytic_cg(p2_st.x[v2], p2_st.time[296], h0=5e2, L=5e4, a=1.0, Tp=900.0)
    17 W3, P3, Z3, H3, U3 = analytic_cg(p2_st.x[v2], p2_st.time[304], h0=5e2, L=5e4, a=1.0, Tp=900.0)
    18 W4, P4, Z4, H4, U4 = analytic_cg(p2_st.x[v2], p2_st.time[312], h0=5e2, L=5e4, a=1.0, Tp=900.0)
    19 W5, P5, Z5, H5, U5 = analytic_cg(p2_st.x[v2], p2_st.time[320], h0=5e2, L=5e4, a=1.0, Tp=900.0)
    20 W6, P6, Z6, H6, U6 = analytic_cg(p2_st.x[v2], p2_st.time[328], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     15x_n = p2_st.x[v2]
     16
     17W1, P1, Z1, H1, U1 = analytic_cg(x_n, p2_st.time[288], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     18W2, P2, Z2, H2, U2 = analytic_cg(x_n, p2_st.time[296], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     19W3, P3, Z3, H3, U3 = analytic_cg(x_n, p2_st.time[304], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     20W4, P4, Z4, H4, U4 = analytic_cg(x_n, p2_st.time[312], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     21W5, P5, Z5, H5, U5 = analytic_cg(x_n, p2_st.time[320], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     22W6, P6, Z6, H6, U6 = analytic_cg(x_n, p2_st.time[328], h0=5e2, L=5e4, a=1.0, Tp=900.0)
     23
     24W1_n = p2_st.stage[288,v2]
     25W2_n = p2_st.stage[296,v2]
     26W3_n = p2_st.stage[304,v2]
     27W4_n = p2_st.stage[312,v2]
     28W5_n = p2_st.stage[320,v2]
     29W6_n = p2_st.stage[328,v2]
     30
     31UH1_n = p2_st.xmom[288,v2]
     32UH2_n = p2_st.xmom[296,v2]
     33UH3_n = p2_st.xmom[304,v2]
     34UH4_n = p2_st.xmom[312,v2]
     35UH5_n = p2_st.xmom[320,v2]
     36UH6_n = p2_st.xmom[328,v2]
     37
     38U1_n = p2_st.xvel[288,v2]
     39U2_n = p2_st.xvel[296,v2]
     40U3_n = p2_st.xvel[304,v2]
     41U4_n = p2_st.xvel[312,v2]
     42U5_n = p2_st.xvel[320,v2]
     43U6_n = p2_st.xvel[328,v2]
    2144
    2245#Plot the stages##############################################################
    2346pyplot.clf()
    24 pyplot.plot(p2_st.x[v2], p2_st.stage[288,v2], 'b.', label='numerical') # 0*T/6
    25 pyplot.plot(p2_st.x[v2], p2_st.stage[296,v2], 'b.')                    # 1*T/6
    26 pyplot.plot(p2_st.x[v2], p2_st.stage[304,v2], 'b.')                     # 2*T/6
    27 pyplot.plot(p2_st.x[v2], p2_st.stage[312,v2], 'b.')                     # 3*T/6
    28 pyplot.plot(p2_st.x[v2], p2_st.stage[320,v2], 'b.')                     # 4*T/6
    29 pyplot.plot(p2_st.x[v2], p2_st.stage[328,v2], 'b.')  # 5*T/6
     47pyplot.plot(x_n, W1_n, 'b.', label='numerical') # 0*T/6
     48pyplot.plot(x_n, W2_n, 'b.')                     # 1*T/6
     49pyplot.plot(x_n, W3_n, 'b.')                     # 2*T/6
     50pyplot.plot(x_n, W4_n, 'b.')                     # 3*T/6
     51pyplot.plot(x_n, W5_n, 'b.')                     # 4*T/6
     52pyplot.plot(x_n, W6_n, 'b.')                     # 5*T/6
    3053
    31 pyplot.plot(p2_st.x[v2], W1,'r-', label='analytical')
    32 pyplot.plot(p2_st.x[v2], W2,'r-')
    33 pyplot.plot(p2_st.x[v2], W3,'r-')
    34 pyplot.plot(p2_st.x[v2], W4,'r-')
    35 pyplot.plot(p2_st.x[v2], W5,'r-')
    36 pyplot.plot(p2_st.x[v2], W6,'r-')
     54pyplot.plot(x_n, W1,'r-', label='analytical')
     55pyplot.plot(x_n, W2,'r-')
     56pyplot.plot(x_n, W3,'r-')
     57pyplot.plot(x_n, W4,'r-')
     58pyplot.plot(x_n, W5,'r-')
     59pyplot.plot(x_n, W6,'r-')
    3760
    3861
     
    4770#Plot the momentums##########################################################
    4871pyplot.clf()
    49 pyplot.plot(p2_st.x[v2], p2_st.xmom[288,v2], 'b.', label='numerical') # 0*T/6
    50 pyplot.plot(p2_st.x[v2], p2_st.xmom[296,v2], 'b.')                    # 1*T/6
    51 pyplot.plot(p2_st.x[v2], p2_st.xmom[304,v2], 'b.')                     # 2*T/6
    52 pyplot.plot(p2_st.x[v2], p2_st.xmom[312,v2], 'b.')                     # 3*T/6
    53 pyplot.plot(p2_st.x[v2], p2_st.xmom[320,v2], 'b.')                     # 4*T/6
    54 pyplot.plot(p2_st.x[v2], p2_st.xmom[328,v2], 'b.')  # 5*T/6
     72pyplot.plot(x_n, UH1_n, 'b.', label='numerical') # 0*T/6
     73pyplot.plot(x_n, UH2_n, 'b.')                     # 1*T/6
     74pyplot.plot(x_n, UH3_n, 'b.')                     # 2*T/6
     75pyplot.plot(x_n, UH4_n, 'b.')                     # 3*T/6
     76pyplot.plot(x_n, UH5_n, 'b.')                     # 4*T/6
     77pyplot.plot(x_n, UH6_n, 'b.')                     # 5*T/6
    5578
    56 pyplot.plot(p2_st.x[v2], P1,'r-', label='analytical')
    57 pyplot.plot(p2_st.x[v2], P2,'r-')
    58 pyplot.plot(p2_st.x[v2], P3,'r-')
    59 pyplot.plot(p2_st.x[v2], P4,'r-')
    60 pyplot.plot(p2_st.x[v2], P5,'r-')
    61 pyplot.plot(p2_st.x[v2], P6,'r-')
     79pyplot.plot(x_n, P1,'r-', label='analytical')
     80pyplot.plot(x_n, P2,'r-')
     81pyplot.plot(x_n, P3,'r-')
     82pyplot.plot(x_n, P4,'r-')
     83pyplot.plot(x_n, P5,'r-')
     84pyplot.plot(x_n, P6,'r-')
    6285
    6386pyplot.title('Xmomentum at several instants in time')
     
    7194#Plot the velocities#########################################################
    7295pyplot.clf()
    73 pyplot.plot(p2_st.x[v2], p2_st.xvel[288,v2], 'b.', label='numerical') # 0*T/6
    74 pyplot.plot(p2_st.x[v2], p2_st.xvel[296,v2], 'b.')                    # 1*T/6
    75 pyplot.plot(p2_st.x[v2], p2_st.xvel[304,v2], 'b.')                     # 2*T/6
    76 pyplot.plot(p2_st.x[v2], p2_st.xvel[312,v2], 'b.')                     # 3*T/6
    77 pyplot.plot(p2_st.x[v2], p2_st.xvel[320,v2], 'b.')                     # 4*T/6
    78 pyplot.plot(p2_st.x[v2], p2_st.xvel[328,v2], 'b.')  # 5*T/6
     96pyplot.plot(x_n, U1_n, 'b.', label='numerical') # 0*T/6
     97pyplot.plot(x_n, U2_n, 'b.')                     # 1*T/6
     98pyplot.plot(x_n, U3_n, 'b.')                     # 2*T/6
     99pyplot.plot(x_n, U4_n, 'b.')                     # 3*T/6
     100pyplot.plot(x_n, U5_n, 'b.')                     # 4*T/6
     101pyplot.plot(x_n, U6_n, 'b.')                     # 5*T/6
    79102
    80 pyplot.plot(p2_st.x[v2], U1,'r-', label='analytical')
    81 pyplot.plot(p2_st.x[v2], U2,'r-')
    82 pyplot.plot(p2_st.x[v2], U3,'r-')
    83 pyplot.plot(p2_st.x[v2], U4,'r-')
    84 pyplot.plot(p2_st.x[v2], U5,'r-')
    85 pyplot.plot(p2_st.x[v2], U6,'r-')
     103pyplot.plot(x_n, U1,'r-', label='analytical')
     104pyplot.plot(x_n, U2,'r-')
     105pyplot.plot(x_n, U3,'r-')
     106pyplot.plot(x_n, U4,'r-')
     107pyplot.plot(x_n, U5,'r-')
     108pyplot.plot(x_n, U6,'r-')
    86109
    87110pyplot.title('Xvelocity at several instants in time')
  • trunk/anuga_core/source/anuga_validation_tests/analytical_exact/carrier_greenspan_transient/plot_results.py

    r8773 r8921  
    1515#Dimensional parameters
    1616L   = 5e4         # Length of channel (m)     
    17 h0  = 5e2          # Height at origin when the water is still
     17h0  = 5e2         # Height at origin when the water is still
    1818g   = 9.81        # Gravity
    1919
     
    3535H2 = W2 - Z2              # dimensional
    3636P2 = U2 * H2              # dimensional
     37     
    3738
    3839W3 = W3*h0                # dimensional
     
    4142H3 = W3 - Z3              # dimensional
    4243P3 = U3 * H3              # dimensional
     44
     45
    4346
    4447#Plot the stages##############################################################
Note: See TracChangeset for help on using the changeset viewer.