4
$\begingroup$

I am trying to solve the heat equation, namely

$$\frac{\partial T}{\partial t} - \alpha \nabla^2 T=0$$ The problem is I have been able to solve this in Mathematica but only for steady state. I'm interested in solving it over a region (check results below).

Here's the Mathematica code for solving this

sol = NDSolveValue[{
   -Laplacian[T[x, y], {x, y}] == NeumannValue[0, x == 0 || y == 0 || y == 100],
   DirichletCondition[T[x, y] == 100, (x - 30)^2 + (y - 40)^2 == 20^2],
   DirichletCondition[T[x, y] == 20, x == 100]
   }, T[x, y], {x, y} ∈ Ω]

After solving it like this, I can easily acquire the heat flow vector field like this

Q = -Grad[sol, {x, y}];

And then plot it like this,

enter image description here

This form of solving the PDE is very natural to me so I would like to ask is it possible to solve the same problem but with the time component. Basically I would like to be able to do a Manipulate[] command and vary the variable t along some range and see how heat flows. I have tried to solve it with the same logic but Mathematica does not output correct results. Here's the code,

sol = NDSolveValue[{
   D[T[x, y, t], t] - Laplacian[T[x, y, t], {x, y}] == 
    NeumannValue[0, x == 0 || y == 0 || y == 100],
   DirichletCondition[
    T[x, y, t] == 100, (x - 30)^2 + (y - 40)^2 == 20^2],
   DirichletCondition[T[x, y, t] == 20, x == 100 && t == 0]
   }, T[x, y, t], {x, 0, 100}, {y, 0, 100}, {t, 0, 100}]

First it outputs a warning like this one

NDSolveValue::femcscd: The PDE is convection dominated and the result may not be stable. Adding artificial diffusion may help.

And it gives me some interpolating functions but trying any operations on them it outputs insufficient information to interpret the result

I have omitted some code for the sake of cleanliness, here's the notebook in case anyone needs to analyze it.

$\endgroup$
1

0