On Sep 19, 2008, at 10:40 AM, Zhiwen Liang wrote:

It seems that the "var.getFaceGrad()" gives better resolution of the field stored in "var" than the "var.getGrad()". This is why I was trying to use FaceVariable in one of the equation terms.

That depends on what you mean by "better resolution". If anything, I would expect `getGrad()` to be smoother, which is generally better.

The problem I am solving needs a very fine mesh. So I thought it might be improved if I use the face variable.

I think there's a conceptual error here. If you need a fine mesh, then make a fine mesh. The FaceVariables are not any finer than the CellVariables; they're just displaced by half a grid-spacing. By definition, FiPy solves equations at Cell centers (CellVariables). Fluxes occur between Cells (diffusion & convection) and call for coefficients that are FaceVariables. Sources (transients and sources) change the value at Cells and therefore *must* be defined using CellVariables.



There are any number of reasons why you might be getting poor results.

Under-resolution is an obvious one: refine your mesh.

Conceivably, `getGrad()` is an inadequate discretization for your needs, in which case we can look into coding up a higher-order discretization.

Quite possibly, the issue is elsewhere altogether, though. What is the physical process you are trying to model? What behavior are you seeing that leads you to believe that you have a problem?


Reply via email to