The discussion at
http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-internal-boundary-conditions
describes exactly what you are trying to do. I think I know why it might not
have worked for you, though. When declaring an `ImplicitSourceTerm`, FiPy has
to be careful not to add negative values to the diagonal of the matrix, so it
examines the signs of the coefficients of the `ImplicitSourceTerm` and compares
them to the signs of the diagonal elements form the `DiffusionTerm` (and
others) that have already been put in the matrix; if the signs are opposite,
then FiPy treats those cells explicitly (puts everything on the RHS vector).
If you declare your equation (like I initially did) as
eq = (fp.DiffusionTerm(coeff=dielectric) + charge ==
conductor * largeValue * conductorPotential
- fp.ImplicitSourceTerm(coeff=conductor * largeValue)
then everything about the conductor gets put on the RHS vector and the implicit
solver never "sees" it. If you reverse the order of the last two terms, then
`conductor * largeValue` gets put on the matrix diagonal and `conductor *
largeValue * conductorPotential` gets put on the RHS and the solution for these
cells becomes dominated by `conductorPotential`.
In short, what I'm saying is that it matters (to FiPy (in this case)) whether
you say
V == conductorPotential
or
conductorPotential == V
I posted an IPython notebook at
https://gist.github.com/guyer/a61d5adfa9a050eb970a
On Oct 14, 2015, at 2:35 AM, Kevin 100 <[email protected]> wrote:
>
> I am a newcomer to FiPy and I am solving the Poisson's equation for the
> electric potential inside a 3D volume. It works fine when surface boundary
> conditions are applied but now I need to place a conductor inside. This will
> be a constant potential surface and I discovered that you cannot use
> potential.constrain for interior surfaces.
>
> The documentation suggests using an ImplicitSourceTerm along with a mask
> defining the surface, but it is not evident how this can be used to constrain
> the potential to be a constant value, or equivalently to constrain the
> electric field to be normal to the conducting surface. Is this possible?
>
> Thanks for any help, Kevin
>
> _______________________________________________
> fipy mailing list
> [email protected]
> http://www.ctcms.nist.gov/fipy
> [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]