SlideShare a Scribd company logo
1 of 39
Introduction to Modeling
Fluid Dynamics
1
2
Different Kind of Problem
• Can be particles, but lots of them
• Solve instead on a uniform grid
3
No Particles => New State
Particle
• Mass
• Velocity
• Position
Fluid
• Density
• Velocity Field
• Pressure
• Viscosity
4
No Particles => New Equations
Navier-Stokes equations for viscous,
incompressible liquids.
  f
u
u
u
u
u












p
t


1
0
2
5
What goes in must come out
Gradient of the velocity field= 0
Conservation of Mass
  f
u
u
u
u
u












p
t


1
0
2
6
Time derivative
Time derivative of velocity field
Think acceleration
  f
u
u
u
u
u












p
t


1
0
2
a
u



t
7
Advection term
Field is advected through itself
Velocity goes with the flow
  f
u
u
u
u
u












p
t


1
0
2
8
Diffusion term
Kinematic Viscosity times Laplacian of u
Differences in Velocity damp out
  f
u
u
u
u
u












p
t


1
0
2
9
Pressure term
Fluid moves from high pressure to low pressure
Inversely proportional to fluid density, ρ
  f
u
u
u
u
u












p
t


1
0
2
10
External Force Term
Can be or represent anythying
Used for gravity or to let animator “stir”
  f
u
u
u
u
u












p
t


1
0
2
11
Navier-Stokes
How do we solve these equations?
  f
u
u
u
u
u












p
t


1
0
2
12
Discretizing in space and time
• We have differential equations
• We need to put them in a form
we can compute
• Discetization – Finite Difference
Method
13
Discretize in Space
X Velocity
Y Velocity
Pressure
Staggered Grid vs Regular
14
Discretize the operators
• Just look them up or derive them
with multidimensional Taylor
Expansion
• Be careful if you used a
staggered grid
15
Example 2D Discetizations
-1 0 1
1
-1
1 -4 1
1
1
Divergence Operator Laplacian Operator
16
Make a linear system
It all boils down to
Ax=b.

















































d
d
d
d n
n
xn
n
x
b
b
x
x
x
















2
1
2
1
?
?
?
?
?
?
?
17
Simple Linear System
• Exact solution takes O(n3) time
where n is number of cells
• In 3D k3 cells where k is
discretization on each axis
• Way too slow O(n9)
18
Need faster solver
• Our matrix is symmetric and
positive definite….This means we
can use
♦ Conjugate Gradient
• Multigrid also an option – better
asymptotic, but slower in
practice.
19
Time Integration
• Solver gives us time derivative
• Use it to update the system state
U(t+Δt)
Ut
U(t)
20
Discetize in Time
• Use some system such as
forward Euler.
• RK methods are bad because
derivatives are expensive
• Be careful of timestep
21
Time/Space relation?
• Courant-Friedrichs-
Lewy (CFL)
condition
• Comes from the
advection term




u
x
t
22
Now we have a CFD simulator
• We can simulate fluid using only
the aforementioned parts so far
• This would be like Foster &
Metaxas first full 3D simulator
• What if we want it real-time?
23
Time for Graphics Hacks
• Unconditionally stable advection
♦ Kills the CFL condition
• Split the operators
♦ Lets us run simpler solvers
• Impose divergence free field
♦ Do as post process
24
Semi-lagrangian Advection
CFL Condition limits
speed of information
travel forward in time
Like backward Euler,
what if instead we
trace back in time?
p(x,t) back-trace
25
Divergence Free Field
• Helmholtz-Hodge Decomposition
♦ Every field can be written as
• w is any vector field
• u is a divergence free field
• q is a scalar field
q


 u
w
26
Helmholtz-Hodge
STAM 2003
27
Divergence Free Field
• We have w and we want u
• Projection step solves this equation
q
q
q
2
2














w
u
w
u
w
q


 w
u
28
Ensures Mass Conservation
• Applied to field before advection
• Applied at the end of a step
• Takes the place of first equation
in Navier-Stokes
29
Operator Splitting
• We can’t use semi-lagrangian
advection with a Poisson solver
• We have to solve the problem in
phases
• Introduces another source of
error, first order approximation
30
Operator Splitting
0


 u
 u
