You are on page 1of 197

Computational fluid dynamics

Somnath Ghosh
Deptt. Of Aerospace Engineering
IIT, Kharagpur
Computational Fluid Dynamics
Computational fluid dynamics

Axial velocity fluctuations in a supersonic turbulent pipe flow (DNS)


Computational Fluid Dynamics

Axial and radial vel. Fluctuations in supersonic pipe


flow (DNS)
Outline
Introduction
PDEs and their classification
Finite difference methods: error estimation, stability
analysis.
Finite volume methods
Turbulent flow simulations: introduction
Computational Fluid Dynamics:
Introduction
Three methods of solving flow problems:

1. Theoretical (analytical solution of governing


equations)

2. Experiments

3. Solving flow equations numerically (CFD)


CFD: Introduction
We can find analytical solutions to simple flows:
1. Coutte flow: incompressible viscous flow between
a moving and a stationary plate.
CFD : Introduction
2. Laminar pipe flow: parabolic velocity profile.
3. 2D Boundary layer equations.

Complex geometries? Turbulence? Shock turbulence


interaction? chemically reacting flows?
- No analytical solutions possible. Experiments or
CFD??
CFD: Introduction
Experiments:
Costly, many quantities can be hard to measure,
Realistic in many cases!
Computations:
High resolution in space and time possible. Flow
parameters can be changed easily without additional
expense. Highly accurate computations of complex,
high Reynolds number turbulent flows still a challenge.
CFD: Introduction
What is done in CFD?
1. Start from nonlinear partial differential equations (pde).
2. Approximate the derivatives numerically to
reduce the 'pde's to algebraic equations.
3. Solve these algebraic equations using standard methods.
4. Validation with experimental results (if available)
Aptitude required: Maths. + Fluid Dynamics+

Programming (on multiple processors)


CFD: Introduction
Applications:
1. Aerospace engg.: Flow over wings, fuselage, flow
through the engine (compressor,combustor, turbine),
2. Mechanical Engineering: IC Engines, external flow
over automobiles
3. Atmospheric Sciences, Astrophysics.
Some popular software: Fluent, Ansys, StarCD,
Powerflow
Introduction
State of the art:
Multiphysics simulations involving turbulence,
shocks, reaction, multiphase, radiation on thousands
of processors.
Computational aeroacoustics

http://ctr.stanford.edu/
Introduction
Mach 1.92 jet, radiated noise (efluids gallery)
Types of CFD simulations
Turbulent flows
Wide range of space and time scales
Large Reynolds numbers
Diffusivity: increased exchange of
momentum(spreading rates of jets, mixing layers)
Almost all practical flows are turbulent
Types of CFD simulations
Turbulent flows are computed by:
DNS (Direct numerical simulations): Navier
Stokes equations solved without using any model.
Expensive. Not feasible for Reynolds numbers of
industrial interest. Valuable tool for research.
LES (large eddy simulations): Simulate (resolve) the
large scales of turbulent flows and model the effect of the
small scales. Can be applied to industrial flows with
limitations on Reynolds number.
Types of CFD simulations
RANS (Reynolds averaged Navier Stokes)
simulations model all the scales of a turbulent
flow and compute the mean quantities. The
workhorse for the industry. Popular models
used are k-, k-, Spalart-Allmaras etc.
Governing Equations (nonlinear)
Navier Stokes eqn for incompressible flow:
Governing equations (nonlinear)
Euler equations:
Governing equations (nonlinear)
Compressible flow:
Some linear partial differential
equations
Laplace equation(2nd order, homogeneous):

Poisson equation (2nd order, nonhomogeneous):


Linear pdes
Wave equation (second order, homogeneous):

Advection equation (first order, homogeneous):


Classification of pdes
Quasilinear, second order, nonhomogeneous pde in 2
independent variables:

where A, B, C may depend on


D, E, F may depend on
G may depend on
Classification is based on sign of discriminant
Classification of pdes
Classification of pdes
Type of curve represented by the conic sections
equation depends on the sign of discriminant.
Classification of pdes
The classification is related to the characteristics of a pde.
What are characteristics? Physical significance?
In 2d space, characteristics are lines along which
certain flow quantities are constant. For Euler equations,
Riemann invariants are these constants.
When CFD was not there, characteristics provided a
useful means to solve the flow equations in 2d.
Also used today for implementing shock capturing schemes.
Classification of pdes
Simple example of characteristics:
Consider 1d convection equation with velocity
u,

