0
$\begingroup$

Checking the documentation on the error were of not that much help to me. Can someone please suggest how to deal with it?

rhop = 10922; rhon = 10922; Cp = 200; Cn = 200; Lan = 1.5*10^(-3); Lap = 1.5*10^(-3); Lbn = 1.5*10^(-3);
Lbp = 1.5*10^(-3); kp = 1.8; kn = 2.2; sigmap = 1/(1.2*10^(-5)); sigman = 1/(10^(-5)); taup = 0.00027; 
taun = -0.000156; L = 2.325*10^(-3); ha = 10;

Tinf = 298; Th = 300; Tc = 298; A = 2.325*10^(-6); Ic = 0.5;

PDE1 = rhop*Cp*D[Tp[x, y, z, t], t] == kp*(D[D[Tp[x, y, z, t], x], x] + D[D[Tp[x, y, z, t], y], y] + 
       D[D[Tp[x, y, z, t], z], z]) + 1/sigmap*(Ic/A)^2 - 
    taup*Ic/A*D[Tp[x, y, z, t], x];

PDE2 = rhon*Cn*D[Tn[x, y, z, t], t] == kn*(D[D[Tn[x, y, z, t], x], x] + D[D[Tn[x, y, z, t], y], y] + 
       D[D[Tn[x, y, z, t], z], z]) + 1/sigman*(Ic/A)^2 + 
    taun*Ic/A*D[Tn[x, y, z, t], x];

Bc1 = kp*Derivative[0, 1, 0, 0][Tp][x, 0, z, t] == ha*(Tp[x, 0, z, t] - Tinf);

Bc2 = kn*Derivative[0, 1, 0, 0][Tn][x, 0, z, t] == ha*(Tn[x, 0, z, t] - Tinf);

Bc3 = -kp*Derivative[0, 1, 0, 0][Tp][x, Lap, z, t] == ha*(Tp[x, Lap, z, t] - Tinf);

Bc4 = -kn*Derivative[0, 1, 0, 0][Tn][x, Lan, z, t] == ha*(Tn[x, Lan, z, t] - Tinf);

Bc5 = kp*Derivative[0, 0, 1, 0][Tp][x, y, 0, t] == ha*(Tp[x, y, 0, t] - Tinf);

Bc6 = kn*Derivative[0, 0, 1, 0][Tn][x, y, 0, t] == ha*(Tn[x, y, 0, t] - Tinf);

Bc7 = -kp*Derivative[0, 0, 1, 0][Tp][x, y, Lbp, t] == ha*(Tp[x, y, Lbp, t] - Tinf);

Bc8 = -kn*Derivative[0, 0, 1, 0][Tn][x, y, Lbn, t] == ha*(Tn[x, y, Lbn, t] - Tinf);

Bc9 = DirichletCondition[Tp[x, y, z, t] == Tc, x == 0];

Bc10 = DirichletCondition[Tn[x, y, z, t] == Tc, x == 0];

Bc11 = DirichletCondition[Tp[x, y, z, t] == Th, x == L];

Bc12 = DirichletCondition[Tn[x, y, z, t] == Th, x == L];

sol = NDSolve[{PDE1, PDE2, Tp[x, y, z, 0] == 0, Tn[x, y, z, 0] == 0, 
   Bc1, Bc2, Bc3, Bc4, Bc5, Bc6, Bc7, Bc8, Bc9, Bc10, Bc11, 
   Bc12}, {Tp, Tn}, {t, 0, 10}, {x, 0, L}, {y, 0, Lap}, {z, 0, Lbp}]
$\endgroup$
11
  • $\begingroup$ To be more specific: your DirichletCondition has forced NDSolve to turn to FiniteElement method, but FiniteElement cannot handle b.c. involving derivative. Since your problem can be handled by the old good TensorProductGrid, simplest solution is to avoid DirichletCondition in your code. $\endgroup$
    – xzczd
    Oct 16, 2020 at 4:59
  • $\begingroup$ @xzczd I have tried avoiding DirichletCondition but its taking very long to evaluate without producing any output. $\endgroup$
    – zhk
    Oct 16, 2020 at 5:42
  • $\begingroup$ Try adjusting the sub-options of TensorProductGrid. Lower DifferenceOrder and MaxPoints should help. (Don't forget currently FiniteElement is just order 2. ) $\endgroup$
    – xzczd
    Oct 16, 2020 at 5:45
  • $\begingroup$ @xzczd I tried Method -> {"MethodOfLines", "DifferentiateBoundaryConditions" -> {True, "ScaleFactor" -> 100}, "SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> 200, "MinPoints" -> 200, "DifferenceOrder" -> 2}} but no luck. $\endgroup$
    – zhk
    Oct 16, 2020 at 6:00
  • $\begingroup$ Since it's a 3+1D problem, I won't be surprised if 200 is too demanding. Consider starting from 20. Also, you can use the tools here to monitor the solving process: mathematica.stackexchange.com/q/134787/1871 $\endgroup$
    – xzczd
    Oct 16, 2020 at 6:05

0