Best practices for solving simulation(s) with multiple boundaries

42 views
Skip to first unread message

phillip mobley

unread,
Oct 11, 2018, 10:45:52 PM10/11/18
to deal.II User Group
Hello all,

I am currently creating an electrostatic solver where the simulation will need to solve a problem with multiple boundaries.

I will be using a simulation of a parallel plate capacitor as an example of what I am trying to do. In this simulation, I will need to solve for the voltage scalar field and electric field in the air surrounding the plates and inside the parallel plates themselves. In this example, I have 3 boundaries that I need to consider. One for each of the parallel plates and the boundary of the air medium. At first, I thought that I would have one large mesh file that I would iterate over and apply boundary conditions when appropriate. However, I believe that this thinking is inaccurate because I am not sure how I would identify the boundary of one plate from the boundary of another plate with just one large mesh file.

My current thinking is to generate multiple mesh objects. One for each boundary. I would have 3 mesh objects. One for the air medium, and two for the parallel plates. I would solve for the voltage field and the eletric field of each mesh object independent of each other. At the very end, I would combine each solution into a vtk file. On paper, this seems to be the better approach. In my air medium mesh object, I would have a boundary of where the air medium stops and then 2 holes in the mesh; one where each plate would be.I would be able to iterate over all the cells and check if they are at a boundary. If so, handle the cell accordingly.

However, I am still learning the ins and outs of dealii, I am not sure if this is the best approach for dealii. Are there any best practices for handling something like this in dealii? Does dealii have any built in functionality that I could utilize in order to make the solver more efficient?

I have an idea of how I want to structure my code but I was also wondering if there might be any recommendations on the architecture of the code (in addition to the recommendations found in Step-4)?

Thank you

Wolfgang Bangerth

unread,
Oct 14, 2018, 5:21:05 PM10/14/18
to dea...@googlegroups.com, phillip mobley

> I will be using a simulation of a parallel plate capacitor as an example of
> what I am trying to do. In this simulation, I will need to solve for the
> voltage scalar field and electric field in the air surrounding the plates and
> inside the parallel plates themselves. In this example, I have 3 boundaries
> that I need to consider. One for each of the parallel plates and the boundary
> of the air medium. At first, I thought that I would have one large mesh file
> that I would iterate over and apply boundary conditions when appropriate.
> However, I believe that this thinking is inaccurate because I am not sure how
> I would identify the boundary of one plate from the boundary of another plate
> with just one large mesh file.

I don't know what your model is, but I don't see a reason *not* to have
everything in one mesh. If you are concerned about tagging each entity in the
mesh appropriately: The way I think a lot of us do this is via

for (auto &cell : ...)
{
if (certain conditions on cell->center() coordinates)
cell->set_material_id (...);

for (f=0...)
if (cell->face(f)->at_boundary())
if (certain conditions on cell->face(f)->center() coordinates)
cell->face(f)->set_boundary_id (...);

}

You might in general be interested in looking at step-46, but in particular
this part:
https://dealii.org/developer/doxygen/deal.II/step_46.html#Meshesandassigningsubdomains

Best
W.

--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Reply all
Reply to author
Forward
0 new messages