On Thu, Jul 14, 2016 at 10:34 AM, Gopalakrishnan, Krishnakumar <krishnaku...@imperial.ac.uk> wrote: > Dear Dan, > > Thanks a lot for your reply. > > In the 'hacked' source term to handle this special boundary condition, i.e. > > fp.ImplicitSourceTerm((mesh.faceNormals * implicitCoeff * > mesh.facesRight).divergence)), > > my implicitCoeff turns out to be also a function of the x-coordinates of the > system. > > > > implicitCoeff = x * D * beta/((1 - beta*dx/2)) > > > > The fact that we are applying this source terms to the right face throws me > off, a bit. Usually, sources (i.e. generation terms) are defined at the > nodes, right ?
Well, in the cell centred FV method everything is really "solved" at the cell centers or associated with the cell. The "implicitCoeff" is a face variable so it can change based on position. > > Consequently, the ‘x’ in my implicitCoeff is x = mesh.cellCenters[0], right > ? (And, NOT x = mesh.FaceCenters[0]) Looking back over the previous email, the "implicitCoeff" is neither a cell or face variable implicitCoeff = -D * k / (1. - k * dx / 2.) It's just a single value, I think. If you want to make that quantity depend on position then you can make it a face variable and also make it dependent on spatial positions of the faces. > The reason why I ask is, with your trick, we have zeroed out the diffusion > coefficient at the right face, and instead applying the trick you had > proposed by turning the boundary condition to the divergence of the > ImplicitSourceTerm applied to the right boundary by the Boolean > mesh.facesRight. Despite the fact that at first glance, ‘x’ looks like > mesh.FaceCenters[0], keeping with the concept of generation terms defined > only at node locations, the ‘x’ in my sourceterm coefficient must be x = > mesh.cellCenters[0]. The "implicitCoeff" needs to be defined at the faces as it's inside a divergence. It won't work otherwise. You may need to think carefully how to zero out the diffusion coefficients on the faces for 2D, but that can also be achieved based on spatial position. -- Daniel Wheeler _______________________________________________ fipy mailing list fipy@nist.gov http://www.ctcms.nist.gov/fipy [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]