I have a problem with the solution of the heat transportation partial differential equation in cylindric coordinates. Basically I have to numerically solve the equation for a pipe through wich the water flows with laminar profile. At the beginning of the pipe the water has temperature $T$ and then flows to infinity. The outside of the pipe has temperature $T_0 < T$ and the water slowly gets cooler. I use the function
T =
NDSolveValue[
{10^(-7)*D[t[r, z], r] + 10^(-7)*r*D[t[r, z], r, r] ==
0.1*(1 - (r^2)/0.0001)*r*D[t[r, z], z],
t[r, 0] == 200, t[1, z] == 0, t[r, 100] == 10},
t, {r, 0, 1}, {z, 0, 100}]
and it seems to work, but then when i plot it with
ContourPlot[T[r, z], {r, 0, 1}, {z, 0, 100}]
I get the image below. I do not understand what i am doing wrong. It seems that the program ignores the boundary condition for $z=0$ and $z=100$. Also the solution seems not be stable because loocks like some kind of noise instead of smooth lines.
Thank you for all the suggestions for the solution of the problem! I rewrited the code along with the implementation of the Neumann boundary condition and the change of discretisation in the following way:
T = NDSolveValue[{-Laplacian[t[r, \[Theta], z], {r, \[Theta], z},
"Cylindrical"]*(10^-5) +
0.001*(1 - (r^2))*D[t[r, \[Theta], z], z] ==
NeumannValue[0, r == 10^-7], DirichletCondition[t[r, \[Theta], z] == 10,
z == 10^-7 && 10^-7 <= r <= 1 && 0 <= \[Theta] <= 2*\[Pi]],DirichletCondition[t[r, \[Theta], z] == 0,
10^-7 <= z <= 10 && r == 1 && 0 <= \[Theta] <= 2*\[Pi]]}, t, {r, 10^-7, 1}, {\[Theta], 10^-7, 2*\[Pi]}, {z, 10^-7, 10}, MaxStepSize -> 0.0001]
and used the command
Plot3D[T[r, \[Theta], z] /. \[Theta] -> \[Pi], {r, 0, 1}, {z, 0, 1},PlotRange -> All]
or
ContourPlot[T[r, \[Theta], z] /. \[Theta] -> \[Pi]/2, {r, 0, 1}, {z, 0, 1},MaxRecursion -> 2]
to plot the solution:
Now is almost the right solution, but as you can see from the 3D representation, I keep getting that small bump at the beginning and also a fluctuation at the edge that brings the temperature below 0 which is obviously wrong. I was unable to figure out if there is any other command that could be implemented in the code to give a solution without those two anomalies.
{}
button above the edit window. The edit window help button?
is also useful for learning how to format your questions and answers. You may also find this this meta Q&A helpful $\endgroup$NeumannCondition
for $ r = 0 $? $\endgroup$