0% found this document useful (0 votes)
46 views

Finite Element Application in Water Engineering: Example

1) The document describes using the finite element method to model water flow in a 1D river. The river is discretized into linear elements with nodes. 2) Element equations are derived using the Galerkin approach to minimize the residual of the governing water flow equation. This results in a system of equations relating the water height at nodes. 3) The document shows applying integration by parts to the element equations, resulting in a system of equations with the water height and its derivative at nodes in terms of the water recharge along the element.

Uploaded by

mohamedyahai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Finite Element Application in Water Engineering: Example

1) The document describes using the finite element method to model water flow in a 1D river. The river is discretized into linear elements with nodes. 2) Element equations are derived using the Galerkin approach to minimize the residual of the governing water flow equation. This results in a system of equations relating the water height at nodes. 3) The document shows applying integration by parts to the element equations, resulting in a system of equations with the water height and its derivative at nodes in terms of the water recharge along the element.

Uploaded by

mohamedyahai
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Finite Element Application in Water Engineering

Example
Consider the water flow in a one dimensional river

h0 = 40 cm Water recharge f ( x ) = 10 hL = 200 cm

x=0 x=L

The governing equation of the water flow is given by

d 2h
= − f ( x) (1)
dx 2

h(0, t ) = h0 = 40 cm , h( L, t ) = hL = 200 cm , L = 10 m

The recharge f (x ) defines a water source along the river.

1) Discretization

Element (1) (2) (3) (4)

Node 1 2 3 4 5
x=0 x = 10m
2) Element Equations
We use linear elements

1
~
h
hj
hi

i j
xi xj
~
h = N i hi + N j h j (2)

The method of weighted residuals


The method of weighted residual consists of finding a minimum for the residual, i.e,

∫ RW dx = 0
i i = 1, 2,…, m (3)

where, Wi are weighting functions, R is the residual (error).

For the governing equation (1),


~
2
d h
R= + f ( x) (4)
dx 2
In the Galerkin approach, the shape functions are used as weighting functions, i.e.

∫ RN dx = 0
i i = 1, 2,…, m (5)

2
1 1
N1 N2

i j
x1
x2
For the one dimensional river, we use linear elements,
x
⎡ 2 ~ ⎤
⎢ d h + f ( x ) ⎥ N i dx = 0 , i = 1, 2

2

x1 ⎢ dx 2

⎣ ⎦


x 2 d 2 h
N i dx = − ∫
x 2
f ( x ) N i dx , i = 1, 2 (6)
x1 dx 2 x1

dv du
∫ dx udx = uv − ∫ dx
vdx integration by parts

~ ~
dv d 2 h d dh u = Ni
Let = 2
= ( ) ,
dx dx dx dx
x2
⎡ ⎤
i = 1, 2
~ ~ ~
x2 d2 h ⎢ d h ⎥ −
x2 d h dN i ,
∫ x1 dx 2
N i dx = N i
⎢ dx ⎥ ∫ x1 dx dx
dx
⎣ ⎦ x1

Then equation (6) becomes,


x2
~
x2 d h dN
⎡ ~

d h
⎢Ni ⎥ + 2 f ( x) N i dx , i = 1, 2
x
∫x1 dx dx i
dx =
⎢ dx ⎥ ∫x1
(7)
⎣ ⎦ x1

Look at the right hand side of equation (7).

For i = 1,
~
⎡ ~ ~

d h dN 1 d h ( x ) d h ( x1 ) ⎥
dx = ⎢ N 1 ( x 2 )
x2 x2
∫x1 dx dx ⎢ dx
2
− N 1 ( x1 )
dx ⎥
+ ∫x1
f ( x ) N 1 dx
⎣ ⎦
~
d h ( x1 ) x2
= −
dx
+ ∫
x1
f ( x ) N 1 dx (7a)

3
For i = 2,
~
⎡ ~ ~

x2 d h dN 2 ⎢ d h ( x ) d h ( x1 ) ⎥ x2
∫x1 dx dx
dx = N 2 ( x2 )
⎢ dx
2
− N 2 ( x1 )
dx ⎥ ∫x1
+ f ( x) N 2 dx
⎣ ⎦
~
d h( x2 ) x2
=+ + ∫ f ( x) N 2 dx (7b)
dx x1

Look at the left hand side of equation (7).

dN1 d x 2 − x −1 1
= ( )= = − , l is the length of the element
dx dx x 2 − x1 x 2 − x1 l

dN 2 d x − x1 1 1
= ( )= =
dx dx x2 − x1 x2 − x1 l
~
dh d h h 1
= ( N1h1 + N 2 h2 ) = − 1 + 2 = (−h1 + h2 )
dx dx l l l

