Sunteți pe pagina 1din 53

The equations governing the steady 2-D Newtonian flow are

or identically
But this is just a theoretical example in which the flow is assumed to have
null thickness
If we want to make a more adequate approach that takes into account the
third dimension we have to use the Shallow Water equations (SSWW)
governing equations
shallow waters
computational fluid dynamics I
x
f u
x
p
y
u
v
x
u
u
t
u
+ A +
c
c
=
c
c
+
c
c
+
c
c
v

1
y
f v
y
p
y
v
v
x
v
u
t
v
+ A +
c
c
=
c
c
+
c
c
+
c
c
v

1
0
,
=
i i
u ( ) u f u u
u
A + V = V +
c
c
v

p
t
1

0 =
c
c
+
c
c
y
v
x
u
2 , 1 = i
governing equations
shallow waters
computational fluid dynamics I
The assumptions to be made are
The distribution of the horizontal velocity along the vertical direction is assumed
to be uniform
An integration in height is carried out, and the horizontal velocity is taken as the
mean value of the horizontal velocities along the vertical direction
The main direction of the flow is the horizontal one, and only very small flows
take place on vertical planes
The acceleration in the vertical direction is negligible compared to gravity and a
hydrostatic distribution of the pressure is assumed
Integrating the continuity equation along the z-axis
As the Leibniz rule to bring the derivatives into the integral sign gives
it is obtained
governing equations
shallow waters. continuity eq.
computational fluid dynamics I
( ) ( ) 0 = + +
} }
b
h
h
h
h
h w h w dz
y
v
dz
x
u
b b
c
c
c
c
0 =
c
c
+
c
c
+
c
c
z
w
y
v
x
u
h
h
b
H=h+h
b
h
( ) ( ) 0 = + =
} }
x
h
h u
x
h
h u udz
x
dz
x
u
b
b
h
h
h
h
b b
c
c
c
c
c
c
c
c
( ) ( ) ( ) ( ) ( ) ( ) 0 = + + + +
} }
b
b
b
h
h
b
b
h
h
h w h w
y
h
h v
y
h
h v vdz
y x
h
h u
x
h
h u udz
x
b b
c
c
c
c
c
c
c
c
c
c
c
c
w(h), (vertical component of the velocity on the surface) is given by
Substituting in the former equation
Noting that , and taking and renaming the main velocities as
the continuity equation is obtained as
0 =
c
c

c
c
+ +
} }
t
h
t
h
vdz
y
udz
x
b
h
h
h
h
b b
c
c
c
c
( ) ( ) ( ) h v
y
h
h u
x
h
t
h
dt
dh
h w
c
c
+
c
c
+
c
c
= =
0 =
c
c
t
h
b
u udz
H
u
h
h
b
=
}
1
v vdz
H
v
h
h
b
=
}
1
0 =
c
c
+
c
c
+
c
c
y
vH
x
uH
t
h
governing equations
shallow waters. continuity eq.
computational fluid dynamics I
As the vertical acceleration is negligible, the third dynamic equation
can be written as
Integrating this equation in depth and assuming the atmospheric pressure
to be zero it is obtained
Deriving with respect to x and y
governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
0
1
= +
c
c

z
f
z
p

z
f
z
w
y
w
x
w
z
p
z
w
w
y
w
v
x
w
u
t
w
+
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2
1
v

dz
z
p
dz f
h
h
h
h
z
b b
} }
c
c
=
( ) ( ) ( ) p h p h p h h f
b b z
= =
x
p
x
h
f
z
c
c
=
c
c

1
y
p
y
h
f
z
c
c
=
c
c

1
The first dynamic equation results into
Adding the continuity equation multiplied by u, it is obtained
this is
as
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
+ =
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2
z
u
y
u
x
u
x
h
f f
z
u
w
y
u
v
x
u
u
t
u
z x
v
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
+ =
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2
z
u
y
u
x
u
x
h
f f
z
w
y
v
x
u
u
z
u
w
y
u
v
x
u
u
t
u
z x
v
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
+ =
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2 2
z
u
y
u
x
u
x
h
f f
z
uw
y
uv
x
u
t
u
z x
v
governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
z
w
u w
z
u
y
v
u v
y
u
x
u
u
t
u
z
uw
y
uv
x
u
t
u
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
+
c
c
2
2
Integrating in depth the former expression
Taking into account that , it is obtained
Cancelling terms
( ) ( ) ( ) +
c
c
+
c
c

c
c
+
c
c

c
c
} }
x
h
h u
x
h
h u dz u
x t
h
h u udz
t
b
b
h
h
h
h
b b
2 2 2
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) dz H
x
h
f f h w h u h w h u
y
h
h v h u
y
h
h v h u uvdz
y
h
h
z x b b
h
h
b
b b
b b
} }
A +
|
.
|