u 

 u
2

 p



1
f


t
u
31
Operator Splitting
1. Add External Forces
2. Semi-lagrangian
advection
3. Diffusion solve
4. Project field
f

 u
u 


u
2


0


 u
32
Operator Splitting
u
2


f

 u
u 


W0 W1 W2 W3 W4
u(x,t)
u(x,t+Δt)
0


 u
33
Various Extensions
• Free surface tracking
• Inviscid Navier-Stokes
• Solid Fluid interaction
34
Free Surfaces
• Level sets
♦ Loses volume
♦ Poor surface detail
• Particle-level sets
♦ Still loses volume
♦ Osher, Stanley, & Fedkiw, 2002
• MAC grid
♦ Harlow, F.H. and Welch, J.E., "Numerical
Calculation of Time-Dependent Viscous
Incompressible Flow of Fluid with a Free Surface",
The Physics of Fluids 8, 2182-2189 (1965).
35
Free Surfaces
+
-
+ +
+ +
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
+
0
0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
MAC Grid Level Set
36
Inviscid Navier-Stokes
• Can be run faster
• Only 1 Poisson Solve needed
• Useful to model smoke and fire
♦ Fedkiw, Stam, Jensen 2001
37
Solid Fluid Interaction
• Long history in CFD
• Graphics has many papers on 1
way coupling
♦ Way back to Foster & Metaxas, 1996
• Two way coupling is a new area
in past 3-4 years
♦ Carlson 2004
38
Where to get more info
• Simplest way to working fluid
simulator (Even has code)
♦ STAM 2003
• Best way to learn enough to be
dangerous
♦ CARLSON 2004
39
References
CARLSON, M., “Rigid, Melting, and Flowing Fluid,” PhD Thesis, Georgia Institute of Technology, Jul.
2004.
FEDKIW, R., STAM, J., and JENSEN, H. W., “Visual simulation of smoke,” in Proceedings of ACM
SIGGRAPH 2001, Computer Graphics Proceedings, Annual Conference Series, pp. 15–22, Aug. 2001.
FOSTER, N. and METAXAS, D., “Realistic animation of liquids,” Graphical Models and Image Processing,
vol. 58, no. 5, pp. 471–483, 1996.
HARLOW, F.H. and WELCH, J.E., "Numerical Calculation of Time-Dependent Viscous Incompressible
Flow of Fluid with a Free Surface", The Physics of Fluids 8, 2182-2189 (1965).
LOSASSO, F., GIBOU, F., and FEDKIW, R., “Simulating water and smoke with an octree data structure,”
ACM Transactions on Graphics, vol. 23, pp. 457–462, Aug. 2004.
OSHER, STANLEY J. & FEDKIW, R. (2002). Level Set Methods and Dynamic Implicit Surfaces. Springer-
Verlag.
STAM, J., “Real-time fluid dynamics for games,” in Proceedings of the Game Developer Conference,
Mar. 2003.

More Related Content

Similar to fluid.ppt

Cfd notes 1
Cfd notes 1Cfd notes 1
Cfd notes 1
sach437
 
Smoothed particle hydrodynamics
Smoothed particle hydrodynamicsSmoothed particle hydrodynamics
Smoothed particle hydrodynamics
quirijnfrederix
 
1 FLO-2D Updates and Enhancements 2019.pptx
1 FLO-2D Updates and Enhancements 2019.pptx1 FLO-2D Updates and Enhancements 2019.pptx
1 FLO-2D Updates and Enhancements 2019.pptx
Jorge Atau
 
Fast Slow Timescale Analysis.1
Fast  Slow Timescale Analysis.1Fast  Slow Timescale Analysis.1
Fast Slow Timescale Analysis.1
ahmad bassiouny
 

Similar to fluid.ppt (20)

CFD Course
CFD CourseCFD Course
CFD Course
 
CFD PPT.ppt
CFD PPT.pptCFD PPT.ppt
CFD PPT.ppt
 
Optimal control of electrodynamic tether orbit transfers
Optimal control of electrodynamic tether orbit transfersOptimal control of electrodynamic tether orbit transfers
Optimal control of electrodynamic tether orbit transfers
 
