# How to apply Neuman boundary condition to Finite-Element-Method problems?

I have a 2D rectangular domain. The governing equation on this domain is Laplace equation:

$\nabla^2 f = 0$

In the left edge there is Neumann boundary conditon : $\frac{\partial f}{\partial n} = -a$

n is the normal vector to the domain's boundary(here on the left edge it's equal to the negative direction of x axis) and 'a' is a given date and it's a constant.

There is a Dirichlet boundary condition at the bottom edge and there is no boundary condition on right and top edge.

My problem is how to apply that Neumann boundary condition. I'm using finite element method (with first order triangulation)

As you may know, in finite element method first we make stiffness matrix (or global coefficient matrix from local coefficient matrix). Then we apply our governing equation(here the Laplace equation).

-
to scott morrison: why do you think my question is too localized and closed it? I just want to know how to apply neumann boundary condition to FEM problems –  kami Nov 11 '09 at 19:10
I also think the question is too localized: it looks like you are asking the MO community to solve a specific differential equation for you. I'd recommend that you clean up the question (capitalization, etc.), take out the specific details, give a short background on FEM, and ask a theoretical question; then someone with more reputation points than I have might re-open it. –  Theo Johnson-Freyd Nov 12 '09 at 1:50
As per Theo's comment. Please flag for moderator attention is you've edited and would like someone to re-open. –  Scott Morrison Nov 12 '09 at 5:34

You need to modify right-hand vector b of an equation Kx = b, where K is your stiffness matrix.

Here's how to do it, depending on which edge is on von Neumann boundary:

• edge 1-2 (i.e. connecting local nodes 1 and 2),

l = sqrt(x21*x21 + y21*y21);
b[node1] += a * l / 2.0f;
b[node2] += a * l / 2.0f;
b[node3] += 0;

• edge 1-3,

l = sqrt(x13*x13 + y13*y13);
b[node1] += a * l / 2.0f;
b[node2] += 0;
b[node3] += a * l / 2.0f;

• edge 2-3,

l = sqrt(x32*x32 + y32*y32);
b[node1] += 0;
b[node2] += a * l / 2.0f;
b[node3] += a * l / 2.0f;

-
Check "Introduction To The Finite Element Method In Electromagnetics" by Anastasis Polycarpou. There is no better introduction to FEM. –  Limal Nov 16 '09 at 17:56

If a=0, i.e., the Neumann data is homogeneous, you don't need to do anything. Just construct the stiffness matrix including the nodes at the Neumann boundary, and solve the equation (do whatever you do to the Dirichlet part, as there can be many ways to implement it). The Neumann b.c. is imposed by the variational formulation automatically, which is the reason to call this b.c. a natural b.c.

Otherwise, you have to change the right hand side, so that it includes a boundary integral term in the variational formulation.

Have a look at

Susanne Brenner and Ridgway Scott. The mathematical theory of finite element methods.

-