\
|
c
c
+ = +
c
c
+
c
c

c
c
u v
( ) ( ) ( ) h v
y
h
h u
x
h
t
h
dt
dh
h w
c
c
+
c
c
+
c
c
= =
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) dz H
x
h
f f h v
y
h
h u
x
h
t
h
h u h v
y
h
h u
x
h
t
h
h u
y
h
h v h u
y
h
h v h u uvdz
y
h
h
z x b
b
b
b b
b
h
h
b
b b
b b
} }
A + |
.
|

\
|
c
c
+ =
(

c
c
+
c
c
+
c
c

c
c
+
c
c
+
c
c
+
c
c
+
c
c

c
c
u v
dz H
x
h
f f uvdz
y
dz u
x
udz
t
h
h
z x
h
h
h
h
h
h
b b b b
} } } }
A +
|
.
|

\
|
c
c
+ =
c
c
+
c
c
+
c
c
u v
2
( ) ( ) ( ) +
c
c
+
c
c

c
c
+
c
c

c
c
} }
x
h
h u
x
h
h u dz u
x t
h
h u udz
t
b
b
h
h
h
h
b b
2 2 2
|
|
.
|

\
|
c
c
+
c
c
+
c
c
+
c
c
+ =
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2 2
z
u
y
u
x
u
x
h
f f
z
uw
y
uv
x
u
t
u
z x
v
governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
Taking mean velocities it is obtained
The viscosity effects can be evaluated as
where v is the turbulent viscosity
Where are the shear stresses acting on the surface (due to the wind action)
and on the bottom (due to the roughness of the channel)
= Wind drag coefficient
= Manning coefficient
= Wind velocity components
= Air density
dz H
x
h
f f
y
uvH
x
H u
t
uH
h
h
z x
b
}
A +
|
.
|

\
|
c
c
+ =
c
c
+
c
c
+
c
c
u v
2
x x
b
b s
h
h
H
y
u
x
u
dz t t v v +
|
|
.
|

\
|
c
c
+
c
c
= A
} 2
2
2
2
u
x x
b s
t t ,

t
i a w
s
W W C
i
= 3 4
2
h
i
b
H
u V gn
H
i
= t
W
C
n
i
W
a

governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
Developing the derivatives in the left hand side
Taking into account the continuity eq.
the former eq becames
governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
y
H
uv H
y
v
u v
y
u
x
H
u H
x
u
u
t
H
u H
t
u
y
uvH
x
H u
t
uH
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
) ( 2
2
2
0 =
c
c
+
c
c
+
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
y
H
v H
y
v
x
H
u H
x
u
t
h
y
vH
x
uH
t
h
vH
y
u
y
H
v H
y
v
x
H
u H
x
u
t
H
u H
x
u
u H
t
u
y
uvH
x
H u
t
uH
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
) (
2
vH
y
u
H
x
u
u H
t
u
y
uvH
x
H u
t
uH
c
c
+ +
c
c
+
c
c
=
c
c
+
c
c
+
c
c
0
2
The derivatives of the depth with respect to x andy are
Carrying out the same operations for the y dimension, and developing the
derivatives taking into account the last expression it is obtained
where f
c
is the Coriolis factor
3 4
2
2
2
2
2
h
x a w
c
H
u V gn
H
W W C
y
u
x
u
v f
x
h
g
y
u
v
x
u
u
t
u
+
|
|
.
|

\
|
c
c
+
c
c
+ +
c
c
=
c
c
+
c
c
+
c
c

v
3 4
2
2
2
2
2
h
y a w
c
H
v V gn
H
W W C
y
v
x
v
u f
y
h
g
y
v
v
x
v
u
t
v
+
|
|
.
|

\
|
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c

v
governing equations
shallow waters. dynamic eq.
computational fluid dynamics I
( )
x
h
x
h h
x
H
b
c
c
=
c
+ c
=
c
c
The shallow water equations result into
with boundary conditions
impermeability , (no slip)
discharge
contour stresses ,
water level
governing equations
shallow waters
computational fluid dynamics I
3 4
2
2
2
2
2
h
x a w
c
H
u V gn
H
W W C
y
u
x
u
v f
x
h
g
y
u
v
x
u
u
t
u
+
|
|
.
|

\
|
c
c
+
c
c
+ +
c
c
=
c
c
+
c
c
+
c
c

v
3 4
2
2
2
2
2
h
y a w
c
H
v V gn
H
W W C
y
v
x
v
u f
y
h
g
y
v
v
x
v
u
t
v
+
|
|
.
|

\
|
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c

v
0 =
c
c
+
c
c
+
c
c
y
vH
x
uH
t
h
0 =
N
u 0 =
T
u
}
= Q ds Hu
N
0
N N
t t =
0
T T
t t =
( ) ( ) t h t h
0
=
If in the N-S dynamic equation we substitute the non-linear velocities by a known
velocity field and the rest of the velocities by the a scalar unknown | we arrive to
the convection diffusion equation that rules the transport of substances by
convective and diffusive actions.
The equations are
or in 1D
where | is the quantity being transported, k is the diffusion coefficient, U
i
is the
known velocity field, and Q are the external sources of the quantity. These are
also known as the Transport Equations
governing equations
convection-diffusion equation
computational fluid dynamics I
f
z y x z
W
y
V
x
U
t
+
|
|
.
|