Location x(t) of a fluid particle is


along pathline
Integration gives f= constant along the pathline.
Classification of pdes
So, the fluid property f is convected along the
pathline, which is the characteristic path associated
with the convection equation.
Classification of pdes
Finding characteristics is not always so simple!!
There are different methods of finding them.
Let's get back to the quasilinear 2d 2nd order eqn.
(1)

Applying chain rule


Classification of pdes
Let us assume a path on which f and its first derivatives
are given and we have to solve for the second derivatives
using the above 3 equations shown in matrix form below:

Using Cramer's rule, the second derivatives will exist on


this path when the determinant of the coefficient matrix is
nonzero.
Classification (contd.)
When the determinant is zero, the second derivatives
are either infinite or indeterminate, thus multivalued
or discontinuous.
Setting the determinant to zero gives the
characteristic eqn.

Soln:
Classification (contd.)
The slope of the characteristic curves is given by
dy/dx.
The value of the discriminant determines the nature
of the characteristics.
Classification (Contd.)
The compatibility conditions are obtained by setting
the numerators in the Cramer's rule to zero to
prevent second derivatives from becoming infinite.
Thus we get the governing eqns which hold along the
characteristic curves and which when integrated
gives the invariants.
Classification (Contd)
Examples:
1. Wave eqn is hyperbolic

2. Laplace eqn is elliptic

3. unsteady heat diffusion eq is parabolic


Classification (contd.)
When real characteristics exist, preferred paths of
information propagation exists. Specific domains of
influence and dependence exist (parabolic and
hyperbolic pdes).
If there are no real characteristics, there are no
preferred paths of information propagation.
The zones of influence and dependence is the
entire domain (elliptic pdes).
Classification (contd.)
Classification of PDEs
For elliptic problems we need to specify conditions
on the whole boundary, for hyperbolic and parabolic
problems we need to specify boundary conditions on
a part of the boundary.
Types of Boundary conditions:
Dirichlet : Prescribe u
Neumann: Prescribe derivative of u
Robin (Mixed): Prescribe linear combination of u and
its derivative.
Canonical form of pdes
Quasilinear 2nd order pde in 2 dim.

Transformation to characteristic coordinates

such that
and the transformation is invertible.
Canonical form
Applying chain rule
Canonical form
Substituting in the original eq we get,

where
Canonical form
On a line of constant ,
that is, (slope of char.)
Substituting in characteristic eq.,

we get,
which means
Canonical form
Similarly it can be proved that on the curves
where is constant, C=0.
The hyperbolic pde then reduces to

or,
This form is suitable for analytical soln.
Classification by Fourier analysis
Consider 2nd order linear pde

Express u in terms of fourier modes.


Classification by Fourier analysis
Substituting in the pde gives:

or,

Same discriminant as the characteristic eqn for the


pde, hence same criteria based on sign of discriminant
for classification.
Classification by Fourier analysis
Advantageous for a system of equations.
Example: Steady state incompressible 2d Navier-Stokes
Classification by Fourier analysis
Substituting the Fourier modes in the eq:
Classification by Fourier analysis
Setting determinant of the coefficient matrix to zero
(to avoid a trivial solution u,v,p=0) yields,

Only complex solutions exists for this equation and


the system of pdes must be elliptic.
System of two pdes
Consider a system of quasilinear pdes,

Total differentials can be written as


System of two pdes
These equations can be written in a matrix form

The partial derivatives are uniquely determined if the


determinant is nonzero
System of two pdes
Setting the determinant to zero yields the
characteristic eqn.

Which may be written also as

Sign of determines the type of pde system


Finite differences
Required to evaluate derivative of a discrete function.
We need to discretize the flow domain with a specific
number of grid points.
For example, velocity field is given on some grid
points and we need to evaluate its derivatives.
Finite differences
Required to evaluate derivative of a discrete function.
We need to discretize the flow domain with a specific
number of grid points.
For example, velocity field is given on some grid
points and we need to evaluate its derivatives.
Finite Differences
Exact differentiation,

