# Finite Element Method (FEM)

## 2D depth-integrated flow (4)

In order to deduce the finite element form, we follow a well-known “recipe” (… it should be studied so that it can be done standing on your head!) and deduce the weak form as the first step. For this purpose we set up weighted integrals first:

 where: Q and W are weighting functions and f1 and f2 stand for the continuity and momentum equations.

According to the Galerkin method the weighting functions Q, W are set equal to the approximation functions  ,  for the wanted variables h and (u,v). It shall be noted that the approximation functions ,  are different for the depth h and the flow velocities (u,v). The program RMA2 for example uses a linear function for  and a square function for .

Partial differentiation and the Gauss theorem are applied to the weighted intergrals from Eq. 3-61. This does not apply to the continuity equation since it does not have any second-order derivatives that could be reduced. The derivatives with respect to time are not subject to partial differentiation either (see Unsteady problems). When going through the calculation it is important to watch that the boundary integrals that are formed make sense physically.