Você está na página 1de 8

Computational Fluid Dynamics

http://www.nd.edu/~gtryggva/CFD-Course/!

Computational Fluid Dynamics


Other ! CFD Methods !


Grtar Tryggvason! Spring 2011!

Finite Volume Methods are used in the vast majority of CFD codes. However, there are other ways to compute the motion of uids. Some of the more common alternatives include:! Spectral Methods! Finite Element Methods! Lattice Boltzmann Methods! Smoothed Particle Hydrodynamics! Vortex Methods and other particle methods! Here we will briey examine those!

Computational Fluid Dynamics


Computational Fluid Dynamics


Consider the initial-boundary value problem for the one dimensional heat equation!

Spectral! Methods !

f 2 f = 0 < x < , t 0 t x 2 f (0, t ) = f ( , t ) = 0 f ( x,0) = f ( x )


By standard technique (Fourier sine transform) the solution is!

f ( x, t ) = an ( t )sin nx
n =1

an ( t ) = f n e n t 2 f n = f ( x )sin nx dx 0
2

Computational Fluid Dynamics


Computational Fluid Dynamics


Assuming that the time integration is exact, the error by using only N terms is!
f f N e N
2

A spectral approximation to the heat equation is now simply!

for all time!

f ( x, t ) = an ( t )sin nx
n =1

Sum to N only!!

This is faster than any power of N. Recall that the error for nite difference/nite volume methods is!
O (h ) 1 N

Substituting into the heat equation we get:!

Spectral methods are said to have spectral or innite order accuracy! This property is not retained if the solution has discontinuities!

dan = n 2 an ; an (0) = f n dt

( n = 1,2, N )

Computational Fluid Dynamics


Computational Fluid Dynamics


For nonlinear equations the use of spectral methods becomes much more involved!
f f f + f = 2 t x x
2

Expand the solution in a Fourier series!


f ( x, t) =

a ( t )e
k |k|< K

2 kx L

We get the following equation for the coefcients:!


2l 2 dal i + l al m am = a L l dt L3 / 2 |m|< K
|l -m|< K

Computing the nonlinear term can become expensive, particularly for three-dimensional systems. By using the Fast Fourier Transform, the computation can be made faster by taking the inverse transform and do the multiplication in real space. Then Fourier transform the product back into spectral space. The multiplication can, however, lead to aliasing problems where the resolved wave numbers are contaminated by unresolved ones.!

Computational Fluid Dynamics


Computational Fluid Dynamics


The fast Fourier transform!

e fj f l
l =1

2 l j N

Although spectral methods can have very high accuracy, they can be difcult to apply to nonlinear problems, problems with complex boundary conditions, and complicated geometries.! In addition to Fourier series, several other basis function can be used for other geometries and to control the resolution near boundaries! Spectral elements methods, where a complex domain is broken into large blocks and each block is treated spectrally can be used treat somewhat complex boundaries !

inverse!

f e f l j
l =1

2 lj N

Can be evaluated in 2N log2N operations! The Cooley-Tukey algorithm!

Computational Fluid Dynamics


Computational Fluid Dynamics


Finite Element Methods !

Finite element methods are similar to spectral methods in that we expand the solution in terms of a known basis function. Unlike spectral methods, where the basis functions are dened globally over the whole computational domain, in the nite element method the basis functions are dened locally on each element.!

f ( x) = f I N I ( x)
I

f N I = fI I x x

Element 1!

Element 2!

Computational Fluid Dynamics


Linear basis functions!

Computational Fluid Dynamics


For element 1:!


(1) i

N i(1) 1

N i(2)

(2) i +1

N i(1) =

x x i1 ; x i

N i(1) 1 =

xi x x i

i 1 element 1! i

element 2!

i +1

N i(1) 1 = ; x x i
For element 2:!

N i(1) 1 1 = x x i
x xi x i +1

For element 1:!