Cfd notes 1
Cfd notes 1Cfd notes 1
Cfd notes 1
 
Fm ppt unit 5
Fm ppt unit 5Fm ppt unit 5
Fm ppt unit 5
 
Presentation- thesis- Chaofan ZHANG
Presentation- thesis- Chaofan ZHANGPresentation- thesis- Chaofan ZHANG
Presentation- thesis- Chaofan ZHANG
 
Smoothed particle hydrodynamics
Smoothed particle hydrodynamicsSmoothed particle hydrodynamics
Smoothed particle hydrodynamics
 
Process Modelling and Control : Summary most important points in process mo...
Process Modelling and Control : Summary   most important points in process mo...Process Modelling and Control : Summary   most important points in process mo...
Process Modelling and Control : Summary most important points in process mo...
 
1 FLO-2D Updates and Enhancements 2019.pptx
1 FLO-2D Updates and Enhancements 2019.pptx1 FLO-2D Updates and Enhancements 2019.pptx
1 FLO-2D Updates and Enhancements 2019.pptx
 
01 intro
01 intro01 intro
01 intro
 
Understanding and predicting CO2 properties - Presentation by Richard Graham ...
Understanding and predicting CO2 properties - Presentation by Richard Graham ...Understanding and predicting CO2 properties - Presentation by Richard Graham ...
Understanding and predicting CO2 properties - Presentation by Richard Graham ...
 
Bakker 01 intro
Bakker 01 introBakker 01 intro
Bakker 01 intro
 
01-intro_Bakker.pdf
01-intro_Bakker.pdf01-intro_Bakker.pdf
01-intro_Bakker.pdf
 
Fast Slow Timescale Analysis.1
Fast  Slow Timescale Analysis.1Fast  Slow Timescale Analysis.1
Fast Slow Timescale Analysis.1
 
Fast Slow Timescale Analysis.1
Fast  Slow Timescale Analysis.1Fast  Slow Timescale Analysis.1
Fast Slow Timescale Analysis.1
 
Numerical Modelling of Trans-Triple Point Temperature Near-Field Sonic Disper...
Numerical Modelling of Trans-Triple Point Temperature Near-Field Sonic Disper...Numerical Modelling of Trans-Triple Point Temperature Near-Field Sonic Disper...
Numerical Modelling of Trans-Triple Point Temperature Near-Field Sonic Disper...
 
Lattice Boltzmann methhod slides
Lattice Boltzmann methhod slidesLattice Boltzmann methhod slides
Lattice Boltzmann methhod slides
 
Cfd notes 1
Cfd notes 1Cfd notes 1
Cfd notes 1
 
Unit.ppt
Unit.pptUnit.ppt
Unit.ppt
 
01 intro cfd
01 intro cfd01 intro cfd
01 intro cfd
 

Recently uploaded

Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Lovely Professional University
 
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
MohammadAliNayeem
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
Kamal Acharya
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DrGurudutt
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
Madan Karki
 

Recently uploaded (20)

Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
Activity Planning: Objectives, Project Schedule, Network Planning Model. Time...
 
Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)Operating System chapter 9 (Virtual Memory)
Operating System chapter 9 (Virtual Memory)
 
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
Fabrication Of Automatic Star Delta Starter Using Relay And GSM Module By Utk...
 
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptxSLIDESHARE PPT-DECISION MAKING METHODS.pptx
SLIDESHARE PPT-DECISION MAKING METHODS.pptx
 
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical EngineeringIntroduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
Introduction to Machine Learning Unit-4 Notes for II-II Mechanical Engineering
 
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
Complex plane, Modulus, Argument, Graphical representation of a complex numbe...
 
Teachers record management system project report..pdf
Teachers record management system project report..pdfTeachers record management system project report..pdf
Teachers record management system project report..pdf
 
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdfInstruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
Instruct Nirmaana 24-Smart and Lean Construction Through Technology.pdf
 
2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge2024 DevOps Pro Europe - Growing at the edge
2024 DevOps Pro Europe - Growing at the edge
 
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message QueuesLinux Systems Programming: Semaphores, Shared Memory, and Message Queues
Linux Systems Programming: Semaphores, Shared Memory, and Message Queues
 
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdfDR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
DR PROF ING GURUDUTT SAHNI WIKIPEDIA.pdf
 
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdfALCOHOL PRODUCTION- Beer Brewing Process.pdf
ALCOHOL PRODUCTION- Beer Brewing Process.pdf
 
ChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdfChatGPT Prompt Engineering for project managers.pdf
ChatGPT Prompt Engineering for project managers.pdf
 
E-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are presentE-Commerce Shopping using MERN Stack where different modules are present
E-Commerce Shopping using MERN Stack where different modules are present
 
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas SachpazisSeismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
Seismic Hazard Assessment Software in Python by Prof. Dr. Costas Sachpazis
 
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdfBURGER ORDERING SYSYTEM PROJECT REPORT..pdf
BURGER ORDERING SYSYTEM PROJECT REPORT..pdf
 
Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1Research Methodolgy & Intellectual Property Rights Series 1
Research Methodolgy & Intellectual Property Rights Series 1
 
Diploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdfDiploma Engineering Drawing Qp-2024 Ece .pdf
Diploma Engineering Drawing Qp-2024 Ece .pdf
 
Intelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent ActsIntelligent Agents, A discovery on How A Rational Agent Acts
Intelligent Agents, A discovery on How A Rational Agent Acts
 
Supermarket billing system project report..pdf
Supermarket billing system project report..pdfSupermarket billing system project report..pdf
Supermarket billing system project report..pdf
 

fluid.ppt

  • 2. 2 Different Kind of Problem • Can be particles, but lots of them • Solve instead on a uniform grid
  • 3. 3 No Particles => New State Particle • Mass • Velocity • Position Fluid • Density • Velocity Field • Pressure • Viscosity
  • 4. 4 No Particles => New Equations Navier-Stokes equations for viscous, incompressible liquids.   f u u u u u             p t   1 0 2
  • 5. 5 What goes in must come out Gradient of the velocity field= 0 Conservation of Mass   f u u u u u             p t   1 0 2
  • 6. 6 Time derivative Time derivative of velocity field Think acceleration   f u u u u u             p t   1 0 2 a u    t
  • 7. 7 Advection term Field is advected through itself Velocity goes with the flow   f u u u u u             p t   1 0 2
  • 8. 8 Diffusion term Kinematic Viscosity times Laplacian of u Differences in Velocity damp out   f u u u u u             p t   1 0 2
  • 9. 9 Pressure term Fluid moves from high pressure to low pressure Inversely proportional to fluid density, ρ   f u u u u u             p t   1 0 2
  • 10. 10 External Force Term Can be or represent anythying Used for gravity or to let animator “stir”   f u u u u u             p t   1 0 2
  • 11. 11 Navier-Stokes How do we solve these equations?   f u u u u u             p t   1 0 2
  • 12. 12 Discretizing in space and time • We have differential equations • We need to put them in a form we can compute • Discetization – Finite Difference Method
  • 13. 13 Discretize in Space X Velocity Y Velocity Pressure Staggered Grid vs Regular
  • 14. 14 Discretize the operators • Just look them up or derive them with multidimensional Taylor Expansion • Be careful if you used a staggered grid
  • 15. 15 Example 2D Discetizations -1 0 1 1 -1 1 -4 1 1 1 Divergence Operator Laplacian Operator
  • 16. 16 Make a linear system It all boils down to Ax=b.                                                  d d d d n n xn n x b b x x x                 2 1 2 1 ? ? ? ? ? ? ?
  • 17. 17 Simple Linear System • Exact solution takes O(n3) time where n is number of cells • In 3D k3 cells where k is discretization on each axis • Way too slow O(n9)
  • 18. 18 Need faster solver • Our matrix is symmetric and positive definite….This means we can use ♦ Conjugate Gradient • Multigrid also an option – better asymptotic, but slower in practice.
  • 19. 19 Time Integration • Solver gives us time derivative • Use it to update the system state U(t+Δt) Ut U(t)
  • 20. 20 Discetize in Time • Use some system such as forward Euler. • RK methods are bad because derivatives are expensive • Be careful of timestep
  • 21. 21 Time/Space relation? • Courant-Friedrichs- Lewy (CFL) condition • Comes from the advection term     u x t
  • 22. 22 Now we have a CFD simulator • We can simulate fluid using only the aforementioned parts so far • This would be like Foster & Metaxas first full 3D simulator • What if we want it real-time?
  • 23. 23 Time for Graphics Hacks • Unconditionally stable advection ♦ Kills the CFL condition • Split the operators ♦ Lets us run simpler solvers • Impose divergence free field ♦ Do as post process
  • 24. 24 Semi-lagrangian Advection CFL Condition limits speed of information travel forward in time Like backward Euler, what if instead we trace back in time? p(x,t) back-trace
  • 25. 25 Divergence Free Field • Helmholtz-Hodge Decomposition ♦ Every field can be written as • w is any vector field • u is a divergence free field • q is a scalar field q    u w
  • 27. 27 Divergence Free Field • We have w and we want u • Projection step solves this equation q q q 2 2               w u w u w q    w u
  • 28. 28 Ensures Mass Conservation • Applied to field before advection • Applied at the end of a step • Takes the place of first equation in Navier-Stokes
  • 29. 29 Operator Splitting • We can’t use semi-lagrangian advection with a Poisson solver • We have to solve the problem in phases • Introduces another source of error, first order approximation
  • 30. 30 Operator Splitting 0    u  u u    u 2   p    1 f   t u
  • 31. 31 Operator Splitting 1. Add External Forces 2. Semi-lagrangian advection 3. Diffusion solve 4. Project field f   u u    u 2   0    u
  • 32. 32 Operator Splitting u 2   f   u u    W0 W1 W2 W3 W4 u(x,t) u(x,t+Δt) 0    u
  • 33. 33 Various Extensions • Free surface tracking • Inviscid Navier-Stokes • Solid Fluid interaction
  • 34. 34 Free Surfaces • Level sets ♦ Loses volume ♦ Poor surface detail • Particle-level sets ♦ Still loses volume ♦ Osher, Stanley, & Fedkiw, 2002 • MAC grid ♦ Harlow, F.H. and Welch, J.E., "Numerical Calculation of Time-Dependent Viscous Incompressible Flow of Fluid with a Free Surface", The Physics of Fluids 8, 2182-2189 (1965).
  • 35. 35 Free Surfaces + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + 0 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - MAC Grid Level Set
  • 36. 36 Inviscid Navier-Stokes • Can be run faster • Only 1 Poisson Solve needed • Useful to model smoke and fire ♦ Fedkiw, Stam, Jensen 2001
  • 37. 37 Solid Fluid Interaction • Long history in CFD • Graphics has many papers on 1 way coupling ♦ Way back to Foster & Metaxas, 1996 • Two way coupling is a new area in past 3-4 years ♦ Carlson 2004
  • 38. 38 Where to get more info • Simplest way to working fluid simulator (Even has code) ♦ STAM 2003 • Best way to learn enough to be dangerous ♦ CARLSON 2004
  • 39. 39 References CARLSON, M., “Rigid, Melting, and Flowing Fluid,” PhD Thesis, Georgia Institute of Technology, Jul. 2004. FEDKIW, R., STAM, J., and JENSEN, H. W., “Visual simulation of smoke,” in Proceedings of ACM SIGGRAPH 2001, Computer Graphics Proceedings, Annual Conference Series, pp. 15–22, Aug. 2001. FOSTER, N. and METAXAS, D., “Realistic animation of liquids,” Graphical Models and Image Processing, vol. 58, no. 5, pp. 471–483, 1996. HARLOW, F.H. and WELCH, J.E., "Numerical Calculation of Time-Dependent Viscous Incompressible Flow of Fluid with a Free Surface", The Physics of Fluids 8, 2182-2189 (1965). LOSASSO, F., GIBOU, F., and FEDKIW, R., “Simulating water and smoke with an octree data structure,” ACM Transactions on Graphics, vol. 23, pp. 457–462, Aug. 2004. OSHER, STANLEY J. & FEDKIW, R. (2002). Level Set Methods and Dynamic Implicit Surfaces. Springer- Verlag. STAM, J., “Real-time fluid dynamics for games,” in Proceedings of the Game Developer Conference, Mar. 2003.