The first term in (7a) becomes

~
x2 d h dN1 x2 1 1 1 x2 1
∫x1 dx dx
dx = ∫ (−h1 + h2 )(− )dx = 2 (h1 − h2 ) ∫ dx = (h1 − h2 )
x1 l l l x1 l
The first term in (7b) becomes
~
x2 d h dN 2 x2 1 1 1
∫x1 dx dx
dx = ∫ x1 l
( − h1 + h2 )( ) dx == ( − h1 + h2 )
l l

Now (7a) and (7b) can be rewritten as:


~
1 d h( x1 ) x2
( h1 − h2 ) = − + ∫ f ( x) N1dx (8a)
l dx x1

~
1 d h( x2 ) x2

l
( − h1 + h 2 ) =
dx
+ ∫x1
f ( x ) N 2 dx (8b)

⎧ ~

⎪− d h ( x1 ) ⎪ ⎧ x2 ⎫
1 ⎡ 1 − 1⎤ ⎧ h1 ⎫ ⎪ dx ⎪ ⎪ ∫x1 f ( x) N1dx ⎪
or ⎨ ⎬=⎨ ~ ⎬+⎨ x ⎬ (9)
l ⎢⎣− 1 1 ⎥⎦ ⎩h2 ⎭ ⎪ d h( x ) ⎪ ⎪ 2 f ( x) N 2 dx ⎪
⎪ dx ⎪ ⎩ 1
2 ∫ x ⎭
⎩ ⎭
--- this is the matrix equation in the local system.

4
In this example, l=10/4=2.5, f(x)=10, then the water source terms in (8a) and (8b)
become

x2 2.5 x2 − x 2.5 2.5 − x


∫x1
f ( x) N 1 dx = ∫ 10 ⋅
0 x 2 − x1
dx = ∫ 10 ⋅
0 2.5 − 0
dx = 12.5

x2 2.5 x − x1 2.5 x−0


∫x1
f ( x) N 2 dx = ∫ 10 ⋅
0 x2 − x1
dx = ∫ 10 ⋅
0 2.5 − 0
dx = 12.5

Assembly

Element (1) (2) (3) (4)

Node 1 2 3 4 5
x=0 x = 10 m

Element number Local node number Global node number


1
1
1
2
2
2
1
2
3
2
3
1
3
4
2
4
1
4
5
2

5
In the global system the matrix for element 1 becomes

0 ⎤ ⎧ h1 ⎫ ⎧ − d h ( x 1 ) / dx + 12 . 5 ⎫
~
⎡1 −1 0 0
⎢− 1 ⎥ ⎪ ⎪ ⎪ ~ ⎪
1 0 0 0 ⎥ ⎪ h 2 ⎪ ⎪ d h ( x ) / dx + 12 . 5 ⎪
1⎢ ⎪ ⎪ ⎪ 2 ⎪
⎢ 0 0 0 0 0⎥⎨ 0 ⎬ = ⎨ 0 ⎬
l⎢ ⎥⎪ ⎪ ⎪ ⎪
⎢ 0 0 0 0 0⎥ 0
⎪ ⎪ ⎪ 0 ⎪
⎢⎣ 0 0 0 0 0 ⎥⎦ ⎪⎩ 0 ⎪⎭ ⎪ ⎪
⎩ 0 ⎭

Similarly the matrix for element 2 becomes

⎡0 0 0 0 0⎤ ⎧ 0 ⎫ ⎧ 0 ⎫
⎢0 ⎪ ⎪
0 ⎥⎥ ⎪⎪ h2 ⎪⎪ ⎪ − d h ( x2 ) / dx + 12 .5 ⎪
~
1 −1 0
1⎢ ⎪ ⎪ ⎪ ~ ⎪
⎢0 −1 1 0 0 ⎥ ⎨ h3 ⎬ = ⎨ d h ( x3 ) / dx + 12 .5 ⎬
l⎢ ⎥
⎢0 0 0 0 0⎥ ⎪ 0 ⎪ ⎪ 0

⎪ ⎪ ⎪ ⎪
⎢⎣ 0 0 0 0 0 ⎥⎦ ⎪⎩ 0 ⎪⎭ ⎪⎩ 0 ⎪⎭

Combining elements 1 and 2 we have

