i have the advection-dispersion equation:
Dz = 0.0000738739; as = 2.21622*10^-6;
Dz*D[u[z, t], z, z] - as*D[u[z, t], z] == D[u[z, t], t]
The boundary and initial conditions are:
u[z, 0] == 0.10,
u[0, t] == 0.30, , (D[u[z, t], z] /. z -> Infinity) == 0
As i wanted to solve numerically, i changed "infinity" to 10^5 and tried to solve the pde numerically with the following code:
pde = {Dz*D[u[z, t], z, z] - as*D[u[z, t], z] - D[u[z, t], t] == 0,
u[z, 0] == 0.1,
u[0, t] ==
0.30 + (0.10 - 0.30)*Exp[-100000*t], (D[u[z, t], z] /.
z -> 10^5) == 0}
solution = NDSolveValue[pde, u, {z, 0, 100000}, {t, 0, 100000}]
Plot[solution[0.6, t], {t, 0, 100000}, PlotRange -> All]
The Exp[-100000*t] term was used to not give inconsisting boundary condition values. The problem is that when i plot the solution, the results are totally wrong comparing to the reality and also to the analitic solution of this pde. I've tried to use the NeumannValue and DirichletCondition functions, i get better results, close to the analitical solution, but still very different from the analitic solution. And i don't know why the results change when i use the NeumannValue and DirichletCondition functions, in my mind they should be the same, as i wrote the code correctly. Here is the analitic solution of the proposed PDE.
z1[z_, t_, as_, Dz_] := (z + as*t)/(2*Sqrt[Dz*t])
z2[z_, t_, as_, Dz_] := (z - as*t)/(2*Sqrt[Dz*t])
A[z_, t_, as_, Dz_] :=
1/2 (Erfc[z1[z, t, as, Dz]] + Exp[((as*z)/Dz)]*Erfc[z2[z, t, as, Dz]])
u[z_, t_, u0_, ui_, as_, Dz_] := ui + (u0 - ui)*A[z, t, as, Dz]
Plot[{u[0.6, t, 0.30, 0.10, as, Dz]}, {t, 0.01, 1000000}, PlotRange -> All]
Can anybody, please, help me to find the solution to this problem? Thanks!




eiditbutton under your post for that. – user21 Mar 18 '19 at 06:45func = {z, t} [Function] u[z, t, u0, ui, as, Dz];
error = DzD[u[z, t], z, z] - asD[u[z, t], z] - D[u[z, t], t] /. u -> func // FullSimplify
Plot3D[Block[{u0 = 1, ui = 3, as = 1, Dz = 1}, error] // Evaluate, {t, 0, 1}, {z, 0, 1}]`
– xzczd Mar 19 '19 at 06:57