Forward difference,

Truncation error
Finite differences
Backward difference,

Central difference,
Finite difference
How to evaluate truncation error?
Taylor series expansion of u around :
Finite difference
Example: 2nd order central scheme

Using Taylor series, the truncation error of the central


scheme comes out to be,
Finite difference
Example: Forward difference is 1st order accurate.

From Taylor's Series, we get


Finite difference
Truncation errors for first and second order
schemes for difference grid spacings.
Finite difference
2nd order backward difference scheme ( ),

2nd order forward difference scheme,


Finite difference
4th order central scheme,

2nd order central scheme for second derivative.


Finite Difference
The expression for the second derivative is obtained
easily from Taylor's series,

Dividing throughout by
Finite difference
Grid refinement by a factor of 2 means the
error is reduced by a factor of 4 for a 2nd
order scheme and by a factor of 16 for a 4th
order scheme.
For the same truncation error a fourth order
scheme, for example, will require less grid
points than a second order scheme.
Finite Difference
Please note that the sum of the coefficients
appearing in the expressions of various finite
difference derivative approximations add up to zero.
This is a general property based on the fact that if the
function values are the same at all grid points, the
derivative must be zero, which is a consistency
requirement.
Finite Difference
General technique for construction of finite
difference schemes:
Let us construct the most accurate scheme with
functional values at j, j+1 and j+2.

Using Taylor's series we get,


Finite Difference

Therefore, we get by substitution in the previous eq.,


Finite Difference
Now, to get the most accurate scheme we need to
set as many terms on the RHS to zero as possible.
Since we have 3 coefficients, we can set the first 3
terms to zero.
Finite Difference
Solving these equations we get,

Resulting finite diff. Formula,

So, with the values at j, j+1, j+2, the best we can do is a


second order approximation.
Pade approximations/Compact schemes

Include derivatives of neighbouring points in the finite


difference scheme to achieve higher accura cy.
Example: Most accurate scheme that includes
derivatives at j, j+1, j-1 in addition to the function
values at those points.
Pade approximations/Compact schemes

Taylor series expansions give the following,


Pade approximations/Compact schemes

Substituting in the finite difference scheme, we


get
Pade approximations/Compact schemes

Setting the coefficients of the first five terms to zero


in order to minimize truncation error, we have a set of
5 algebraic eqn
Pade approximations/Compact schemes

The solution of the equations is,

Substitution in the finite difference equation we get the following


scheme,

If j=1,2,...n-1, then we have a system of equations for


There are n-1 equations for n+1 unknowns.
Pade approximations/Compact schemes

So, 2 additional equations at the boundary points are


needed.
In this example, the following 3rd order boundary
schemes can be used.
Pade approximations/Compact schemes

Pade schemes are 'compact' (involves a small


stencil) despite high order of accuracy.
Pade schemes are global. To compute derivative at a
points, the functional values at all points are required.
Either we get the derivatives at all points or none.
Schemes for higher derivatives can be constructed in
a similar manner as discussed above.
Modified wavenumber analysis
Assume a harmonic function of period L,

where the wavenumber (or frequency) k is given by

and
Modified wavenumber analysis
Analytical differentiation gives,

Discretize x axis of Length L with a uniform mesh,


with j=0,1,2,,,N-1

Consider 2nd order central difference formula,


Modified wavenumber analysis
Substituting into the central
difference formula we get,
Modified wavenumber analysis
Here is called the
Modified wavenumber.
Solid line: 2nd
order explicit; dashed
line: 4th order
explicit; dash-dot
line: 4th order
compact.
Modified wavenumber analysis
For the 4th order compact scheme:

the modified wavenumber is


Dissipation and dispersion errors in F.D
schemes
For central difference schemes, the modified wavenumber is
real but for backward difference schemes it is complex (true
for explicit as well as compact schemes!!).

Real part of k' is associated with dispersion error and


imaginary part is associated with dissipation error.
Numerical soln of ODEs
Initial value problem:

We solve for y for subsequent times.


Taylor's series methods:
Taylor's series expansion of solution at about the
solution at
Numerical soln of ODEs

From the ODE we get,

