Hello Burak,

I think I can help here as I bumped into the same problem.

The problem I see with your equation is the expression with $r$ inside that lays outside of the diffusion term. One way to solve that is to multiply throughout by $r^2$. Then, you can move $r^2$ inside the transient term, which is no problem for fipy and your source term will be slightly modified which should also be okay.

So, your equation should look like

\frac{d}{dt}\left(r^{2}t\right)=\frac{1}{C}\frac{d}{dr}\left(kr^{2}\frac{dT}{dr}\right)+\frac{r^{2}\dot{q}}{C}

I realize that this latex code is rather unreadable, but if I may suggest, you can copy and paste in this free online latex equation editor:
http://www.thrysoee.dk/laeqed/

So, if C is doesn't depend on $r$ or $T$, without having tested anything, I think this could be entered in fipy as

eq =
TransientTerm(coeff=r**2.0)
== ImplicitDiffusionTerm(coeff=k*r**2.0/C)
+ r**2.0*qdot/C

where $r^2$ is a CellVariable.

Hope this helps!

Regards,

Etienne Rivard
Lehrstuhl für Technische Thermodynamik und Transportprozesse (LTTT)
Universität Bayreuth

Burak Atakan wrote:
Hello all!
We have a simple problem, but don't know how to set it up in FiPy:
We are interested in transient heat transfer in a 1D spherical system in radial
direction.
How do we set up the diffusion term (or the mesh) for such a problem? The
equation would look like:
dT/dt=  1/(C *r**2) d(k*r**2 (dT/dr))dr + qdot/C


Thanks!
Regards,
 Burak


Reply via email to