0 ⎤ ⎧ h1 ⎫ ⎧ − d h ( x ) / dx + 12 .5 ⎫
~
⎡1 −1 0 0
⎢− 1 1 + 1 − 1 ⎥ ⎪ ⎪ ⎪ 1 ⎪
0 0 ⎥ ⎪ h2 ⎪ ⎪ 0 + 12 .5 + 12 .5 ⎪
1⎢ ⎪ ⎪ ⎪ ~ ⎪
⎢0 −1 1 0 0 ⎥ ⎨ h3 ⎬ = ⎨ d h ( x ) / dx + 12 .5 ⎬
l⎢ ⎥
0⎥ ⎪ 0 ⎪ ⎪ ⎪
3

⎢0 0 0 0
⎪ ⎪ ⎪ 0 ⎪
⎢⎣ 0 0 0 0 ⎥
0 ⎦ ⎪⎩ 0 ⎪⎭ ⎪ ⎪
⎩ 0 ⎭

The global matrix of all elements is therefore

0 ⎤ ⎧ h1 ⎫ ⎧− d h( x ) / dx + 12.5⎫
~
⎡ 1 −1 0 0
⎢− 1 1 + 1 − 1 ⎥ ⎪ ⎪ ⎪ 1 ⎪
⎥ ⎪⎪ 2 ⎪⎪ ⎪⎪ ⎪
0 0 h
1⎢
25

⎢ 0 − 1 1 + 1 − 1 0 ⎥ ⎨h3 ⎬ = ⎨ 25 ⎬
l⎢ ⎥⎪ ⎪ ⎪ ⎪
⎢0 0 − 1 1 + 1 − 1⎥ h4
⎪ ⎪ ⎪ ~ 25 ⎪
⎢⎣ 0 0 0 ⎥
− 1 1 ⎦ ⎪⎩h5 ⎪⎭ ⎪ d h( x ) / dx + 12.5 ⎪
⎩ 5 ⎭

6
~
At the two boundaries h1 = 40 cm and h5 = 200 cm (but d h( x1 ) / dx and
~
d h( x5 ) / dx are not known). Therefore the global equation becomes

0 ⎤ ⎧ 40 ⎫ ⎧− d h( x ) / dx + 12.5⎫
~
⎡1 −1 0 0
⎢− 1 1 + 1 − 1 ⎥⎪ h ⎪ ⎪ ⎪
1

⎢ 0 0 ⎥ ⎪⎪ 2 ⎪
⎪⎪ ⎪ 25 ⎪

⎢0 − 1 1 + 1 − 1 0 ⎥ ⎨ h3 ⎬ = ⎨ 25 ⎬ × 2 .5
⎢ ⎥
⎢0 0 − 1 1 + 1 − 1⎥ ⎪ h4 ⎪ ⎪ ⎪
⎪ ⎪ ⎪ ~ 25 ⎪
⎢⎣ 0 0 0 − 1 1 ⎥⎦ ⎪⎩200 ⎪⎭ ⎪ d h( x ) / dx + 12.5 ⎪
⎩ 5 ⎭
In the above, there are 3 unknowns in equations 2, 3 and 4, so we can solve these

3 equations to get the values of h2 , h3 and h4 .

⎡ 2 − 1 0 ⎤ ⎧h2 ⎫ ⎧ 62 .5 + 40 ⎫ ⎧102 .5 ⎫
⎢ − 1 2 − 1⎥ ⎪ h ⎪ = ⎪ ⎪ ⎪ ⎪
⎢ ⎥⎨ 3 ⎬ ⎨ 62 .5 ⎬ = ⎨ 62 .5 ⎬
⎢⎣ 0 − 1 2 ⎥⎦ ⎪⎩ h 4 ⎪⎭ ⎪62 .5 + 200 ⎪
⎩ ⎭
⎪ 262 .5 ⎪
⎩ ⎭

⎡2 − 1 0 ⎤ ⎧ h2 ⎫ ⎧ 102 . 5 ⎫
⎪ ⎪ ⎪ ⎪
⎢ 0 1 .5
⎢ − 1⎥⎥ ⎨ h3 ⎬ = ⎨113 . 7 . 5 ⎬
⎢⎣ 0 − 1 2 ⎥⎦ ⎪⎩ h4 ⎪⎭ ⎪⎩ 262 . 5 ⎪⎭

⎡2 − 1 0 ⎤ ⎧h2 ⎫ ⎧ 102 .5 ⎫
⎢ 0 1 .5 − ⎥ ⎪ h ⎪ = ⎪113 .7.5⎪
⎢ 1 ⎥⎨ 3 ⎬ ⎨ ⎬
⎢⎣0 0 1.333 ⎥⎦ ⎪⎩h4 ⎪⎭ ⎪⎩ 338 .33 ⎪⎭

The solutions are h2 = 173.75 cm , h3 = 245 cm and h4 = 253.75 cm .

You might also like