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

184

views

0

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

Any inputs would be much appreciated.

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`+`k``x`∇`y`).`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

Please login to add an answer/comment or follow this question.

So I have these equations (Poisson-Nersnt-Planck), C,a and k are generic constants.

$\frac{\partial x}{\partial t}+\nabla.J=0$∂

x∂t+∇.J=0$J=C\left(\nabla x+kx\nabla y\right)$

J=C(∇x+kx∇y)$\nabla^2y=ax$∇

^{2}y=axPreviously 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?

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.