cfd icfd i computational fluid dynamics i - udccaminos.udc.es/info/asignaturas/201/cfd...

243
CFD I Computational Fluid Dynamics I CFD I CFD I Computational Fluid Dynamics I Pablo Rodríguez-Vellando Fernández-Carvajal Hochschule Magdeburg-Stendal Universidad de A Coruña Escuela Técnica Superior de Ingenieros de Caminos Canales yPuertos Hochschule Magdeburg Stendal Fachbereich Wasser und Kreislaufwirtschaft Escuela Técnica Superior de Ingenieros de Caminos, Canales y Puertos

Upload: hoangminh

Post on 10-Apr-2018

229 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

CFD ICFD I Computational Fluid Dynamics IPablo Rodríguez-Vellando Fernández-Carvajal

Hochschule Magdeburg-Stendal

Universidad de A CoruñaEscuela Técnica Superior de Ingenieros de Caminos Canales y Puertos

Hochschule Magdeburg StendalFachbereich Wasser und Kreislaufwirtschaft

Escuela Técnica Superior de Ingenieros de Caminos, Canales y Puertos

Page 2: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• First term, MSc International Master in Water Engineering, 6 ECTS

• Lectures timetable:

• Grades: Attendance + Courseworks

• Lecturers

– Pablo Rguez-Vellando

– Héctor García Rábade

– Jaime Fe Marqués

Page 3: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

Main Bibliography

• G Carey J Oden ‘Finite Elements’ Prentice-Hall 1984G. Carey, J. Oden, Finite Elements , Prentice-Hall,1984

• A. Chadwick, Hydraulics in Civil Engineering, Allen&Unwin, 1986

• J. Donea, ‘Finite Element Methods for Flow Problems’ Wiley, 2003y

• J. Ferziger, M. Peric, Computational methods for Fluid Dynamics

• P. Gresho, R Sani, ‘ Incompressible flow and the finite element method’, Wiley, 2000

• O. Pironneau, ‘Finite Element Methods for Fluids’, Wiley, 1989

• J. Puertas Agudo, Apuntes de Hidráulica de Canales, Nino, 2000

• Singiresu Rao, ‘The Finite Element Method in Engineering’, Elsevier 2005

• O. C. Zienkiewicz, R.L. Taylor, ‘The Finite Element Method. Vol 3, Fluid dynamics’, Mc

Graw HillGraw Hill

Page 4: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

0. Introduction to CFD. Revision of concepts (6h) 4. End user programmes (20h)

Computational Fluid Dynamics I

0. Introduction to CFD. Revision of concepts (6h)

1. Open channel flow. A revision

2. Saint-Venant equations

2. Introduction to CFD

3. Mathematical preliminaries

4. End user programmes (20h)1. MATLAB (8h)

2. HEC-RAS (4h)

3. SMS//RMA2 (8h)

1. Governing equations (6h)

1. Navier-Stokes

2. Potential, stream function, stokes flow

3. Shallow Water equations

4. Convection-diffusion eq

2. Finite elements and fluids hydrodynamics (24 h)

1. Finite elements and fluids

2. Variational and weighted residuals methods

3 Discretization3. Discretization

4. Potential flow

5. Stokes flow

6. Stable velocity-pressure pairs

7. Unsteady convective flow

8. Penalty methods

9. Shallow water equations

10. Stabilizing techniques

11. Flow in porous media

12. Conservative transport

13. Non-isothermal transport of reactives

3. Introduction to Finite Volumes (4h)

Page 5: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

CFDCFDI 1 Introduction to CFDI 1. Introduction to CFD

Page 6: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• In previous subjects we have regarded the Open Channel and Pipe flows

Computational Fluid Dynamics I

• In previous subjects we have regarded the Open Channel and Pipe flows• In the pipe flow the geometry is given and the unknowns are the pressure p(x,t)

and the velocity v(x,t). Some computational approaches have been regarded (e.g. EPANET)EPANET)

p

• In the open channel flow there is a hydrostatic distribution of pressures theIn the open channel flow there is a hydrostatic distribution of pressures, the unknowns are the shape (depth y(x,t)) and the velocity. Some computational approaches have been regarded (e.g. HEC-RAS)

p(z)zy zy

Page 7: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• As we can recall, the one dimensional flow in channels depends on space(x) and time (t) and can characterized as

Gradually varied

Unsteady

Open channel

Rapidly varied

Open channel Gradually varied flowFlow profiles (Curvas de remanso)

Non-uniformSt d fl

Uniform (i=I)

Steady flow Rapidly varied flowBroadcrested weir, hydraulic jump, sudden discharge variations

0 t/

Uniform (i=I) variations,…0/ x

Page 8: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• The open channel flow takes place into natural channels and also in irrigation,

Computational Fluid Dynamics I

The open channel flow takes place into natural channels and also in irrigation, navegation, spillways, sewers, culverts and drainage ditches

• Prismatic channels are assumed (all the cross sections are equal)• Basic notation B• Basic notation

y(x,t)

B

y( , )

v(x,t) Ah

xPz

• Depth (y), Stage (h) height from datum, Area (A), Wetted perimeter (P), Surface width (B), Ground height from datum (z)

x

• Hydraulic radius (R), (R=A/P)• Hydraulic mean depth (Dm), (D=A/B)

Page 9: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• In previous subjects you have regarded the Open Channel and Pipe flows

Computational Fluid Dynamics I

• In previous subjects you have regarded the Open Channel and Pipe flows• Saint-Venant equations allow for a resolution of the one dimensional flow• The continuity equation is given by the conservation of mass as

0

xv

BA

xyv

ty

• The dynamic equation is given by the conservation of momentum as

yvv

• In these differential equations the unknowns are the velocity v and the depth y for

0

iIg

xyg

xvv

tv

a given horizontal direction x• i is the geometric slope (i=-dz/dx) • I is the friction slope (I=- dE/dx)I is the friction slope (I dE/dx) • E is the Energy per unit weight given Bernoulli´s eq, E=z+y+v2/2g= z+pgv2/2g

Page 10: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• Saint Venant equations assume :

Computational Fluid Dynamics I

• Saint-Venant equations assume :• The slope is small i<0.1• Flow straight and paralell. Hydrostatic distribution of pressures• Turbulent flow fully developedTurbulent flow fully developed• Uniform velocity within the section (Coriolis factor, =1)• Non-erodible boundaries• Prismatic channel

• Finding the value of dv/dx in the stationary continuity equation and substituting it in the stationary dynamic equation we obtain

IiIidy

• That can also be written as

gyvIi

gABvIi

dxdy

/1/1 22

That can also be written as yFryIiy 21

• Slow regime (Fr<1), fast regime (Fr>1)

Page 11: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• The friction slope can be obtained from the Manning coefficient as

Computational Fluid Dynamics I

• The friction slope can be obtained from the Manning coefficient as2 2

4 3⁄  

• The equation yFryIiy 21

has no analytic solution an has to be solve by a numerical method

Th l ti f hi h ill b i f th f

y

• The solution of which will be an expression of the form xyy M1

yn y M2

M3 xyc

Page 12: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

Page 13: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• The solution to the equation

Computational Fluid Dynamics I

yIi • The solution to the equation

can be solved on a finite element basis, to obtain

yFryy 21

xff kk

1

dx

xdf

wherekk x

IiFryx

**2

11

