On May 26, 2006, at 9:06 AM, I wrote:


Factoring out everything that *operates* on phi:
\[
\left[\frac{\partial}{\partial t} - \nabla\cdot(\vec{u}) - [\nabla\cdot(\Gamma_i)]^n - S_1 \right] phi = S_0
\]
*This* is now in the form of a FiPy equation:
>>> TransientTerm() - ConvectionTerm(coeff=u) - DiffusiontTerm (coeff=(Gamma1, ...)) - ImplicitSourceTerm(coeff=S1) == S0


\phi doesn't appear explicitly in *any* of these expressions; it's built into the Terms.


This does not mean that you factor out every single appearance of \phi in your equations. Only these specific appearances. Factor out the canonical appearance of \phi in each of the cannonical terms:

\partial (\rho \phi) / \partial t = \left(\partial \rho / \partial t \right)[\phi] = TransientTerm(coeff=rho)

\nabla\cdot(D \nabla \phi) = \left(\nabla\cdot(D \nabla))[\phi] = DiffusionTerm(coeff=D)

\nabla\cdot(\vec{u} \phi) = \left(\nabla\cdot(\vec{u}))[\phi] = ConvectionTerm(coeff=u)

\rho can still be a function of \phi. D can be a function of \phi. \vec{u} can be a function of \phi. Leave those functions of \phi as they are, just factor out the *canonical* \phi that *must* be in the term.


Reply via email to