On Jul 18, 2013, at 4:58 AM, Edwin Sze Lun Khoo <[email protected]> wrote:
> J_face.setValue(-1.0/2.0*(c.harmonicFaceValue-rho/2.0)*phi.faceGrad) In this case, you are getting a boundary value that depends on the phi.faceGrad.constrain() > J_cell.setValue(-1.0/2.0*(c-rho/2.0)*phi.grad) whereas here phi.grad depends on the *values* at the faces, not on the gradients at the faces. It knows nothing about the phi.faceGrad.constrain() you applied. > It seems that J_cell becomes 1 (which is suspiciously half of 2) on the > rightmost cell while J_face is still 2. I would like to ask why J_cell > doesn't achieve a value of 2 on the rightmost cell. In the absence of a phi.constrain() on the right, the value at the exterior face is the same as the value at the neighboring cell center and so the gradient across the cell is seen as half the gradient you expect. _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