N i(1) =
For element 2:!

x x i1 ; x i
x i +1 x ; x i +1

N i(1) 1 =
N i(2) +1 =

xi x x i
x xi x i +1

N i(2) =

x i +1 x ; x i +1

N i(2) +1 =

N i(2) =

N i(2) 1 = ; x x i +1

N i(2) 1 +1 = x x i +1

Computational Fluid Dynamics


Computational Fluid Dynamics


Example: Elliptic Problem!

f k = q x x
The residual is:!

f k dx = x x

q Wdx

Integrate by parts!

f R = k q x x
The weighted residual is:!

f W dx + k x x

f W k dx = x x

q Wdx

Evaluating the second term:! W(x): Weighting function!

Or:!

W ( x ) R( x ) dx = 0
W

f f f W dx + W k W k = k x x x 2 x 1

q Wdx

f k dx = x x

q Wdx

Cancel for adjacent elements!

Computational Fluid Dynamics


Computational Fluid Dynamics



i +1 i +1 N j Ni dx qN i ( x )dx = 0 x x i 1

Galerkin Method! Take weighting function equal to the interpolation function!

f ( x) = f I N I ( x)
I

j = i 1

f k
j i 1

i +1

integrating!

f W dx = k x x
For node i:!

q W dx

N i(1) 1 = ; x x i N i(1) 1 1 = x x i N i(2) 1 = x x i +1


N 1 = x x i +1
(2) i +1

ki +1/2

fi +1 fi f f q + 4 qi + qi +1 ki 1/2 i 2i 1 i 1 =0 x 2 x 6
Notice that a nite difference method would give the same result except with qi on the RHS!

N i(1) 1 = ; x x i N i(1) 1 1 = x x i N i(2) 1 = x x i +1


N i(2) 1 +1 = x x i +1

j = i 1


fj

i +1

i +1

i 1

i +1 N j Ni dx qN i ( x )dx = 0 x x i 1

where!

ki +1/2

1 = x

i +1

k dx
i

Computational Fluid Dynamics


Computational Fluid Dynamics


Finite Element approximation of an unsteady problem:!

t W dx + U x W dx = 0

f ( x) = f I N I ( x)
I

f f +U =0 t x
Weak formulation!

Introduce the nite element representation!

t W dx + U x W dx = 0

t N N
I I

f I

dx + U N I

dN J dx = 0 dx

or!

Introduce the nite element representation!

t
I

f I

M IJ + U K IJ = 0
I

f ( x) = f I N I ( x)
I

M IJ =

N I N J dx;

K IJ =

dN J dx; dx

Mass matrix!

Stiffness matrix!

Computational Fluid Dynamics


Computational Fluid Dynamics


In two-dimensions triangular (or tedrahedron) elements are frequently used! The mass matrix makes it complex to use simple explicit time integrators. This can be overcome by lumping the matrix!

Computational Fluid Dynamics


Computational Fluid Dynamics


While nite elements dominate solid mechanics, their role in computational uid dynamics has been secondary to nite volume methods. Indeed, most methodological progress has been rst developed in the context of nite volumes and then implemented in the nite element framework. Some areas, such as simulations of viscoelastic ows have, however, relied heavily on nite elements for historical reasons.!

Lattice Boltzmann Methods !

Computational Fluid Dynamics


Lattice Boltzmann methods ! Lattice Boltzmann methods use particles on hexagonal grids where the particles move according to discrete rules. It can be shown that the macroscopic motion of the particles resembles the Navier-Stokes equations. It is now believed that these methods can yield results comparable in accuracy to other numerical methods!

Computational Fluid Dynamics


