0

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 = rhopCpD[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 - taupIc/AD[Tp[x, y, z, t], x];

PDE2 = rhonCnD[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 + taunIc/AD[Tn[x, y, z, t], x];

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

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

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

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

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

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

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

Bc8 = -knDerivative[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}]

user21
  • 39,710
  • 8
  • 110
  • 167
zhk
  • 11,939
  • 1
  • 22
  • 38
  • 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. – xzczd Oct 16 '20 at 04:59
  • @xzczd I have tried avoiding DirichletCondition but its taking very long to evaluate without producing any output. – zhk Oct 16 '20 at 05:42
  • Try adjusting the sub-options of TensorProductGrid. Lower DifferenceOrder and MaxPoints should help. (Don't forget currently FiniteElement is just order 2. ) – xzczd Oct 16 '20 at 05:45
  • @xzczd I tried Method -> {"MethodOfLines", "DifferentiateBoundaryConditions" -> {True, "ScaleFactor" -> 100}, "SpatialDiscretization" -> {"TensorProductGrid", "MaxPoints" -> 200, "MinPoints" -> 200, "DifferenceOrder" -> 2}} but no luck. – zhk Oct 16 '20 at 06:00
  • 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: https://mathematica.stackexchange.com/q/134787/1871 – xzczd Oct 16 '20 at 06:05
  • @xzczd In this article the authors have used FDM to solve these PDEs. 10.1016/j.ijheatmasstransfer.2009.12.056 – zhk Oct 16 '20 at 06:11
  • Why don't you use NeumannValue for your PBCs - that what it's for. You don't need all those factors in front of the Derivative. Have a look at the Heat Transfer tutorial – user21 Oct 16 '20 at 11:29
  • @user21 It worked but the results are not correct. – zhk Oct 16 '20 at 11:58
  • @zhk and they are correct with the TPG method? Perhaps a sing issue? – user21 Oct 16 '20 at 16:51
  • @user21 yes! Correct with TPG – zhk Oct 16 '20 at 17:14
  • @user21 Whats the correct way to define for example Bc1 interms of NeumannValue? – zhk Oct 18 '20 at 03:18

0 Answers0