How to set the boundary conditions of conductors with unknown potential when solving the potential distribution

Hi all, I want to use FEniCS to solve the Poisson equation and obtain the potential distribution of the system. However, there is a conductor in the system, and the surface of the conductor should be an equipotential surface, and the potential on this surface is unknown. Therefore, I need to set a constant boundary condition, and this boundary value is unknown and needs to be solved. I found that FEniCS’s Dirichlet boundary condition requires the boundary potential value. Is there a way to add an equipotential surface with an unknown potential on the surface of the conductor and then solve for this potential value?

I would use the constrained domain option in fenics to map all dofs on the surface to a single dof (like a periodic boundary condition collapsed to a point).
See for instance: Rigidity constraint · Issue #9 · jorgensd/dolfinx_mpc · GitHub

Thank you very much, I have read and understood this method, and I think it can solve my current problem.

A simple way is to model the boundary as a thin layer with very high dielectric constant.

If you prefer to solve it in a more nifty way, there was a past discussion in which Nitsche’s method was used to enforce this constraint. If interested, you can read it here:

1 Like

Since potential is defined up to a constant anyway, what would be wrong if you just impose a vanishing Dirichlet boundary condition on the conductor surface? Fenicsx would then solve for.the potential on the rest.of the geometry and you would know.the relativr potential with respect.to the conductor one.

It won’t work in general since you need to have the potential at that constant value which produces the right gradient normal to that boundary. However, if in your whole domain you do not have any other boundary at fixed potential then I suspect it might actually work to just prescribe this surface at zero potential