Kevin -

I'm happy to answer the questions, but let's please keep it on the list for 
benefit to all.

I wondered how it was you knew the potential of a conductor embedded in an 
insulator. 

To set the gradient to a non-zero value on an interior boundary, 
http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#applying-fixed-flux-boundary-conditions
 should be applicable. To set the electric field to zero, however, I think the 
most straightforward thing to do is set the dielectric to something large 
within the conductor (you could create the flux divergence source term, but it 
would just add zero to the RHS, which wouldn't do anything). See 
https://gist.github.com/guyer/d474dee23566e2389630 for an example.

When I do Poisson problems in my own work, I usually define the mesh such that 
the contacts are exterior faces; Poisson's equation isn't wrong inside the 
conductor, just largely irrelevant. You could use Gmsh to define a mesh with a 
hole in it, or you could do something like this (in 2D, but the same works in 
3D):

mesh = (fp.Grid2D(nx=20, ny=10) 
        + (fp.Grid2D(nx=10, ny=20) + [[20], [0]]) 
        + (fp.Grid2D(nx=20, ny=10) + [[10], [20]]) 
        + (fp.Grid2D(nx=10, ny=20) + [[0], [10]]))

X, Y = mesh.faceCenters
conductor = mesh.exteriorFaces & (X > 1) & (X < 29) & (Y > 1) & (Y < 29)

- Jon

On Oct 28, 2015, at 5:04 AM, Kevin 100 <[email protected]> wrote:

> Jonathan
>  
> Thank you for your response and your clear iPython notebook example.
>  
> In my particular case the problem was not the order of the terms. I am 
> dealing with large potentials (10^5) and because of this I set largeValue = 
> 10^15. This gives nonsensical results. However, I found that setting 
> largeValue = 10^10 gives reasonable results. Looks like I created an overflow 
> somewhere.
>  
> I hope you do not mind one more rookie question. Normally the potential of an 
> interior conductor is not known, and a better boundary condition is that the 
> potential be constant on the conductor. In 3D this is equivalent to 
> restricting the gradient to be perpendicular to the conductor surface. Does 
> FiPy allow applying a boundary condition like this for an interior object?
>  
> Kevin
>  
>  
> 
> From: Guyer, Jonathan E. Dr.
> Sent: Thursday, October 22, 2015 3:54 PM
> To: FIPY
> Subject: Re: FiPy interior conductor with Poisson's equation
>  
>  
> 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 ]


_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to