Beruflich Dokumente
Kultur Dokumente
Computational Fluid
Dynamics
Course Notes
Dr PK Dyson
Sep 2004
Computational Fluid Dynamics
CFD Overview
and
Introduction to CFX
Computational Fluid Dynamics
Introduction
DesignModeller
(*.agdb file)
CFX-Mesh
(*.cmdb file)
Geometry file
(*.gtm)
Computational Fluid Dynamics
Geometry file
(*.gtm)
Problem
type
Solution
control
Solver
Results Output
file (*.res) file (*.out)
(numerical data
in text file)
CFX-Post
Velocities Forces
Streamlines
Numerical output
File Management
IMPORTANT NOTE
If you encounter problems with CFX, then
by all means visit the CFX Community
pages (address is on the Resources
Sheet), but do not contact ANSYS-CFX
Staff until you have first discussed your
problems with UoP staff.
Contact with ANSYS-CFX should
normally be through UoP Staff.
Computational Fluid Dynamics
Theory Overview
Computational Fluid Dynamics
Momentum
mass-velocity
= u y
y,v x
z,w
v
x,u
u v w
u v w 0
t x y z x y z
Substantial
derivative
D u v w
0
Dt x y z
u
u x
u x
y
x mom : x mom :
x
u2y
u2y
u 2
y
x
x
v x mom :
uvx
Computational Fluid Dynamics
y
x
Computational Fluid Dynamics
u y x u v x y
2
x y
u u u v
u u v u x y
x x y y
u v
u
x y
For:
steady state
2-dimensional
incompressible
u u P 2u 2u
u v X 2
x y x x y
2
v v P 2v 2v
u v Y 2
x y y x y
2
Computational Fluid Dynamics
F P 2 v
Dv
Dt
Computational Fluid Dynamics
Taking u = u1 v = u2 w = u3
u jui, j fi P,i ui, j , j
where
1, 2, 3 represent x, y, z directions
a subcripted comma and index represents a
derivitive
u 2v
i.e. u1,2 ; u2,3 ,3
y w 2
repeated subscript means set it to 1, 2, 3 in
turn and sum resulting variables
i.e. u ju1, j u1u1,1 u2u1,2 u3u1,3
u u u
u v w
x y z
Internal generation
u
y
x
v
Convection
with mass transfer Conduction
by temperature gradient
T T 2T 2T
C p u v k 2
x y x y
2
where
2 2
u 2
v w
2
u v
2 2 2
x y z y x
u w
2
v w
2
z x z y
Computational Fluid Dynamics
s
Infinitely
long
y
Stationary plate
x
u v
0
x y
u u P 2u 2u
u v X 2
x y x x y
2
Computational Fluid Dynamics
u u P 2u 2u
u v X 2
x y x x y
2
v v P 2v 2v
u v Y 2
x y y x y
2
Computational Grid
Since analytical solution is available only in
simplest of cases, numerical techniques are
required; thus a grid across flow domain
needs to be defined
x y
Computational Fluid Dynamics
i-1, j i, j i+1, j
x
Computational Fluid Dynamics
Solution Techniques
Broadly speaking, one of three techniques is
adopted for the solution of the governing
equations:
ui
i i+1 x
Taylor Expansion
u 2u x 2 3u x 3
ui1 ui x 2
3
....
x i x i 2 x i 6
Also
u 2u x 2
ui1 ui x 2
x i x i
2
3u
x 3 ....
3
x i
6
Subtractin g :
u 3u x 3
ui1 ui 1 2 x 2 3
....
x i x i 6
u ui 1 ui 1
O x 2
(second order
x i 2x central difference)
Computational Fluid Dynamics
u u P 2u 2u
u v 2
x y x x y
2
becomes
ui 1, j ui 1, j ui, j 1 ui, j 1 Pi 1, j Pi 1, j
ui, j v i, j
2 x 2y 2 x
ui 1, j 2ui, j ui 1, j ui, j 1 2ui, j ui, j 1
x 2
y 2
Computational Fluid Dynamics
b b b b
. then we will form 3n simultaneous
equations in 3n unknowns.
Use modified
continuity
equation to Do u, v values satisfy
calculate a continuity?
pressure N (convergence criterion)
correction
Y
Finish
Computational Fluid Dynamics
u=value u=value
v=0 v=0
P=value P=value
u=0,v=0 wall
model is over-defined since
velocity and pressure are stipulated
at inlet and outlet. Values may thus
not satisfy the continuity and
momentum equations.
Computational Fluid Dynamics
u 0, v 0
v=0
P= value
P= value
u 0, v 0
Computational Fluid Dynamics
Grids (1)
Structured Mesh
usually comprising quadrilateral elements
Physical Space
eg. circular duct
Computational
Space
Computational Fluid Dynamics
Grids (2)
Aerofoil Section (Example of structured
mesh, refined in critical regions)
Computational Fluid Dynamics
Grids (3)
Unstructured Mesh
usually based on triangular pyramids
(eg CFX 5)
vel at Turbulence
a point
u
time
Computational Fluid Dynamics
Turbulent Flow
Additional momentum
diffusion due to turbulence
Concept of
turbulent (or eddy)
viscosity, t
t is not a fluid property, but depends
on level of turbulence in flow
concept leads to mathematical models
to deal with turbulence; each model is
an approximation to what is really
happening
one popular model (k-epsilon model)
introduces two further unknowns:
u u u , v v v, w w w, p p p
Superscript bar denotes the ensemble average or
the mean value.
Dash denotes the fluctuating part.
uj
continuity : 0
x j
ui ui 1 p ui
momentum : uj uiu j
t x j x i x j x j
Computational Fluid Dynamics
Turbulence Closure
Equations (also called Reynolds equations) for
ensemble average values are identical to the Navier-
Stokes equation except for the cross-products of
the fluctuation terms.
u 2 , v 2 , w 2 , uv, uw , vw
Since these terms have similar functions as viscous
stresses, they are called turbulent stresses or
Reynolds stresses.
To properly close the system, we have to define the
behaviour for turbulence cross-product terms.
k- Model - Theory
k t
. U k . k Pk
t k
t
. U . C1 Pk C 2
t k
Computational Fluid Dynamics
u
1
2 2
Exercises
Computational Fluid Dynamics
Exercise 1
Create
Createfolder
folderMyCFX
MyCFXand
andaasub-folder
sub-folderTutorial_1
Tutorial_1
Start
StartANSYS
ANSYSCFX
CFX10.0.
10.0.
In
Inthe
theLauncher,
Launcher,set
setthe
theWorking
WorkingDirectory
Directoryto
tothe
thesub-
sub-
folder
folderyou
youhave
havejust
justcreated
createdand
andthen
thengo
gototoANSYS
ANSYS>>
Workbench
Workbench10.0.
10.0.
In
Inthe
theStart
Startpanel
panelthat
thatnow
nowopens,
opens,click
clickEmpty
EmptyProject
Project
(under
(underNew)
New)
Go
GototoHelp
Help>>ANSYS
ANSYSDesignModeller
DesignModellerHelp.
Help.In
Inthe
the
Contents
Contentspanel,
panel,expand
expandthetheCFX-Mesh
CFX-MeshHelp
Helptree
treeand
and
click
clickTutorials.
Tutorials.Click
ClickClick
Clickhere.
here.
Work
Workthrough
throughTutorial
Tutorial1:
1:Static
StaticMixer.
Mixer.
This
Thiswill
willtake
takeyou
youthrough:
through:
Geometry
Geometrycreation
creationusing
usingDesignModeller
DesignModeller
Mesh
Meshgeneration
generationusing
usingCFX-Mesh
CFX-Mesh
At
Atthe
theend
endofofthis
thistutorial,
tutorial,under
underthe
theparagraph
paragraphIf
Ifyou
you
want
wanttotocontinue
continueby byworking
workingthrough
throughthe
theANSYS
ANSYSCFX CFX
example
example,,follow
followsteps
steps1,1,22and
and33totoopen
openthe
themesh
meshinin
CFX-Pre.
CFX-Pre.
Now
Nowclick
clickHelp
Help>>Tutorials
Tutorialswhich
whichwill
willtake
takeyou
youinto
intothe
the
CFX
CFX(Fluid
(FluidModelling)
Modelling)Tutorials
Tutorials(as
(asopposed
opposedto tothe
the
DesignModeller/CFX-Mesh
DesignModeller/CFX-Mesh(Solid (SolidModelling)
Modelling)Tutorial
Tutorialyou
you
have
havejust
justbeen
beenworking
workingthrough)
through)and
andclick
clickFlow
Flowininaa
Static
StaticMixer.
Mixer.
Computational Fluid Dynamics
Exercise 1 (continued)
Continue
Continuewith
withthis
thistutorial,
tutorial,but
butnote
notethe
theinstructions
instructionsinin
para
para44at
atthe
theend
endofofthe
theDesignModeller
DesignModellerTutorial:-
Tutorial:-
missing
missingout outthe
theinstructions
instructionsininthe
thesection
sectionCreating
Creatingaa
New
NewSimulation.
Simulation.Note
Notethatthatyou
youdodonot
notneed
needtotocopy
copythethe
sample
samplefilefileStaticMixerMesh.gtm
StaticMixerMesh.gtmto toyour
yourworking
working
directory
directoryififyou
youhave
havejustjustcreated
createdthe
themesh
meshininCFX-Mesh,
CFX-Mesh,
since
sinceyouyouwill
willwant
wanttotouse
useyour
yournew
newmesh
meshand
andnotnotthe
the
one
onesupplied
suppliedwithwithANSYS
ANSYSCFX. CFX.ForForthe
theImporting
Importingaa
Mesh
Meshsection,
section,the
theonly
onlyaction
actionthat
thatyou
youneed
needtotocarry
carryout
out
isisto
toselect
selectAssembly
Assemblyfrom fromthe
theSelect
SelectMesh
Meshdrop-down
drop-down
list,
list,as
asthe
themesh
meshisisloaded
loadedautomatically
automaticallywhen
whenyouyoustart
start
ANSYS
ANSYSCFX CFXininthe
themanner
mannerdescribed
describedabove.
above.
This
Thiswill
willtake
takeyou
youthrough:
through:
Problem
ProblemDefinition
Definitionusing
usingCFX-Pre
CFX-Pre
Solution
Solutionusing
usingCFX
CFXSolver
SolverManager
Manager
Viewing
Viewingofofresults
resultsusing
usingCFX-Post
CFX-Post
Computational Fluid Dynamics
Whats
Whatsthe
thedifference
differencebetween
between
Sketching
Sketchingmode
modeandandmodelling
modellingmode
mode
DesignModeller
DesignModellerand
andCFX-Mesh
CFX-Mesh
Surface
SurfaceMesh
Meshand
andVolume
VolumeMesh
Mesh
In
InANSYS
ANSYSWorkbench
Workbenchgo goto toHelp
Help>>ANSYS
ANSYS
Workbench
WorkbenchHelp
Helpand
andininthe
theContents
ContentsTree
Treego
goto
to
DesignModeller
DesignModellerHelp
Help>>Welcome
Welcometotothe
the
DesignModeller
DesignModeller10.0
10.0Help
Help>>Process
Processfor
forCreating
Creatingaa
Model
Model
Read
Readthrough
throughthe
thepages
pagesandandrun
runthe
thevideo
videosequences
sequences
to
toremind
remindyourself
yourselfof
ofthe
theprocess
processof
ofcreating
creatingaa
geometry.
geometry.
Computational Fluid Dynamics
Exercise 2
Work
Workthrough
throughTutorial
Tutorial2,
2,Static
StaticMixer
Mixer(Refined
(Refined
Mesh)
Mesh)which
whichwill
willshow
showyou:
you:
more
moreabout
aboutthe
themesh
meshgeneration
generationprocess
process
modifying
modifyinggeometry
geometry
use
useof
ofCFX
CFXCommand
CommandLanguage
Language(CCL)
(CCL)to
toavoid
avoid
too
toomany
manyrepetitive
repetitivekeystrokes.
keystrokes.
As
Asbefore
beforeyou
youwill
willneed
needtotostart
startininthe
the
DesignModeller/CFX-Mesh
DesignModeller/CFX-Mesh(Solid (SolidModelling)
Modelling)
Tutorial
Tutorialand
andswitch
switchto
tothe
theCFX
CFX(Fluid
(FluidModelling)
Modelling)
Tutorial.
Tutorial.
Computational Fluid Dynamics
Exercise 3
Refine
Refinethethemesh
meshevenevenfurther
furtherininthe
theoutlet
outletregion
regionof of
the
themixer
mixerby byinserting
insertingaamesh
meshcontrol
controlas
asfollows.
follows.
Re-open
Re-openStaticMixer
StaticMixerininCFX-Mesh
CFX-Mesh
Right
Rightclick
clickControl
Control>>Insert
InsertPoint
PointSpacing
Spacing
Click
ClickPoint
PointSpacing
Spacing11ininDetail
DetailView
Viewand
andchange
change
the
thesettings
settingsto:
to:Length
Lengthscale
scale0.1
0.1m,m,Radius
Radiusof of
Influence
Influence0.5 0.5m,
m,Expansion
ExpansionFactor
Factor1.2
1.2
Right
Rightclick
clickPoint
PointSpacing
Spacing>>Insert
InsertLine
LineControl
Control
Click
ClickLine
LineControl
Control11
In
InDetail
DetailView,
View,for
forpoint
point11click
clickApply,
Apply,andandaccept
accept
coordinates
coordinatesas as0,0,0.
0,0,0.Repeat
Repeatfor forpoint
point22and
andmake
make
coordinates
coordinates0,0,-2.
0,0,-2.Click
Clickininthe
thebox
boxnext
nextto to
spacing,
spacing,thenthenclick
clickPoint
PointSpacing
Spacing11ininTree
TreeViewView
&&click
clickApply.
Apply.
Right
Rightclick
clickBody
Body11>>Suppress
Suppressand andobserve
observe
position
positionof ofLine
LineControl.
Control.Unsuppress
UnsuppressBody Body1. 1.
Generate
Generatethe thesurface
surfacemesh
meshas asbefore
beforeand
andnotenote
the
thedifference
differencearound
aroundthe theexit.
exit.
Generate
GenerateVolume
VolumeMesh,
Mesh,apply
applythethephysics
physics(use(use
import
importCCLCCLininPre),
Pre),Run
RunSolver
Solverandandview
viewresults.
results.
Computational Fluid Dynamics
Now
Nowuse
usethe
theHelp
Helppages
pagestotoanswer
answerthe
thefollowing
following
questions.
questions.
Computational Fluid Dynamics
Exercise 4
x z
The
The3D3Dbody
bodyformed
formedby bythe
thebox
boxwith
withthe
thecylinder
cylindercut
cut
out,
out,sometimes
sometimesconfusingly
confusinglyreferred
referredto
toas
asthe
thesolid,
solid,isis
where
wherethe
thefluid
fluidwill
willflow.
flow.
0.3
2
10 surface A
1
2 diameter 0.3
y
x z
point 0 0 0
Computational Fluid Dynamics
IfIfwe
wewant,
want,say,
say,around
around66elements
elementsininthetheregion
regionwith
with
the
themost
mostcoarse
coarsemeshmesh(near
(nearthe
theexit),
exit),then
thenthis
thisgives
gives
aadefault
defaultmesh
meshlength
lengthof
ofabout
about0.3
0.3m.
m.Since
Sincethis
thisisisaa
2D2Dproblem,
problem,ititneeds
needsonly
onlytotobe
be11element
elementthick,
thick,
which
whichisiswhy
whywe wealso
alsomake
makethe thebox
boxwidth
width0.30.3m.m.
Would
Wouldmaking
makingititthicker
thickergive
giveany
anybenefit
benefitor
orpenalty?
penalty?
Using CFX-Pre
Using CFX-Solver
Using CFX-Post
18. View streamlines, using the inlet as the location.
22. Print one of the plots to a JPEG file using File - Print,
and check the White background box. This could
later be included in a report.
Questions
Defining Polylines
Intersection Line
A line of intersection between a boundary (defined in
CFX-Pre) and a plane (defined in CFX-Post) may be
used.
File Input
A text file is written (outside CFX) containing co-
ordinates of the points required, in a format shown by
the following example.
0 0 0
0.005 0.01193 0
0.0075 0.01436 0
0.0125 0.01815 0
0.025 0.02508 0 xyz
coodinates,
0.05 0.03477 0
delimited by
0.075 0.04202 0 tabs or
0.1 0.04799 0 spaces.
0.15 0.05732 0
0.2 0.06423 0
5.00E+01
Angle (deg)
0.00E+00
Pressure (Pa)
-1.00E+02
-1.50E+02
-2.00E+02