Changeset 8921
- Timestamp:
- Jun 15, 2013, 5:50:23 PM (12 years ago)
- 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 99 99 print indent+'Errors in xmomentum: ',euh10, euh30 100 100 101 print euh10102 101 103 102 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 45 45 jac = zeros((n,n)) 46 46 if 1.0+q[0]-x<0.0: 47 print "Problem occurs i=",i48 print "PROBLEM OCCURS.......... 1.0+q[0]-x=",1.0+q[0]-x47 #print "Problem occurs i=",i 48 #print "PROBLEM OCCURS.......... 1.0+q[0]-x=",1.0+q[0]-x 49 49 q[0] = x-1.0 + 0.0001 50 print "NOW problem is fixed as 1.0+q[0]-x=",1.0+q[0]-x50 #print "NOW problem is fixed as 1.0+q[0]-x=",1.0+q[0]-x 51 51 f0 = f(q) 52 52 for i in range(n): -
trunk/anuga_core/source/anuga_validation_tests/analytical_exact/carrier_greenspan_periodic/plot_results_cross_section.py
r8768 r8921 13 13 v2=(p2_st.y==v) 14 14 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) 15 x_n = p2_st.x[v2] 16 17 W1, P1, Z1, H1, U1 = analytic_cg(x_n, p2_st.time[288], h0=5e2, L=5e4, a=1.0, Tp=900.0) 18 W2, P2, Z2, H2, U2 = analytic_cg(x_n, p2_st.time[296], h0=5e2, L=5e4, a=1.0, Tp=900.0) 19 W3, P3, Z3, H3, U3 = analytic_cg(x_n, p2_st.time[304], h0=5e2, L=5e4, a=1.0, Tp=900.0) 20 W4, P4, Z4, H4, U4 = analytic_cg(x_n, p2_st.time[312], h0=5e2, L=5e4, a=1.0, Tp=900.0) 21 W5, P5, Z5, H5, U5 = analytic_cg(x_n, p2_st.time[320], h0=5e2, L=5e4, a=1.0, Tp=900.0) 22 W6, P6, Z6, H6, U6 = analytic_cg(x_n, p2_st.time[328], h0=5e2, L=5e4, a=1.0, Tp=900.0) 23 24 W1_n = p2_st.stage[288,v2] 25 W2_n = p2_st.stage[296,v2] 26 W3_n = p2_st.stage[304,v2] 27 W4_n = p2_st.stage[312,v2] 28 W5_n = p2_st.stage[320,v2] 29 W6_n = p2_st.stage[328,v2] 30 31 UH1_n = p2_st.xmom[288,v2] 32 UH2_n = p2_st.xmom[296,v2] 33 UH3_n = p2_st.xmom[304,v2] 34 UH4_n = p2_st.xmom[312,v2] 35 UH5_n = p2_st.xmom[320,v2] 36 UH6_n = p2_st.xmom[328,v2] 37 38 U1_n = p2_st.xvel[288,v2] 39 U2_n = p2_st.xvel[296,v2] 40 U3_n = p2_st.xvel[304,v2] 41 U4_n = p2_st.xvel[312,v2] 42 U5_n = p2_st.xvel[320,v2] 43 U6_n = p2_st.xvel[328,v2] 21 44 22 45 #Plot the stages############################################################## 23 46 pyplot.clf() 24 pyplot.plot( p2_st.x[v2], p2_st.stage[288,v2], 'b.', label='numerical')# 0*T/625 pyplot.plot( p2_st.x[v2], p2_st.stage[296,v2], 'b.')# 1*T/626 pyplot.plot( p2_st.x[v2], p2_st.stage[304,v2], 'b.') # 2*T/627 pyplot.plot( p2_st.x[v2], p2_st.stage[312,v2], 'b.') # 3*T/628 pyplot.plot( p2_st.x[v2], p2_st.stage[320,v2], 'b.') # 4*T/629 pyplot.plot( p2_st.x[v2], p2_st.stage[328,v2], 'b.')# 5*T/647 pyplot.plot(x_n, W1_n, 'b.', label='numerical') # 0*T/6 48 pyplot.plot(x_n, W2_n, 'b.') # 1*T/6 49 pyplot.plot(x_n, W3_n, 'b.') # 2*T/6 50 pyplot.plot(x_n, W4_n, 'b.') # 3*T/6 51 pyplot.plot(x_n, W5_n, 'b.') # 4*T/6 52 pyplot.plot(x_n, W6_n, 'b.') # 5*T/6 30 53 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-')54 pyplot.plot(x_n, W1,'r-', label='analytical') 55 pyplot.plot(x_n, W2,'r-') 56 pyplot.plot(x_n, W3,'r-') 57 pyplot.plot(x_n, W4,'r-') 58 pyplot.plot(x_n, W5,'r-') 59 pyplot.plot(x_n, W6,'r-') 37 60 38 61 … … 47 70 #Plot the momentums########################################################## 48 71 pyplot.clf() 49 pyplot.plot( p2_st.x[v2], p2_st.xmom[288,v2], 'b.', label='numerical')# 0*T/650 pyplot.plot( p2_st.x[v2], p2_st.xmom[296,v2], 'b.')# 1*T/651 pyplot.plot( p2_st.x[v2], p2_st.xmom[304,v2], 'b.') # 2*T/652 pyplot.plot( p2_st.x[v2], p2_st.xmom[312,v2], 'b.') # 3*T/653 pyplot.plot( p2_st.x[v2], p2_st.xmom[320,v2], 'b.') # 4*T/654 pyplot.plot( p2_st.x[v2], p2_st.xmom[328,v2], 'b.')# 5*T/672 pyplot.plot(x_n, UH1_n, 'b.', label='numerical') # 0*T/6 73 pyplot.plot(x_n, UH2_n, 'b.') # 1*T/6 74 pyplot.plot(x_n, UH3_n, 'b.') # 2*T/6 75 pyplot.plot(x_n, UH4_n, 'b.') # 3*T/6 76 pyplot.plot(x_n, UH5_n, 'b.') # 4*T/6 77 pyplot.plot(x_n, UH6_n, 'b.') # 5*T/6 55 78 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-')79 pyplot.plot(x_n, P1,'r-', label='analytical') 80 pyplot.plot(x_n, P2,'r-') 81 pyplot.plot(x_n, P3,'r-') 82 pyplot.plot(x_n, P4,'r-') 83 pyplot.plot(x_n, P5,'r-') 84 pyplot.plot(x_n, P6,'r-') 62 85 63 86 pyplot.title('Xmomentum at several instants in time') … … 71 94 #Plot the velocities######################################################### 72 95 pyplot.clf() 73 pyplot.plot( p2_st.x[v2], p2_st.xvel[288,v2], 'b.', label='numerical')# 0*T/674 pyplot.plot( p2_st.x[v2], p2_st.xvel[296,v2], 'b.')# 1*T/675 pyplot.plot( p2_st.x[v2], p2_st.xvel[304,v2], 'b.') # 2*T/676 pyplot.plot( p2_st.x[v2], p2_st.xvel[312,v2], 'b.') # 3*T/677 pyplot.plot( p2_st.x[v2], p2_st.xvel[320,v2], 'b.') # 4*T/678 pyplot.plot( p2_st.x[v2], p2_st.xvel[328,v2], 'b.')# 5*T/696 pyplot.plot(x_n, U1_n, 'b.', label='numerical') # 0*T/6 97 pyplot.plot(x_n, U2_n, 'b.') # 1*T/6 98 pyplot.plot(x_n, U3_n, 'b.') # 2*T/6 99 pyplot.plot(x_n, U4_n, 'b.') # 3*T/6 100 pyplot.plot(x_n, U5_n, 'b.') # 4*T/6 101 pyplot.plot(x_n, U6_n, 'b.') # 5*T/6 79 102 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-')103 pyplot.plot(x_n, U1,'r-', label='analytical') 104 pyplot.plot(x_n, U2,'r-') 105 pyplot.plot(x_n, U3,'r-') 106 pyplot.plot(x_n, U4,'r-') 107 pyplot.plot(x_n, U5,'r-') 108 pyplot.plot(x_n, U6,'r-') 86 109 87 110 pyplot.title('Xvelocity at several instants in time') -
trunk/anuga_core/source/anuga_validation_tests/analytical_exact/carrier_greenspan_transient/plot_results.py
r8773 r8921 15 15 #Dimensional parameters 16 16 L = 5e4 # Length of channel (m) 17 h0 = 5e2 17 h0 = 5e2 # Height at origin when the water is still 18 18 g = 9.81 # Gravity 19 19 … … 35 35 H2 = W2 - Z2 # dimensional 36 36 P2 = U2 * H2 # dimensional 37 37 38 38 39 W3 = W3*h0 # dimensional … … 41 42 H3 = W3 - Z3 # dimensional 42 43 P3 = U3 * H3 # dimensional 44 45 43 46 44 47 #Plot the stages##############################################################
Note: See TracChangeset
for help on using the changeset viewer.