\
|
c
c
+
c
c
+
c
c
=
c
c
+
c
c
+
c
c
+
c
c
2
2
2
2
2
2
| | |
v
| | | |
0 = + + + Q k U
jj j j t , , ,
| | |
0 = +
|
.
|

\
|
c
c
c
c

c
c
+
c
c
Q
x
k
x x
U
t
| | |
CFD
I
finite elements in fluids
computational fluid dynamics I
3. Finite Elements in Fluids
There is no analytical solution for most engineering problems such as
fluid flow
The determination of the velocity and pressure field is required in a
domain of infinite degrees of freedom
The Finite Element Method (developed about 1950 for structures)
substitutes the domain by another with a finite number of freedom
degrees, thus an approximation of the solution is obtained
Some important names in the finite element history are Courant, Turner,
Clough, Zienkiewicz, Brookes, Hughes,
Now it is used not only in structural mechanics but also in heat
conduction, seepage flow, electric and magnetic fields, and of course
in fluid dynamics
finite elements in fluids
general issues
computational fluid dynamics I
finite elements in fluids
general issues
computational fluid dynamics I
sms.avi
finite elements in fluids
general issues
computational fluid dynamics I
2D h zoom at the mine.avi
3D H(x,y), water depth colour (only 600 days).avi
largo modulos.avi
finite elements in fluids
general issues
computational fluid dynamics I

X
Y
0 100 200
0
50
100
150
200
250
VEL
1.78125
1.6625
1.54375
1.425
1.30625
1.1875
1.06875
0.950002
0.831252
0.712501
0.593751
0.475001
0.356251
0.237501
0.11875
1.69975E-06
9.60324E-07
4.19696E-07
8.11084E-08
2D H (water level).avi
finite elements in fluids
general issues
computational fluid dynamics I
The main way of solving continuum problems in the finite element method are the
following
The direct approach (matrix analysis), by using a direct physical reasoning to establish
the element properties. Requires very simple basic elements (bars, pipelines,)
Variational approach (e.g. Rayleigh-Ritz based method), in this method the stiffness
matrix is obtained as a result of the resolution of a variational problem
Weighted residual approach (e.g. Galerkin Method), as a result of weighting the
differential equations and integrating them in the domain
finite elements in fluids
general issues
computational fluid dynamics I
Main steps of the finite element method
Subdivide the domain in a finite number of elements interconnected a the nodes,
where the unknowns (p, u) are going to be determined
It is assumed that the variation of the unknowns can be approximated by a simple
function
The approximation functions are defined in terms of the values of the field
variables at the nodes
When the equilibrium or variational equations has been obtained the new finite
unknowns are introduced into the equations
The system of equations is solved and the unknowns are determined at the nodes
The approximation functions give the solution in the rest of the domain points
Following, the femsolution of the one simple 1-D problemis to be considered
on a 6-step basis
finite elements in fluids
general issues
computational fluid dynamics I
In the traditional Rayleigh-Ritz methods the interpolating functions have to be
defined over the entire domain and have to satisfy the boundary conditions.
Meanwhile in the FEM the interpolating trial functions are defined on a finite element
basis, being more versatile when the shape is not simple enough
The limitation is that the FEM trial functions have to satisfy in addition some
convergence conditions (continuity and completeness and compatibility)
finite elements in fluids
general issues
computational fluid dynamics I
'...as the nature of the universe is the most perfect and the work of the
Creator is wiser, there's nothing that takes place in the universe in
which the ratio of maximum and minimum does not appear. So there is
no doubt whatsoever that any effect of the universe can be explained
satisfactorily because of its final causes, through the help of the method
of maxima and minima, as can be by the very causes taking place
Leonhard Euler
(Basel,1707- Saint Petersburg,1783)
When using a variational approach, the aimis to find the vector function of
unknowns, that makes a minimumor a maximumof the functional I (typically
the energy)
After the discretezation has been carried out in terms of E smaller parts the
piecewise approximation is introduced so that
or in terms of the so called shape functions N
i
where are the values of the unknowns at the nodes
finite elements in fluids
variational approach
computational fluid dynamics I
dS
x
g dV
x
F I
} }
|
.
|