Substitution in the Taylor's series gives the forward


(explicit) Euler scheme,
Numerical soln of ODEs
Implicit or backward Euler method:

Crank Nicholson or Trapezoidal method:


Numerical stability
Stable numerical scheme: Numerical solution
does not blow up (grow without bounds) with any
choice of parameters.
Unstable numerical scheme: Numerical solution
blows up with any choice of parameters.
Conditionally stable scheme: Solution is stable
for certain choice of parameters.
Numerical Stability
Consider the ode ( is a constant),

Apply the forward Euler method to this ode,

The solution at the n-th time step


Numerical Stability
The amplification factor for this scheme is,

For stability, we require that,

For real , should be negative and could


be as low as -2. This means
Numerical Stability
The forward Euler method is conditionally
stable. We need to advance the solution in
small time steps to get a stable solution. This
means more time steps are needed to reach
the final time of integration.
The exact solution of the ode in question is
which is stable for negative
Numerical Stability
Applying backward Euler scheme to the same
ode gives,

or,
Solution at nth time step,
where
Numerical Stability
If is complex then,

That is,

with the modulus and phase


factor
Numerical Stability
For stability,
that is,
Since should always be negative
(stabilitity condition for the ode), so A >1.
Hence backward Euler method is
unconditionally stable.
Numerical Stability
Applying Crank-Nicholson scheme to the ode,

or,

Amplification factor,
Numerical stability

Where and

so,
Numerical stability
Since should be negative for stability of
the ode, A<B.
So, <1
So, as expected from an implicit scheme,
the trapezoidal (Crank Nicholson) scheme is
unconditionally stable.
Accuracy
We will determine the order of accuracy of the
schemes by comparing with the exact solution,

Now,
Amplification factor of forward Euler scheme,

It can reproduce only the first two terms of


Accuracy
For backward Euler scheme,

Both forward and backward Euler schemes can


reproduce only upto the first order term of the
exponential series.
Hence both are globally first order accurate,
although for a single timestep they are 2nd order
accurate.
Accuracy
For Crank-Nicholson method,

This shows that this method is globally second-order


accurate.
Runge-Kutta methods
2 stage, 2nd order RK method,

are to be determined to ensure


highest order accuracy of the method.
Runge-Kutta methods
Using Taylor series expansion and matching
coefficients of similar terms, the following
second-order scheme results:

Free parameter is commonly chosen as .


Runge-Kutta methods
Accuracy and linear stability:
Using this scheme for the linear ode,
we obtain,

So, the method is second order accurate.


Runge-Kutta methods
Amplification factor,
For stability,
To find the stability boundary, , it is
convenient to find the complex roots of
the equation,

for different values of


Runge-Kutta methods
4th order, 4 stage Runge-Kutta Method:
Runge-Kutta methods
Using this scheme for the linear ode results in

Hence the scheme is 4th order accurate.


Linear stability boundary is obtained by finding the
roots of the equation,

for different values of


Runge-Kutta methods
Im( ) Stability regions of
Forward Euler (1st order
Runge-Kutta, p=1); Runge-
Kutta method of 2nd, third
and 4th order (p=2,3,4) on
the complex plane.
Re( )
Amplitude and phase errors
Amplitude and phase errors
Consider linear ode with pure imaginary = ,

Amplification factor for Explicit Euler method,

or,
Amplitude and phase errors
Amplitude of numerical solution after first
timestep is

And that of the exact solution, is 1.


Amplitude error = ratio of amplitudes of
numerical to exact solution starting from same
initial condition =
Amplitude and phase errors
Being a complex number, can be written as,

where the phase,


Phase error,

where, is the phase of the exact solution after one


timestep.
Amplitude and phase errors
Phase error after n timesteps is
For Crank-Nicolson method,

For purely imaginary ,


No amplitude error for this method.
Amplitude and phase errors
The amplification factor is
with
Phase error,
Stability of fully discretized PDE
Von Neumann Analysis:
Consider the 1-d linear, diffusion equation,

Using Forward Euler for temporal discretization and


central scheme for spatial discretization,
Von Neumann Analysis
Assume a solution of the form

Substituting in the discretized equation leads to,

Dividing both sides by and keeping in mind


