I am trying to solve the following governing equations via NDSolve.
The system consists of three layers. The following shows how I constructed a numerical model my system with given parameter values:
rw = 0.01;
er = 0.5;
ez = er;
D2 = 1;
Dp = 0.1;
bp = 1;
b1 = 5;
b2 = 5;
R1 = 1;
R2 = 1;
Rp = 1;
λ1 = 0;
λ2 = λ1;
λp = λ1;
Q = 1;
θ1 = 0.5;
θ2 = 0.5;
θp = 0.5;
A = Q/(2*Pi*θ1*b1);
C0 = 10;
vp = 0.1;
v2 = 0.1;
R = 10;
NR[z_] := If[z <= b1, R1, If[b1 < z < b1 + bp, Rp, R2]];
Ner[z_] := If[z <= b1, er, Exp[-10000 z]];
Nez[z_] := If[z <= b1, ez, If[b1 < z < b1 + bp, (Dp*vp)/A, (D2*v2)/A]];
Nv[z_] := If[z <= b1, Exp[-10000 z], If[b1 < z < b1 + bp, vp, v2]];
NA[z_] := If[z <= b1, A, Exp[-10000 z]];
sys =
{NR[z]*Derivative[0, 0, 1][NC][r, z, t] ==
(A*Ner[z]*Derivative[2, 0, 0][NC][r, z, t] +
(A*Ner[z] + NA[z])/r*Derivative[1, 0, 0][NC][r, z, t]) +
A*Nez[z]*Derivative[0, 2, 0][NC][r, z, t] -
Nv[z]*Derivative[0, 1, 0][NC][r, z, t],
NC[rw, z, t] == C0,
NC[R, z, t] == Exp[-10000 z],
Derivative[0, 1, 0][NC][r, 0, t] == Exp[-10000 r],
Derivative[0, 1, 0][NC][r, b1 + bp + b2, t] == Exp[-10000 r],
NC[r, z, 0] == Exp[-10000 r]};
sol =
NDSolve[
sys, NC, {r, rw, R}, {z, 0, b1 + bp + b2}, {t, 0, 100},
Method -> "BDF", AccuracyGoal -> 24, PrecisionGoal -> 10]
The coefficients are a function of z; thus, the governing equations are suitable for each governing equation of the three layers.
To validate the numerical results, I derived a semi-analytical solution as a reference. The code producing the reference is longer than I am permitted to post, so I can not include its code here.
The numerical results seem to be unstable and give the totally difference from reference solution.
Show[
Plot[Evaluate[NC[r, 2.5, 100] /. sol], {r, rw, R}, PlotRange -> All],
ListPlot[RR, PlotRange -> All]]
The solid line is the numerical result and the dotted line is the reference solution,
Can you see any problems with the way I am handling the numerical model for the three layers? Do you have any suggestion about dealing with this kind problem?