2/* FrFrFr 2/* III

xdx

where

and

21 /* kk FrFrFr 21 /* kk III

kkk gyBy

QFr 310

3422 2

/

/k

k ByByQnI

• The finite diference problem can be completed by using an intial condition

kk gyBy kBy

00 xyx

yn=y10 y0

y9

yn

x x10 x9 x8 x7 x6 x5 x4 x3 x2 x1 x0=0

Page 14: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• First proposed in XIX c by Boudine (1861) and further developed by Bakhmeteff (1932)

Computational Fluid Dynamics I

• First proposed in XIX c. by Boudine (1861) and further developed by Bakhmeteff (1932)• Assuming that the initial condition is given downstream (y0 ) and that he stretch is long

enough for the normal depth to be reached, the iterative expression can be used N times varying the value of y from y0 up to yn at vertical equidistant intervals, and finally obtaining y g y y0 p y q , y gthe x for which the depth is the normal one

2009_10 Tramo 3k y fr I fr* I*

0 1 54 1 0023876 0 00364198 00 1,54 1,0023876 0,00364198 01 1,632 0,9188329 0,00309299 0,9606102 0,003367485 -3,001066462 1,724 0,8462737 0,00265301 0,88255329 0,002873 -13,86127333 1,816 0,7827859 0,00229591 0,8145298 0,002474459 -34,86001414 1,908 0,7268574 0,00200275 0,75482162 0,002149326 -69,29974365 2 0,6772855 0,0017596 0,70207141 0,001881175 -122,2435925 2 0,6772855 0,0017596 0,70207141 0,001881175 122,2435926 2,092 0,6331028 0,00155607 0,65519413 0,001657836 -202,0602687 2,184 0,5935233 0,00138424 0,61331306 0,001470155 -324,1347348 2,276 0,5579026 0,00123806 0,57571295 0,001311153 -521,809089 2,368 0,5257075 0,00111282 0,54180505 0,001175445 -892,257412

10 2,46 0,4964941 0,00100482 0,51110081 0,001058825 -2047,68149

1 71,92,12,32,52,7

do

Tramo 4

T

0,70,91,11,31,51,7

-2500 -2000 -1500 -1000 -500 0

Cal

ad

Distancia

Tra…

Page 15: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• Even the one dimensional Saint Venant equations are difficult to resolve and

Computational Fluid Dynamics I

• Even the one-dimensional Saint-Venant equations are difficult to resolve and some numerical procedure is to be needed. Step, characteristics, finite differences, finite volumes and finite elements are some of those

• The extension of the Saint Venant equations to the three dimensions are called• The extension of the Saint-Venant equations to the three dimensions are called the Navier-Stokes. They are also made up of continuity and dynamic equation

0

wvu

zyx

2

2

2

2

2

21zu

yu

xu

xpf

zuw

yuv

xuu

tu

x

2

2

2

2

2

21zv

yv

xv

ypf

zvw

yvv

xvu

tv

y

2221 wwwpwwww

the unknowns in these equations will be the velocities u(t,x,y,z), v(t,x,y,z), w(t,x,y,z)

222

1zw

yw

xw

zpf

zww

ywv

xwu

tw

z

and the presure p(t,x,y,z)

Page 16: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• That is

Computational Fluid Dynamics I

That is

0

zw

yv

xu

0iiu zyx

xfzu

yu

xu

xp

zuw

yuv

xuu

tu

2

2

2

2

2

21

2221 1

0iiu ,

yfzv

yv

xv

yp

zvw

yvv

xvu

tv

2

2

2

2

2

21

zfwwwpwwwvwutw

2

2

2

2

2

21

jjiiijijti upfuuu ,,,,

1

with boundary conditions: Dirichlet in (prescribed velocity)

zyxzzyxt

222

ii bu t bou da y co d t o s c et (p esc bed e oc ty)Newman in 2 (prescribed normal stress )

with initial conditions (unsteady flow)

ii buijij tn

jiji xuxu 00 ,

Page 17: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• Anyway, in most of the cases some others equations are used to provide a

simplified b t meaningf l sol tion to the flo problems Among these e cansimplified but meaningful solution to the flow problems. Among these we can

quote as some of the most important

–Potential and stream function equations

–Stokes flow eqs.Stokes flow eqs.

–Shallow water flow eqs. (SSWW)

Page 18: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• The potential flow equation is a simplification that uses the potential variable to

solve the continuity equation

• In the stream/vorticity formulation the u and p variables are written in terms of

the variables and , obtaining in this way simplified N-S equations

• In the Stokes equations the convective term is dropped

• The Shallow Water equations are the result of the integration in depth of the

three dimensional equations, therefore a two dimensional model is obtained

Page 19: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• The flow in a porous media simplifies Navier-Stokes eq and is also to be

Computational Fluid Dynamics I

• The flow in a porous media simplifies Navier-Stokes eq. and is also to be

considered

• Once the velocity field is obtained, we can use it as an input value to resolve the

transport equation that gives the concentration of a given species in the flowt a spo t equat o t at g es t e co ce t at o o a g e spec es t e o

• The transport equation can be also considered for non-isothermal reactivesThe transport equation can be also considered for non isothermal reactives

• The equations of the transport of sediments are also needed for the case inThe equations of the transport of sediments are also needed for the case in

which non-soluble substances are included in the flow

• For convective enough flows, a turbulent model is to be required

Page 20: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD I

• With respect to the dynamic macroscopic behaviour, flows can be regarded

Computational Fluid Dynamics I

With respect to the dynamic macroscopic behaviour, flows can be regardedas laminar or turbulent

• The laminar flow is ordered and it takes place in layers• The laminar flow is ordered and it takes place in layers

• In the turbulent flow particles move on an irregular fluctuant and erraticIn the turbulent flow, particles move on an irregular, fluctuant and erraticway -> turbulents models are required

• This situation takes place for a Reynolds number Re(=UL/ > 2000

• The Reynolds number indicates the weight of the convection with respect tothe viscous losses

Page 21: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• When the Reynolds number is large enough, the velocity unknown is split

into a mean velocity U and a fluctuating term that depends on time u’(t),

leading to u(t)=U+u’(t)

• The most common models are the algebraic, de one equation models

(Prandtl's Baldwin-Barth etc ) and the two eq (k k )(Prandtl s, Baldwin-Barth, etc...) and the two eq. (k k ,...)

Page 22: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• The FEM was developed in the 50s to be applied to the aeronauticengineering

• Advantages:• Advantages:– Suitable to model complex geometries

– Consistent treatment of b.c.

– Possibility of being programmed in a flexible and general way

• Fluid materials change their shape and that leads to a importantcomplexity

• Structural or heat problems lead to a diffusive equation that turns into affsymetric stiffness matrices

• For those cases, Galerkin formulation leads to convergent iterativesolutions in an easy waysolutions in an easy way

Page 23: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• The presence of a convective acceleration in the fluids formulation leads to theobtaining of non-symmetric stiffness matrices

• That is the reason of the Galerkin formulation not being appropriate anymore.When using it, spurious wiggles show up in the solutiong p gg p

Page 24: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFD IComputational Fluid Dynamics I

• In order to do avoid these oscillations, some techniques have been developed since the

70s which are known as stabilization techniques. The most important of which are

SUPG (Streamline Upwind Petrov Galerkin)– SUPG (Streamline Upwind Petrov-Galerkin)

– GLS (Galerkin Least Squares)

– FIC (Finite Increment Calculus),...

• A correct coupling in the selection of the pressure and velocity variables is required for

convergenceg

• The heterogeneity of the unknowns require the use of the so-called mixed and penalized

methodsmethods

• The mesh refinement also leads to the stabilization (but means high computational costs

Page 25: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

index

0. Introduction to CFD (4 h)

Computational Fluid Dynamics I

0. Introduction to CFD (4 h)

1. Governing equations (6 h)

1. Navier-Stokes

2. Potential, stream function, stokes flow

3. Shallow Water equations

4. Convection-diffusion eq

2. Finite elements and fluids hydrodynamics (26 h)

1. Finite elements and fluids

2. Variational and weighted residuals methods

3. Discretization

4. Potential flow

5. Stokes flow

6. Stable velocity-pressure pairs

7 Unsteady convective flow7. Unsteady convective flow

8. Penalty methods

9. Shallow water equations

10. Stabilizing techniques

3. Flow in porous media (6 h)

4. Conservative transport (6 h)

• Non-isothermal transport of reactives

• Transport of sediments

• Turbulence models

• Finite volumes

Page 26: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

introduction to CFDderivative operators

f ( ) i 1D l fi ld

derivative operatorscomputational fluid dynamics I

• f (x,t) is a 1D scalar field

• f (x,t) is a 3D vectorial field

• · = scalar product332211 babababa jj a·b

• Index notationj

iji x

uu

,

• Gradient , divergence

zyx

,,

• Laplacian

y

2

2

2

2

2

2

zyx,,

zyx

Page 27: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

introduction to CFDReference SystemReference Systemcomputational fluid dynamics I

• Lagrangian coordinates (the net follows the particle)– Not able to model big deflections (even in structures)Not able to model big deflections (even in structures)– Allows to follow the interface between different materials

• Eulerian coordinates (the net is fixed and the fluid moveswith respect to it)

– Allows for a characterization of big deflections (fluids)– Difficulties to evaluate interfaces and free surfaces

• ALE coordinates (mixture of both)– The net moves with an independent velocity from that of the

ti lparticles

Page 28: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

introduction to CFDeulerian coordinateseulerian coordinatescomputational fluid dynamics I

• In the Lagrangian coordinates there are no convective efects and the materialderivative is just a temporal derivative

I th E l i di t th i l ti t f th t i l• In the Eulerian coordinates there is a relative movement of the materialcoordinates with respect to the spatial ones, and the material derivative of anscalar field f is given by

xffddf j

ftf

dtdf

·utxtdt j

ftdt

ffdfdfdffdf )(

jj

i

xfu

tf

dtdz

zf

dtdy

yf

dtdx

xf

tf

dttxdf

),(

Page 29: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

introduction to CFDeulerian coordinateseulerian coordinatescomputational fluid dynamics I

• The total derivative of a vectorial field is given by

xffdf j ff dt

xxf

tf

dtdf j

j

iii

fuff

·tdt

d

jj

i

xfu

tf

dtdz

zf

dtdy

yf

dtdx

xf

tf

dttxdf

1111111 ),(

jj

i

xfu

tf

dtdz

zf

dtdy

yf

dtdx

xf

tf

dttxdf

2222222 ),(

j

jj

i

xfu

tf

dtdz

zf

dtdy

yf

dtdx

xf

tf

dttxdf

3333333 ),(

jxtdtzdtydtxtdt

Page 30: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

introduction to CFDeulerian coordinateseulerian coordinatescomputational fluid dynamics I

• The compact integral forms are:

da v:u)vu,(

dqqb v·)u,(

dvuu,va ·)(

dqwqw ),(

dc u)·v·(w)u,w;v(

duwuwc )·v(),;v(

dhh)(where

j

iij x

u

u

ii vu uu

dhwhwN

N),(

j

i

j

i

xx v:u

iji x

uvw

u·v·w

i

i xu

ii xv

xuvu

·jxii

Page 31: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equations

computational fluid dynamics I

CFDCFDI2 Governing EquationsI2. Governing Equations

Page 32: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstress() and strain() of fluids

• For solids Hookes´s law states

stress() and strain() of fluidscomputational fluid dynamics I

E• For solids, Hookes s law states• For Newtonian fluids (air and water are included) Newton´s viscosity law

states

E

du

where is the dynamic viscositydn

smkg·

and is the cinematic viscosity

sm2

• For no-newtonian fluids (plastics, coloidal suspensions, emulsions,...) theviscosity is not a constant

• For the non-frictional flow or non-viscous flow (inviscid) viscosity isnegligiblenegligible

• In what follows, the Navier-Stokes eq., governing the viscous flow, aredescribed for compressible fluids (gases is not a constant) and fornon-compressible fluids (liquids, c)

Page 33: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationscontinuity equation

• The principle of conservation of mass states that in any time interval and for any

continuity equationcomputational fluid dynamics I

• The principle of conservation of mass states that in any time interval and for any control volume the volume of mass entering must equal the volume of mass leaving, i.e.

outoutinin QQ outoutinin QQ

outoutoutininin AuAu

• As velocity and density depend on time and space, the equilibrium of mass in a differential volume dxdydz can be stated from

dydzdxux

u

udydzy

xz

Page 34: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationscontinuity equation

• The flux of mass per second this is is equal to (subtract in figure)

continuity equationcomputational fluid dynamics I

dxdydz• The flux of mass per second, this is , is equal to (subtract in figure) dxdydzt

dxdydzwz

dxdydzvy

dxdydzux

dxdydzt

• Since the control volume is independent of time

y

F i ibl fl id i t t d th ti it ti lt i t

wz

vy

uxt

• For incompressible fluids is a constant and the continuity equation results into

0

iiuwvu u· iizyx ,

Page 35: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsdynamic equation

• Newton´s second law states that

dynamic equationcomputational fluid dynamics I

• Newton s second law states that mav

dtdm

dtmvdF

• In the control volume there is no variation in mass, and therefore

ii dxdydzadF • The equilibrium of forces gives

ii y

dxdzdyyx

dydzdxxxxx

y dydzxx

dxdyzx

dxdzdyyyx

yxxx

xz

y

dxdydzz

zxzx

dxdzyxz

Page 36: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsdynamic equation

• Newton´s second law can be written for the x direction as

dynamic equationcomputational fluid dynamics I

• Newton s second law can be written for the x direction as

dydzdxx

dydzdxdydzBdF xxxxxxxx

dxdzdyx

dxdz yxyxyx

where Bx are the body forces in the x directionDi idi b th t l l d ki th ti f th th

dxdydzx

dxdy zxzxzx

• Dividing by the control volume and making the same operations for the three dimensions in space it is obtained

Ba zxyxxxxx

zyxxx

zyxBa zyyyxy

yy

zyx

Ba zzyzxzzz

Page 37: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in solids

• Which is the value of ? Let us see first how solids behave

stresses in solidscomputational fluid dynamics I

• Which is the value of ij ? Let us see first how solids behave

• In solids the strains are related to the stresses asIn solids the strains are related to the stresses as

,...zzyyxxxx E

1

where E is the Young modulus, is the Poisson ratio and G is the Modulus of

,...G

xyxy

Rigidity or shear modulus

Page 38: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in solids

• The volume dilation e can be defined as follows

stresses in solidscomputational fluid dynamics I

• The volume dilation e can be defined as follows

d d d

dxdydzdxdydzVVe xxxxxx

111dxdydzV

32121e zzyyxxzzyyxx

where is the mean of the three normal stressesTh fi t t i th f b d

EE zzyyxxzzyyxx

• The first strain can therefore be expressed as

xxxxxxzzyyxxxxzzyyxxxx 3111 xxxxxxzzyyxxxxzzyyxxxx EEE

13

1 xxxxE

Page 39: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in solidsstresses in solidscomputational fluid dynamics I

• Therefore, writing in terms of e

3 EeEE

• Noting that Young´s and shear modulus and Poisson´s ratio are related as

211111

xxxxxx

Noting that Young s and shear modulus and Poisson s ratio are related as

12EG

• It is obtained

eGG xxxx 22 eG xxxx

21

Page 40: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in solids

• Subtracting from both sides of the former equation we obtain

stresses in solidscomputational fluid dynamics I

• Subtracting from both sides of the former equation we obtain

eEGGeGG xxxxxx

2132122

2122

eGGeGGeGGG xxxxxxxx

31

32

2122

31

2122

21312

2122

• Or

Si il l

32 eG xxxx

2 eG• Similarly

3

2G yyyy

32 eG zzzz

• From the first equations it is already known that 3

xyxy G

G yzyz G

zxzx G

Page 41: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in fluidsstresses in fluidscomputational fluid dynamics I

• Up to this point we have been concerned with solids It has been shownUp to this point we have been concerned with solids. It has been shown empirically that stresses in fluids are related not to strain but to time rate of strain

• We have just shown that

32 eG xxxx

• Replacing the rigidity modulus by a quantity in terms of its dimensions (F/L2), the stresses in fluids would be of the form

3xxxx

3

2 2 et

LFT xxxx /

• Where the proportionality constant is known as the dynamic viscosity and has the dimensions (FT/L2)=(M/TL)

• The equations result into• The equations result into

,...te

txx

xx

322 ,...

txy

xy

t

Page 42: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in fluidsstresses in fluidscomputational fluid dynamics I

• Taking the mean pressure as –p, the equations are

te

tp xx

xx

322 xyxy

e 2te

tp yy

yy

322

ezz 22

yzyz

L t fi d t th l f th ti d i ti f d i t f

ttp zz

zz

32 zxzx

• Let us now find out the value of the time derivatives of xy and e in terms of u,v and w

Page 43: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstresses in fluidsstresses in fluidscomputational fluid dynamics I

• If the coordinates of a point before deformation are x,y,z and after deformations are xy+, z+the strains are given by

xxx

yyy

zzz

• The rate of strain and volume dilation would be therefore

xyxy

yzyz

zxzx

,...xu

txxttxx

wvue

,...xv

yu

txtyxyttxy

zyxtt zzyyxx

Page 44: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsdynamic equation

• And consequently the stresses result into

dynamic equationcomputational fluid dynamics I

• And consequently the stresses result into

322

322

xup

te

tp xx

xx

yu

xv

txy

xy

322

yvpyy

2

zv

yw

yz

It i bt i d f th fi t di i

322

zwpzz

xw

zu

zx

• It is obtained for the first dimension

zyxB

zuw

yuv

xuu

tua zxyxxx

xx

111

zyxzyxt

xw

zu

zyu

xv

yxup

xB

zuw

yuv

xuu

tu

x

1121 yyy

Page 45: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsdynamic equation

• The first dynamic equation is transformed into

dynamic equationcomputational fluid dynamics I

• The first dynamic equation is transformed into

xw

zu

zyu

xv

yxup

xB

zuw

yuv

xuu

tu

x

1121

xzw

zu

yu

xyv

xu

xpB

zuw

yuv

xuu

tu

x

2

2

2

2

22

2

2

21

wvuuuupBuuuu 2221

zyxxzyxx

pBz

wy

vx

ut x

222

2

2

2

2

2

21 uuupBuwuvuuu

• Proceeding in the same way for for y and z, the 3D Navier equations are finally

1

222 zyxx

Bz

wy

vx

ut x

jjiiijijti upfuuu ,,,,

1

1 fuuuu

p

t1·

Page 46: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsdynamic equation

• That is

dynamic equationcomputational fluid dynamics I

That is

0

zw

yv

xu

xfzu

yu

xu

xp

zuw

yuv

xuu

tu

2

2

2

2

2

21

222

yfzv

yv

xv

yp

zvw

yvv

xvu

tv

2

2

2

2

2

21

wwwpwwww

2221

with boundary conditions: Dirichlet in (prescribed velocity)

zfzw

yw

xw

zp

zww

ywv

xwu

tw

222

1

ii bu t bou da y co d t o s c et (p esc bed e oc ty)Newman in 2 (prescribed normal stress )

with initial conditions (unsteady flow)

ii buijij tn

jiji xuxu 00 ,

• When the flow is non-isothermal, the temperature of the fluid has to be solved making use of the energy equation, which represents the conservation of energy

Page 47: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstokes flow

• The Stokes flow simplification is obtained when the flow is taken as steady and

stokes flowcomputational fluid dynamics I

• The Stokes flow simplification is obtained when the flow is taken as steady and the convective term is dropped. For the two dimensional case leads to

0 vu

01

xfuxp

0

yx

x

01

yfvyp

• The equation can be solved in terms of the variables as – Stream function formulation– Stream-function-vorticity formulation– Velocity presure

Page 48: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationspotential flowpotential flowcomputational fluid dynamics I

• A flow is said to be inviscid (or non-viscous) when the effect of viscosity is small compared to the other forces (convection)

• This can be assumed for instance in flow through orifices, over weirs or in channelsg• A flow is said to be irrotational when its particles do not rotate and maintain the same

orientation wherever along thr streamline

irrotational rotational

Page 49: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationspotential flowpotential flowcomputational fluid dynamics I

• In irrotational flows the rotational of the velocity vector is zero

kji

0kji

kji

urot

yu

xv

xw

zu

zv

yw

wvuzyx

• Therefore in rotational flows it is verified that

wvu

0

zv

yw

0

xw

zu 0

yu

xv

• Far from the boundaries, most of the flows of fluids with low viscosity (such as air and water) behave as irrotational and these simplification can be assumed, that is why the

y y

inviscid flow can be considered in certain occasions as irrotational

Page 50: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationspotential flow

• The potential flow equations are a simplified version of the N-S equations in which the

potential flowcomputational fluid dynamics I

• The potential flow equations are a simplified version of the N-S equations in which the potential function is used to solve the continuity equation

• We define in such a way that its partial derivatives with respect to the space, give the velocity in that directiony

• Substituting this expression into the 2-D continuity equation it is obtained

ux

v

yv

g p y q

0

yv

xu

• It is also verified that

02

2

2

22

yx

It is also verified that

and the assumption of a velocity potential requires the flow to be irrotational

xv

yu

yxxy

and the assumption of a velocity potential requires the flow to be irrotational

Page 51: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationspotential flow

• With this formulation we can solve problems such as flow around a cylinder flow out of an

potential flow computational fluid dynamics I

With this formulation we can solve problems such as flow around a cylinder, flow out of an orifice or around an airfoil

• The flow through a saturated homogeneous porous media results as well in a Laplacian, as the Darcy´s law is given by , where h is the water level, can be dxdhku written as

ku

where k is the hydraulic conductivity• Taking this equation to the continuity equation it is obtained

assuming k as a constant

fkk ·

g

Page 52: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationspotential flowpotential flowcomputational fluid dynamics 1

• The governing equations of the two dimensional potential flow are therefore given by

22

in 02

2

2

22

yx

where the velocity components are given by

with the boundary conditions

xu

yv

with the boundary conditionsDirichlet in

Newman in 2

0

0VllV yxn

2

were lx and ly are the direction cosines of the outward unit vector n to 2

0yxn yxn

Page 53: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstream functionstream function computational fluid dynamics 1

• The stream function ( formulation is an alternative way of describing the motion ofthe fluid that has some important advantages compared to the velocity-pressureformulationformulation

• The streamline (línea de corriente) is a line that connects points at a given instantwhose velocity vectors are tangent to the line

• The path line (línea de trayectoria) connects points through which a fluid particle offixed identity passes as it moves in space

I t d fl b th li th• In steady flow both lines are the same

• Since the velocity vector meets the streamlines tangentially no fluid can cross thestreamline

• In the stream-function formulation the unknown is defined as

u v

y x

Page 54: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstream function

• If a unit thickness of the fluid is considered is defined as the volume rate

stream function computational fluid dynamics I

• If a unit thickness of the fluid is considered, is defined as the volume rate (vol per unit distance/T) of fluid between streamlines AB and CD. Let C’D’ be a streamline very closed to CD. Let the flow between CD and C’D’ be d

D’

C’

Ddx

dyv

u D

PC

C

B

• At a point P (with velocities u and v), the distance between CD and C´D´ is denoted by –dx and dy

A

denoted by –dx and dy• Since no fluid crosses the streamlines, the volume rate of flow across dy is u and

the volume rate across –dx is v, therefore

ddd vdxudyd

Page 55: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsstream functionstream function computational fluid dynamics I

• Therefore

A d th ti it ti i t ti ll ti fi d b th t f ti

uy

v

x

• And the continuity equation is automatically satisfied by the stream function

0

xyyxyv

xu

• If the flow is irrotational, the equation to be satisfied is

yyy

0

uv

• Substituting u and v by its values in terms of it is obtained yx

0

u

• And therefore

0

xyxx

222 0222

yx

Page 56: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters

• The equations governing the steady 2 D Newtonian flow are

shallow waterscomputational fluid dynamics I

• The equations governing the steady 2-D Newtonian flow are

0

yv

xu

xfuxp

yuv

xuu

tu

1

or identically

yfvyp

yvv

xvu

tv

1

0 fu

1or identically

• But this is just a theoretical example in which the flow is assumed to have

0, iiu ufuu

pt

· 2,1i

j pnull 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)third dimension we have to use the Shallow Water equations (SSWW)

Page 57: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters

• The equations governing the steady 2 D Newtonian flow are

shallow waterscomputational fluid dynamics I

• The equations governing the steady 2-D Newtonian flow are

0

yv

xu

xfuxp

yuv

xuu

tu

1

or identically

yfvyp

yvv

xvu

tv

1

0 fu

1or identically

• But this is just a theoretical example in which the flow is assumed to have

0, iiu ufuu

pt

· 2,1i

j pnull 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)third dimension we have to use the Shallow Water equations (SSWW)

Page 58: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow watersshallow waterscomputational fluid dynamics I

•The assumptions to be made are•The assumptions to be made are

– The distribution of the horizontal velocity along the vertical direction is assumed y gto be uniform

An integration in height is carried out and the horizontal velocity is taken as the– 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

Page 59: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. continuity eq.

• Integrating the continuity equation along the z axis

shallow waters. continuity eq.computational fluid dynamics I

• Integrating the continuity equation along the z-axis

0

wvu

h

0 hh

hwhwdvdu

0

zyx h

hbH=h+hb

A th L ib i l t b i th d i ti i t th i t l i i

0 bhh

hwhwdzy

dzx

bb

• As the Leibniz rule to bring the derivatives into the integral sign gives

0 xhhu

xhhuudz

xdz

xu b

b

h

h

h

h

it is obtainedxxxx hh bb

0 bb

b

hb

b

h

hwhwhhvhhvvdzhhuhhuudz

bb

hb

h yyyxxxbb

Page 60: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. continuity eq.

• w(h) (vertical component of the velocity on the surface) is given by

shallow waters. continuity eq.computational fluid dynamics I

• w(h), (vertical component of the velocity on the surface) is given by

hvyhhu

xh

th

dtdhhw

• Substituting in the former equation

hh bhh

• Noting that and taking and renaming the main velocities as

0

th

thvdz

yudz

xb

hh bb

0hb• Noting that , and taking and renaming the main velocities as0t

b

uudzH

uh

hb

1

vvdzH

vh

hb

1

the continuity equation is obtained asb

0

vHuHh 0

yxt

Page 61: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• As the vertical acceleration is negligible the third dynamic equation

shallow waters. dynamic eq.computational fluid dynamics I

As the vertical acceleration is negligible, the third dynamic equation

zfzw

yw

xw

zp

zww

ywv

xwu

tw

2

2

2

2

2

21

can be written as01

zfzp

yy

• Integrating this equation in depth and assuming the atmospheric pressure to be zero it is obtained

z

phh

dz

zpdzf

h

h

h

h zbb

phphphhf bbz

• Deriving with respect to x and y

phf 1 phf 1xp

xfz

y

py

fz

Page 62: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• The first dynamic equation results into

shallow waters. dynamic eq.computational fluid dynamics I

• The first dynamic equation results into

2

2

2

2

2

2

zu

yu

xu

xhff

zuw

yuv

xuu

tu

zx

• Adding the continuity equation multiplied by u, it is obtained

zyxxzyxt

2

2

2

2

2

2

zu

yu

xu

xhff

zw

yv

xuu

zuw

yuv

xuu

tu

zx

this is

2

2

2

2

2

22

zu

yu

xu

xhff

zuw

yuv

xu

tu

zx

as zyxxzyxt

wuwuvuvuuuuuwuvuu

22

zzyyxtzyxt

Page 63: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• Integrating in depth the former expression

2222 uuuhuwuvuu

shallow waters. dynamic eq.computational fluid dynamics I

• Integrating in depth the former expression

xhhu

xhhudzu

xthhuudz

tb

b

h

h

h

h bb

222

222 zu

yu

xu

xhff

zuw

yuv

xu

tu

zx

xxxtt bb

dzHxhffhwhuhwhu

yhhvhu

yhhvhuuvdz

yh

hzxbb

h

hb

bbbb

u

• Taking into account that , it is obtained

yyy

hvyhhu

xh

th

dtdhhw

dHhffhhhhhhhhhhhhhhhhhhdhbbbh b

xhhu

xhhudzu

xthhuudz

tb

b

h

h

h

h bb

222

• Cancelling terms

dzHx

ffhvy

huxt

huhvy

huxt

huy

hvhuy

hvhuuvdzy hzxb

bb

bbbh

bbb

bb

u

dzHxhffuvdz

ydzu

xudz

th

hzx

h

h

h

h

h

h bbbb

u2

Page 64: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• Taking mean velocities it is obtained

shallow waters. dynamic eq.computational fluid dynamics I

Taking mean velocities it is obtained

dzHxhff

yuvH

xHu

tuH h

hzxb

u

2

• The viscosity effects can be evaluated as

bs

h

hHuudz

2

2

2

2

u

where v is the turbulent viscosity• Where are the shear stresses acting on the surface (due to the wind action)

d th b tt (d t th h f th h l)

xxb

bsh yx

22

xx bs ,and on the bottom (due to the roughness of the channel)

iaws

WWCi 34

2

h

ib H

uVgnH

i

= Wind drag coefficient = Manning coefficient= Wind velocity components

h

WCn

iW y p= Air density

i

a

Page 65: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• Developing the derivatives in the left hand side

shallow waters. dynamic eq.computational fluid dynamics I

• Developing the derivatives in the left hand side…

yHuvH

yvuv

yu

xHuH

xuu

tHuH

tu

yuvH

xHu

tuH

)(2 2

2

• Taking into account the continuity eq….

yyyxxttyxt

0

yHvH

yv

xHuH

xu

th

yvH

xuH

th

the former eq becames

uHvHuHuuuvHHuuH 2

vHyu

yHvH

yv

xHuH

xu

tHuH

xuuH

tu

yuvH

xHu

tuH

)(

uuuuvHHuuH 2

vHyuH

xuuH

tu

yuvH

xHu

tuH

0

Page 66: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters. dynamic eq.

• The derivatives of the depth with respect to x and y are

shallow waters. dynamic eq.computational fluid dynamics I

• The derivatives of the depth with respect to x and y are

xh

xhh

xH b

• Carrying out the same operations for the y dimension, and developing the d i ti t ki i t t th l t i it i bt i d

xxx

derivatives taking into account the last expression it is obtained

34

2

2

2

2

2xaw

c HuVgn

HWWC

yu

xuvf

xhg

yuv

xuu

tu

hHHyxxyxt

34

2

2

2

2

2yaw

c HvVgn

HWWC

yv

xvuf

yhg

yvv

xvu

tv

where fc is the Coriolis factor

hHHyxyyxt

Page 67: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsshallow waters

• The shallow water equations result into

shallow waterscomputational fluid dynamics I

• The shallow water equations result into

0

yvH

xuH

th

34

2

2

2

2

2

h

xawc H

uVgnH

WWCyu

xuvf

xhg

yuv

xuu

tu

yxt

hyy

34

2

2

2

2

2

h

yawc H

vVgnH

WWCyv

xvuf

yhg

yvv

xvu

tv

with boundary conditionsimpermeability , (no slip)0u 0uimpermeability , (no slip)discharge contour stresses ,

t l l

0Nu 0Tu

QdsHuN

0NN 0TT

water level thth 0

Page 68: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

governing equationsconvection-diffusion equation

• If in the N S dynamic equation we substitute the non linear velocities by a known

convection diffusion equationcomputational fluid dynamics I

• 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 actionsconvective and diffusive actions.

• The equations are

fWVU

222 f

zyxzW

yV

xU

t

222

0 QkU

or in 1D

0 QkU jjjjt ,,,

0

QkU

where is the quantity being transported, k is the diffusion coefficient, Ui is the

0

Qx

kxx

Ut

known velocity field, and Q are the external sources of the quantity. These are also known as the Transport Equations

Page 69: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids

computational fluid dynamics I

CFDCFDI 3 Finite Elements in FluidsI 3. Finite Elements in Fluids

Page 70: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral issues computational fluid dynamics I

• There is no analytical solution for most engineering problems such asfluid flow

• The determination of the velocity and pressure field is required in a• The determination of the velocity and pressure field is required in adomain of infinite degrees of freedom

• The Finite Element Method (developed about 1950 for structures)The Finite Element Method (developed about 1950 for structures)substitutes the domain by another with a finite number of freedomdegrees, 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 heatconduction, seepage flow, electric and magnetic fields, and of coursein fluid dynamicsin fluid dynamics

Page 71: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral issues computational fluid dynamics I

sms.avi

Page 72: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral issues computational fluid dynamics I

largo modulos.avi

2D h zoom at the mine.avi

3D H(x,y), water depth colour (only 600 days).avi

Page 73: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral issues computational fluid dynamics I

200

250VEL

1.781251.66251.543751.4251.306251 1875

Y

100

150

1.18751.068750.9500020.8312520.7125010.5937510.4750010.3562510.2375010.118751.69975E-069.60324E-07

50

100 4.19696E-078.11084E-08

X0 100 200

0

2D H (water level).avi

Page 74: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral issues computational fluid dynamics I

Page 75: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral 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 problemmatrix 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

Page 76: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral 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 determinedwhere the unknowns (p, u) are going to be determined

– It is assumed that the variation of the unknowns can be approximated by a simplefunction

– The approximation functions are defined in terms of the values of the fieldvariables at the nodes

– When the equilibrium or variational equations has been obtained the new finiteWhen the equilibrium or variational equations has been obtained the new finiteunknowns 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 fem solution of the one simple 1-D problem is to be considered6 t b ion a 6-step basis

Page 77: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsgeneral issuesgeneral 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

I th t diti l R l i h Rit th d th i t l ti f ti h t b

(Basel,1707- Saint Petersburg,1783)

• In the traditional Rayleigh-Ritz methods the interpolating functions have to bedefined over the entire domain and have to satisfy the boundary conditions.

• Meanwhile in the FEM the interpolating trial functions are defined on a finite elementbasis, being more versatile when the shape is not simple enough

• The limitation is that the FEM trial functions have to satisfy in addition someconvergence conditions (continuity and completeness and compatibility)convergence conditions (continuity and completeness and compatibility)

Page 78: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approachvariational approach computational fluid dynamics I

• When using a variational approach, the aim is to find the vector function ofunknowns, that makes a minimum or a maximum of the functional I (typicallythe energy)

the energy)

dSx

gdVx

FI

,...,,...,

• After the discretezation has been carried out in terms of E smaller parts thepiecewise approximation is introduced so that

or in terms of the so called shape functions Ni

e

aproxe

where are the values of the unknowns at the nodes

···

ee

NNe2211

i

Page 79: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approachvariational approach computational fluid dynamics I

• Afterwards, the condition of extremezation of I with respect to i is imposed

II 1

0

M

i

I

II···

2

• Adding all those element contributions it is obtained

E e

• Assuming I to be a quadratic functional of the element equation results in

E

e i

e

i

II1

0

• Assuming I to be a quadratic functional of the element equation results in

eee

e

e

PKI

Page 80: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approachvariational approach computational fluid dynamics I

• After the assembling process it is obtained

PΦK

where and

E

e

e

1KK

E

e

e

1

PP

• After applying the boundary conditions the system is solved for the nodalunknowns iunknowns i

• Once i are known, we can obtain other variables as a post-processing value

Page 81: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplevariational approach, examplecomputational fluid dynamics I

• Example. Find the velocity distribution of an inviscid fluid flowing trough avarying cross section pipe shown in the figure

The governing equations are defined by finding the potential that minimizes the– The governing equations are defined by finding the potential that minimizes theenergy integral equation

dxddAI

L

0

2

21

with the boundary condition u(x=0)=u0, where the cross section area is

dx 02

LxeAA 0

A

u0

A0A1 A2

1 2 3

L

1 2 3

l(1) l(2)

L

Page 82: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplevariational approach, examplecomputational fluid dynamics I

• 1st step. Discretization

Divide the continuum into two finite elements. The values of the potentialfunction at the three nodes will be the unknowns of the femfunction at the three nodes will be the unknowns of the fem

• 2nd step. Select an interpolation model, easy but leading to convergence

The potential function will be taken as linearThe potential function will be taken as linear

bxax

and can be evaluated at each element as

x

where l(e) is the length of the e element

eeeee

lxx 121

g

Page 83: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplevariational approach, examplecomputational fluid dynamics I

• 3rd step. Derivation of stiffness matrices K(e) and load vectors P(e) by usinga variational principle

Deriving the interpolating function with respect to it is obtainedDeriving the interpolating function with respect to x it is obtained

eee

lo

eeeel eele xAdxAdxdAI 2112

122

12

2

2

122

oee

lldx 222 200

T

eeeee AA 11112 1122

12

2

where the cross sectional areas can be taken for the first and second element

eeTe

eeee

ee

lA

lAI ΦKΦ

21

1111

21

22

2

121

1212

e e t e c oss sect o a a eas ca be ta e o t e st a d seco d e e e tas and

where the nodal unknowns are respectively and2

10 AA 2

21 AA

11)(Φ

22)(Φ

2

3

Page 84: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplepp pcomputational fluid dynamics I

• 3rd step. (cont)

The minimal potential energy principle gives , if we take into account theexternal inflow

0

i

I

external inflow

where Q is the mass flow rate across section

eTeeeTeeeee

e

eeeee QQ

lAI QΦΦKΦ

21

22

221112

21

22

AuQ where Q is the mass flow rate across section

therefore, if we derive the functional I for each basic element

22 e AAI

AuQ

022 121221

112

21

22

111

)()()( eee

eeeeeeeee

e Ql

AQQlAI

02

22

)()()( eeeeeeeeeeee

QAQQAI

or in matrix form

022 212221

21212

221

)()()( eeee

eeeeeeeee Q

lQQ

l

1 eI 0

21

eeeeTeeeTe

ii

eI QΦKQΦΦKΦ

Page 85: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplevariational approach, examplecomputational fluid dynamics I

• 4th step. Assembly of the stiffness and load vectors

Once we have obtained the matrices for all the basic elements as

1111

1

11

lAK

1111

2

22

lAK

0111 uA

Q

23

2 0uA

Q

we can assemble the system to obtainQKΦ

0012211

1

1

1

1

0

0uA

AAAAlA

lA

223

2

2

2

2

2

2211 0

0uA

lA

lA

llll

Page 86: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsvariational approach, examplevariational approach, examplecomputational fluid dynamics I

• 5th step. Resolution of the system

As we need a reference value for the potentials (u3 is an unknown) we can set equal to 0 equal to 0

Taking A(1) as 0.80 A0 and A(2) as 0.49 A0, and l(1)= l(2)=L/2, the system of twoequations with two unknowns givesequations with two unknowns gives

• 6th step. Computation of the resultsLu01 651. Lu02 0271.

p p

Once we have obtained the potentials, the velocities can be derived by usingthe equivalence

12d

which gives the velocities at elements 1 and 2 as

112

ldxdu

0

1 251 uu . 0

2 052 uu .

Page 87: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• In this method the FE equations can be directly obtained from the governingequations (or equilibrium equations)

GF

The discretization is made and the field variable is approximated as

GF

n

xNx~

where i are constants and Ni(x) are linearly independent functions chosensuch that the boundary conditions are satisfied

i

ii xNx1

y

• A quantity R known as the residual or error is defined as

~~ FGR • The weighted function of the residual is taken as

FGR

0 dVRwfwhere f(R)=0 when R=0

0 dVRwfV

Page 88: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• There are several approaches to the weighted residuals method such as thecollocation method, the Least Squares method and the most commonly used ofall the Galeking methodall, the Galeking method

• In the Galerkin method the weighting functions are chosen to be equal to thetrial functions and f(R) is taken as Rf( )

with i=1,2,…,n0 dVRN

Vi

• In the rest of the aspects the method is similar to the variational

Page 89: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• Example. Find the velocity distribution of an inviscid fluid flowing trough avarying cross section tube shown in the figure

The governing equations are given by the continuity equation– The governing equations are given by the continuity equation

02

2

dd

with the boundary condition u(x=0)=u0, where the cross section area is

2dx

LxeAA 1

u0

A1A2 A3

u0 1 2 3

l(1) l(2)

L

Page 90: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• 1st step. Discretization

Divide the continuum into two finite elements. The values potential function inthe three nodes will be the unknowns of the femthe three nodes will be the unknowns of the fem

• 2nd step. Select an interpolation model, easy but leading to convergence

The potential function will be taken as linearThe potential function will be taken as linear

bxax

and can be evaluated at each element as

x

where l(e) is the length of element e

eeee

lxx 121

g

Page 91: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• This can also be obtained through the shape functions which have to be 1 at itsnode and zero at the others, that is

xN 11

1

xNxNx 2211

elN 11

x

l(e)

this is

elxN 21

l(e)

this is

eee lx

lx

lxx 12121 1

(the same as obtained before)

Page 92: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• 3rd step. Derivation of stiffness matrices K(e) and load vectors P(e) by usingequilibrium. Obtaining of a weak form

The integral of the weighted residual isThe integral of the weighted residual is

00 2

2

dxdxdw

el

i

integrating by parts dxdxddv 2

2dxdv

iwu idwdu

0002

dxdwddwldlwdwddwdxdw ile

ell

l eee

e 0000

00 2

dx

dxdxdxw

dxlwdw

dxdxwdx

dxw iiiii

12 0 uwulwdxddw

ie

i

l ie

120 dxdx ii

Page 93: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• This is

Th l t t i lt i t

122

121

02211

00 uwulwdx

dxdN

dxdN

dxdwdxNN

dxd

dxdw

ie

i

l il iee

• The elementary matrices result into

• As

h

0 eee PΦK

where

dxdNdNdNdNdx

dNdx

dNdx

dNdx

dN

dxdx

dNdx

dNdNdx

dNe

2212

2111

21

2

1

K

2

1

uueP

• As the derivatives are

the elementary matrices result into

dxdxdxdxdx

2

LdxdN 11

LdxdN 12

the elementary matrices result into

111

11

1122 leee dxll

e

K

11)(Φ

22)(Φ

1111 0

22

e

ee

ldx

ll

K

2

Φ

3

Φ

Page 94: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

• 4th step. Assembly of the stiffness and load vectors

Once we have obtained the matrices for all the basic elements as

11111

11

lK

11111

22

lK

001 u

P

2

2 0u

P

we can assemble the system to obtainQKΦ

0111

01111

011ull

23

2

22

2211 0

110u

ll

llll

Page 95: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsweighted residualsweighted residuals computational fluid dynamics I

•5th step. Resolution of the system

6th t C t ti f th lt•6th step. Computation of the results

A b th t f ti bt i d b th i ht d id lAs can be seen, the system of equations obtained by the weighted residualsmethod is the same as in the variational method except for the absence of thedensity (which can be removed as it is a constant), and the cross section areas.y ( ),

The areas are not present in the second formulation as the system is solved invelocities and not in flow rates. To avoid this fact a two dimensional modelshould be considered.

Page 96: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretizationdiscretization 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)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

Page 97: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretizationdiscretization computational fluid dynamics I

Page 98: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization

• The mesh can be improved by

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 gaddition 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• 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)g ( )– Triangular quadratic

Page 99: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, convergence

• The FEM is an approximation that converges to the exact solution as the element

discretization, convergence computational fluid dynamics I

• The FEM is an approximation that converges to the exact solution as the element size is reduced if:

i Th fi ld i bl d it d i ti t h t ti th l ti. The field variable and its derivatives must have representation as the element size reduces to zeroFor example, second derivatives cannot be represented with linear functionsThen the elements are said to be ‘complete’Then the elements are said to be complete

ii. The field variable and its derivatives should be continuous within the element (Cr

piecewise differentiable where r is the maximum order of derivatives within thepiecewise differentiable, where r is the maximum order of derivatives within the integrand)

dxdxd

r

r

(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 boundarieselement boundariesThen the elements are said to be ‘compatible’ or ‘conforming’

Page 100: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, convergencediscretization, convergence computational fluid dynamics I

• If we had for instance, ‘flat penthouses’ as interpolating functions, theinterpolating 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’)

100.00

25.00

30.00

35.00

40.00

45.00

50.00

55.00

40.00

50.00

60.00

70.00

80.00

90.00

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

0.00 10.00 20.00 30.00 40.00 50.00 60.00 70.00 80.00 90.00 100.000.00

10.00

20.00

30.00

Page 101: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.

L t th b i li t i l l t ti d 1 2 d 3 b

discretization, triangular linear b.e.computational fluid dynamics I

• Let the basic linear triangular element connecting nodes 1, 2,and 3 be

• The equation that gives the• The equation that gives the surface (plane) is

(1) 2

(1)

that leads to the following

yxyx 321 ,

3 gequations

131211 yx 1

3

yx

y

232212 yx

333213 yx

22 , yx

11, yx 33 , yxx

Page 102: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.discretization, triangular linear b.e.computational fluid dynamics I

• The solution of the former system gives

3322111 21 aaaA

1

(2)

3322112 21 bbbA

1 33

22

11

111

21

yxyxyx

A

(2)where

3322113 21 cccA

132 yyb 321 yyb

231 xxc

312 xxc

23321 yxyxa

31132 yxyxa

123 xxc 213 yyb 12213 yxyxa

substituting (2) in (1) and rearranging terms it is obtained

Page 103: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.discretization, triangular linear b.e.computational fluid dynamics I

• The interpolating function results

332211 ,,,, yxNyxNyxNyx

where

233223321111 21

21 xxyyyxyxyx

Aycxba

AyxN , 233223321111 22

yyyyyA

yA

y,

311331132222 21

21 xxyyyxyxyx

Aycxba

AyxN ,

(3)

122112213333 21

21 xxyyyxyxyx

Aycxba

AyxN ,

(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

Page 104: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear

• For an A element matrix equal to

discretization, triangular linearcomputational fluid dynamics I

• For an A element matrix equal to

dxdyy

Ny

Nx

Nx

NA jijiij

e

A

• The integrals are

yy

NNNNNNNNNNNN

313121211111

dxdy

NLNNNNNNNNNNy

Ny

Nx

Nx

Ny

Ny

Nx

Nx

Ny

Ny

Nx

Nx

Nyyxxyyxxyyxx

e

e

333323231313

323222221212A

• As the integrand is a constant there is no need to integrate numerically

yyxxyyxxyyxx

333323231313

s t e teg a d s a co sta t t e e s o eed to teg ate u e ca y

dxdyxxxxyyyyxxyyxxxxyyyyxxxxyyyyxxyy

A e

e12312113

231

213

12232132312313322

232

32

24A

exxyysimA e2

122

214

Page 105: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear

Th b i l t t i lt

discretization, triangular linearcomputational fluid dynamics I

• The basic element matrix results

22

2

122

21

123121132

312

13

12232132312313322

232

32

4xxyysim

xxxxyyyyxxyyxxxxyyyyxxxxyyyyxxyy

A ee A

• That now can be assembledin the stiffness matrix to yield

2

1

2

1

··· ff

in the stiffness matrix to yield

6

6

5

4

3

2

6

5

4

3

2

··· ffff

2

9

8

7

6

9

8

7

6

···fffff

9 1010 f

Page 106: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.

Th d f i t ti th h f ti d th i d i ti

discretization, triangular linear b.e.computational fluid dynamics I

• 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 L1, L2, and L3 3

AAL 1

1 AAL 2

2 AAL 3

3

2P

A2 A1

A

where A is the area defined by the point P and the opposite side1

2A31321 LLL

where Ai is the area defined by the point P and the opposite side

• The shape functions for this triangular linear element are

ii LN 321 ,,i

Page 107: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.

3

discretization, triangular linear b.e.computational fluid dynamics I

• The shape functions are in fact as seen in (3) 3

PA2 A1

Ayx jj 2

11

1

2P

A3AA

yxyx

ALN i

kk

jj

ii 22

11

21

jkkjjkkjii xxyyyxyxyxA

yxLyxN 21,,

• Or in matrix form

xxyyyxyxL 1

1 233223321 1111

yx

yx

xxyyyxyxxxyyyxyx

ALL

21

12211221

31133113

3

2

33

22

11

21

yxyxA

Page 108: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular linear b.e.discretization, triangular linear b.e.computational fluid dynamics I

• The derivatives of L1, L2 and L3 being3

A AyyL 321

yyL 132

yyL 213

2P

A2 A1

A3

Ax 2 Ax 2

Axx

yL

2312

Axx

yL

2231

Ax 2

Axx

yL

2123

1Ay 2y Ay 2

Page 109: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• For natural coordinates in triangles the same procedure can be used

discretization, triangular quadraticcomputational fluid dynamics I

• 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 limitsg g

1321 LLL

12

1

0

1

0 2112

1

0

1

0

11 1 dLdLLLgdLdLyxfJ

dxdyyxfLL

,,,

where the jacobian determinant is

LLLLJ 111221

and the integral is

A

xxyyxxyyAyxyx

J24 231331322

1221

1 1 12 dLdLLLAdfL

120 0 2112 dLdLLLgAdyxf

,,

Page 110: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• For an A element matrix equal to

discretization, triangular quadraticcomputational fluid dynamics I

• For an A element matrix equal to

122 dLdLyL

yL

xL

xLAdxdy

yN

yN

xN

xNA jijijiji

ije

A

• The integrals are yyyy

313121211111 LLLLLLLLLLLL

12

1

0

1

0

333323231313

3232222212121

2 dLdL

LLLLLLLLLLLLyL

yL

xL

xL

yL

yL

xL

xL

yL

yL

xL

xL

yyxxyyxxyyxx

AL

ee

A

• As the integrand is a constant there is no need to integrate numerically

333323231313

yyxxyyxxyyxx

s t e teg a d s a co sta t t e e s o eed to teg ate u e ca y

1 1

12123121132

312

13

12232132312313322

232

32

2

1

42 L

e dLdLxxxxyyyyxxyyxxxxyyyyxxxxyyyyxxyy

AA A

0 02

122

21

4xxyysim

A

Page 111: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• Integrating the basic element area it is obtained

discretization, triangular quadraticcomputational fluid dynamics I

• Integrating the basic element area it is obtained

21

21

121

11

1

0 1

1

0 1102

1 1

121

1

LLdLLdLLdLdL LL

(it is a half of the area of the square)

22 0

110 10 1020 0

12

(it is a half of the area of the square)• The integrals are

22

2

122

21

123121132

312

13

12232132312313322332

4xxyysim

xxxxyyyyxxyyxxxxyyyyxxxxyyyyxxyy

A ee A

which, as can be seen gives the same result as the one obtained with the global coordinatesthe global coordinates

Page 112: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, quadrilateral linear b.e.

• For linear quadrilateral elements The unknown function is now

discretization, quadrilateral linear b.e.computational fluid dynamics I

• For linear quadrilateral elements The unknown function is now expressed as

jh N ,,

4

where the quadrilateral natural coordinates are given by the lines that join the midpoints of opposite lines

jj

,,1

join the midpoints of opposite lines• The shape functions for this triangular quadratic elements result

1141

1 N

1

1141

3 N

1

1

2 (1,1)(-1,1)

1141

4

N 1141

2

N 3

4(-1,-1)(1,-1)

Page 113: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, quadrilateral linear b.e.

• The derivatives that show up in the integrals leading to the basic

discretization, quadrilateral linear b.e.computational fluid dynamics I

• The derivatives that show up in the integrals leading to the basic matrices are made in terms of the global coordinates

where the jacobian determinant is

ddgddJyxfdxdyyxf ,,,

where the jacobian determinant is

yxyxJ

J

Page 114: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, quadrilateral linear b.e.

• f(x y) is a function of N and its derivatives where its derivatives with

discretization, quadrilateral linear b.e.computational fluid dynamics I

• f(x,y) is a function of Ni and its derivatives, where its derivatives with respect to global coordinates can be written in terms of the local coordinates as

yNyNN iii 1

xNxNN

yyJx

iii

iii

1

where Cartesian and natural coordinates are related as follows

Jy

4

1ikk xNx

k

kNxx

k

kNxx

4

1kkk yNy

k

kNyy

k

kNyy

Page 115: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, quadrilateral linear b.e.

• For a A matrix equal to

discretization, quadrilateral linear b.e.computational fluid dynamics I

• For a A matrix equal to

ddJ

yN

yN

xN

xNdxdy

yN

yN

xN

xNA jijijiji

ijA

eNeNeNeNeNeNeNeNeNeNeNeNeNeNeNeNy

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

4141313121211111

dd

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eNy

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

J

4343333323231313

4242323222221212

A

• The integrals are

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eNyyyyyyyy

4444343424241414

e teg a s a e

4

1

4

1

4

1

4

1

1k K

kk

jkk

j

k K

kk

ikk

iij

NyNNy

NNyNNyNJ

A

ddNx

NNxNNxNNxN

k K

kk

jkk

j

k K

kk

ikk

i

4

1

4

1

4

1

4

1

Page 116: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, quadrilateral linear b.e.

• The integration of the elementary matrices has to be done in terms of

discretization, quadrilateral linear b.e.computational fluid dynamics I

• The integration of the elementary matrices has to be done in terms of a numerical procedure the most common of which is the Gauss integration. The integrals are evaluated as

n n1 1

i jijji fHHddfI

1 1

1

1

1

1 ,,

Hi=Hjn ij

1

1.00.577352

2.001 -1 1

for instance, if a four point Gauss rule is used it is obtained

0.888880.55555

00.77459

3

-1

• A Gauss surface integration with nxn Gauss points will be enough to bt i th t l ti f l i l f d t 2 1 i h

570570570570570570570570001001 .,..,..,..,.).)(.( ffffI

obtain the exact solutions for polynomials of grade up to 2n-1 in each direction of the space.

Page 117: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• When the basic triangular element is quadratic

discretization, triangular quadraticcomputational fluid dynamics I

• When the basic triangular element is quadratic

2

45

1

3

y6

22 , yx

11, yx 33, yxx

• It is more convenient to express the shape functions in terms of the local (or natural) coordinates which are referred to every single basic elementnatural) coordinates which are referred to every single basic element.

Page 118: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

Th k f ti i d

discretization, triangular quadraticcomputational fluid dynamics I

• The unknown function is now expressed as

662211 NNNyx ···,

• The shape functions for this triangular quadratic elements result

662211y,

12 iii LLN214 4 LLN

325 4 LLN 1

• The jacobian determinant being

321 ,,i316 4 LLN

• The jacobian determinant being

NyNxNyNxyxyxJ k

kk

kk

kk

k

12211221 L

yLL

yLLLLL kkkk

Page 119: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• For a A matrix equal to

discretization, triangular quadraticcomputational fluid dynamics I

• For a A matrix equal to

12dLdLJy

NyN

xN

xNdxdy

yN

yN

xN

xNA jijijiji

ij

A

6161···21211111y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

12

············

6262···22221212 dLdL

eNeNeNeNeNeNeNeNeNeNeNeN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eN

y

eN

y

eN

x

eN

x

eNyyyyyy

J

A

• The integrals are

6666···2&261616y

N

y

N

x

N

x

N

y

N

y

N

x

N

x

N

y

N

y

N

x

N

x

N

e teg a s a e

4

1

4

1 221

4

1

4

1 1221

1k K

kk

jkk

j

k K

kk

ikk

iij L

NyN

LNy

LN

LNy

LN

LNy

LN

JA

12

4

1

4

1 1221

4

1

4

1 1221

dLdLLNx

LN

LNx

LN

LNx

LN

LNx

LN

k K

kk

jkk

j

k K

kk

ikk

i

Page 120: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsdiscretization, triangular quadratic

• For elementary triangles the numerical integration in terms of the

discretization, triangular quadraticcomputational fluid dynamics I

• For elementary triangles the numerical integration in terms of the natural coordinates gives

n

iii LLLfwdLLLfI 321321 ,,,,

ii LLLfwdLLLfI

1321321 ,,,,

Order Triang. Coord. Weights

Linear (O(h2)) 31

31

31 ,, 1

Quad, (O(h3))

021

21 ,,

31 Quad, (O(h )) 22

21

210 ,,

210

21 ,,

3

31

31

for instance, if a four point Gauss rule is used it is obtained

22 3

11111111

210

21

21

2100

21

21

31

21

321 ,,,,,, ffLLLfI

Page 121: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow2D potential flowcomputational fluid dynamics 1

• The governing equation of the two dimensional potential flow is therefore given by

22

in 02

2

2

22

yx

where the velocity components are given by

with the boundary conditions

xu

yv

with the boundary conditionsDirichlet in

Newman in 2

0

0VnnV yxn

2

were nx and ny are the direction cosines of the outward unit vector n to 2

0yxn yxn

Page 122: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, Galerkin approach2D potential flow, Galerkin approachcomputational fluid dynamics 1

1.- Divide the region into E finite elements of p nodes each2.- Assume a suitable interpolation model for e in element e as

p

3.- Set the integral of the weighted (with weights equal to the interpolation

p

i

eii

e yxNyx1

,,

functions (Galerkin)) residue over the regions of the elements equal to zero

i=1,2,…,p

02

2

2

2

dyx

NIee

i

, , ,p

4.- Integration by parts (Green-Gauss theorem)

yx

0

dny

nx

Ndyy

Nxx

Nee

y

e

x

e

i

ei

ei

Page 123: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, green-gauss integ.

f

2D potential flow, green gauss integ. computational fluid dynamics I

The first second derivative in the integral, i.e.

n ny

dx

NI i 2

2

can be integrated by parts making dyd

xL

xR dyudvdxdyNI i

yB

yT yy

xxi

iNu x

dxxx

v

this results in with

xyB

dxdyxx

Ndyx

NI iy

y

x

xi

T

B

R

L

dndy x

and therefore

02

dnNdNdNee

ie

d

xxNdn

xNI i

xi

or Carrying out the same procedure for the derivatives with respect to y…

02

eee

dnx

Ndxx

dx

N xii

i

Page 124: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, integral equation

and writing the contour integral in terms of the boundary conditions as

2D potential flow, integral equation computational fluid dynamics I

and writing the contour integral in terms of the boundary conditions as

20

dVNdny

nx

Neee

iy

e

x

e

i

the integral equation results

221

therefore the Newman boundary conditions are naturally introduced

20

2

dVNdyy

Nxx

Nee

i

ei

ei

therefore, the Newman boundary conditions are naturally introduced

In matrix form eee PK

with

dTe BBK 20

2

dNVPTe

Page 125: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, matrix formulation2D potential flow, matrix formulation computational fluid dynamics I

where

31312121

2

12

1 NNNNNNNNNN

NNNx

Nx

Nx

N

321

321

B

3232

2

22

2

yN

yN

xN

xN

yN

xN

yyxxyyxxyx

T BB

yyy

2

32

3

yN

xNsim

yyy

.

(for a linear triangular basic element)Assembling the elementary matrices it is obtained

PK

Page 126: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, matrix formulation2D potential flow, matrix formulation computational fluid dynamics I

for a linear triangular basic element the elementary stiffness matrix results in

22

1 kikijijiii ccbbccbbcb1

22

22

41

kk

kjkjjj

kikijijiii

eTe

cbsimccbbcb

AdBBK ycxba

AN iiii

21

and the source matrix

011

20

20

2

ijTe sVdNVP

when the fluid is entering the edge ij of length sij with a velocity V0 normal to the edge

02

If the fluid is entering the edges jk or ik the elementary vectors are

10

0 jke sVP

01

0 ike sVP

11

2P

10

2P

Page 127: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, example

Let us apply the so-obtained formulation to the obtaining of the confined flow

2D potential flow, example computational fluid dynamics I

et us app y t e so obta ed o u at o to t e obta g o t e co ed oaround a cylinder. Due to its symmetry, the domain can be chosen to be a forth of the total area

2 3 41

0 n

3

42

16

13

5

2 3

6

7 8

1

0

7

8 9

12

10

1113

5 6

12131 n

0

Th b d diti ill b

8 9

9 10 11

0 nThe boundary conditions will be:•An inlet constant velocity V0=1 normal to boundary 1-9•Constant potential in boundary 4-13 due to the symmetry (taken as cero for convenience

0 n

convenience •Tangential velocity (V0=0) in the rest of the boundaries

Page 128: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, example

For the nodes coordinates shown the node-1 basic stiffness matrices are

2D potential flow, example computational fluid dynamics I

o t e odes coo d ates s o t e ode bas c st ess at ces a eobtained as

Nodo x yNodo x y

1 0 8

2 5 8

3 9.17 8

0406250400251

1 ....

K4 12 8

5 0 4

6 5 4

7 9 17 5 5

6250.sim

7 9.17 5.5

8 12 5.5

9 0 0

10 5 0

022

1P11 8 0

12 9.17 2.83

13 12 4

0

Page 129: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D potential flow, example

N

2D potential flow, example computational fluid dynamics I

Notes

•As the potentials 4= =0, the corresponding rows and columns can be li i t d f th t f ti t b l d f eliminated from the system of equations to be solved for 1, 5, ,

9, , 12.•The velocity can be obtained as a post-process value making

ij

ijji xxx

u

ij

ijji yyy

v

Page 130: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, preliminary issues

• Up to this point some simple flow problems have been solved but there are

2D laminar NS, preliminary issuescomputational fluid dynamics I

• Up to this point some simple flow problems have been solved, but there are many flow problems in which the navier-stokes equation has to be solved

• The navier-stokes equations present two important problems that did not arise before i.e.:

– The presence an heterogeneous set of unknowns (velocity and pressure) that requires special treatment.This has to do with the verification of the continuity equation and causes instabilities in the pressure field, no matter the Reynolds number is.Therefore a proper combination of the velocity and pressure field is required p p y p qunless special formulation to circumvent this is added

– The non-linear convective term appears, turns the stiffness matrix into a non-symmetric one and leads to a certain amount of instability. y yThe Galerkin formulation lacks stability when convective effects dominate (this is for large Reynolds numbers, Re=uL/v) and alternative stabilizing techniques have to be used (Petrov-Galerkin, Characteristics Galerkin, GLS, SUPG, Finite Increment Calculus, Bubble functions,...)

Page 131: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, velocity & pressure

• The need of verifying the continuity condition (divergence free

2D laminar NS, velocity & pressurecomputational fluid dynamics I

• The need of verifying the continuity condition (divergence free condition) together with the existence of two different types of variables is mainly solved in two different ways:

– Keeping both variables and both sets of equations leads to the so-called mixed formulation, the stiffness matrix becomes a partitioned one with a null submatrix in the diagonal and a proper selection of theone with a null submatrix in the diagonal and a proper selection of the basic elements has to be made to verify the LBB condition or circumvent itTh lt f l ti t k– The penalty formulation takes

instead of the continuity condition, where is a very small parameter, p u·

y , y p ,and takes it into the dynamic equation.The selection of is a difficult task as being too small may cause a loss of accuracy and being too big may prevent the convergenceof accuracy and being too big may prevent the convergence

Page 132: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, algebra issues2D laminar NS, algebra issues computational fluid dynamics I

• Some kind of functions to which the velocity and pressure fields must belong

S b l f i t bl f ti ithi 2L

Some kind of functions to which the velocity and pressure fields must belongto are presented

• Sobolev space of square integrable functions within

• Hilbert space, subspace of L2 of functions whose

2L

kHderivatives up to the k-th also belong to L2

• Subspace of L2 with a null mean in the domain (to beused in relation to the pressure. Can be avoided by

20L

p ysetting a given pressure at a certain point)

• Subspace of functions that, belonging to H1, arecancelled at the boundary

10H

y

Page 133: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, algebra issues

• With respect to the velocity u the space of trial solutions is denoted by

2D laminar NS, algebra issues computational fluid dynamics I

With respect to the velocity, u, the space of trial solutions is denoted byS, which must be a subspace of H1 that satisfies the Dirichletconditions on the boundary

• The weighting functions of the velocity, w, will belong to the V spaceswhich belong to H1 and vanish on the boundary where the velocity isprescribed

• Finally the subspace Q will be introduced for the pressure. As noli it b d diti ib d f dexplicit boundary conditions are prescribed for pressure and no

derivatives of the pressure show up in the weighted formulation as itwill be seen it is only required that Q belongs to L2 for both the trialwill be seen, it is only required that Q belongs to L for both the trialand weighting functions

Page 134: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, weighted residuals2D laminar NS, weighted residuals computational fluid dynamics I

• Once we´ve got the governing Navier-Stokes differential equation, we aregoing to solve it by using the finite element method, that is, to obtain theapproach

n

where Ni are the shape functions defined on a local basis for each element

ii1

Nuu

where Ni are the shape functions defined on a local basis for each elementand where the coefficients i are the unknowns for each of the nodes

• In order to do so we need to express the governing equation as• In order to do so, we need to express the governing equation as

m

ejjjj eedddd

1gGuguG

so as to obtain the integral forms, we can apply the weighted residualsmethod (de Galerkin) or the variational( )

Page 135: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, weighted residuals

The 2D equations to be solved are

2D laminar NS, weighted residuals computational fluid dynamics I

• The 2D equations to be solved are

01 ijjiijijti fupuuu ,,,,

• Multiplying the equation by the weighting functions and integrating within the

0iiu ,

Multiplying the equation by the weighting functions and integrating within thedomain, it is obtained

01

dfupuuuw ijjiijijtii ,,,,

0dqu ii ,

if the these integral expressions are verified for any wi, q, then, the differentialequations will be satisfied within the whole domain

Page 136: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, weighted residuals

• The viscous term is

2D laminar NS, weighted residuals computational fluid dynamics I

• The viscous term is

dyu

xuwduw ii

ijjii 2

2

2

2

,

• Integrating the first term by parts(in 2D)

dyudvdxdyuwI ii

y yyxxi

iwu udxuv ii

n n

dyd

xL

• The integral b.p. results into

i xxx

yT

xLxR

x

xyBdxdy

xu

xwdy

xuwI ii

y

y

x

x

ii

T

B

R

L

uwu

d

xu

xwdn

xuwI ii

xi

i dndy x

Page 137: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, Green theorem

• Proceeding in an analogous way with the second term it is obtained

2D laminar NS, Green theorem computational fluid dynamics I

Proceeding in an analogous way with the second term, it is obtained

duwdnuwduw iiy

ii

ii

therefore

yyyyy yii

dnuwduwduw jjiijijijjii ,,,,

• Proceeding in an analogous way with the pressure term

dpnwdpwdpw iiiiii 111

,,

Page 138: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, weak form

• The stationary formulation that also ignores the convective terms gives

2D laminar NS, weak formcomputational fluid dynamics I

• The stationary formulation that also ignores the convective terms gives

21

dwtdfwpdwduw iiiiiijiji ,,, 2

2

iiiiiijiji ,,,

0dqu ii ,

Vwi Qq ii bu 1 ijij tn 2

or in vectorial notation

21

dddpd wtfwwwu ···: 22

dddpd wtfwwwu :

0dq u·

q

Page 139: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, matrices2D laminar NS, matricescomputational fluid dynamics I

• The Stokes simplification can be written as

y

x

TTy

x

ff

pvu

BBBABA

where

yx pBB

dNwNwA jiji

ij

dwB j

ixij

dwB ji

yij

e yyxxij e x jxij e y jyij

dtwdfwf xiixiixi

ee

dtwdfwf yiiyiiyi ee ee

Page 140: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• As stated before, the selection of the basic functions N and is not trivial, as it

2D laminar NS, LBBcomputational fluid dynamics I

As stated before, the selection of the basic functions N and is not trivial, as it involves different types of equations and unknowns

• The matrix expression of the stationary flow results into

hfu

0BBK

T

nxn nxm

hp0BT

mxn

where the dimension of K is nxn (n range) and the dimension of B is nxm. Inorder to obtain a unique solution, the stiffness matrix (with dimensions(n+m)x(n+m)) must be non-singular and in order to achieve so, it is required(although not sufficient) that

in other case the range of matrix B would be n (its range cannot be bigger than

hh VQ dim dim

n) there would be more equations than unknowns, and the system would benon-compatible

Page 141: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• The sufficient condition is the so called LBB (Ladyzhenskaya -Babuska-

2D laminar NS, LBB computational fluid dynamics I

The sufficient condition is the so called LBB (Ladyzhenskaya BabuskaBrezzi) condition, that sets that for a given value of regardless of themesh size, the existence of an approximate solution (uh, ph), requires anelection for subspaces Vh, Qh, so that

010

hi

hii

h

VwQq wq

dwqhh

ihh

,supinf

from the system fBKu p

0uBT

solving first equation for u gives

pBfKu 1

that once introduced at the second one gives

hfKBBKB 11 TT p hfKBBKB p

Page 142: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• If the velocity-pressure pair verifies the LBB condition that is it ensures

2D laminar NS, LBB computational fluid dynamics I

• If the velocity-pressure pair verifies the LBB condition, that is, it ensuresthat ker B = 0, the matrix BTK-1B is positive definite, the stiffness matrixis regular (non-null determinant) and the problem of finding

if i h i i i ll d i d

hh Vu hh Qp verifying the equations is univocally determined

• We are going to illustrate this condition with some particular examplesof velocity-pressure pairs. After that, the most popular pairs for fluidy p p , p p pproblems will be presented

• In order to do so the particular case of a square domain of n by n nodes(like the one being used to evaluate the cavity flow) will be presented(like the one being used to evaluate the cavity flow) will be presented

2 3 n..1 1350

400

Level vel19 0 95

2

3

:

Y

50

100

150

200

250

300

350 19 0.9518 0.917 0.8516 0.815 0.7514 0.713 0.6512 0.611 0.5510 0.59 0.458 0.47 0.356 0.35 0.254 0.23 0.152 0.11 0.05

nX0 50 100 150 200 250 300 350 400 450 500

0

Page 143: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• For a domain divided into P P (linear velocity/constant pressure)

2D laminar NS, LBB computational fluid dynamics I

• For a domain divided into P1P0 (linear velocity/constant pressure) triangular elements of nxn nodes, the number of equations/unknowns in the continuity equation is

Equations (pressure unknowns): 2(n-1)2-1Unknowns (velocities): 2(n-2)2

2 3 n..

2

1 1

3

n:

As the number of equations is bigger than the number of unknowns the only possible solution is the trivial and the problem is ‘locked’y p p

Page 144: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• For a domain divided into P P (quadratic velocity/linear pressure)

2D laminar NS, LBB computational fluid dynamics I

• For a domain divided into P2P1 (quadratic velocity/linear pressure) triangular elements of nxn corner nodes, the number of equation and unknowns in the continuity equation is

Equations (pressure unknowns): n2-1Unknowns (velocities): 2(2n-3)2

2 3 n..

2

1 1

3

n:

As the number of equations is smaller than the number of unknowns (n>2), the pair allows for a solution different from the trivial

Page 145: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

• Similarly for a domain divided into Q P (bilinear velocity/constant

2D laminar NS, LBB computational fluid dynamics I

• Similarly, for a domain divided into Q1P0 (bilinear velocity/constant pressure) triangular elements of nxn corner nodes, the number of equations/unknowns in the continuity equation is

Equations (pressure unknowns): (n-1)2-1Unknowns (velocities): 2(n-2)2

11 2 3 n..

2

3

n:

As the number of equations is smaller than the number of unknowns (n>4), the pair allows for a solution different from the trivial, but not necessarily exact as it leads to a discontinuous checkerboard pressure modeexact as it leads to a discontinuous checkerboard pressure mode

Page 146: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB

S f th t l l it i

2D laminar NS, LBB computational fluid dynamics I

Some of the most popular velocity-pressure pairs are

• Q1P0 (bi-linear velocity – constant pressure);Q1P0 (bi linear velocity constant pressure)LBB is not verified , discontinuous pressure

• P1P0 (linear velocity - constant pressure)LBB is not verified , discontinuous pressure

• Q1Q1 (bi-linear velocity – bi-linear pressure)LBB is not verifieds ot e ed

• P1P1 (linear velocity - linear pressure)LBB is not verified

Page 147: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, LBB2D laminar NS, LBB computational fluid dynamics I

• P2P1 (quadratic velocity – linear pressure)LBB is verified ;

• Q2Q1 ‘Taylor-Hood’(bi-quadratic velocity, bi-linear pressure)y ( q y, p )LBB is verified

• Q2Q1 ‘Taylor-Hood serendipity’ (bi-linear velocity and pressure)LBB is verified

Page 148: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS

• Taking the unsteady convective flow equations

2D laminar NScomputational fluid dynamics I

Taking the unsteady convective flow equations

012

2

dwtpdwduwdfuuuw iiiijijiijijtii ,,,,,

0dqu ii ,

Vwi Qq ii bu 1 jiji xuxu 00 ,

or in vector notation1

jj

1

u 012

2

dwtdpddt iiw·w:ufu·uuw

0udq ·

0udq

Page 149: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, matrices2D laminar NS, matricescomputational fluid dynamics I

• When the transient convective flow is considered a finite different approach can be considered to integrate the differenctial equation. The derivatives with respect to time can be taken as

tt

nn 1 MM

where are the velocities obtained for the previous temporal step

11

1n

11,1

nnnnnnn

tt MfBpAvuCM

0B nT 0B T

Page 150: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, matrices2D laminar NS, matricescomputational fluid dynamics I

• When the convective term is included a non-linear convective term is obtained that can be evaluated making use of Newton-Raphson or a successive approximation technique, the former leading to

nnnnnn 11 v,uCv,uC

where are the velocities obtained for the previous convection step and can be estimated are zero for the step

11 nn v,u

111 11

nnnnnnn

tt MfBpAv,uCM

• For each time step the iterations for convection should be carried out

0B nT

For each time step the iterations for convection should be carried out

Page 151: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, matrices2D laminar NS, matricescomputational fluid dynamics I

• When the transient and convective flows are taken into account it is obtained

nnnn uv,uCuM 11

1

n

nnn

n

n

tpvv,uC

pvM 111

1

1

1

1

1

n

n

n

y

x

n

n

n

Ty

Tx

y

x

tpvu

MM

ff

pvu

BBBABA

where

NN jj

e

dNwM jiij

e

dy

NvN

xN

uNwC jkk

jkkiij

Page 152: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, solver

• The direct solvers are one step methods that give an exact solution to the

2D laminar NS, solvercomputational fluid dynamics I

• The direct solvers are one-step methods that give an exact solution to the systems. Nevertheless, the memory requirements involved are very high even with skyline storing and specially for fluids

• The sparse storage allows to drop all the non zero elements but cannot be used• The sparse storage allows to drop all the non-zero elements but cannot be used in combination with a direct solver due to the fact that some elements could be ‘thrown out’ of the sparse stencil

• The row-indexed sparse storage mode requires a memory space of only twice the• The row-indexed sparse storage mode requires a memory space of only twice the number of the non-zero matrix elements uses an integer pointer vector (p) and a real vector (v), where the sparse elements are loaded

• An iterative solver of the Kryliov type such as the (PBCG or the GMRES) can be• An iterative solver of the Kryliov type, such as the (PBCG or the GMRES) can be used in connection with the sparse matrix storing

Page 153: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, benchmark

• Benchmark problem: Cavity flow

2D laminar NS, benchmarkcomputational fluid dynamics I

10000Re /uL• Benchmark problem: Cavity flow 10000Re /uL

350

400

350

400

Level vel19 0.9518 0.917 0.85

Y 200

250

300

Y 200

250

300 16 0.815 0.7514 0.713 0.6512 0.611 0.5510 0.59 0.458 0.47 0 35

50

100

150

50

100

1507 0.356 0.35 0.254 0.23 0.152 0.11 0.05

X0 50 100 150 200 250 300 350 400 450 500

0

X0 50 100 150 200 250 300 350 400 450 500

0

Page 154: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, benchmark

• Benchmark problem: Cavity flow 10000Re /uL

2D laminar NS, benchmarkcomputational fluid dynamics I

• Benchmark problem: Cavity flow 10000Re /uL

4 444

5 55 55 55

5 666 6

6 6

6

6

7

88

89 910

1111

12134 15 6 16

17400Re = 10000

1

22

22

2

3

33 3

33

3 3

33 3

3

4

4

4

4

4

4

4

44

4 4

5 5

55

5 5

5

5 5

6 66

6

66

7

77 7

8

Y 200

250

300

350Level h19 0.038030918 0.035016717 0.032002616 0.028988515 0.025974414 0.022960213 0.019946112 0.01693211 0.013917910 0.0109037

0.8

1

1.2

Ghia 129x129

1 1

1

2

2

2

2

3

3

3

3

4

444 4

444 4

4 4

5

5

5 5

5

5

5 5

5

5 5

5 5

666

6

6

6

6

Y

50

100

150

200 10 0.01090379 0.007889628 0.00487557 0.001861376 -0.0001703225 -0.001152754 -0.002867523 -0.004166882 -0.005503661 -0.0062906 0.2

0.4

0.6Ghia 129x129Present 41x41

56

66

6

66 66 6 6 67

X0 100 200 300 400 500

00-0.5 0 0.5 1 1.5

Page 155: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, benchmark

• Benchmark problem: Backward step 1200Re /uD

2D laminar NS, benchmarkcomputational fluid dynamics I

• Benchmark problem: Backward step 1200Re /uD

6

7

8

X

Y

0 5 10 15 20 25 30 35 40 45 500

1

2

3

4

5

6

Y 4

5

6

7

8

VEL0.9375680.8750640.8125590.7500550.687550.6250460.5625410.5000360 437532

X0 10 20 30 40 50

0

1

2

3

0.4375320.3750270.3125230.2500180.1875140.1250090.0625046

1 123 3 44

10 12 1

Y

2

3

4

5

6

7

8

15 -0.0061812714 -0.012678213 -0.019175212 -0.025672211 -0.032169210 -0.03866619 -0.04516318 -0.05166017 -0.05815716 -0.0646545 -0.0711514 -0.0776483 -0.0841452 -0.09064191 -0.0971389

11 1

11

11

2

22

2

2

3

3

33 3 3 3 3

444 4

44

44

555 5

5

6

6

7 88

8

8

99

9 9 99 9

9 9999

9

10

10 10

0

1111

1111

212

1212

313

13

14

14

151515

15

X0 5 10 15 20 25 30 35 40 45 50

0

1

Page 156: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluids2D laminar NS, benchmark

• Benchmark problem: Backward step 1200Re /uD

2D laminar NS, benchmarkcomputational fluid dynamics I

• Benchmark problem: Backward step 1200Re /uD

s3

s2

s1

Reattachment length s3

15

20

25

30

s3 Armaly exps3 Armaly cal

0

5

10

15 s3 Armaly calPresent

0 200 400 600 800 1000 1200 1400

Page 157: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidspenalty formulation

Th lt th d b i t t d bli l ti f th

penalty formulationcomputational fluid dynamics I

• The penalty method can be interpreted as enabling a relaxation of the incompressibility constraint so that the incompressible problem is approached by a slightly compressible formulationapproached by a slightly compressible formulation

• The pressure unknown is removed from the mixed formulation and therefore the only unknowns of the problem will now the pressuresy

Page 158: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidspenalty formulation

• The penalty formulation is based upon substituting the incompressibility condition

penalty formulationcomputational fluid dynamics I

• The penalty formulation is based upon substituting the incompressibility conditionby

pu ii ,

where tends to zero, and drive it into the dynamic equation to obtain

1 df

ti th t d t d d th k idi th

01

dwuwfwu iiiiiijiji )( ,,,,

equation that does not depend upon the pressure unknown, so avoiding theproblems found in the mixed formulation

Page 159: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidspenalty formulation

• In order to impose the incompressibility condition is required to be very small

penalty formulationcomputational fluid dynamics I

• In order to impose the incompressibility condition, is required to be very small,but not to much, because in that case, the penalty term (if it leads to a regularmatrix) promotes the obtaining of a unique trivial solution

• In order to avoid it, it is required to carry out a ‘reduced integration’ or ‘selectiveintegration’, that is to carry out a roughly approximating of the penalized term,leading to a similar effect to that obtained for the mixed elements verifying theleading to a similar effect to that obtained for the mixed elements verifying theLBB condition

• It is recommended to chose as

with c=107 1 Rec ,max

Page 160: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Q1P0 (2x2, reducida 1)

• P1P0 (1, reducida 1)

• P2P1 (3, reducida 1)

• Q2Q1 (3x3, reducida 2x2)

• Q2Q1 (3x3, reducida 2x2)

finite elements in fluidspenalty formulation, reduced integrat. computational fluid dynamics I

Page 161: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Proceeding in the same way as in the mixed formulation it is obtained

or in matrix notation

012

2

dwtdwuduwfuuuw hi

hi

hii

hii

hji

hji

hi

hji

hj

hti

hi

h

,,,,,,

fBAvuCM

1,

t

y

x

yTx

t ff

vu

BDDB

vu

AA

vu

vuCvuC

vu

MM

1

,,

finite elements in fluidspenalty formulation, matrices computational fluid dynamics I

Page 162: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Where the basic matrices are

n

n

n

n

nn

nn

n

n

t vu

AA

vu

vuCvuC

vu

MM

,,1

1

111n

n

y

xn

n

yTx

t vu

MM

ff

vu

BDDB

e

dNwM jiij

e

dy

NvN

xN

uNwC jkk

jkkiij

e

dy

Nyw

xN

xwA jiji

ij

e

dx

NxwB ji

yij

e

dy

NywB ji

xij

e

dy

NxwD ji

ij

ee

dtwdfwf hxiixiixi

ee

dtwdfwf hyiiyiiyi

finite elements in fluidspenalty formulation, matrices computational fluid dynamics I

Page 163: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• As we know, the Shallow Water equations are

finite elements in fluidsssww equationscomputational fluid dynamics I

34

2

2

2

2

2

h

xawc H

uVgnH

WWCyu

xuvf

xhg

yuv

xuu

tu

34

2

2

2

2

2

h

yawc H

vVgnH

WWCyv

xvuf

yhg

yvv

xvu

tv

0

yvH

xuH

th

Page 164: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Following a similar procedure as the one carried out for the 2D laminar equations in the continuity equation it is obtained

finite elements in fluidsssww equationscomputational fluid dynamics I

0

yvH

xuH

th

dqHuduHqqh Niit ,,

0,,

dHuhq iit

dqHudHuqdqh iiit ,,

Page 165: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Identically, with the dynamic equation, it is obtained

finite elements in fluidsssww equationscomputational fluid dynamics I

34

2

2

2

2

2

h

xawc H

uVgnH

WWCyu

xuvf

xhg

yuv

xuu

tu

iiijjijijt Sghghuuuu ,,,,,,

2,,,,,2

dwtdhwgduwdSuuuwh

hhh

hi

hi

hhii

hji

hjii

hji

hj

hti

hi

34

2

2

2

2

2

h

yawc H

vVgnH

WWCyv

xvuf

yhg

yvv

xvu

tv

Page 166: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• And the matrix expressions are

finite elements in fluidsssww equationscomputational fluid dynamics I

e

dy

NvN

xN

uNwC jkk

jkkiij

e

dy

Nyw

xN

xwA jiji

ij

e

dxwgB j

ixij

e

dywgB j

iyij

e

dNx

HD ji

kkxij

ee

dtwdSwf xiixiixi

ee

dtwdSwf yiiyiiyi

e

dNy

HD ji

kkyij

h

y

x

yx

y

x

hh fff

hvu

DDBABA

hvu

vuCvuC

,,

e

dHuqf Nihi

Page 167: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

CFDI

finite elements in fluids

computational fluid dynamics I

stabilizing techniques

Page 168: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The stabilizing techniques are ways of circunventing the LBB conditionthat allow to use velocity-pressure terms which are not stable for thestandard Galerkin formulation. These problems grow bigger as theconvective term is larger compared to the other terms in the equation

• The basic idea behind stabilization is to enforce the positive definitenessof the matrix

• The most commonly use of these methods are the Petrov-Galerkin,Characteristics Galerkin, GLS, SUPG, Finite Increment Calculus, BubbleFunctions,...

finite elements in fluidsstabilizing techniquescomputational fluid dynamics I

0BBK

T

Page 169: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The stiffness matrix is non-symmetric and its treatment with the Galerkinfunctions is not adequate

• To show these problems we are first going to use the one dimensional steadyconvection-diffusion equation

• After dealing with the transport equation, the particulars will be generalized forthe multidimensional Navier-Stokes equations

• The former equation has an analytical solution for constant U and k, and Q equalto zero which is given by (if there is no convection it would be a straight line)

• For boundary conditions (x=0)=0 and (x=L)=1 the solution is given by

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

0

Q

dxdk

dxd

dxdU

xkU

ecc 21

kUL

xkU

e

e

1

1 k

ULk

UL

Lk

U

ee

eLx

1

1

1

122

/x

L

1

Page 170: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• We can introduce the discretization

• For an internal element the following equation is obtained

where

• Integrating the elementary matrices elements, taking U, Q and k as constantsand the weighting functions equal to the shape functions it is obtained

0 ijij fK

h jih j

iij dxdx

dNk

dxdwdx

dxdN

Uwk00

h

ii Qdxwf0

211U

hkk

222U

hkk

212U

hkk

221U

hkk

21Qhf

22Qhf

hxN 11

hxN 2

kkN

1

i-1 i i+1

N1 N2

Page 171: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• Assembling the matrices it is obtained

• And the equation for our internal element is

or

0

··121··

2

··

··

··········

··22

····

··2222

··

····22

············

1

1

QL

UhkU

hk

UhkU

hkU

hkU

hk

UhkU

hk

i

i

02

22 11

Qh

hkU

hkU

hk

iii

01212

11 kQhPePe iii

kUhPe2

Page 172: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• In fact, the so obtained solution is also the result of using a finite differentapproach. In finite differences the derivative is approached by the secant

• Taking the Taylor expansion of

a function f(x) around x as

• The first derivative can then

be approximated by

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

···´ xhfxfhxf

h

xfhxfxf

xx-h x x+h

f(x)y

Page 173: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• Taking the third term in the Taylor´s expansions

adding the former expressions it is obtained

subtracting the former expressions it is obtained

• For the variables in our equation the central approximation results into

···´ xfhxhfxfhxf 2

···´ xfhxhfxfhxf 2

xfh

xfhxfhxf

222

hdxd ii

211

211

2

2

22hxd

d iii

xfh

hxfhxf

2

Page 174: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• Substituting the central finite difference approaches into the governing equation,it is obtained

which is the same equation as the one obtained before for the Galerkinapproximation

• Pe, the Peclet number, measures the importance of the convection in theequation. The stiffness matrix is not symmetric and, the bigger the Peclet numberis, the more non-symmetric the matrix turns

0

Q

dxdk

dxd

dxdU

012122

2

2

1121111

kQhPePeQ

hk

hU iii

iiiii

kUhPe2

Page 175: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• When the Peclet number tends to infinity (theconvection is dominant) the solution is purelyoscillatory and non-sense, this is shown in thepicture for the value = 0, which means aGalerkin formulation is being used.

(Q is taken as 0, and the boundary conditionsare x and xL

for Pe=0 (no convection) the differentialequation is d2dx2=0, the solution of which isa straight line, and for Pe infinite (no diffusion)the solution of the equation is ddx=0 is aconstant, and only a boundary condition canbe imposed (because the eq is of first order))

For strong convection the downstreamboundary condition is only noticed in avery small region and the upstreamweighting is more adequate !

Page 176: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• As the propagation of the information is in the direction of the velocity, a straightforwards procedure would be to substitute the first central finite derivative by afull upwind differencing

• This results in an equation

• This full upwind solutions provide with realistic (though not always accurate)solutions for several Peclet numbers ( in the plot The exact solution beingonly obtained for infinity Peclet numbers (in the same way the Galerkinformulation obtains the exact solution only for full diffusion -> Petrov-Galerkin is amixture of both that achieves an exact solution for all Peclet numbers.

hdxd ii 1

02222

11 kQhPePe iii

211

2

2

22hxd

d iii

hdx

d ii 1 0U 0U

Page 177: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• The Petrov-Galerkin methods arebased in taking the weightingfunctions equal to

where

*iii wNw

e

hdxwi 2*

Page 178: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• If we take the simplest discontinuous function

the equation to be obtained for the so-posed problem is

when the full upwind formulation is obtained and when the Galerkinformulation is got

• It can be proved that the selection

gives the exact nodal values for all values of Pe.

• It can also be shown that with oscillations will take place whenever

UU

dxdNhsignU

dxdNhw ii

i 22 *

01122112

11 kQhPePePe iii

Peeeee

PePe PePe

PePe 11

coth

12

k

UhPe

Page 179: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• The above weighting functions should be applied on any term in the equation

• The weighting functions can be taken as discontinuous as far as the convectiveterms are concerned

• But when the weak form of the diffusive term is taken into account the derivativeof the weighting function is required and the discontinuity can not take place atthe node but within the element (see figure)

dxdx

dNUw

h ji0

h ji dx

dxdN

kdxdw

0

Page 180: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

finite elements in fluidsstabilizing techniques, conv-diffcomputational fluid dynamics I

• If instead of the governing equation considered we substitute it by the expression

with

that is, an artificial diffusion that acts in the direction of the flow is considered, itis obtained

which is the same expression obtained for the Petrov-Galerkin formulation

• This shows that the effects of considering a Petov-Galerkin formulation is at lastthat of considering an artificial diffusion that acts in the direction of the flow

0

Q

dxdkk

dxd

dxdU b

Uhkb 21

01122112

11 kQhPePePe iii

Page 181: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The GLS (Galerkin least squares method) is a different approach that leads tothe same formulation

• In the GLS method the positive definiteness of the stiffness matrix isaccomplished by carrying out a modification in the weak form of theincompressibility condition rending non-zero diagonal terms in the stiffnessmatrix

• If we pose the same differential problem with the differential operator L notationthe previous considered problem can be written as

with

leading to the Galerkin approximation for the k-th equation

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

0QL Nˆ

dxdk

dxd

dxdUL

dxQLNL

k ̂0

Page 182: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• In the GLS method the square of the residual

has to be minimized, therefore

or

• If we take now a linear combination of the Galerkin formulation plus times theformer equation, it is obtained

00

dxQLN

dxdk

dxd

dxdNUN

L

kk

k ˆ

QLR ̂

021

00

2 dxdLdQLdxR

dd L

k

L

k

ˆˆ

021

00

2

dxN

dxdk

dxd

dxdNUQLdxR

dd L

kkL

k

ˆ

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

Page 183: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• If we drop the second-order term as we could do for linear shape functions andwe take

the formulation obtained is

i.e. the same as the one obtained for the Petrov-Galerkin formulation

020

dxQL

dxdN

UhU

NL k

k ˆ

Uh

2

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

Page 184: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Let us follow the explanation of the stabilizing techniques by extrapolating theformulation to the two-dimensional steady-state convection diffusion equationwhich can be written as

• The Peclet number is now the vector

• Following the analogy with the balancing diffusion, the convection is only activein the direction of the resultant velocity U, and therefore the so-introducedbalancing diffusion should be only different from zero in the direction of thevelocity resultant

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

0

yk

yxk

xyV

xU

kh

2UPe

Page 185: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• This can be accomplish by considering weighting functions

rather than the previously used

where now is defined as

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

kh

Pe2U

i

kik

kkkkkk dx

dNUUhN

dydNV

dxdNU

UhNwNw

21

2*

dxdN

UUhNwNN k

kkkk 2 *

PePe 1coth

iiUUVU 22U

Page 186: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• This is equivalent to using a balancing diffusion to be used in the term

equal to

that therefore acts only in the direction of the velocity

• The length h can be taken as the maximum size in the direction of the velocityvector as shown in the picture

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

ijk~

dxN

xNk

jiij

U2~ ji

ij

UhUk

UU

hh

Page 187: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Extending the GLS to the multidimensional problems where the formulationpresented was

• It is obtained

which is an identical stabilizing term to that of the streamline Petrov-Galerkinformulation

• The use of one or another approach is in most of the cases a matter of taste

finite elements in fluidsstabilizing techniques, conv-diff computational fluid dynamics I

dxQLdx

dNUhU

NL k

k

ˆ

0 2

dQ

xk

xxU

dxdNhUN

jjjj

i

kik

ˆˆ

U2

Page 188: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Let us extend the GLS particulars to the vector valued Navier-Stokes equations

• The basis of the GLS stabilization technique is to add a term to both continuityand dynamic equations. These terms depend on the residual of the momentumeq., and therefore ensure the consistency of the stabilized formulation

• Se obtiene el mínimo de la suma de los cuadrados de los residuos. Para laformulación de Stokes, resulta

El extremo del funcional viene dado por

para cualquier valor de w y q, esto es:

dpppLs fufu,u 22

21

00

dqpdLs ,wu

Q x 022 Vw,qdpq

fuw

finite elements in fluidsstabilizing techniques, glscomputational fluid dynamics I

Page 189: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Or eqivalently:

if we now add the ‘stabilizing’ terms multiplied by a certain factor to thedynamic and continuity equations, it is obtained

Vdp

wfuw 022

Qqdpq 02

fu

finite elements in fluidsstabilizing techniques, glscomputational fluid dynamics I

21 2

1

dwtdfwdfpuwdpwduwh

h

el

hh

hi

hi

hi

hi

n

e

hi

hi

hjji

hjjie

hhii

hji

hji ,,,,,,

h

el

dfpuqduqn

n

hi

hi

hjji

hie

hii

h 01

,,,,

Page 190: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• If linear interpolation functions for velocity and pressure are used, the terms withsecond derivatives vanish and we obtained

The terms lead to the appearance of non zero diagonal terms thatallow for the stabilization. As a consequence, basic elements with an equal orderinterpolation for velocity and pressure are stable (for example Q1Q1)

• The factor e is the stabilization parameter

where he is a measure of the element size, 0 can be taken as 1/3 for linearelements

dpq hi

hi ,,

finite elements in fluidsstabilizing techniques, glscomputational fluid dynamics I

2,,,2

1

dwtdfwdpwduwh

hhh

hi

hi

hi

hi

hhii

hji

hji

h

elel

dfqdpqduqn

n

hi

hie

n

n

hi

hie

hii

h

11,,,,

4

2

0e

eh

Page 191: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Extrapolating to vector valued equations the issues regarded for the convectiondiffusion eq., the SUPG method can be also used for the Navier-Stokesequations

• The Galerkin formulation leads to a central approximation of the convective termand it is not optimal for convection dominate flows, that is for big Reynoldsnumbers as the stiffness matrix becomes more non-simmetric

• The SUPG formulation takes weighting functions as

where the upwind contribution to the weighting function p, is defined as

finite elements in fluidsstabilizing techniques, SUPGcomputational fluid dynamics I

iii pww

uˆ i

iuu iiuu2uh

hji

hjh

i

wukp

uˆ ,

Page 192: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The multimensional definition of k is given by:

finite elements in fluidsstabilizing techniques, SUPGcomputational fluid dynamics I

2 huhu

khh

1coth

1coth

2hu h

2

hu h

heii

h ueu heii

h ueu

x1

x2

e

e

h

h

Page 193: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Provided known initial conditions in the domain the steadysolution of the flow problems should be accurately transported in time

• The easiest way of integrating the unsteady equations is to consider a finitedifference approach for the local acceleration term, that is taking

• The forward differencing from level tn to level tn+1 would lead to the explicit (so-called Euler method) scheme

where the convective matrix is known at each iteration.

The accuracy of the former scheme is O(t and the step t must be restrictedfor stability

finite elements in fluidstime integration, classical time&spacecomputational fluid dynamics I

tOtt

nn

uuu 1

nnnnnn p

tFBAuucuuM

1

0uB nT

xu,xu 00 t

e

dNwM jiij

Page 194: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• An implicit scheme could also be obtained by backward differencing from tn+1

to tn , to obtain

where the non-linearities can be solved by either taking

that is

or taking

that anyway requires the non-linear terms to be small and to change slowly withrespect to time (t small)

finite elements in fluidstime integration, classical time&spacecomputational fluid dynamics I

11111

nnnnnn p

tFBAuucuuM

0uB 1nT

nn ucuc 1

dxhn

hn

hn 11 · uuwuc

nnnnnn p

tuCFBAuuuM

1111

Page 195: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• These approaches can be regarded in a joint way by considering the parameter in terms of which the equations could be written as

for the Euler method is obtained and for the formulation results into thebackward Euler algorithm

• For the so-called Crack-Nicolson formulation is obtained, which provideswith a second order accuracy as it leads to central differencing

finite elements in fluidstime integration, classical time&spacecomputational fluid dynamics I

0111111

nnnnnnnnnn pp

tFBAuucFBAuucuuM

0uuB nnT 11

Page 196: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The splitting techniques would be also an alternative. For example the operatorcontributions associated with the non-linearities and the incompressibility can besplit to provide

and a second step that makes

formulation with many different variants

finite elements in fluidstime integration, classical time&spacecomputational fluid dynamics I

nnnnnn p

tucFBAu

/uuM ///

/

21212121

2

0uB 2/1nT

21111211

2 // BFAuuc

/uuM

nnnnnn p

t

Page 197: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Time and space are linked in such a way that the discretization of one has aninfluence on the discretization of the other.

• An accurate spatial representation can be spoilt when it is transported in time ifthe integration algorithm is not able to propagate the information along thedirections prescribed by the convection problem

• This could be circumvented by resorting to a Lagrangian formulation, in whichthe convective terms disappear from the governing equations

• Nevertheless, the lagrangian description is not practicable as it would lead toexcessive distortion of the computational mesh

• The semi-Lagrangian, Lagrange-galerkin and characteristic-based methodsmake use the benefits to which the lagrangian description may lead to in theEulerian approach. They all take advantage to the fact that the unknown isconstant along a particle path or characteristic

finite elements in fluidstime integration, characteristicscomputational fluid dynamics I

Page 198: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The classical first an second order time-stepping algorithms are not optimalfor convection-dominated problems as they are unable to take into account thedirectional character of the propagation of the information in the convection.

• This gets worst as the time stepping is increased

• That is why the higher order time-stepping schemes (such as the Taylor-Galerkin) are used allowing for un indirect propagation of the information alongthe characteristics

finite elements in fluidstime integration, characteristicscomputational fluid dynamics I

Page 199: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Let us consider the one dimensional PDE of the convective-difussive transportequation

where although U and Q could depend on x and t, will be taken as constants

• We are going to transform the PDE into an ODE along the appropriate direction

• If we state the change of coordinates

the change of coordinates will give

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

0

Q

xk

xxU

t

Utx Utx

11UU

xxtt

x

t

Page 200: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Taking Q=k=0, the convective transport equation

becomes

this is

the convective term disappears and the Galerkin formulation is available

• Therefore, only depends on that is

this means that the solution at point x and time t is equal o the solution at time t-t and point x-Ut

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

0 xt U

02 U

0

Utx

UtxtUUttUxtttUxtx ,,

Page 201: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The concept of transport along the characteristic shows how an initial distribution

follows a uniform transport along the characteristic curve (line in this case) andremains constant along x=Ut+cte, as shown in the picture

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

xx 00,

x=Ut+cte

(x1,0)

(x1,0)=0(x1)

(x,t)

x

t

tt(x-Ut,t-t)

(x-Ut,t-t)=0(x1)

(x,t)=0(x1)

t

Page 202: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The characteristic lines can beexpressed in their parametricexpression as

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

rxx

rtt

0

xU

t

x

t 3.53.5 4.5

• The idea is therefore to transform the PDE of the convective transport into anODE in which the unknown is integrated along the characteristic curves in the

space-time plane

Page 203: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The variation of the unknown along the characteristic curve is given by

comparing this material derivative with the convective transport equation

we would have then

• From the first of the equations with t(r=0)=0, it is obtained

• The second equation gives for a constant U

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

0

drdx

xdrdt

tdrd

0

xU

t

Udrdx

1drdt

0drd

rt

Udtdx

drdx

0xUtx

Page 204: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The equation

gives the characteristic curves along which the unknown verifies

this is, is a constant. In other words, we have transformed the PDE into anODE that has been integrated along the characteristic

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

0xUtx

0drd

Utxxtx 0000,

x-Ut=x0

(x,0)=0(x0)

x

t• The characteristics curves are a family ofequations in the x-t plane with parameterx0

• That is, for each value of x0 a differentcurve is obtained, where x0 is given by theinitial condition

0xUtx

Page 205: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Example 1. Integrate

with the initial condition

Comparing the PDE with the material derivative of we have

that is

the initial condition is given by

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

021

xt

xx sin0,

21

dtdx

drdx1

drdt

0drd

02xtx 02

xtx

2sinsin, 0 txxtx

Page 206: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

Their partial derivatives being

• Example 2. Integrate

with the initial condition

the equations to be verified now are

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

q.e.d. 02/cos

212/cos21

2/cos

2/cos21

txtxtx

x

txt

xxt

t2

xx 0,

xtdtdx

drdx 21

drdt

dtd

drd

Page 207: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

The former equations give

from the total derivative we have

therefore, the solution to the PDE becomes

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

tdtx

dx 2 ktx 2ln2tcex 2

0texx

2

0txex

dtd

drd

dtd

kt ln tce 0

00, cextx tex0

22

, tttt xeexetx

Page 208: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

Deriving the former expressions

• Example 3. Integrate

with the initial condition

the equations to be verified now are

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

q.e.d. 221

2122

2

2

tttt

tt

tt

xteetxe

x

etxt

02

xt

xx 0,

2dtdx

drdx1

drdt

0dtd

drd

Page 209: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

If d/dr=0, then is constant along the characteristic and the equation dx/dt=2

gives

the initial condition gives

with derivatives

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

02 xtx 0

2 xtx

txx 20

tx 22

t

xtx

1

,

q.e.d. 0

1211

212

1

12 23

23

txtxtx

txx

txxt

Page 210: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• In the former examples the PDE has been solved by solving a ODE along thecharacteristic curve which has been obtained through another ODE

• This equations, anyway, not always can be solved analytically and anumerical solution has to be introduced in the characteristic approach thatsubdivides both the pressure and time spaces into discrete bits

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

Page 211: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The convective transport equation

can be resolved by characteristics (that is the convective term eliminated) byusing a Lagrangian viewpoint as follows

• For a given space-time point (x1,t1), the characteristic line X passing through thepoint can be obtained from the differential equation

that verifies

with reference to the Lagrangian point of view, can be interpretedas providing the position at time t of a fluid particle transported by the convectionvelocity field U, which occupies the spatial position x1 at time t1. That is, definesthe trajectory of the particle

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

txQx

txUt

,,

ttxXUdt

ttxdX ;,;,11

11

1111 ;, xttxX

ttxXX ;, 11

Page 212: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The value of the unknown along the characteristic will be

that is, its characteristic form. The solution of which will be

or

depending on the characteristic hitting the abscise or the ordinate axes

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

tQdtd

dttQtXtxt

tD

1,, 11

dttQXtxt

1

0011 0,

Page 213: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The most obvious of the application of characteristics to the FEM would be toupdate the position of the mesh points in a Lagrangian way

we would have

for a constant velocity

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

11 n

n

t

t

ni

ni Udtxx

tUxx ni

ni 1

tn

tn+1= tn +t

x

t

xin xi

n+1

Page 214: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• On the updated mesh only the time-dependent diffusion has to be resolved(featured by symmetric matrices), but the process of continuously updating themesh would be unaffordable because of too large distortions in the mesh leadingto tough difficulties at the boundary

• After a single step, a return to the original one should be carried out byinterpolating from the updated values to the original mesh points

• The diffusion part of the computation will be carried out either on theoriginal or the final mesh leading to a certain splitting of the convectionand diffusion

• The general process will be generalized in the so-called characteristic-Galerkin methods

finite elements in fluidstime integration, the method of charac.computational fluid dynamics I

Page 215: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The unknown is going to be split into a convective and a diffusive part

leading to the equations

computational fluid dynamics I

finite elements in fluidstime integration, characteristic-galerkin

***

0*

xU

t

0**

Q

xk

xt

Page 216: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The convective diffusive transport can be written along the characteristic as

• In the former equation the convective term vanishes and the source and diffusionterms are average quantities along the characteristic. The equation is now self-adjoint and the Galerkin spatial approximation is optimal

• The time discretization of the former equation along the characteristic gives

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

0,

XQX

kXt

ttX

x

nn

x

nn Qx

kx

Qx

kxt

111

1

where is equal to zero for explicit formsand between zero and one for semi andfully implicit forms

• But this formulation requires meshupdating and leads to boundary problems x

n1

nn((x-)

=Ut

t

Page 217: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The Taylor series expansion

or

would lead in this case to

that could also be used to take (with

where =Ut is the distance travelled by the particle in the x-direction

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

2

22

2 xx

nnn

x

n

nn

x xk

xxxk

xxk

x

221

21

xQQQ

nn

x

222

1

···!

2

2axafaxafafxf

···!

2

2xxfxxfxfxxf

Page 218: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• And U is an averaged value of the velocity along the characteristic and can betaken as

• Writing and substituting the former equations in the first expression it is obtained

• Substituting =Ut in the former expression and neglecting higher order terms, itis obtained

where

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

1

2

221

21

21

nnnnn

Qx

kxxxtt

n

xQQ

xk

xxk

x

2

2

21

xUtUUU

nnn

2121

1 //

nnn

nn Qx

kxx

Ut n

xQUt

xk

xUt

xU

xtt

222 2

22

nnn

xk

xxk

xxk

x

21

21 12/1

2

12/1

nnn QQQ

Page 219: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The so-obtained formulation is identical to that obtained for the Taylor-Galerkinapproach (to be considered later).

• If we write the multidimensional problem in the fully explicit form, that isapproximating the n+1/2 in terms of n, we obtain

where the additional terms add the stabilizing diffusion in the streamline direction

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

n

iijj

nn Qx

kxx

Ut 1

n

ii

iikk

jji

i xQUt

xk

xxUt

xUU

xtt

222

Page 220: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• An alternative approximation for U would be taking it as

using the Taylor expansion

taking and substituting in the first equation it is obtained

where

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

2

1

x

nn UUU

xUtUUU

nnn

x

n

2

22/12/12/11

221

xUUt

xxUUt

xU

tnn

nnn

nnnn

xQUtQ

xk

xxUt

xk

xn

nn

n

2/12/12/1

22

2

12/1

nnn UUU

Page 221: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• As carried out before, we can approach

obtaining

• For multidimensional problems the formulation to be obtained is

(*)

which is very similar to the one obtained for the other approximation of U andidentical for the particular case U constant. This formulation will be the one to beused in what follows

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

nn UU 2/1

n

nnn Qx

kxx

Ut 1n

nn Qx

kxx

Ux

Ut

2

2

n

iij

jnn Qx

kxx

Ut

1 n

iij

j

k

nk Q

xk

xxU

xUt

2

2

Page 222: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Writing the unknown in terms of the approximation

it is obtained

where

• The new terms introduced by the discretization along the characteristics afterintegrating by parts and dropping the second order derivatives (those relatedto diffusion) are

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

~N

ns

nu

nnnnn tt fKfKCM ~~~~~ 21

dTNNM

dUx i

i

TNNC

dx

kx ii

T NNK

..tbdQT

Nf

dUx

Ux i

i

Ti

iu NNK

21 ..

21 tbdQU

xT

ii

s

Nf

Page 223: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The former formulation is only conditionally stable. For one dimensionalproblems, the stability condition for linear elements is given by

• In two dimensional problems the critical time step may given as

where t is given by the former equation and th2/2k is the diffusive limit forthe critical one-dimensional time step

• With t tcrit the steady state solution results in an almost identicalapproach to that obtained by using the optimal streamline upwindingprocedure. Therefore is the steady state conditions are pursued the time stepshould be t tcrit

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

Uhtt crit

tttttcrit

Page 224: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The formulation for the steady state would be that in which

and the characteristic based formulation results in

which taking

results in a formulation identical to that of the Petrov-Galerkin formulationdropping the second order terms related to diffusion)

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

~~~ 1 nn

0~ su tt ffKKC

2UhUt

020

dxQL

dxdN

UhU

NL k

k ˆ

Page 225: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• If we carry out the same approach for vector valued functions such as the twodimensional field in the dynamic Navier-Stokes equation, the formulationobtained is

where

finite elements in fluidstime integration, characteristic-galerkincomputational fluid dynamics I

n

unn t

1 ~~~ fKKCM

dTNNM

dx

Ui

i

T NNC

dx

kx j

iji

T NNK

..2

tbdQx

Ut

i

T

iT

NNf

dx

tUUx j

jii

T

uNNK

2

Page 226: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The Taylor–Galerkin is another approach to the same problem that leads to thesame formulation

• Starting with the Taylor series expansion in time (instead of space as before) of we would have

• If we write the convective-diffusive transport equation as

and derive it with respect to time

finite elements in fluidstime integration, Taylor-galerkincomputational fluid dynamics I

nn

Qx

kxx

Ut

32

221

2tO

tt

tt

nnnn

nn

Qx

kxx

Utt

2

2

Page 227: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Now, we could substitute both former eqs. into the Taylor expansion to yield

• Assuming U and k constants

• Substituting in the former equation and neglecting higherorder terms, it is obtained

computational fluid dynamics I

nnnn Q

xk

xxU

ttQ

xk

xxUt

2

21

nnnn Q

tk

xtU

xtQ

xk

xxUt

2

21

nn

Qx

kxx

Ut

finite elements in fluidstime integration, Taylor-galerkin

n

nn Qx

kxx

Ut 1

n

QQx

kxx

Ukx

Qx

kxx

UUx

t

2

2

Page 228: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Or also

which is the same one as the obtained for the Characteristic-Galerkin formulationfor constant U and k

• The multidimensional formulation turns out to be

computational fluid dynamics I

n

iijj

nn Qx

kxx

Ut 1

n

ijj

ij

jii

QUx

kx

Ux

UUx

t

2

2

finite elements in fluidstime integration, Taylor-galerkin

n

nn Qx

kxx

Ut 1

n

UQx

kx

Ux

Ux

t

2

2

2

Page 229: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• The so-called characteristics based split method is a procedure that, based in thesplitting methods developed by Chorin in the sixties, were introduced byZienkiewicz and Codina in the nineties

• The dynamic equation can be discretized in time using a characteristic Galerkinprocess.

• The dynamic equation is equal to the convection diffusion equation except for thepressure term, that can be treated as a known quantity provided that we haveanother way of evaluating the pressure

• Writing the Navier-Stokes equations as

where

finite elements in fluidstime integration, CBScomputational fluid dynamics I

2

n

iij

ijij

j

i Qgx

Uuxt

U

i

j

j

iij x

uxu

forcesbody igi

i

xU

tp

ct

2

1

sound of speedc

Page 230: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• In the former equation the source term Q taking as a known value equals

with

or with

• Using equation (*) from the characteristics method in which we have substituted by Ui it is obtained

(*)

finite elements in fluidstime integration, CBScomputational fluid dynamics I

i

nni x

pQ

22

i

n

i

n

i

n

xp

xp

xp

2

1

2 12

ii

n

i

n

xp

xp

xp

2

2

nn ppp 1

n

ini

j

nij

j

nijn

in

ii gQxx

UutUUU

21 n

iij

ij

k

nk gQ

xUu

xut

2

2

n

iij

jnn Qx

kxx

Ut

1 n

iij

j

k

nk Q

xk

xxU

xUt

2

2

Page 231: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Let us introduce now the spilt in which we substitute a suitable approximation forQ which allows the calculations to proceed before the pn+1 is evaluated

• Let us introduce an auxiliary variable U*i such that the pressure gradient terms

are removed from the equation

(1)

• The former equation can then be solved by an explicit time step. Once thesolution U*

i is obtained we could compute

(2)

as far as we knew the pressure increment

finite elements in fluidstime integration, CBScomputational fluid dynamics I

n

ij

ij

kki

j

ij

j

ijniii g

xUu

xutg

xxUu

tUUU

2

**

k

ni

ki

n

ini

nii x

Qutx

ptUUUU

2

2*1

2

Page 232: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• From the dynamic equation for general incompressible fluids we obtain theequality

• Replacing Uin+1 by the known intermediate auxiliary variable Ui

*, rearranging andneglecting higher order terms it is obtained

(3)

where Ui* and pressure terms come from equation (2). This equation is self-

adjoint and a standard Galerkin formulation can be used

computational fluid dynamics I

i

i

i

ni

i

ni

n

xU

xUt

xUtp

c 12

11

iiii

n

i

i

i

ni

n

xxp

xxpt

xU

xUtp

c

2

2

2

112

1 *

finite elements in fluidstime integration, CBS

Page 233: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Therefore, the equations to be solved are– Solve (1) for Ui

*

– Solve (3) for p

– Solve (2) for Ui thus stablishing the values at tn+1

computational fluid dynamics I

finite elements in fluidstime integration, CBS

Page 234: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

• Some examples

finite elements in fluidssome examplescomputational fluid dynamics I

X

Y

1 2 3 4 5 6

0

1

2

3

4

Detalle agitación. Situación Actual 27 Oct 2002 NNDetalle agitación. Situación Actual 27 Oct 2002 NN

Page 235: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

X

Y

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 200

1

2

3

4

5

6

7

8

Frame 001 03 Oct 2002 NNFrame 001 03 Oct 2002 NN

X

Y

0 2 4 6 8 10 12 14 16 18 200

2

4

6

8

Líneas de Corriente. Situación actual 03 Oct 2002 NNLíneas de Corriente. Situación actual 03 Oct 2002 NN

finite elements in fluidssome examples

Page 236: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

Baffleplate

Sluge hoppers

Overflowlaunder

Baffle plateFoam sweeperInfluent intake

Walkway

Baffle slab

Sluddge scrappers

Sludge hopper

Influent pipe Sludge removal pipe

Effluentpipe

Foam sweepers

Foamlaunder

Overflowlaunder

Foam launder

Sluge scraper

Sluge withdrawal

Influent intake

X

Y

0 1000 20000

100

200

300

400

500

600

700

800

Frame00101Aug2000ITERACFrame00101Aug2000ITERAC

X

Y

-800 -700 -600 -500 -400 -300 -200 -100 0 100 200 300 400 500 600 700 800 9000

100

200

300

400

500

600

700

Frame 001 29 Jun 2000 ITERACFrame 001 29 Jun 2000 ITERAC

finite elements in fluidssome examples

Page 237: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

X

Y

0 10 20 30 40 50 60 700

10

20

30

40

50

Frame 003 03 Jul 2000 ITERAC= 1Visc= 1.000000000000000E-002Frame 003 03 Jul 2000 ITERAC= 1Visc= 1.000000000000000E-002

X

Y

0 10 20 30 40 50 600

10

20

30

40

50

Fram e 001 30 Jun 2 000 IT ER AC= 1Visc= 1 .0000000 00 00 00 00E -002Fram e 001 30 Jun 2 000 IT ER AC= 1Visc= 1 .0000000 00 00 00 00E -002

finite elements in fluidssome examples

Page 238: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 001 01 Jun 2000 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 001 01 Jun 2000 ITERACFrame 001 01 Jun 2000 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 001 01 Jun 2000 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 001 01 Jun 2000 ITERACFrame 001 01 Jun 2000 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 0 01 01 Jun 200 0 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 00 1 0 1 Jun 2000 ITERACFrame 00 1 0 1 Jun 2000 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 001 01 Jun 200 0 ITERAC

X

Y

0 100 200 3000

50

100

150

200

250

300

350

400

Frame 00 1 0 1 Jun 2000 ITERACFrame 00 1 0 1 Jun 2000 ITERAC

1 2

3

I

II

finite elements in fluidssome examples

Page 239: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

finite elements in fluidssome examples

Page 240: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

finite elements in fluidssome examples

Page 241: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

finite elements in fluidssome examples

Page 242: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

finite elements in fluidssome examples

Page 243: CFD ICFD I Computational Fluid Dynamics I - UDCcaminos.udc.es/info/asignaturas/201/CFD I_complete.pdf · CFD I Computational Fluid Dynamics I CFD ICFD I Computational Fluid Dynamics

computational fluid dynamics I

finite elements in fluids