Changeset 5587 for anuga_work/development/anuga_1d/dry_dam_sudi.py
 Timestamp:
 Jul 30, 2008, 5:03:47 PM (15 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

anuga_work/development/anuga_1d/dry_dam_sudi.py
r5565 r5587 22 22 # Calculate Analytical Solution at time t > 0 23 23 u3 = 2.0/3.0*(sqrt(g*h1)+x[i]/t) 24 h3 = 4.0/(9.0*g)*(sqrt(g*h1)x[i]/(2.0*t))*(sqrt(g*h1)x[i]/(2.0*t)) 24 h3 = 4.0/(9.0*g)*(sqrt(g*h1)x[i]/(2.0*t))*(sqrt(g*h1)x[i]/(2.0*t)) 25 u3_ = 2.0/3.0*((x[i]+L/2.0)/tsqrt(g*h1)) 26 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)) 25 27 26 if ( x[i] <= t*sqrt(g*h1) ): 28 if ( x[i] <= 1*L/2.0+2*(sqrt(g*h1)*t)): 29 u[i] = 0.0 30 h[i] = h0 31 elif ( x[i] <= 1*L/2.0(sqrt(g*h1)*t)): 32 u[i] = u3_ 33 h[i] = h3_ 34 35 elif ( x[i] <= t*sqrt(g*h1) ): 27 36 u[i] = 0.0 28 37 h[i] = h1 … … 57 66 58 67 L = 2000.0 # Length of channel (m) 59 N = 100 # Number of compuational cells68 N = 800 # Number of computational cells 60 69 cell_len = L/N # Origin = 0.0 61 70 … … 85 94 yieldstep = 1.0 86 95 L = 2000.0 # Length of channel (m) 87 number_of_cells = [ 100]#,200,500,1000,2000,5000,10000,20000]96 number_of_cells = [200]#,200,500,1000,2000,5000,10000,20000] 88 97 h_error = zeros(len(number_of_cells),Float) 89 98 uh_error = zeros(len(number_of_cells),Float) … … 102 111 domain.set_boundary({'exterior': Reflective_boundary(domain)}) 103 112 domain.default_order = 2 104 domain.default_time_order = 1113 domain.default_time_order = 2 105 114 domain.cfl = 1.0 106 domain.limiter = " vanleer"115 domain.limiter = "minmod" 107 116 108 117 t0 = time.time() 109 118 110 119 for t in domain.evolve(yieldstep = yieldstep, finaltime = finaltime): 111 pass120 domain.write_time() 112 121 113 122 N = float(N)
Note: See TracChangeset
for help on using the changeset viewer.