Lattice Boltzmann methods ! Update the velocity distributions at each node by:! f 1 ( eq ) + e fv = f f , = 0,1,, M t where! 2 9 3 2 f( eq ) = w 1 + 3 e u + e u ( u u ) 2 2

) (

and at each node!


= f
=1
M

u = f e
=1

e6 e3
e7

e2

e5 e1 e8

e4

Computational Fluid Dynamics


Lattice Boltzmann methods !

Computational Fluid Dynamics


Lattice Boltzmann methods ! Proof!
f ( x, t + t ) f ( x, t ) = f ( x, t ) f ( x te , t )

f 1 + e f v = ( f ( eq ) f ), = 0,1,, M t
Approximate the time derivative by a rst order forward in time, the advection term by upwind and the collision by downwind, we get! f ( x, t + t ) f ( x, t ) = f ( x, t ) f x te , t

f ( x te , t ) f ( eq ) ( x te , t )

Set! = t e

x ; = x

x = t e
t e x

Replace! x
t e

by!x + te

))

where!

f ( x te , t ) f ( eq ) ( x te , t )

f ( x + te , t + t ) f ( x + te , t ) =

( f (x + te , t ) f (x, t ))

( f (x, t) f (x, t))

( eq )

taking! t = x = y = And crossing out the common term yields!

= t e x ; = x

x = t e

taking! t = x = y = And replacing! x by! x + te yields!

f ( x + te , t + t ) f ( x, t ) =

1 ( eq ) ( f (x, t ) f (x, t ))

f ( x + te , t + t ) f ( x, t ) =

1 ( eq ) ( f (x, t ) f (x, t ))

Computational Fluid Dynamics


Lattice Boltzmann methods ! The displacement vectors are!
e0 = 0

Computational Fluid Dynamics


Lattice Boltzmann methods ! Summary:! Update the velocity distributions at each node by:! 1 f ( x + te , t + t ) f ( x, t ) = ( f ( eq ) ( x, t ) f ( x, t )) where! 2 9 3 2 f( eq ) = w 1 + 3(e u ) + (e u ) (u u ) 2 2
e2

e =

x , = 1, 3, 5, 7 ( 1) ,sin ( 1) cos t 2 2 x cos ( 1) + ,sin ( 1) + , = 2, 4, 6, 8 2 2 t 4 4

e = 2

e6

e5 e1

and at each node!


= f
=1
M

e6 e3
e7

e2

e5 e1 e8

w0 = 0 w = 4 9 = 1, 3, 5, 7

The weights must be taken to be!

e3
e7 e4

u = f e
=1

w = 1 36 v = 2, 4, 6, 8

e8

e4

Computational Fluid Dynamics


Lattice Boltzmann methods ! Advantages! Very easy to programparallelization easy! Fastin part because incompressibility is not enforced ! Disadvantages! Difcult to implement new physicsmust nd a discrete equation that corresponds to the new physics! The ow is not completely incompressible!

Computational Fluid Dynamics


Lattice Boltzmann methods !
By now it is understood that LBM are give results comparable to second order nite difference/volume methods! LBM has been extended to more complex ow, including multiphase ows with sharp interfaces! The gure shows a comparison of the unsteady rise of a buoyant bubble computed by LBM (left) and front tracking nite volume method (right).!

From: K. Sankaranarayanan, I.G. Kevrekidis, S. Sundaresan , J. Lu, G. Tryggvason. A comparative study of lattice Boltzmann and front-tracking nitedifference methods for bubble simulations. Int. J. Multiphase Flow 29 (2003) 109116.!

Computational Fluid Dynamics


Computational Fluid Dynamics


Smooth Particle Hydrodynamics! Smooth Particle Hydrodynamics: the uid mass is lumped into smoothed blobs that are moved using Newtons second law directly, without an underlying mesh!

Smooth Particle Hydrodynamics !


x1 x2 x3

Computational Fluid Dynamics


Smooth Particle Hydrodynamics! In SPH the uid is modeled as a collection of smooth blobs or particles ! We start by the relationship!
A(r ) =

Computational Fluid Dynamics


Smooth Particle Hydrodynamics! Approximate the integral by a sum over the smoothed particles:!
A(r ) =

