On Apr 27, 2006, at 3:34 PM, Damm, Edward F. (E. Buddy) wrote:

Regarding your statement:
        "However you determine Mc, yva, and d2Gmducdphi, remember that
they must be determined on faces to be consistent with
phi.getFaceGrad()."
How do I find out if I am determining these values on the face?

If you calculate them with fields on cells (like uc and phi), then they'll be values on cells. If I have a function:

def g(f):
    return (f * (1 - f))**2

and I call it as g(phi), then I'll get back a field on cells.
If I call it as g(phi.getArithmeticFaceValue()), then I'll get back a field on faces. If I call it as g(phi).getArithmeticFaceValue(), then I'll get back a slightly different field on faces. That difference doesn't usually matter, but it can. Basically, if you pass face values in, then you'll get face values back out. If you pass cell values in, then you'll get cell values back out.

  If I am
not, is it just as easy to use one of the other 'getGrad' variations?

   Mc[on cells] * yva[on cells] * d2Gmducdphi[on cells] * phi.getGrad()

is easier to write, and should work, but it will be less accurate. Potentially much less accurate.


Ie
getArithmeticFaceValue(), and not have to change how I am determining
the values of Mc, yva, and d2Gmducdphi?

Use getArithmeticFaceValue() to convert a *scalar* field on cells to a *scalar* field on faces.
Use getGrad() to calculate a *vector* field on cells.
Use getFaceGrad() to calculate a *vector* field on faces.

When you multiply fields together, they must be consistent: all on faces or all on cells.

FiPy ultimately wants the convection coeff as a vector field on faces. if it gets a vector field on cells, it will interpolate, but it will do so less accurately than you can usually do yourself.


Reply via email to