On 01/08/2016 06:31 PM, krei wrote:
>
> The domains of the two problems share a boundary, but I made two
> different meshes for 1) Vacuum over a metal surface
> (
http://i.imgur.com/R2KOiXB.png); and 2) the metal
> (
http://i.imgur.com/XIBAsg2.png).
>
> I vacuum, I want to solve the Laplace equation for electric potential
> such that the boundary condition at the surface of the metal is just
> potential = 0. This I have already managed to do.
>
> In the metal part I want to solve a stationary equation for currents
> (hopefully this latex is displayed correctly): [; \nabla \cdot \sigma(x)
> \nabla \varphi = 0 ;]
>
> with Neumann boundary condition on the copper-vacuum boundary (represent
> emission currents): [; \vec{n} \cdot \vec{J}(E_\text{vac}) = \vec{n}
> \cdot \sigma(x) \nabla \varphi ;]
>
> From my initial testing with VectorTools::point_gradient as Simon
> suggested, It seems to work to implement this BC, but I would love to
> hear suggestions how to solve the problem in a better way.
You could try to go into the implementation of
VectorTools::interpolate_b_v to see what this function does. You will
find that it requires the evaluation of the boundary values at the
"support points", i.e., the points where the finite element shape
functions are defined. For example, for a Q1 element, these are just the
vertices of faces at the boundary, whereas for Q2 elements there are
also the face and edge midpoints. If your two meshes match, then the
points where you need to evaluate the gradient of one solution happen to
be also the vertices of the other solution, and this can make many
things simpler. Specifically, you would only need to evaluate the first
solution (as boundary conditions for the second solution) at points that
are quite well defined and easy to find, rather than having to do what
VectorTools::point_gradient does (namely, loop over all cells, find the
appropriate cell, evaluate the solution there). The result should of
course be the same, but it would be more efficient. If, on the other
hand, your assembly is currently not the bottleneck, then there is no
reason for you to go to a more complicated scheme than you currently
already have.
> Eventually, I also need to couple the currents equation with the heat
> equation [; \nabla \cdot \kappa(x,T) \nabla T = -
> \frac{J^2}{\sigma(x,T)} ;] and also the emission currents and the
> electric conductivity become temperature dependent. I am currently
> studying step-21 on how to couple multiple PDE-s, but any suggestions on
> this are also welcome.
This is a classical problem in solving coupled problems. step-21 is an
example of solving something like this. step-15 also provides a number
of tools that you will need (specifically on how to evaluate solutions
at quadrature points).