\
|
c
c
+
|
.
|

\
|
c
c
= ,... , ,... ,
|
|
|
|
|
( )
( ) e
aprox
e
| | =
( )
( ) ( )
+ u + u =
e e
N N
e
2 2 1 1
|
i
u
Afterwards, the condition of extremezation of I with respect to u
i
is imposed
Adding all those element contributions it is obtained
Assuming I to be a quadratic functional of | , the element equation results in
finite elements in fluids
variational approach
computational fluid dynamics I
0 =
|
|
|
|
|
.
|

\
|
u c c
u c c
u c c
=
u c
c
M
i
I
I
I
I

2
1
( )

=
=
u c
c
=
u c
c
E
e
i
e
i
I I
1
0
( )
( )
( )
| |
( ) ( ) e e e
e
e
P K
I
u =
u c
c
After the assembling process it is obtained
where and
After applying the boundary conditions the system is solved for the nodal
unknowns u
i
Once u
i
are known, we can obtain other variables as a post-processing value
finite elements in fluids
variational approach
computational fluid dynamics I
| | P K =
| |
( )
| |

=
=
E
e
e
1
K K
( )

=
=
E
e
e
1
P P
Example. Find the velocity distribution of an inviscid fluid flowing trough a
varying cross section pipe shown in the figure
The governing equations are defined by finding the potential | that minimizes the
energy integral equation
with the boundary condition u(x=0)=u
0
, where the cross section area is
finite elements in fluids
variational approach, example
computational fluid dynamics I
dx
dx
d
A I
L
}
|
.
|

\
|
=
0
2
2
1 |

L x
e A A

=
0
u
0
A
0
L
A
1
A
2
u
1
u
2
u
3
l
(1)
l
(2)
1
st
step. Discretization
Divide the continuum into two finite elements. The values of the potential
function | at the three nodes will be the unknowns of the fem
2
nd
step. Select an interpolation model, easy but leading to convergence
The potential function will be taken as linear
and can be evaluated at each element as
where l
(e)
is the length of the e element
( ) bx a x + = |
( )
( )
( ) ( ) ( )
( )
( ) e
e e e e
l
x
x
1 2 1
u u + u = |
finite elements in fluids
variational approach, example
computational fluid dynamics I
3
rd
step. Derivation of stiffness matrices K
(e)
and load vectors P
(e)
by using
a variational principle
Deriving the interpolating | function with respect to x it is obtained
where the cross sectional areas can be taken for the first and second element
as and
where the nodal unknowns are respectively and
( )
( )
( ) ( )
( )
( )
( ) ( ) ( ) ( )
( )
( )
| |
( ) e
e e
l
o
e
e e e e
l
e
e e
l
e
x
l
A
dx
l
A dx
dx
d
A I
2
2
2
1
2
1
2
1 2
2
1
2
2
0
2
1 2
0
2
u u u + u
=
|
|
.
|

\
|
u u
=
|
.
|

\
|
=
} }

