tdiffusion_dn.mac - pism - [fork] customized build of PISM, the parallel ice sheet model (tillflux branch)
HTML git clone git://src.adamsgaard.dk/pism
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tdiffusion_dn.mac (686B)
---
1 /* pure diffusion, Dirichlet at the base and Neumann at the surface */
2 T(t) := exp(-(lambda*alpha)^2*t);
3 Z(z) := A*sin(lambda*z) + B*cos(lambda*z);
4 v(z,t) := T(t) * Z(z);
5
6 phi(z) := U[0] + Q[L] * z;
7 u(z,t) := v(z,t) + phi(z);
8
9 B : 0;
10 lambda : %pi / (2*L);
11
12 /* Check that T satisfies its equation */
13 eq_T : diff(T(t), t) + (lambda*alpha)^2 * T(t) = 0;
14
15 /* Check that Z satisfies its equation */
16 eq_Z : diff(Z(z), z, 2) + lambda^2 * Z(z) = 0;
17
18 /* Check that u(x,t) satisfies the PDE */
19 eq: diff(u(x,t),t) = alpha^2 * diff(u(x,t),x,2);
20 lhs(eq) - rhs(eq), expand;
21
22 /* Check that du/dx = Q[L] at x = L */
23 ux_L : subst([x = L], diff(u(x,t), x));
24
25 /* Check that u(0,t) = U[0] */
26