Commit d00b69ef by Jigyasa Watwani

paper parameters

parent 6fe6f78c
...@@ -47,9 +47,9 @@ def advection_diffusion(Nx, L, Nt, tmax, v, D): ...@@ -47,9 +47,9 @@ def advection_diffusion(Nx, L, Nt, tmax, v, D):
return [c_array,x_array] return [c_array,x_array]
Nx, L, tmax, D, alpha = 512, 1, 0.25, 1, 1 Nx, L, tmax, D, alpha = 3200, 1, 1, 1, 0.1
v = df.Expression('alpha*x[0]', alpha=alpha, degree=1) v = df.Expression('alpha*x[0]', alpha=alpha, degree=1)
nt_array = np.array([5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 30, 35, 40, 45, 50]) nt_array = np.array([5,6,7,8,9,10, 20, 30])
# , 400, 800, 1600, 3200, 6400, 12800]) # , 400, 800, 1600, 3200, 6400, 12800])
dt_array = tmax/(nt_array) dt_array = tmax/(nt_array)
error_in_c = np.zeros(len(nt_array)) error_in_c = np.zeros(len(nt_array))
...@@ -66,7 +66,7 @@ for i in range(len(nt_array)): ...@@ -66,7 +66,7 @@ for i in range(len(nt_array)):
else: else:
l = L * np.exp(alpha * times[j]) l = L * np.exp(alpha * times[j])
beta = (-D * np.pi**2 /(2 *alpha * L**2)) * (1 - np.exp(-2 * alpha * times[j])) beta = (-D * np.pi**2 /(2 *alpha * L**2)) * (1 - np.exp(-2 * alpha * times[j]))
c_exact[j] = 1 + 0.2 * np.cos(np.pi*x[j]/l) * np.exp(-alpha * times[j]) * np.exp(beta) c_exact[j] = np.exp(-alpha * times[j])* (1 + 0.2 * np.cos(np.pi*x[j]/l) * np.exp(beta))
error_in_c[i] = np.max(np.abs(c[-1] - c_exact[-1])) error_in_c[i] = np.max(np.abs(c[-1] - c_exact[-1]))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment