# Measuring Temp on a cubical using heat equation with Neumann and Dirichlet boundary conditions

I'm trying to solve 3D heat equation to understand how the temperature varies with time on cubical. i have mixed boundary conditions: Dirichlet on the bottom surface (constant Temp) Neumann on all the other surfaces (convection and radiation)

Im using the 3D heat equation, but first i tried to solve for the 1D:

op = Derivative[1, 0][u][t, x] - Derivative[0, 2][u][t, x]
BC1 = DirichletCondition[u[t, x] == 873 - Exp[-100 t], x == 0];
BC2 = NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56) -
Exp[-100 t], x == 0.3];
uifHeat =
NDSolveValue[{op == BC2, BC1, u[0, x] == 298},
u, {t, 0, 100}, {x, 0, 0.3}];
Plot3D[Evaluate[u[x, t] /. %], {t, 0, 3600}, {x, 0, 0.25},
PlotRange -> All]


But then i got the next error:

The PDE is convection dominated and the result may not be stable. \


I tried the suggested solution - Exp[-100 t] but it didn't help. Then i tried to solve it in 3D:

k = 25.5;(*W/(m K)*)
sig = 5.67*10^-8;(*W/(m^2 K^4)*)
h = 6.98;(*W/(m^2K)*)
Reg= ImplicitRegion[0 <= x <= 0.4 && 0 <= y <= 1.4 && 0 <= z <= 0.3, {x, y, z}];
op = Derivative[1,0,0,0][u][t,x,y,z]-Laplacian[u[t,x, y, z], {x, y, z}]
BC1 = DirichletCondition[u[t, x, y, z] == 873,
z == 0 && 0 <= y <= 1.4 && 0 <= x <= 0.4];
BC2= {NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(
k 0.56), z == 0.3 && 0 <= y <= 1.4 && 0 <= x <= 0.4],
NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56),
x == 0 && 0 <= y <= 1.4 && 0 <= z <= 0.3],
NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56),
x == 0.4 && 0 <= y <= 1.4 && 0 <= z <= 0.3],
NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56),
y == 0 && 0 <= x <= 0.4 && 0 <= z <= 0.3],
NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56),
y == 1.4 && 0 <= x <= 0.4 && 0 <= z <= 0.3]};
uifHeat = NDSolveValue[{op == BC2, BC1, u[0, x, y, z] == 298},
u, {t, 0, 100}, {x, y, z} ∈ Reg];
Animate[Plot3D[uifHeat[t, x, y, 0], {x, y, z} ∈ uifHeat["ElementMesh"],
PlotRange -> {0, 160}], {{t, 10}, 0, 40, 2},
SaveDefinitions -> True]


This time i got the error:

"PDE parsing error of \
{{u$46316-u$46317-u$46318-u$46319-NeumannValue[-49.1575,z==0.3&&0<=y<=\
1.4&&0<=x<=0.4],u$46316-u$46317-u$46318-u$46319-NeumannValue[-49.1575,\
x==0&&0<=y<=1.4&&0<=z<=0.3],u$46316-u$46317-u$46318-u$46319-\
NeumannValue[-49.1575,x==0.4&&0<=y<=1.4&&0<=z<=0.3],u$46316-u$46317-u$\ 46318-u$46319-NeumannValue[-49.1575,y==0&&0<=x<=0.4&&0<=z<=0.3],u$\ 46316-u$46317-u$46318-u$46319-NeumannValue[-49.1575,y==1.4&&0<=x<=0.4&&\
0<=z<=0.3]}}. Inconsistent equation dimensions"


I can't figure what is the problem

• Sorry for all the mistakes i fixed it i hope. it's my first time. thank you for your fast response and your desire to help – Maxim Kozminov Feb 15 '16 at 16:57
• Concerning your first lock of code Plot3D[Evaluate[u[x, t] /. %], {t, 0, 3600}, {x, 0, 0.25} should be Plot3D[Evaluate[%[x,t]], {t, 0, 100}, {x, 0, 0.25}, . Then it works despite the message "...convection dominated...". Concerning the second block, there are still problems ... – andre314 Feb 15 '16 at 18:03
• Concerning the second block, you can't use as Neumann condition BC2 a List of NeumannValue[...]. BC2 must be a single NeumannValue[], in your case BC2 = NeumannValue[-((h*100)/(k 0.56)) - (0.7 sig (100)^4)/(k 0.56), (z == 0.3 && 0 <= y <= 1.4 && 0 <= x <= 0.4) || (x == 0 && 0 <= y <= 1.4 && 0 <= z <= 0.3) || (x == 0.4 && 0 <= y <= 1.4 && 0 <= z <= 0.3) || (y == 0 && 0 <= x <= 0.4 && 0 <= z <= 0.3) || (y == 1.4 && 0 <= x <= 0.4 && 0 <= z <= 0.3)] Then NDSolve works and gives a InterpolatingFunction[...] – andre314 Feb 15 '16 at 19:17
• Concerning the end of the second block : Animate[Plot3D ... . What you want to do is not clear : Plot3D is for plotting 2 dimensionnal functions, but {x,y,z} element of ... determine a tree dimensionnal space. One thing more : implement Animate only when your Plot will be OK. – andre314 Feb 15 '16 at 19:29
• To see the function, I suggest you do for example for the plan at z=0.15 : Labeled[Plot3D[uifHeat[#, x, y, 0.15], {x, 0, 0.4}, {y, 0, 1.4}], "t=" <> ToString[#]] & /@ Range[0, 100, 20] . I don't know what you are waiting for physically. – andre314 Feb 16 '16 at 20:42