Von Neumann analysis
We get,

For stability,
or,

The inequality on the right is always satisfied since


is always less than zero.
Von Neumann analysis
The left side inequality can be written as

or,

In the worst case scenario ( = -1 ),


Von Neumann Analysis
Linear convection equation:

Using forward Euler scheme in time and backward


difference in space,
Von Neumann Analysis
Or,

where is called the Courant number or


the CFL (Courant-Friedrichs-Lewy) number.
Substituting ,
Von Neumann Analysis
Following the steps as before we get,

or,

Stability condition can be written as


Von Neumann Analysis
Which gives,

or,
which means

Therefore, is the stability criterion for


this combination of spatial and temporal schemes.
Von Neumann Analysis
For c > 0, backward differencing in space
corresponds to an 'upwind' difference.
For c < 0, forward differencing in space
corresponds to an 'upwind' difference.
Upwind differencing can be shown to be stable
as was demonstrated above for the backward
scheme.
Von Neumann Analysis
Using forward Euler and central differencing for the
convection equation,

Substituting ,
Von Neumann Analysis
Finally we get,

We readily notice that this scheme is unstable for any


value of since

is greater than or equal to 1.


So, von Neumann analysis shows that the central
difference scheme is unstable.
Von Neumann Analysis
In summary:
Von Neumann analysis can be applied to full
discretization of linear partial differential equations.
Effects of boundary conditions/schemes are not
included.
Relative simplicity of analysis. Provides useful insights
about stability problems which arise from interior
schemes.
Widely used to get the initial estimates of time step.
Modified wavenumber analysis
Consider the 1d linear diffusion equation (or the heat
equation)

Assume a solution of the form

Substitution in the equation leads to the linear ODE,


Modified wavenumber analysis
The semi-discrete form of the pde, using a central
scheme for the second derivative is,

Let's assume a solution for the semi-discrete form,


Modified wavenumber analysis
Substitution in the ode gives,

or,
where

is the modified wavenumber.


Modified wavenumber analysis
Notice the similarity between the linear ODEs

and
When the two equations will be
identical and we can apply the stability
analysis results shown earlier for ODEs.
Modified wavenumber analysis
For example, for the Forward Euler scheme the
timestep was given by,

So, when forward Euler scheme is used with the


central scheme for this pde, the timestep will be
given by,
Modified wavenumber analysis
The most critical case occurs when

Then,

which was also obtained from von Neumann


analysis.
Modified wavenumber analysis
If 4th order Runge-Kutta scheme was used instead of
the forward Euler scheme then,

So, in this case in the worst case scenario


( )
Modified wavenumber analysis
So, using the modified wavenumber analysis, the
stability limits of various time advancement schemes
are readily obtained for the same spatial
discretization.
The method is simpler than von Neumann analysis.
Let's now look at the semi-discrete linear convection
equation:
Modified wavenumber analysis
Assume
Substitution gives,

where
Modified wavenumber analysis
Comparing with the model equation,
we find, which is purely imaginary.
So, for the convection equation the stability
limit of the timestepping scheme for imaginary
become important.
Forward Euler and 2nd order Runge-Kutta
have poor stability properties for imaginary
Modified wavenumber analysis
4th order Runge-Kutta method has good
stability property for imaginary
From the stability diagram of Runge-Kutta scheme
we find the stability limit to be,

For the worst case scenario ( when equals


1) replacing for results in
Modified wavenumber analysis
Or,
CFL number,
To summarize:
Modified wavenumber analysis can be applied to linear
PDEs
Simpler than von Neumann analysis. Stability criteria
Various timestepping schemes can be readily obtained.
Effects of boundary schemes cannot be included.
Matrix stability analysis
Consider 1-d linear diffusion equation,

with given initial conditions.Boundary conditions are at j=0,N


Using central difference for the spatial derivative we get the
following semi-discrete form:
Matrix stability analysis
So we have a system of N-1 ordinary
differential equations which can be expressed
in matrix form as follows:
Matrix stability analysis
Since A is a symmetric matrix, we can
diagonalize it as follows:

where is the diagonal matrix with the


eigenvalues of A on its diagonal and S is the
matrix whose columns are eigenvectors of A.
Matrix stability analysis
Substitution in the ODE leads to,

