Changeset 4958
 Timestamp:
 Jan 19, 2008, 7:26:50 PM (15 years ago)
 Location:
 anuga_work/development/shallow_water_1d
 Files:

 1 edited
 1 moved
Legend:
 Unmodified
 Added
 Removed

anuga_work/development/shallow_water_1d/analytic_dam.py
r4946 r4958 61 61 h = zeros(n,Float) 62 62 uh = zeros(n,Float) 63 x = C 3*L/4.063 x = CL/2.0 64 64 #x = zeros(n,Float) 65 65 #for i in range(n): … … 79 79 x2=z*t 80 80 x1=c1*t 81 x1_ = 1*L/2.0x1 82 x2_ = 1*L/2.0+2*x1 83 #x3_ = 1*L/2.0x3 81 84 82 #t=50 85 83 #x = (L/2:L/2) … … 87 85 # Calculate Analytical Solution at time t > 0 88 86 u3 = 2.0/3.0*(sqrt(g*h1)+x[i]/t) 89 h3 = 4.0/(9.0*g)*(sqrt(g*h1)x[i]/(2.0*t))*(sqrt(g*h1)x[i]/(2.0*t)) 90 u3_ = 2.0/3.0*((x[i]+L/2.0)/tsqrt(g*h1)) 91 h3_ = 1.0/(9.0*g)*((x[i]+L/2.0)/t+2*sqrt(g*h1))*((x[i]+L/2.0)/t+2*sqrt(g*h1)) 92 #if t == 30: 93 # x[i] = 500 94 # print 'x2',x2 95 # print 'x3',x3 96 # print 'x1',x1 97 if ( x[i] <= x2_ ): 98 #print 'here x2_=', x2_ 99 u[i] = 0.0 100 h[i] = 0.0 101 uh [i] = u[i]*h[i] 102 #elif ( x[i] <= x3_ ): 103 # print 'here x3_=', x3_ 104 # u[i] = 1*u2 105 # h[i] = h2 106 # uh[i] = u[i]*h[i] 107 elif ( x[i] <= x1_ ): 108 #print 'here x1_=', x1_ 109 u[i] = u3_ 110 h[i] = h3_ 111 uh[i] = u[i]*h[i] 112 #else: 113 # u[i] = 0.0 114 # h[i] = h0 115 # uh[i] = u[i]*h[i] 87 h3 = 4.0/(9.0*g)*(sqrt(g*h1)x[i]/(2.0*t))*(sqrt(g*h1)x[i]/(2.0*t)) 116 88 117 #elif ( x[i] <= x1/2.0 ): 118 # u[i] = 0.0 119 # h[i] = h1 120 # uh[i] = u[i]*h[i] 121 elif ( x[i] <= x1 ): 122 #print 'here x1=', x1 89 if ( x[i] <= x1 ): 123 90 u[i] = 0.0 124 91 h[i] = h1 125 92 uh[i] = u[i]*h[i] 126 93 elif ( x[i] <= x3 ): 127 #print 'here x3=', x3128 94 u[i] = u3 129 95 h[i] = h3 130 96 uh[i] = u[i]*h[i] 131 97 elif ( x[i] < x2 ): 132 #print 'here x2=', x2133 98 u[i] = u2 134 99 h[i] = h2 135 100 uh[i] = u[i]*h[i] 136 101 else: 137 #print 'here the last section'138 102 u[i] = 0.0 139 103 h[i] = h0
Note: See TracChangeset
for help on using the changeset viewer.