A(r ')W (| r r ' |, h) dr ' A(r ') (r ') W (| r r ' |, h) dr '


(r ')
mk (r ')dr '

A(r ') (| r r ' |) dr '

And then approximate the delta function by a smoother kernal!


A(r ) =

A(r ')W (| r r ' |, h) dr '


& W (r, h) h r 0

We could select the kernal to be a Gaussian, although usually we desire a compact support!
r2 W (r, h) = 3/ 2 exp h2 h 1

A = mk k W (| r rk |, h) k k

For density we have!


i = (ri ) = mk
k

Where:!

W (r, h) dr = 1

()

k W (| ri rk |, h) = mkW (ri rk , h), k k

Computational Fluid Dynamics


Smooth Particle Hydrodynamics! The introduction of the smoothed kernal allows us to compute the gradient!
A A(r ) = mk k W (| r rk |, h) k k

Computational Fluid Dynamics


Start with the momentum equation!


du 1 = P dt

A(r ) = mk
k

For the pressure we write:!


P P 1 P = + 2

Ak W (| r rk |, h) k

The introduction of the smoothed kernal allows us to compute the gradient!

And using that!


= mk W (| r rk |, h)
k

P P = mk k2 W (| r rk |, h) k k

The momentum equation is!


P du i P = mk k2 + i2 W (| ri rk |, h) dt k i k

Computational Fluid Dynamics


Computational Fluid Dynamics


Similarly, for density we start with!


d i = u dt

The energy equation is !


A(r ) = mk
k

Ak W (| r rk |, h) k

dE P = u dt

A(r ) = mk
k

Ak W (| r rk |, h) k

And using that!

Using that!
= mk W (| r rk |, h)
k

( u) = ( u) u
The mass conservation equation is!
d i = mk u k u i W (| ri rk |, h) dt k

P P P u = u u

= mk W (| r rk |, h)
k

gives!
dEi dt = mk
k

Pk
2 k

Sometimes an alternative form is used!


d i dt = i
k

(u

u i W (| ri rk |, h)

mk

(u

u i W (| ri rk |, h)

Computational Fluid Dynamics


Smooth Particle Hydrodynamics! Summary of governing equations!
d i m = i k u k u i W (| ri rk |, h) dt k k

Computational Fluid Dynamics


Smooth Particle Hydrodynamics! Several different kernals have been used. The following is a popular one:!

Mass!
W ( s) =

P du i P = mk k2 + i2 W (| ri rk |, h) dt k i k

Momentum! Energy! Advect particles!

10 7 h2

3 3 1 s 2 + s3 0 s 1 2 4 1 2 1< s 2 4 (2 s) 0 2<s<

dEi P = mk k2 u k u i W (| ri rk |, h) dt k k

SPH has been modied to include viscous effects by local averaging as well as incompressibility.!
For a more complete introduction, see: J. J. Monaghan. An introduction to SPH. Computer Physics Communications 48, 1988, Pages 89-96.!

dri = ui dt

Plus an equation of state!

P = P( , e)

Computational Fluid Dynamics


Computational Fluid Dynamics



Particle methods cover a large range of physical situations, some overlapping with more conventional methods. Particle methods include:! !Point vortex/vortex blob methods!

Other Particle Methods !

!Particle-in-Cell codes! !Direct Simulation Monte Carlo (raried ow)! !Dissipative particle methods ! !Molecular dynamics! !and many more! In many cases a grid is used also, either for efciency or to account for some of the physics!

Not really for continuum ows!

Computational Fluid Dynamics


Dissipative Particles Dynamics: particles represents molecules or uid blobs but while the method has similarities with SPH, it is generally used to model mesoscale behavior of complex uids and more liberties are taken in modeling the interactions of the particles! Molecular Dynamics: Not really a CFD technique but can be used to simulate small (really small) uid regions!

Você também pode gostar