2011-lecture-29
TRANSCRIPT
-
7/27/2019 2011-Lecture-29
1/8
Computational Fluid Dynamics
Other
CFD Methods
Grtar Tryggvason!Spring 2011!
http://www.nd.edu/~gtryggva/CFD-Course/!
Computational Fluid Dynamics
Finite Volume Methods are used in the vast majority
of CFD codes. However, there are other ways to
compute the motion of fluids. 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 briefly examine those!
Computational Fluid Dynamics
Spectral
Methods
Computational Fluid Dynamics
Consider the initial-boundary value problem for the onedimensional heat equation!
By standard
technique
(Fourier sinetransform) the
solution is!
f
t=
2f
x2
0 < x < , t 0
f(0,t) = f(,t) = 0
f(x,0) = f(x)
f(x, t) = an(t)sinnxn=1
an(t) = fnen 2t
fn =2
f(x)sinnx dx0
Computational Fluid Dynamics
Assuming that the time integration is exact, the error by
using only N terms is!
f fN eN2t for all time!
This is faster than any power of N. Recall that the error
for finite difference/finite volume methods is!
O(h)
1
N
Spectral methods are said to have spectral or infinite
order accuracy!
This property is not retained if the solution has
discontinuities!
Computational Fluid Dynamics
A spectral approximation to the heat equation is now
simply!
f(x,t) = an(t)sinnxn=1
N
Sum to N only!!
Substituting into the heat equation we get:!
dan
dt= n
2an; an (0) = fn (n =1,2,N)
-
7/27/2019 2011-Lecture-29
2/8
Computational Fluid Dynamics
For nonlinear equations the use of spectral methods
becomes much more involved!
f
t+ f
f
x=
2f
x2
Expand the solution in a Fourier series!
f(x,t) = ak(t)ei
2
Lkx
|k|< K
dal
dt+
i
L3/ 2
l alm am =
2l
L
|m|< K
|l -m|< K
2
al
We get the following equation for the coefficients:!
Computational Fluid Dynamics
Computing the nonlinear term can becomeexpensive, 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 theproduct back into spectral space. The
multiplication can, however, lead to aliasingproblems where the resolved wave numbers arecontaminated by unresolved ones.!
Computational Fluid Dynamics
The fast Fourier transform!
fj fle
i2
Nl j
l=1
N
Can be evaluated in 2N log2N operations!
inverse!
fl fjei
2
Nlj
l=1
N
The Cooley-Tukey algorithm!
Computational Fluid Dynamics
Although spectral methods can have very highaccuracy, they can be difficult to apply to nonlinear
problems, problems with complex boundaryconditions, and complicated geometries.!
In addition to Fourier series, several other basisfunction can be used for other geometries and to
control the resolution near boundaries!
Spectral elements methods, where a complexdomain is broken into large blocks and each block
is treated spectrally can be used treat somewhat
complex boundaries !
Computational Fluid Dynamics
Finite
ElementMethods
Computational Fluid Dynamics
f x( ) = fINI x( )I
f
x= fI
NI
xI
Finite element methods are similar to spectral methods
in that we expand the solution in terms of a known basisfunction. Unlike spectral methods, where the basisfunctions are defined globally over the whole
computational domain, in the finite element method thebasis functions are defined locally on each element.!
Element 1! Element 2!
-
7/27/2019 2011-Lecture-29
3/8
Computational Fluid Dynamics
Ni
(1)=
x xi1
xi
; Ni1
(1)=
xi x
xi
Ni
(2)=
xi+1 x
xi+1
; Ni+1
(2)=
x xi
xi+1
For element 2:!
For element 1:!
i
i +1
i1
Ni
(1)
Ni1
(1)
Ni
(2)
Ni+1
(2)
Linear basis functions!
element 1! element 2!
Computational Fluid Dynamics
Ni
(1)
x=
1
xi
;N
i1
(1)
x=
1
xi
Ni
(1)=
x x i1
xi
; Ni1
(1)=
xi x
xi
Ni
(2)=
xi+1 x
xi+1
; Ni+1
(2)=
x xi
xi+1
For element 2:!
For element 1:!
Ni
(2)
x=
1
xi+1
;N
i+1
(2)
x=
1
xi+1
Computational Fluid Dynamics
Example: Elliptic Problem!
xkf
x
= q
R =
xkf
x
q
W(x)R(x)dx
= 0
W x
kfx
dx
= qWdx
The residual is:!
The weighted residual is:!
Or:!
W(x): Weighting function!
Computational Fluid Dynamics
Integrate by parts!
W
xkf
x
dx
= qWdx
kf
x
W
xdx
+
xW k
f
x
dx
= q Wdx
kf
x
W
xdx
+ W kf
x
2
W kf
x
1
= q Wdx
Evaluating the second term:!
Cancel for adjacent elements!
Computational Fluid Dynamics
Galerkin Method!
Take weighting function equal to theinterpolation function!
f x( ) = fINI x( )I
kf
x
W
x
dx
= q W dx
For node i:!
fjj=i1
i+1
kNj
xi1
i+1
Ni
xdx qNi (x)
i1
i+1
dx = 0
Ni
(1)
x
=
1
x i
;
Ni1
(1)
x=
1
xi
Ni
(2)
x=
1
xi+1
Ni+1
(2)
x=
1
xi+1
Computational Fluid Dynamics
fjj=i1
i+1
kNj
xi1
i+1
Ni
xdx qNi (x)
i1
i+1
dx = 0
ki+1/2fi+1 fi
x2
ki1/2fi fi1
x2
qi1 + 4qi + qi+1
6= 0
ki+1/2
=1
xk
i
i+1
dx
integrating!
where! Notice that a finite
difference method
would give the sameresult except with q
i
on the RHS!
Ni
(1)
x
=
1
x i
;
Ni1
(1)
x=
1
xi
Ni
(2)
x=
1
xi+1
Ni+1
(2)
x=
1
xi+1
-
7/27/2019 2011-Lecture-29
4/8
Computational Fluid Dynamics
Finite Element approximation of anunsteady problem:!
f
t+U
f
x= 0
f x( ) = fINI x( )I
f
tW dx
+ Uf
xW dx
= 0
Weak formulation!
Introduce the finite element representation!
Computational Fluid Dynamics
f x( )=
fINI x( )I
f
tW dx+ U
f
x W dx= 0
Introduce the finite element representation!
fI
tI
NINJ dx
+ U NIdNJ
dxdx
= 0
or!
fI
tM
IJ+ U K
IJ
I
= 0I
MIJ
= NIN
Jdx
; KIJ = NIdN
J
dxdx
;
Mass matrix! Stiffness matrix!
Computational Fluid Dynamics
The mass matrix makes it complex to use
simple explicit time integrators. This can
be overcome by lumping the matrix!
Computational Fluid Dynamics
In two-dimensions triangular (or tedrahedron)elements are frequently used!
Computational Fluid Dynamics
While finite elements dominate solid
mechanics, their role in computational fluiddynamics has been secondary to finitevolume methods. Indeed, most
methodological progress has been firstdeveloped in the context of finite volumes
and then implemented in the finite element
framework. Some areas, such assimulations of viscoelastic flows have,
however, relied heavily on finite elementsfor historical reasons.!
Computational Fluid Dynamics
Lattice Boltzmann
Methods
-
7/27/2019 2011-Lecture-29
5/8
-
7/27/2019 2011-Lecture-29
6/8
Computational Fluid DynamicsLattice Boltzmann methods !
Advantages!
Very easy to programparallelization easy!
Fastin part because incompressibility is not enforced
Disadvantages!
Difficult to implement new physicsmust find a
discrete equation that corresponds to the newphysics!
The flow is not completely incompressible!
Computational Fluid DynamicsLattice Boltzmann methods !
By now it is understood that
LBM are give resultscomparable to second orderfinite difference/volumemethods!
LBM has been extended tomore complex flow, includingmultiphase flows with sharpinterfaces!
The figure shows a comparisonof the unsteady rise of abuoyant bubble computed byLBM (left) and front trackingfinite volume method (right).!
From: K. Sankaranarayanan, I.G. Kevrekidis, S.
Sundaresan , J. Lu, G. Tryggvason. A comparative
study of lattice Boltzmann and front-tracking finite-difference methods for bubble simulations. Int. J.
Multiphase Flow 29 (2003) 109116.!
Computational Fluid Dynamics
Smooth ParticleHydrodynamics
Computational Fluid Dynamics
Smooth Particle Hydrodynamics: the fluid mass is
lumped into smoothed blobs that are moved using
Newtons second law directly, without an underlying mesh!
Smooth Particle Hydrodynamics!
x
1 x
2 x
3
Computational Fluid Dynamics
In SPH the fluid is modeled as a collection of smooth blobs
or particles !
A(r) = A(r ') | r r ' |( )dr '
We start by the relationship!
And then approximate the deltafunction by a smoother kernal!
A(r) = A(r ')W(| r r ' |,h) dr '
W(r,h) dr =1 & W(r,h) h0 r( )
Where:!
W(r,h) =1
3/2hexp
r
2
h2
We could select thekernal to be a
Gaussian, althoughusually we desire acompact support!
Smooth Particle Hydrodynamics!
Computational Fluid Dynamics
i= (r
i) = m
k
k
k
k
W(| ri r
k|,h) = m
k
k
W(ri rk,h),
A(r) = A(r ')W(| r r ' |,h) dr '
= A(r ')(r ')
(r ')W(| r r ' |,h) dr '
= mk
k A
k
k
W(| r rk
|,h)
Smooth Particle Hydrodynamics!
m
k (r ') dr '
Approximate the integral by a sum over
the smoothed particles:!
For density we have!
-
7/27/2019 2011-Lecture-29
7/8
-
7/27/2019 2011-Lecture-29
8/8
Computational Fluid Dynamics
Other
ParticleMethods
Computational Fluid DynamicsParticle methods cover a large range of physical situations, someoverlapping with more conventional methods. Particle methodsinclude:!
!Point vortex/vortex blob methods!
!Particle-in-Cell codes!
!Direct Simulation Monte Carlo (rarified flow)!
!Dissipative particle methods !
!Molecular dynamics!
!and many more!
In many cases a grid is used also, either for efficiency or toaccount for some of the physics!
Not really forcontinuum flows!
Computational Fluid Dynamics
Dissipative Particles Dynamics: particles
represents molecules or fluid blobs but while
the method has similarities with SPH, it isgenerally used to model mesoscale behavior
of complex fluids and more liberties are taken
in modeling the interactions of the particles!
Molecular Dynamics: Not really a CFDtechnique but can be used to simulate small(really small) fluid regions!