I am trying to use NDSolve to find the solution to a set of coupled diffEQs. They represent 1d (radial) heat balance in a spherical shell.
The goal is to specify a heat flux into the base of the shell, Hb, and have the model output the shell thickness and temperature profile for which heat is balanced.
Within the shell, the temperature T[r,t] is guided by conduction, like
p C ∂T/∂t = ∇∙(A/T ∇T) + Q
where p is density, C specific heat capacity, and Q[r] a source term.
The conductivity is temperature dependent with k=A/T with A a constant.
At the base of the shell, any imbalance in flux into the base (Hb) and out of the base (Fb) is accommodated by phase change which changes the shell thickness, d[t], like
p L ∂d/∂t = -1/3 (Hb - Fb)
where p is density, and L is latent heat.
Flux in (Hb) is an input to the model, but the flux out of the base, Fb, is determined by the temperature gradient at the shell base
Fb = -A/Tb * T'[R-d[t],t]
where Tb = T[R-d[t],t] is the constant temperature at the shell base (rb[t] = R - d[t]).
When there is no source term, this is possible to do by hand so I know it's possible.
With a source, it gets wild though.
As an initial attempt I want to use NDSolve to give the solutions for T and d in the sourceless system (if i can figure it out without a source, I will add that in later).
Here is what I wrote...
Sorry its an image instead of a code block. I tried for some time using the formatting tool, but I use symbols and such that this editor does not seem to like and the code is nearly illegible when I tried. I'll post it here anyway for those who might want to try a copy/paste of it.
Dsolfunc\[LetterSpace]flux[{AI_, \[Rho]I_, cI_, LI_}, {rC_, R_}, {Tb_, Ts_}, Hb_, Qfun_, T0_, d0_] := NDSolve[{
(* Conduction within shell *)
\[Rho]I cI (\!\(\*SubscriptBox[\(\[PartialD]\), \(t\)]\(T[r, t]\)\)) == Div[(AI/T[r, t]) Grad[T[r, t], {r, \[Theta], \[Phi]}, "Spherical"], {r, \[Theta], \[Phi]}, "Spherical"] + Qfun,
(* Initial temperature *)
T[r, 0] == T0,
(* Temperature at boundaries *)
T[R, t] == Ts,
T[R - d[t], t] == Tb,
(* Phase change at base *)
\[Rho]I LI (\!\(\*SubscriptBox[\(\[PartialD]\), \(t\)]\(d[t]\)\)) == -(1/3) (Hb + (AI/Tb) Derivative[1, 0][T][R - d[t], t]),
(* Initial shell thickness *)
d[0] == d0
}, {T, d}, {r, rC, R}, {t, 0, 10^25}];
When I run the the NDSolve I get the error
I believe this has to do with the fact that NDSolve expects both T and d to be functions of radius, r, and time, t.
My shell thickness, however, is not a function of radius. It just changes in time.
So my question is - is there a way to use Mathematica to model diffEQs where one of the things you solve for is the position of the boundary?
The thickness solution needs the temperature gradient, but the temperature solution needs the thickness to apply the boundary condition, so its certainly coupled.
I viewed many other posts in the hopes I could scrounge together other people's work, but I am having difficulty parsing some of those. In particular, I thought this post an answer to related question was getting close to what I need, but it looks like both of the things they solve for are dependent on the same two variables still, even though it looks like a boundary is moving.
Alright if anyone has some insight I'd appreciate it!! Thanks much.