( )
( ) ( ) ( ) ( )
( )
( )
( ) ( )
| |
( )
( )
( )
( ) ( ) ( ) e e
T
e
e
e
e
e e
e
e e e e
e
l
A
l
A
I K
2
1
1 1
1 1
2
1
2
2
2
1
2 1
1 2
2
1
2
2
=
(

u
u
(


u u =
u u u + u
=

2
1 0
A A +
2
2 1
A A +
|
|
.
|

\
|
u
u
=
2
1 1) (

|
|
.
|

\
|
u
u
=
3
2 2) (

finite elements in fluids


variational approach, example
computational fluid dynamics I
3
rd
step. (cont)
The minimal potential energy principle gives , if we take into account the
external inflow
where Q is the mass flowrate across section
therefore, if we derive the functional I for each basic element
or in matrix form
( )
( ) ( ) ( ) ( )
( )
( )
( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) e
T
e e e
T
e e e e e
e
e e e e
e
Q Q
l
A
I Q K = u u
u u u + u
=
2
1
2
2
2 2 1 1
1 2
2
1
2
2

0 =
u c
c
i
I
( )
( )
( ) ( ) ( ) ( )
( )
( ) ( )
( )
( )
( ) ( )
( ) 0 2
2
1 2 1 2 2 1
1
1 2
2
1
2
2
1 1
1
= u u = u + u
u c
c
u u u + u
u c
c
=
u c
c
) ( ) ( ) ( e e e
e
e e e e e e e e
e
e
Q
l
A
Q Q
l
A I
( )
( )
( ) ( ) ( ) ( )
( )
( ) ( )
( )
( )
( ) ( )
( ) 0 2
2
2 1 2 2 2 1
2
1 2
2
1
2
2
2 2
1
= u u = u + u
u c
c
u u u + u
u c
c
=
u c
c
) ( ) ( ) ( e e e
e
e e e e e e e e
e
e
Q
l
A
Q Q
l
A I
( )
( ) ( ) ( ) ( ) ( )
( )
( ) ( ) ( )
0
2
1
= =
u c
c
=
u c
c
e e e e
T
e e e
T
e
i i
e
I
Q K Q K
Au Q =
finite elements in fluids
variational approach, example
computational fluid dynamics I
4
th
step. Assembly of the stiffness and load vectors
Once we have obtained the matrices for all the basic elements as
we can assemble the system to obtain Q K=
( )
( )
( ) (


=
1 1
1 1
1
1
1
l
A
K
( )
( )
( ) (


=
1 1
1 1
2
2
2
l
A
K
( )
(

=
0
1 1 1
u A
Q
( )
(

=
2 3
2
0
u A
Q
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
(
(
(

=
(
(
(

u
u
u
(
(
(
(
(
(

2 2
0 0
3
2
1
2
2
2
2
2
2
2
2
1
1
1
1
1
1
1
1
0
0
0
u A
u A
l
A
l
A
l
A
l
A
l
A
l
A
l
A
l
A




finite elements in fluids
variational approach, example
computational fluid dynamics I
5
th
step. Resolution of the system
As we need a reference value for the potentials (u
3
is an unknown) we can set
u
3
equal to 0
Taking A
(1)
as 0.80 A
0
and A
(2)
as 0.49 A
0
, and l
(1)
= l
(2)
=L/2, the systemof two
equations with two unknowns gives
6
th
step. Computation of the results
Once we have obtained the potentials, the velocities can be derived by using
the equivalence
which gives the velocities at elements 1 and 2 as
L u
0 1
65 1. = u
L u
0 2
027 1. = u
( ) 1
1 2
l dx
d
u
u u
= =
|
( )
0
1
25 1 u u . =
( )
0
2
05 2 u u . =
finite elements in fluids
variational approach, example
computational fluid dynamics I
In this method the FE equations can be directly obtained fromthe governing
equations (or equilibriumequations)
The discretization is made and the field variable is approximated as
where u
i
are constants and N
i
(x) are linearly independent functions chosen
such that the boundary conditions are satisfied
A quantity R known as the residual or error is defined as
The weighted function of the residual is taken as
where f(R)=0when R=0
finite elements in fluids
weighted residuals
computational fluid dynamics I
( ) ( ) | | G F =
( ) ( )

=
u =
n
i
i i
x N x
1
~
|
( ) ( ) | |
~ ~
F G R =
( ) 0 =
}
dV R wf
V
There are several approaches to the weighted residuals method such as the
collocation method, the Least Squares method and the most commonly used of
all, the Galeking method
In the Galerkin method the weighting functions are chosen to be equal to the
trial functions and f(R) is taken as R
with i=1,2,,n
In the rest of the aspects the method is similar to the variational
finite elements in fluids
weighted residuals
computational fluid dynamics I
0 =
}
dV R N
V
i
Example. Find the velocity distribution of an inviscid fluid flowing trough a
varying cross section tube shown in the figure
The governing equations are given by the continuity equation
with the boundary condition u(x=0)=u
0
, where the cross section area is
finite elements in fluids
weighted residuals
computational fluid dynamics I
0
2
2
=
dx
d |
L x
e A A

=
1
u
0
A
1
L
A
2
A
3
u
1
u
2
u
3
l
(1)
l
(2)
1
st
step. Discretization
Divide the continuuminto two finite elements. The values potential function | in
the three nodes will be the unknowns of the fem
2
nd
step. Select an interpolation model, easy but leading to convergence
The potential function will be taken as linear
and can be evaluated at each element as
where l
(e)
is the length of element e
( ) bx a x + = |
( )
( ) ( ) ( )
( )
( ) e
e e e
l
x
x
1 2 1
u u + u = |
finite elements in fluids
weighted residuals
computational fluid dynamics I
This can also be obtained through the shape functions which have to be 1 at its
node and zero at the others, that is
this is
(the same as obtained before)
finite elements in fluids
weighted residuals
computational fluid dynamics I
( ) ( ) ( ) x N x N x
2 2 1 1
u + u = |
( ) e
l
x
N =1
1
( ) e
l
x
N =
2
1
l
(e)
1
l
(e)
( )
( ) ( )
( )
( ) e e e
l
x
l
x
l
x
x
1 2 1 2 1
1 u u + u = u +
|
.
|

\
|
u = |
3
rd
step. Derivation of stiffness matrices K
(e)
and load vectors P
(e)
by using
equilibrium. Obtaining of a weak form
The integral of the weighted residual is
integrating by parts
( )
0
0
2
2
=
}
dx
dx
d
w
e
l
i
|
finite elements in fluids
weighted residuals
computational fluid dynamics I
dx
dx
d
dv
2
2
|
=
dx
d
v
|
=
i
w u =
i
dw du =
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
0
0
0
0 0
0
0
2
2
=
|
|
.
|

\
|
=
(

=
} } }
dx
dx
dw
dx
d
dx
d
w
dx
l d
l w dw
dx
d
dx
d
w dx
dx
d
w
i
l
i
e
e
i i
l
l
i
l
i
e e
e
e
| | | | | |
( )
( )
( ) ( )
1 2
0
0u w u l w dx
dx
d
dx
dw
i
e
i
l
i
e
=
}
|
finite elements in fluids
weighted residuals
computational fluid dynamics I
This is
The elementary matrices result into
As
where
As the derivatives are
the elementary matrices result into
( ) ( ) ( )
0 =
e e e
P K
( )
( )
( )
( )
( ) ( )
1 2
2
1
2 1
0
2 2 1 1
0
0u w u l w dx
dx
dN
dx
dN
dx
dw
dx N N
dx
d
dx
dw
i
e
i
l
i
l
i
e e
=
(

u
u
(

= u + u
} }
( )
} }
|
|
|
|
.
|

\
|
=
(

(
(
(

= dx
dx
dN
dx
dN
dx
dN
dx
dN
dx
dN
dx
dN
dx
dN
dx
dN
dx
dx
dN
dx
dN
dx
dN
dx
dN
e
2 2 1 2
2 1 1 1
2 1
2
1
K
( )
(

=
2
1
u
u
e
P
L dx
dN 1
1
=
L dx
dN 1
2
=
( )
( ) ( )
( ) ( )
( )
( ) |
|
.
|

\
|


=
|
|
|
|
.
|

\
|

=
}
1 1
1 1
1
1 1
1 1
0
2 2
2 2
e
l
e e
e e
e
l
dx
l l
l l
e
K
|
|
.
|

\
|
u
u
=
2
1 1) (

|
|
.
|

\
|
u
u
=
3
2 2) (

4
th
step. Assembly of the stiffness and load vectors
Once we have obtained the matrices for all the basic elements as
we can assemble the system to obtain
Q K=
( )
( ) (


=
1 1
1 1
1
1
1
l
K
( )
( ) (


=
1 1
1 1
1
2
2
l
K
( )
(

=
0
0 1
u
P
( )
(

=
2
2
0
u
P
( ) ( )
( ) ( ) ( ) ( )
( ) ( )
(
(
(

=
(
(
(

u
u
u
(
(
(
(
(
(

2
0
3
2
1
2 2
2 2 1 1
1 1
0
1 1
0
1 1 1 1
0
1 1
u
u
l l
l l l l
l l
finite elements in fluids
weighted residuals
computational fluid dynamics I
5
th
step. Resolution of the system
6
th
step. Computation of the results
As can be seen, the system of equations obtained by the weighted residuals
method is the same as in the variational method except for the absence of the
density (which can be removed as it is a constant), and the cross section areas.
The areas are not present in the second formulation as the systemis solved in
velocities and not in flow rates. To avoid this fact a two dimensional model
should be considered.
finite elements in fluids
weighted residuals
computational fluid dynamics I
Finite elements = Piecewise approximation of the solution by dividing the
region into small pieces
This approximation is usually made in terms of a power series (polynomial) which
is easy to integrate and easy to be improved in accuracy by increasing the order,
fitting in this way the shape of the polynomial to that of the solution (see figure)
When the polynomial is of higher order (bigger than one) the midside and/or
interior nodes have to be used in addition to the corner nodes
Some other approximations such as Fourier series could also be used
Problems involving curved boundaries can be solved using isoparametric
elements which are not straight-sided
finite elements in fluids
discretization
computational fluid dynamics I
finite elements in fluids
discretization
computational fluid dynamics I
The mesh can be improved by
Subdividing selected elements (h-refinement)
Increasing the order of the polynomial of selected elements (p-refinement)
Moving node points (r-refinement)
Defining a new mesh
In higher order elements the midside and/or interior nodes have to be used in
addition to the corner nodes in order to match the number of nodal degrees of
freedom with the number of constants
As it will be shown a different interpolation for the velocity and pressure
unknowns is required for fem in fluids
Basic elements to be considered
Triangular linear
Quadrilateral linear
Triangular linear (natural)
Triangular quadratic
finite elements in fluids
discretization
computational fluid dynamics I
The FEM is an approximation that converges to the exact solution as the element
size is reduced if:
i. The field variable and its derivatives must have representation as the element
size reduces to zero
For example, second derivatives cannot be represented with linear functions
Then the elements are said to be complete
ii. The field variable and its derivatives should be continuous within the element (C
r
piecewise differentiable, where r is the maximum order of derivatives within the
integrand)
(The polynomials are inherently continuous and satisfy this requirement)
The field variable and its derivatives, up to the r-1-th, must be continuous at the
element boundaries
Then the elements are said to be compatible or conforming
finite elements in fluids
discretization, convergence
computational fluid dynamics I
dx
dx
d
r
r
}
|
If we had for instance, flat penthouses as interpolating functions, the
interpolating surface would be discontinuous (would break and split up)
Still, there are many fem basic elements that not verifying the former properties
still provide meaningful solutions (such as the checker board pressure mode)
finite elements in fluids
discretization, convergence
computational fluid dynamics I
5.00 10.00 15.00 20.00 25.00 30.00 35.00 40.00 45.00 50.00 55.00
5.00
10.00
15.00
20.00
25.00
30.00
35.00
40.00
45.00
50.00
55.00
0.00 10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.00
0.00
10.00
20.00
30.00
40.00
50.00
60.00
70.00
80.00
90.00
100.00
Let the basic linear triangular element connecting nodes 1, 2,and 3 be
The equation that gives the
surface (plane) | is
(1)
that leads to the following
equations
( ) y x y x
3 2 1
o o o | + + = ,
1 3 1 2 1 1
y x o o o | + + =
2 3 2 2 1 2
y x o o o | + + =
3 3 3 2 1 3
y x o o o | + + =
1
|
2
|
3
|
( )
2 2
, y x
( )
1 1
, y x
( )
3 3
, y x
x
y
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
The solution of the former system gives
(2)
where
substituting (2) in (1) and rearranging terms it is obtained
( )
3 3 2 2 1 1 1
2
1
| | | o a a a
A
+ + =
( )
3 3 2 2 1 1 2
2
1
| | | o b b b
A
+ + =
( )
3 3 2 2 1 1 3
2
1
| | | o c c c
A
+ + =
1 3 2
y y b =
3 2 1
y y b =
2 3 1
x x c =
3 1 2
x x c =
1 2 3
x x c =
2 1 3
y y b =
2 3 3 2 1
y x y x a =
3 1 1 3 2
y x y x a =
1 2 2 1 3
y x y x a =
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
3 3
2 2
1 1
1
1
1
2
1
y x
y x
y x
A =
The interpolating function results
where
(3)
The shape functions take the value of 1 at its node and cero at the rest
These expressions are complicated and depend on x and y
( ) ( ) ( ) ( )
3 3 2 2 1 1
, , , , | | | | y x N y x N y x N y x + + =
( ) ( ) ( ) ( ) ( )
2 3 3 2 2 3 3 2 1 1 1 1
2
1
2
1
x x y y y x y x y x
A
y c x b a
A
y x N + + = + + = ,
( ) ( ) ( ) ( ) ( )
3 1 1 3 3 1 1 3 2 2 2 2
2
1
2
1
x x y y y x y x y x
A
y c x b a
A
y x N + + = + + = ,
( ) ( ) ( ) ( ) ( )
1 2 2 1 1 2 2 1 3 3 3 3
2
1
2
1
x x y y y x y x y x
A
y c x b a
A
y x N + + = + + = ,
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
For an A element matrix equal to
The integrals are
As the integrand is a constant there is no need to integrate numerically
( )
( )
}
O
c
c
+
c
c
c
c
= = dxdy
y
N
y
N
x
N
x
N
A
j
i
j
i
ij
e
c c
v A
finite elements in fluids
discretization, triangular linear
computational fluid dynamics I
( )
( )
dxdy
y
N
y
L
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
y
N
y
N
x
N
x
N
e
e
}
O
|
|
|
|
|
|
|
.
|

\
|
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
c
c
c
c
+
c
c
c
c
=
3 3 3 3 2 3 2 3 1 3 1 3
3 2 3 2 2 2 2 2 1 2 1 2
3 1 3 1 2 1 2 1 1 1 1 1
v A
( )
( )
( )
( ) ( ) ( )( ) ( )( ) ( )( ) ( )( )
( ) ( ) ( )( ) ( )( )
( ) ( )
( )
}
O
|
|
|
|
.
|

\
|
+
+ +
+ + +
=
e
dxdy
x x y y sim
x x x x y y y y x x y y
x x x x y y y y x x x x y y y y x x y y
A
e
e
2
1 2
2
2 1
1 2 3 1 2 1 1 3
2
3 1
2
1 3
1 2 2 3 2 1 3 2 3 1 2 3 1 3 3 2
2
2 3
2
3 2
2
4
v
A
The basic element matrix results
That now can be assembled
in the stiffness matrix to yield
finite elements in fluids
discretization, triangular linear
computational fluid dynamics I
( )
( )
( ) ( ) ( )( ) ( )( ) ( )( ) ( )( )
( ) ( ) ( )( ) ( )( )
( ) ( )
|
|
|
|
.
|

\
|
+
+ +
+ + +
=
2
1 2
2
2 1
1 2 3 1 2 1 1 3
2
3 1
2
1 3
1 2 2 3 2 1 3 2 3 1 2 3 1 3 3 2
2
2 3
2
3 2
4
x x y y sim
x x x x y y y y x x y y
x x x x y y y y x x x x y y y y x x y y
A
e
e
v
A
6
2
9
(
(
(
(
(
(
(
(
(
(
(
(
(
(

=
(
(
(
(
(
(
(
(
(
(
(
(
(
(

u
u
u
u
u
u
u
u
u
u
(
(
(
(
(
(
(
(
(
(
(
(
(
(

10
9
8
7
6
5
4
3
2
1
10
9
8
7
6
5
4
3
2
1



f
f
f
f
f
f
f
f
f
f
The need of integrating the shape functions and their derivatives over
the domain leads to the use of the natural (local) coordinates, which
allows for an element based integration that simplifies the calculations
The natural triangular system of referenced is defined with the linear
dependent coordinates L
1
, L
2
, and L
3
where A
i
is the area defined by the point P and the opposite side
The shape functions for this triangular linear element are
A
A
L
1
1
=
A
A
L
2
2
=
A
A
L
3
3
=
1
3
2
P
A
2
A
1
A
3
i i
L N = 3 2 1 , , = i
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
1
3 2 1
= + + L L L
The shape functions are in fact as seen in (3)
Or in matrix form
1
3
2
P
A
2
A
1
A
3
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
A
A
y x
y x
y x
A
L N
i
k k
j j
i i
2
2
1
1
1
2
1
= = =
( ) ( ) ( ) ( ) ( )
j k k j j k k j i i
x x y y y x y x y x
A
y x L y x N + + = =
2
1
, ,
( ) ( ) ( )
( ) ( ) ( )
( ) ( ) ( ) (
(
(

(
(
(




=
(
(
(

y
x
x x y y y x y x
x x y y y x y x
x x y y y x y x
A
L
L
L 1
2
1
1 2 2 1 1 2 2 1
3 1 1 3 3 1 1 3
2 3 3 2 2 3 3 2
3
2
1
3 3
2 2
1 1
1
1
1
2
1
y x
y x
y x
A =
The derivatives of L
1,
L
2
and L
3
being
1
3
2
P
A
2
A
1
A
3
finite elements in fluids
discretization, triangular linear b.e.
computational fluid dynamics I
A
y y
x
L
2
3 2 1

=
c
c
A
y y
x
L
2
1 3 2

=
c
c
A
x x
y
L
2
3 1 2

=
c
c
A
x x
y
L
2
2 3 1

=
c
c
A
y y
x
L
2
2 1 3

=
c
c
A
x x
y
L
2
1 2 3

=
c
c
For natural coordinates in triangles the same procedure can be used
except for the fact that one of the three coordinates is linear
dependant and can be dropped from the integration leading to a
change in the integration limits
where the jacobian determinant is
and the integral is
( )( ) ( )( ) | |
A
x x y y x x y y
A y
L
x
L
y
L
x
L
J
2
1
4
1
2 3 1 3 3 1 3 2
2
1 2 2 1
= =
c
c
c
c

c
c
c
c
=
( ) ( ) ( )
1 2
1
0
1
0
2 1 1 2
1
0
1
0
1 1 1
dL dL L L g dL dL y x f
J
dxdy y x f
L L
} } } } }

O
= = , , ,
1
3 2 1
= + + L L L
finite elements in fluids
discretization, triangular quadratic
computational fluid dynamics I
( ) ( )
1 2
1
0
1
0
2 1
1
2 dL dL L L g A d y x f
L
} } }

O
= O , ,

S-ar putea să vă placă și