CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   finite element method for the Shallow Water Equations help (

alvesker December 4, 2011 22:28

finite element method for the Shallow Water Equations help

I try to solve the Shallow Water Equations using finite element methods. Can anyone explain me how to treat nonlinear terms?

The problem is that we can write linear terms as matrix-vector multiplication where matrix is independent on time. For example for the height field h we have


after getting the Galerkin equation by multiplying on test function and integrating over domain we will get the term like

\sum_{i=1,N}c_i^h\int B_iB_jdx

or in the matrix form

(\int B_iB_jdx)_{i,j=1,N}(c_i^h)_{i=1,N}

Hence we compute the matrix only once and then multiply by updated coefficient vector

But how to deal with the terms like $uh$? where u is the velocity


after getting the Galerkin equation this will be like

\sum_{i,k=1,N}c_i^uc_k^h\int B_iB_jB_kdx

How these can be represented in the matrix form in order not to compute all these integrals on each timestep?

seyedashraf December 5, 2011 03:31

Dear alvesker,

you don't have to write the FEM approximated form of each parameter is more accurate, though, I would suggest writing the the mean value of those parameters to simplify the weak form.

about the integration on each time step
it depends on the grid form you are using to split the domain.

alvesker December 5, 2011 05:48

Dear seyedashraf,

Thanks for the quick reply.

Can you explain what do you understand by the mean value?
is it like the following?

hu = \sum_{i=1,N}c_i^hc_i^u B_i

and how write it to the terms like

u\nabla h

where u, h are the velocity component and height field

u = \sum_{i=1,N}c_i^uB_i,\ h=\sum_{i=1,N}c_i^hB_i

So if apply the FEM we have

u\nabla h=\sum_{i=1,N}c_i^uB_i\sum_{i=1,N}c_i^h\nabla B_i=\sum_{i,j=1,N}c_i^uc_j^hB_i\nabla B_j

what is the average in the case when in the multiplication one of unknows one contain gradient (we have these in the advection formulation)

alvesker December 5, 2011 06:01

the grid form - I use triangular grid

All times are GMT -4. The time now is 04:41.