Left multiplication with gives,


Matrix stability analysis
The previous equation can be written as

with
Since is diagonal we have a set of
decoupled equations whose solution is,
Matrix stability analysis
Hence, the stability of the solution with time
will depend on the eigenvalues of A
The solution in terms of the original variable is

where is the jth eigenvector of A.


For the present case, the eigenvalues turn out to be
real. So, for stability of the solution, they should be
negative which leads to a decaying solution.
Matrix stability analysis
Suppose we use forward Euler for time
integration,
Then the timestep will be restricted by

where is the magnitude of the largest


eigenvalue (All eigenvalues should be negative)
Matrix stability analysis
For the convection equation, using the central
scheme results in,

For simplicity we exclude the effects of boundary


schemes (at j=0,N) right now and we get the matrix form,
Matrix stability analysis
Here B is a tridiagonal matrix with 0 on the diagonal,
-1 and 1 on the sub and superdiagonals.
The eigenvalues in this case turn out to be complex
and, say, are given by
So, the solution as expected is oscillatory and
each mode's temporal behaviour depends on
.
Matrix stability analysis
Using 4th order Runge Kutta for time
integration leads to,
Modified equation analysis
Consider the 1d linear diffusion equation and discretize it
with explicit Euler and a second order central scheme.

where is a continuous, differential function which


has the same values as the numerical solution on the
space time grid.
Let be the exact solution.
Modified equation analysis
Expand every term of the previous equation in Taylor
series and substitute,

So,
Modified equation analysis
Substitution in the discrete equation gives,

that is (dropping the superscript n),

This is the modified equation which the numerical


solution satisfies.
Modified equation analysis
As and approach zero the modified
equation approaches the original pde.
In this case it is seen that the scheme is first order
accurate in time and 2nd order in space.
Finite volume method
Hyperbolic conservation law (scalar form):

Discretise the domain into control volumes.


Finite volume method
Discretise the integral formulation of the
conservation laws in each control volume.
Use the resulting equations to update the
dependent variables.
Finite volume method
Integral form of the conservation law:

where is the volume over which the integration


is done.
Use Gauss divergence theorem and convert the 2nd
volume integral to a surface integral.
Finite volume method

The rate of change of U inside the control volume is


equal to the net flux through its boundary.
In 1d:
Finite volume method
The flux terms are discretised as

denotes the numerical approximation of the


flux.

U is assumed to be discontinuous across the control


volume boundaries, which is where the fluxes are
evaluated.
Finite volume method
Let's denote the volume averaged value of U
in the i-th control volume to be
So the discrete form of the integrated
conservation law can be written as (using
explicit Euler timestepping for simplicity):
Finite volume method
So, we are updating the volume averaged
values of the dependent variable at every
timestep for each volume.
To do this we need to estimate the fluxes at
the control volume boundaries.
For this we need to assume a specific distribution of
U inside the control volume, e.g. constant or linear or
parabolic without changing the average value
Finite volume method
Distribution of U inside the control volume determines
the order of accuracy of the method e.g. assuming
constant U gives 1st order method, linear distribution
gives 2nd order method and so on.
For 1d the discrete formulation is

where is the location of the cell center and


and are the location of the boundaries.
Finite volume method
Finite volume method
Consider linear convection equation,

which can be written as


where the flux
The discrete finite volume form of this
equation is
Finite volume method

Various approximations of the numerical flux


can be made.
Upwind (Constant U inside the cell):
if c > 0
if c < 0
Finite volume method
This results in the following first order upwind
scheme (also known as CIR scheme)
c>0:

c<0 :
Finite volume method
Finite volume Lax Wendroff scheme (2nd
order):

Replacing in the discrete equation,


Finite volume method
High order methods can be derived using suitable
interpolation schemes esp. in incompressible flows.
We look at a particular example where a 'compact'
interpolation scheme is used to get the interface values
of the primitive variables.
In 1d the interfaces are points and in 2d and 3d they are
lines and surfaces respectively.
Finite volume method
The following interpolation scheme can be
used for the variable :

The cell averaged value is given by


