Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

What is Computational Fluid

Dynamics? (CFD)
• Three conservation laws govern fluid flow
• Mathematical formulation of these laws leads to the
governing equations:
– Partial differential equations or
– Integral equations
• These equations are nonlinear and coupled
– Can be solved exactly for a small no. of special cases
– Can be solved approximately using numerical methods on
a computer (“CFD”)
• Current CFD technology can handle realistic
geometries and complex physics

Finite-Volume Method: Introduction


• The numerical technique we’ll use to solve the governing equations
is the FVM
• ANSYS Fluent uses it as do many other commercial CFD codes
• Basic idea: Divide flow domain into little chunks and apply
conservation laws using integral form
– Get system of algebraic equations
• Can also use the FEM to solve the governing equations by
converting to a system of algebraic eqs.
• FVM is preferred in CFD
• Advantage: Applies conservation directly rather than indirectly
• So we’ll use the FVM to convert the governing equations to a set of
algebraic eqs

1
Example: Flow in a Channel

Find:
• Velocity and pressure distribution
• Wall friction

Simplifications:
• Steady, 2D, laminar, incompressible

Pre-Analysis

1. Mathematical model
2. Numerical solution procedure
3. Hand-calculations of expected results/trends

2
Mathematical Model: Governing
Equations
1. Conservation of mass (continuity eq.)
 ⋅ =0
2. Conservation of momentum ( ⃗ = ⃗)
 ( ⋅ ) =− +

= ̂+ ̂

y
Unknowns: x
, , , , ( , )

Mathematical Model: Boundary


Conditions

= =0

= =
=0 1

= =0

3
Finite Volume Method

• Divide the domain into multiple control volumes or


“cells”
• Reduce the problem to determining velocity and
pressure values at cell centers

Cell or
control volume

“Discretization”

How to Find Velocity and Pressure


at Cell Centers?
System of
Mathematical Model Invert Cell-center
algebraic
(Boundary Value values of
equations in cell-
Problem) , ,
center values
Post
Control volume processing
balance for each cell
, , ( , )
Wall shear etc.
Each algebraic
equation will relate a
cell-center value to
its neighbors

4
How to Derive System of Algebraic
Equations?
Differential Form Integral Form
Conservation of ⋅ =0 ⋅ dS =0
mass
Conservation of ( ⋅ ) ⋅ =
momentum =− +
− + ⃗

How to Derive System of Algebraic


Equations?
• Apply mass &
momentum
conservation to each
cell
– Average & interpolate
cell center values to
get values at the ⋅ dS =0
control surfaces
– At boundaries, use
boundary conditions

5
Example: Algebraic Equation for
Mass Conservation

“Conservation is built into the finite


volume method"
• Algebraic equation can be
derived using:
 Physical arguments
 ∫ ⋅ dS =0
• We calculate fluxes face
by face + +
– This means mass leaving + − =0
CV is equal to mass
entering
– Conservation is
guaranteed for each CV

6
Discretization: Overview
Algebraic
Differential form Integral form of
CV equations
FVM of governing governing
balances relating cell-
equations + BCs equations + BCs
center values

Algebraic
Differential form of Weighted integral
FEM Polynomial equations
governing form of governing interpolation
relating nodal
equations + BCs equations + BCs
values

Additional Complication: Algebraic


Equations are Nonlinear
• Momentum eq. has
nonlinear terms
∫ ⋅ = −∫

+ ⃗
• How to solve nonlinear
system of algebraic eqs.?
– Linearize about guess
values
– Solve iteratively

7
Linearization Illustration

Discretization and Linearization:


Overview

Differential form Integral form Discretization Algebraic


of governing of governing error equations
equations + equations + relating cell-
BCs BCs center values
Linearization
error

Stop iterations Solve iteratively Linearized


when imbalances updating guess algebraic
are below after each equations relating
tolerance iteration cell-center values

8
How do we know when to stop iterating?

• Solution to algebraic
equations after each
iteration satisfies:
 + +
+ − + +
= + − =0
• Aggregate imbalance:
| |
 R=

Algorithm for Iterative Solution


Assign guess values at cell
centers

Tweak guess values using


linearized equations

Calculate aggregate mass &


momentum imbalances

Yes Imbalances < No


Converged
Tolerance?

9
Boundary Value Problem

⋅ =0
( ⋅ ) =− +
= =0

= =
=0 1

= =0

Quantifying Discretization Error:


Order of Accuracy
+
= +
2

10
Extension to Irregular Meshes
• Cells can be any
type of
– Polygon in 2D
– Polyhedron in 3D
• Calculate fluxes and
forces face by face
– Use neighboring cell
center values to get
face values

11

You might also like