This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Best practice for setting Boundary Conditions in a Laplace Electrostatic Problem?

+2 votes

I’m new to Python/Fenics. I am trying a 2D Laplace electrostatic example (see sketch below). The mesh is defined manually in a .xml file. A semicircle is the surface of a conductor and the outer box is grounded. A Neumann boundary defines a line of symmetry. I need to apply a constant voltage to the circle, a Neumann boundary condition on the symmetry line, and ground (0 Volts) on the box edges. I've gotten as far as getting the mesh to import and plot and am moving on to boundary conditions and equation solving. What is the best way to apply these boundary conditions? I didn't see any examples that matched my case very well. Is it possible to assign bc’s to a list of vertices that makeup the respective boundaries? Also, in terms of solving this example, can I just use the Poisson formulation and set the right hand equation to zero?

G = 0 Volts
V = 200 Volts
N = Neumann
M = Meshed space (air)
- = Solid conductor, not part of the solution space

GGGGGGGGGGGGGGGGGGGGGGGGGG
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
VVV MMMMMMMMMMMMMMMMMMMM G
-------V MMMMMMMMMMMMMMMMMMM G
----------V MMMMMMMMMMMMMMMMMM G
------------V MMMMMMMMMMMMMMMMM G
------------V MMMMMMMMMMMMMMMMM G
----------V MMMMMMMMMMMMMMMMMM G
-------V MMMMMMMMMMMMMMMMMMM G
VVV MMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
N MMMMMMMMMMMMMMMMMMMMMM G
GGGGGGGGGGGGGGGGGGGGGGGGGG

asked Jan 9, 2014 by jleman FEniCS Novice (140 points)

You need to provide more information to be able to get any help for example the math, some code. Boundary conditions including Neumann and DirichletBC is well covered in the FEniCS book in chapter 10.3.9.

1 Answer

+1 vote

Is it possible to assign bc’s to a list of vertices that makeup the respective boundaries?

No. But similar and correct approach is using the MeshFunction/FacetFunction. You mark its values using SubDomain (or import values generated by external mesh-generator) and use it to define DirichletBC for V, G and Neumann BC for N. This is covered by FEniCS book and demos.

Also, in terms of solving this example, can I just use the Poisson formulation and set the right hand equation to zero?

I have no clue what is right hand equation.

answered Jan 13, 2014 by Jan Blechta FEniCS Expert (51,420 points)
...