On Fri, Jun 8, 2012 at 9:59 AM, Jonathan Guyer <[email protected]> wrote: > > > Good question. > > I've forked your gist at https://gist.github.com/2895662, but I don't see any > way to show you a diff. What I did is extended the mesh so that the > boundaries at 0 and D now lie at cell centers and then I used coupled > ImplicitSourceTerms to apply the coupled boundary conditions.
The anchors should be left_anchor = 1e+10 * (x < (dx / 2)) right_anchor = 1e+10 * (x > (D - dx / 2)) otherwise two cells are being constrained on the right hand side. If the face gradients are constrained, this allows a natural inflow and outflow, which seems to get very close to the analytical. I_right.faceGrad.constrain(0, m.facesRight) I_left.faceGrad.constrain(0, m.facesLeft) The diff is this: 20,24c20,21 < < left_anchor = 1e+10 * (x < (dx / 2)) < right_anchor = 1e+10 * (x > (D - dx / 2)) < I_right.faceGrad.constrain(0, m.facesRight) < I_left.faceGrad.constrain(0, m.facesLeft) --- > left_anchor = 1e+10 * (x < dx) > right_anchor = 1e+10 * (x > D - dx) Cheers -- Daniel Wheeler _______________________________________________ fipy mailing list [email protected] http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
