### How can I apply boundary conditions involving derivatives of more than one variable?

252
views
0
8 months ago by
Hello,

I've read the Fenics tutorial and there are explanations for cases involving Dirichlet and Neumann boundary conditions and these BC are usually applied to the function spaces of each variable. Now let's say I have two variables x and y and on the boundary I have to satisfy the condition:   $\left(\nabla x+kx\nabla y\right).n$(x+kxy).n =0, where k is a generic constant and 'n' is a unit vector normal to the boundary (so here we have a dot product involving this unit vector). This is kind of a "no-flux" boundary condition.  How should I proceed to apply such boundary condition?

Any inputs would be much appreciated.
Community: FEniCS Project
1
which system of PDEs are you attempting to discretise?
written 8 months ago by Nate
1
What is your weak formulation? Doesn't anything similar to the boundary condition pop up in it?
written 8 months ago by Adam Janecka
I thumb'd up these comments ^^ ...  I agree this is required information for a good answer.  If the terms do not show up in the weak form, you may be able find a good solution that satisfies the boundary condition by using a Lagrange multiplier.
written 8 months ago by pf4d
The term  $\nabla x+k\nabla y$∇x+k∇y  can be seen as a current density J, with x being the charge density and y the potential. Such term arises in the Nernst-Planck equation and one requirement would be the no-flux outside the conductor. So I'd like to know how I could impose the condition J.n = 0 at the conductor surface, being n a unit vector normal to the surface.
written 8 months ago by George
1
Well, if your weak form does not include the $j \cdot n$ term, you'll need to adjoin the PDE constraint to the weak form.  This is a standard procedure for the FEM.
written 8 months ago by pf4d
So I have these equations (Poisson-Nersnt-Planck), C,a and k are generic constants.
$\frac{\partial x}{\partial t}+\nabla.J=0$xt +∇.J=0
$J=C\left(\nabla x+kx\nabla y\right)$J=C(x+kxy)
$\nabla^2y=ax$2y=ax

Previously I was just replacing the second equation into the first one and so I could not see how to implement the condition J.n=0. On the other hand, if I consider the 2nd equation as just one more component of the system of equations it might be easier to do this implementation, how to do it, I'm not sure. Does this idea has anything to do with what you pointed out?

written 8 months ago by George
2

Using the divergence theorem, the weak formulation of the second term in the first equation reads
$\int_\Omega div(\mathbf{J}) q \, dx = - \int_\Omega \mathbf{J} \cdot \nabla q \,dx + \int_{\partial \Omega} (\mathbf{J} \cdot \mathbf{n}) q \,dS,$
$q$ being the test function. Then, enforcing the boundary condition means just setting the last integral to zero.

written 8 months ago by Adam Janecka
That ^ is a perfect explanation.
written 8 months ago by pf4d