Finite volume method
The coefficients are determined
by expanding all the variables about
and requiring the coefficients of the low order
terms to vanish.
The expansions are different than in usual
finite difference schemes because
Finite volume method
A fourth order scheme looks as follows:

Some notes:
Finite volume schemes are more suitable for
complex geometries than Finite difference scheme.
Finite volume method
Conservation is easier to achieve in FV than in
FD schemes.
Higher order accuracy is easier to achieve in
FD than in FV.
FV schemes appear to be more robust than
FD schemes and hence widely used in
commercial software.
Incompressible flows
Poisson equation for pressure,

is obtained by taking divergence of the momentum


equations and using the continuity equation
(divergence of velocity is zero). In incompressible
flow computations we have to ensure that the velocity
fields are divergence-free.
Incompressible flows
During incompressible flow calculations, we update
the velocity fields in time using the momentum
equations.
What about pressure? How to satisfy the continuity
equation?
The most popular approach is to solve the Poisson
equation for pressure at each timestep.
Incompressible flows
Basic idea:
Compute a velocity field from the momentum equations
using an initial (guessed) pressure field or no pressure
field.
Use the computed velocity field in Poisson equation to
get an updated pressure field.
Calculate the corrected velocity field using the updated
pressure and ensure divergence-free condition.
Incompressible flows
Solving Poisson eqn in 2d :

Assuming uniform grid spacing


and using 2nd order central difference scheme
for the second derivative we get,
Incompressible flows
We can write these equations for all the
gridpoints and obtain a linear system of
equations of the form,

Solve this linear system using standard


methods.
Turbulent flows
Turbulent flows are observed in everyday life
Smoke from a chimney
Water flow in a river, waterfall
Atmospheric boundary layer
Mixing of milk in coffee
Turbulent flows
Turbulence in engineering applications:
Flow over aircraft wings
Combustion processes involve turbulence and
the mixing is enhanced by it.
Flow in oil and natural gas pipelines is turbulent
Turbulence acts as a hindrance in aviation, it
leads to difficulties in aircraft control and increases
drag.
Turbulent flows
Turbulence is desirable in mixing processes in
order to homogenize fluid mixtures and to
accelerate chemical reaction rates.
Flow is seemingly random, highly unsteady.
Turbulence is a continuum phenomenon.
Smallest scales are much larger than
molecular length scales. It is governed by
Navier-Stokes eqn.
Turbulent flows
Turbulent flows
RANS equations
Eddy viscosity models
Filtering
Filtered variable is obtained as follows:

where G is a low-pass spatial filter.


Fourier transform of convolution of two functions is
equal to the product of their transforms.
Therefore the above equation can be written as
Filtering
Here is a scaled wavenumber.
Example:
Filtering
Filtering
Filtering
Large-eddy simulation (LES)
Filtered Navier Stokes equation for
incompressible flow:

In LES we solve this equation for the filtered


quantities ( , ) and we need a closure for
the term
LES
We can write:

and obtain the usual LES equation as:

where is called the subgrid


scale stress (SGS stress).
LES
Eddy viscosity models
Eddy viscosity can be written as a product of a
velocity and a lengthscale.

The basic task of modelling is to find estimates


of these velocity and length scales.
Algaebraic Eddy viscosity models

Mixing Length models: Need to specify mixing


length in the flow.

Smagorinsky:
Baldwin, Lomax:
Two equation models
No need to assume a mixing length.
Velocity and length scales are obtained from
turbulent kinetic energy and turbulent
dissipation rate.
model
Need transport equations for TKE ( ) and
turbulent dissipation rate
So, is essentially an eddy viscosity
model.
LES models
Smagorinsky model: Linear eddy viscosity
model relates the SGS stress to the filtered
strain rate.
Non-uniform grids
The variable to be solved for may vary rapidly in
some part of the domain.
So, we need clustering of grid points in regions of
strong variation. Hence, non uniform grids.
Finite difference formula for nonuniform grids is of
low order.
Alternative is to use coordinate transformation.
Non-uniform grids
We can use the following coordinate
transformation in general,

Here x is the coordinate of the nonuniform grid


and is the coordinate of the uniform grid.
Using chain rule,
Non-uniform grids
Finite difference approximations on uniform
grids can then be used to calculate
Example:

You might also like