在mathematica中求解耦合热pde

时间:2018-04-05 20:11:22

标签: wolfram-mathematica differential-equations equation-solving pde

dC1/dt = -(Fp)(L)/Vp*(dC1/dx) - PSg/Vp(C1/Wp-C2) + Dp*(dC1/dx2);

dC2/dt = PSg/Visfp(C1/Wp-C2) + Disf*(dC2/dx2);

我的边界条件是:

C1(t,x)|x=0 = Cin(t)

C2(t,x)|x=0 = 0

Cin(t) is a function of a known form e.g. Cin(t)= exp(-t);

dC1(t,x)/dx|x=0 = 0

dC2(t,x)/dx|x=0 = 0

dC1(t,x)/dx|x=L = 0

dC2(t,x)/dx|x=L = 0

最初的条件是:

C1(t,x)|t=0 = 0

C2(t,x)|t=0 = 0

此外,初始条件是分段的:

when (t=t.min)  {
C1 = if (x=x.min) 1 else 0
C2 = 0;

我在mathematica中准备了一个代码:

Fp = 0.016666667; Vp = 0.07; Wp = 0.94; Dp = 
 10^-18; PSg = 0.05; Visfp = 0.35; Disf = 10^-18; L = 0.1;

\[Phi][x_] := Piecewise[{{1, x == 0}, {0, x > 0}}]; 
mol[n_, o_: "Pseudospectral"] := {"MethodOfLines", 
  "SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> n, 
    "MinPoints" -> n, "DifferenceOrder" -> o}}

{sol4, solp} = 
 NDSolve[{Derivative[1, 0][C1][t, 
       x] == -Fp*L/Vp*Derivative[0, 1][C1][t, x] - 
       PSg/Vp*(C1[t, x]/Wp - C2[t, x]) + 
       Dp*Derivative[0, 2][C1][t, x], 
     Derivative[1, 0][C2][t, x] == 
      PSg/Visfp*(C1[t, x]/Wp - C2[t, x]) + 
       Disf*Derivative[0, 2][C2][t, x], C1[t, 0] == Exp[-t], 
     C2[t, 0] == 0, C1[t, L] == 0, C2[t, L] == 0, 
     Derivative[0, 1][C1][t, 0] == 0, Derivative[0, 1][C2][t, 0] == 0,
      Derivative[0, 1][C1][t, L] == 0, 
     Derivative[0, 1][C2][t, L] == 0, C1[0, x] == \[Phi][x], 
     C2[0, x] == 0}, {C1, C2}, {t, 0, 30}, {x, 0, L}, 
    Method -> mol[##]] & @@@ {{33, 4}, {33}}

Plot3D[Evaluate[C1[t, x] /. sol4[[1]]], {t, 0, 30}, {x, 0, L}]

但是,无论网格大小如何,解决方案都是错误的。它应该看起来像(C1[x,t]):

1

当我使用分段初始条件时,问题就开始了。如果我设置C1[0, x] ==1,那么解决方案就可以了(与我使用的其他软件相比)。但是这个分段的初始条件是至关重要的(我将结果与我知道的其他软件进行比较,肯定会得到正确的结果)

我很感激任何反馈。

非常感谢,

0 个答案:

没有答案