Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

MDB4013Z CFD Part 1 Sep 2019

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

1.

Introduction to CAE
Computational Fluid Dynamics (CFD)
1.1. Definitions
1.2. Why and what is
“Numerical Methods”
1. Introduction to CAE
1.1. Definitions

Computer Aided Design (CAD)

The technology concerned with the use of computer systems


to assist in the:

• creation,
• modification
• analysis
• optimization

of a design
1. Introduction to CAE
1.1. Definitions

Computer Aided Manufacturing (CAM)

The technology concerned with the use of computer systems


to :

• Plan
• Manage
• Control of manufacturing operation

Through either direct or indirect use of computer interfacing


1. Introduction to CAE
1.1. Definitions

Computer Aided Engineering (CAE)

The technology concerned with the use of computer systems


to :

• Analyze CAD geometry

Allowing the designer to simulate and study how the product


(or the fluid flow or heat transfer or forces) will behave so
that the design can be refined and optimized.
1. Introduction to CAE,
1.2. Numerical Methods
Why we need to do simulation using mathematical
equations? In other words can’t we obtain the
details by doing experimental measurements ?
Computational modelling has advantages over experimental
techniques in the investigation of flow, temperature and moisture,
stress, strain, etc distribution where the introduction of
instrumentation into the flow paths would influence the flow
structure.

With numerical simulation, it is possible to obtain the above


information without the need to physically build the model and test it
experimentally (i.e. cheaper).
1. Introduction to CAE,
How Computers Aid Engineers

We might model water flow from water tap by dividing it into 1000
parts and use mathematical fluid flow equations to obtain the details
of these parts (i.e. velocity, flow profile).
If you divide it into few number of parts, your simulation will not be
accurate.
If you divide it into too many parts, your computer will take long
time calculating the result!
1. Introduction to CAE,
1.2. Numerical Methods
Example of simulation by dividing the model into parts called mesh.
Calculation will be performed at each node to obtain the details (i.e.
temperature, velocity, flow profile, stress, strain…etc) at these parts.
• Aerospace
Where CAE used?
Aerospace
• Automotive
• Biomedical
• Chemical Processing
• HVAC
• Hydraulics
• Marine
• Oil & Gas Biomedical
• Power Generation
• Sports
• Fire

Automotive

Temperature and natural


convection currents in the eye
following laser heating.
8
In many engineering applications, computers are used to aid
engineers by predicting the temperature, flow profile, stress and
strain distribution, smoke movement…etc.

Many software have been developed to perform the simulation

So what are we going to learn/study in this course?

We will study and understand how the software work and the
method used in solving mathematical equations related to fluid
flow, heat and mass transfer and solid mechanics.

If the software can do the simulation, why we need to study


CAE?

Well, because anyone can play with the software, run the
simulation & get results
But the question is, are the results correct & valid?

Obviously No, because the results needs to be checked, analysed


validated and verified before considering the results are valid.

Therefore UTP – Mechanical Engineering Department is offering


the CAE course for the students so that students know how the
software run and are able to perform analysis to see if the
results obtained are valid or not.
Using computer software to do simulation
is significantly increasing in the world.
Simply because using computer
simulation will save money and time

Therefore engineers with computer


simulation skills are in high demand in
the world
In this course
You will learn about computer simulation in
fluids and solids to study fluid flow, velocity,
temperature, mass distribution profiles, which
is called Computational Fluid Dynamics (CFD).
To make you feel the importance of this
course and make the course interesting
Occasionally during the lecture I will show you
some jobs advertisements and talk about
projects that used CAE and what's the
updates on CAE on the internet.

If the time permits, I may invite some of our


postgraduate students to present to you on
the use of CAE in their research work.
Computational Fluid Dynamics
(CFD).
In heat transfer you learn how to calculate a heat exchanger
outlet temperature by using effectiveness – NTU method and/or
Log Mean Temperature (LMT) method. But both methods do not
show us the internal temperature and velocity distribution in a
heat exchanger.
CFD techniques are able to give us the internal temperature and
velocity distribution in a heat exchanger.
SIMULATIONS VS EXPERIMENTS
1. Introduction to CAE,
1.2. Numerical Methods
Analytical Solution vs Numerical Solution

gives gives

Exact behavior of the Approximation of the exact


system at any point solution at selected point

T1
T2 T1
T2
By Li-Zhi Zhang, International Journal of Heat and Mass Transfer 50 (2007) 151–162
Modeling (governing equations)
Navier-Stokes equations (3D in Cartesian coordinates)
u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 
v v v v pˆ   2v  2v  2v 
  u  v  w      2  2  2 
t x y z y  x y z 

w w w w pˆ  2w 2w 2w


  u  v  w     2  2  2 
t x y z z  x y z 

Local Convection Piezometric pressure gradient Viscous terms


acceleration
 u  v  w
    0 Continuity equation
t x y z
p  RT Equation of state

Wow, so complicated equations , so how CFD can solve it?


20
We can see that previous equations are complicated
and difficult to solve.

In CFD, we use discritisation techniques to convert the


previous complicated first order and second order
partial differential equations to simple algebraic
equations which be solved with small error.


So this is what discritisation means

By the way, meaning of dicritisation


is not available in many dictionaries
Numerical methods
The continuous Initial Boundary Value Problems
(partial differential equations) are discretised into
algebraic equations using numerical methods.
Assemble the system of algebraic equations and solve
the system to get approximate solutions
Numerical methods include:
1. Discretisation methods
2. Solvers and numerical parameters
3. Grid generation and transformation
4. High Performance Computation (HPC) and post-
processing

22
So what are the component of the
software?
1. Pre processor: Here you will create the geometry,
generate the mesh and define boundary conditions (see
below example on cooling towers

By Ra’fat Al Waked (2004)


2. Solver: The software will perform discritisation and
solve relevant equations

By Ra’fat Al Waked (2004)


3. Postprocessor: The last stage in the CFD process is the
post-processor stage where the output of a numerical
simulation is visualised using external or built-in
visualisation programs. In these programs, the
domain geometry and the grid can be displayed, as
can the field’s velocity vectors and pressure contours.

Moreover, the output of the numerical simulation can be


saved to be used by other analytical tools such as
spreadsheets.
3. Postprocessor
By Ra’fat Al Waked (2004)
Some modelling work using CFD
Research has been done on showers to study water
distribution on human body and how to conserve water
Pre-processor:

By
Darren
Woolf
The software solver performed discritisation
and solved the relevant equations
Postprocessor: Results presented as follows

By
Darren
Woolf
By
Darren
Woolf
By
Darren
Woolf
By
Darren
Woolf
By
Darren
Woolf
And there are many many many more
examples on research and projects
done using CFD and in general CFD.

In other words there is no limit on work


done using CFD
(i.e. the sky is the limit) 
Computational Fluid Dynamics (CFD)
There are two fundamental approaches to design and perform analysis of
engineering systems: which are experimentation and calculation.
With experimentation, it involves construction of models that are tested in
wind tunnels or other facilities.
While calculations involves solution of differential equations, either
analytically or computationally.
CFD is the field of study devoted to solution of the
equations of fluid flow, energy, species
(mass)…etc through the use of a computer.

However, in modern engineering, we apply both


experimental and CFD analyses and the two
complement each other.

Engineers may obtain global properties , such as


lift, drag, pressure drop..etc, experimentally.

But by using CFD, we can get the details about


the flow field, velocity distribution, pressure
profiles….

By matching experimental data with CFD results,


CFD then can be used to shorten the design
cycle, by utilising it to model the changes to the
design without the need to change the physical
model in the experiment, hence significant cost
will be saved.
CFD in Job Market
CFD has been widely used by industries all
over the world. There are many CFD
software in the market and many
organizations are using CFD techniques
because it can predict the performance of
a system.
In Malaysia many organizations are utilizing
CFD modelling in their work.
In general we can learn how to use CFD software
but is this enough to perform CFD modelling?

The answer simply is NO, because we need to


know how the CFD software works and how it
does the modelling so that we can analyse
correctly the results and make sure that the
software gave us the correct results.
Discritisation
As we mentioned in previous slides that CFD “is
the field of study devoted to solution of
the equations of fluid flow, energy, species
(mass)…etc through the use of a
computer”.
However, the above equations are
differential/partial differential equations which
are difficult to solve. Hence CFD will convert
these equations to approximate algebraic
equations so that it can be solved easily but with
some error in which the CFD solution minimises
this error to get almost exact solutions
1. First order Partial Differential Equation (P.D.E)
To replace a partial derivative with suitable algebraic equation we need to
use Taylor series expansions.
Remember from mathematics, Taylor series expansions.
 y    2 y  x 2   3 y  x3   n y  x n!
y( xo  x)  y( xo )   x        ........   
 x   x  2!  x  3!
2 3  x  n!
n
     
where ! n  1
The above equation is mathematically an
y

exact expression of y(xo+Δx) if the number
y
of terms is infinite and/or Δx approach
zero •
y

When we say first order discritisation Δx Δx
xo- Δx xo xo-+Δx
Rearrange the above (first order)

 y  y( xo  x )  y( xo ) Represents the
   O(x) truncation error
 x  x which is resulted
due to ignoring
other terms
u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 
v v v v pˆ   2v  2v  2v 
  u  v  w      2  2  2 
t x y z y  x y z 

w w w w pˆ  2w 2w 2w


  u  v  w     2  2  2 
t x y z z  x y z 

 u  v  w


   0
t x y z

This discretization can be implemented on each term in NS equation


partial differential equations above

 y  y( xo  x )  y( xo )
   O(x)
 x  x
In mathematics, a Taylor series is a
representation of a function as an infinite
sum of terms that are calculated from the
values of the function's derivatives at a
single point.

It is common practice to approximate a


function by using a finite number of terms
of its Taylor series.
1.1 First order Forward Differencing Format

 y  y( xo  x )  y( xo )
   O(x) It’s a first order
 x  x equation, which is
The above equation can be written approximated to
as follows: linear equation
y = f(x)
y y y
 yi'  i 1 i  O(x)
x x
yi+1

To use above equation for the curve
yi
shown in this slide
Error due to ignoring other y = f(x) •
terms in Taylor series which
yi-1

considers the curvature as Δx Δx
linear
yi 1  yi • i+1 xi xi+1
xi-1
x
•i
Δx Since the solution is forward (from i to i+1) it
i+1 is called forward format
i
1.2 First order Backward Differencing Format

In a similar way we can use the previous method between i-1 and i
To use above equation for the curve
shown in this slide
yi  yi 1 y = f(x)
yi 
'
 O(x)
x yi+1

Error due to ignoring other
terms in Taylor series which yi
considers the curvature as y = f(x) •
linear
yi-1

yi  yi 1 •i Δx Δx

x xi-1 xi xi+1

•i-1
Δx Since the solution is backward (from i-1 to i)
i-1 i it is called backward format
d2y
1.3 First order Central Differencing Format dx 2

y = f(x)
To obtain central differencing between i-1 and i+1, Taylor seriesy
expansions is used.
i+1

From previous slide yi
 y    2 y  x 2   3u  x 3   nu  x n! •
y( xo  x )  y( xo )   x   2 
 x 
  3 
 x  2!  x  3!
 ........   n 
 x  3!
yi-1

where ! n  1 Δx Δx
xi-1 xi xi+1
 y 
y(i 1)  y(i )   x......(equation a)
 x  Between nodes i to i+1
 y 
y(i 1)  y(i )   (x)  ......(equation b)
 x  Between i-1 to i
                               subtract a and b
 y 
y(i 1)  y(i 1)  2 x
 x 
Since the solution takes all points (from i-1 to i+1) it is
Re arrange
called central format
y yi 1  yi 1

x 2x
1.4 Second Order Partial Differential Equation (P.D.E)
To obtain more accurate results we need to account for the
y = f(x)
curve curvature not to simply consider it a line (as shown in yi+1

previous slide). Therefore Taylor series expansions is used.
yi
From previous slide •
 y 
y( xo  x)  y( xo )   x 
 x 
  2 y  x 2   3 y  x3

 2


 
 3


  n y  x n!
 ........  
 n


yi-1

 x  2!  x  3!  x  n!
Δx Δx
where ! n  1
 y    2 y  x 2 i-1 i i+1
y(i 1)  y(i )   x   2     ......(equation a) where ! n  1

 x   x  2!
Between nodes i to i+1
 y    y  (x)
2 2
y(i 1)  y(i )   (x)   2   ......(equation b)
 x   x  2! Between i-1 to i
                               sum a and b
  2 y  x 2 !=n-1, n=2
y(i 1)  y(i 1)  2 y(i )  2 2 
 x  2 Hence !=2-1=1
Re arrange
 2 y yi 1  2 yi  yi 1

x 2
x 2
Lets implement what you learn on a fluid and fluid properties
Assume “B” is a fluid property (example density, viscosity …etc) S axis in the
B
 f ( B, S ) •i+1 streamline
S
A. Forward differencing representation i • direction

B B  Bi
 f ( Bi , Si )  i 1 •i-1
S S
B. Backward differencing representation
B B  Bi 1 •
S
 f ( Bi , Si )  i
S •i i+1

C. Central differencing representation


•i-1 Linear

B B  Bi 1
 f ( Bi , Si )  i 1
S 2S

In all of the above we are solving by
•i i+1
using first order (linear)
•i-1 •
D. Second order differencing representation •i i+1

2B
S 2
 f ( Bi , S i ) 
Bi 1  2 Bi  Bi 1
S 2
•i-1
This can be done in the x direction
Assume “B” is a fluid property (example density, viscosity …etc)
B
yi+1

 f ( B, x )
x yi

A. Forward differencing representation yi-1

B Bi 1  Bi Δx Δx

x x i-1 i i+1
B. Backward differencing representation

B Bi  Bi 1

x x
C. Central differencing representation

B Bi 1  Bi 1

x 2x
D. Second order differencing representation

 2 B Bi 1  2 Bi  Bi 1

x 2 x 2
and can be used in the y direction
Assume “B” is a fluid property (example density, viscosity …etc)
B
 f ( B, y )
j+1

y

Δy Δy
j
A. Forward differencing representation •
B B j 1  B j
j-1


y y
B. Backward differencing representation i-1 i i+1

B B j  B j 1

y y

C. Central differencing representation


B B j 1  B j 1

y 2y
D. Second order differencing representation

 2 B B j 1  2 B j  B j 1

y 2
y 2
The previous discritisation techniques are based on differencing
(i.e. difference between i and i+1 or j and j+1, or i and i-1, or j and
j-1….etc)
Hence we call this technique as

finite differencing
Finite Difference Accuracy

As we know that Finite Difference utilsed Taylor series


 y    2 y  x 2   3 y  x3   n y  x n!
y( xo  x)  y( xo )   x        ........   
 x   x  2!  x  3!
2 3  x  n!
n
     
where ! n  1

y=f(x)
 fx    2 fx  x 2   3 fx  x 3
f ( x  x )  f( x)   x   2    3   ........
 x   x  2  x  6
If we take only this
term, the solution
will not be accurate If we add this term, its If we add this term, its
(first guess only) going to be linear first going to be second order.
order, in fact this term This term accounts for the
represents the slope of curve curvature. The
the curve. The accuracy of accuracy of the solution
the solution will improve will improve further
f(x) 4

5
 fx    2 fx  x 2   3 fx  x 3 2
f ( x  x )  f( x)  
 x 
x   2    3   ........ • 3
 x  2  x  6 1
If we neglect the partial terms, we will get
x
f ( x  x )  f ( x ) Δx x+Δx
1 3 x
If we take the first two terms, it will improve the
solution, but first order equation (slope of the
curve, i.e. line)
 fx 
f ( x  x )  f ( x )   x  1 4
  x 
If we take the first three terms, it will further
improve the solution, second order equation

 fx    2 fx  x 2
f ( x  x )  f( x)   x   2  1 5
  x   x  2

To obtain the exact solution (point 2), we must consider ∞(infinity) terms
f(x) 4
Example
If f(x)=sin 2πx, x=0.2 and Δx=0.02 Exact solution 5
2
At x=0.2, f(x)=sin2π0.2=0.9511, where π=180 • 3
At x+Δx=0.2+0.02=0.22, f(x)=sin2π0.22=0.9823 1
 fx    2 fx  x 2   3 fx  x 3 x
f ( x  x )  f ( x )    x   2 
   
3 
 ........
  x   x  2  x  6
x Δx x+Δx
1. If we take the first term only
f ( x  x )  f ( x )
This correspond to point 3,
f (0.22)  f (0.2)  sin 2 (0.2)  0.9511
error [(0.9823-0.9511)/0.9823]X100= 3.17% 
2. If we take the first two terms
 fx 
f ( x  x )  f ( x )   x
 x 
f (0.22)  f (0.2)  2 cos2 0.2(0.02)  0.9899This correspond to point 4, error 0.775% (better)
3. If we take the first three terms
 fx    2 fx  x 2
f ( x  x )  f( x)   x   2 
 x   x  2
0.02 2
f (0.22)  f (0.2)  2 cos2 0.2(0.02)  4 sin2 0.2 2

2
 0.9511  0.0388  0.0075  0.9824 This correspond to point 5, error 0.01%  much better
Error %

If we take case 1 3.176 


in previous slide

If we take case 2 0.775


in previous slide

If we take case 3 0.01


in previous slide 
We can conclude that the more terms in Taylor series for partial derivative we
take, the better is the accuracy (less error)
But usually in heat transfer we go up to the second order (case 3 above) which
gives us low error and acceptable accuracy in the solution
1.5 Mixed derivative (two dimensional)
So far you have learned how to discritise differential
equations for 1 Dimensional (x or y). If we have two
dimensional model with mixed derivative like the one
shown below   2u 
 
 xy 
 

• • •
i-1, j+1 i, j+1 i+1, j+1
Δ
y

• •P •
i-1, j i, j i+1, j
• • •
i-1, j-1 i, j-1 i+1, j-1

ΔX

What are we suppose to do?


Back to the equations in the beginning of this lecture series
The following equation is based on forward (ui+1,j)
 u    2u  x 2
ui 1, j  ui , j    x   2   ........
equation a

 i , j
x  x i , j 2

We can develop the same equation but based on backward (ui-1,j)


 u    2u  ( x )2
ui 1, j  ui , j    ( x )   2   ........equation b
 x i , j  x i , j 2
Differentiate equation “a” with respect to “y” gives
 u   u    2u   3u  x 2
        x   2 
    ........
 y i 1, j  y i , j  xy i , j  x y i , j 2

Now Differentiate equation “b” with respect to “y” gives


 u   u    2u   3u  x 2
        x   2 
  x y   ........
y 
 i 1, j  i , j 
y x y i , j  i , j 2
 u   u    2u    3u  x 2
  
     x   2   ................equation a
  
 i 1, j  i , j 
y y xy   x y  2
i , j  i , j

 u   u    2u   3 
 x    u  x  .............equation b
2
      
 y i 1, j  y i , j  xy i , j  x 2y 
 i , j 2

Now subtract the above equations gives


 u   u    2u 
      2  x  ........

 y i 1, j  y i 1, j  xy i , j

Rearrange the above equation


 u   u 
    
  2u   y i 1, j  y i 1, j
   ........
 xy  2x
 i , j
Using central differencing which you
learned in previous slides for the • • •
i-1, j+1 i, j+1 i+1, j+1

Δ
y
relevant nodes shown in the figure • •P •
i-1, j i, j i+1, j
 u  ui 1, j 1  ui 1, j 1
 

 i 1, j
y

2y
• • •
i-1, j-1 i, j-1 i+1, j-1

 u  ui 1, j 1  ui 1, j 1 ΔX
  

 i 1, j
y 2y

Substitute the above in this equation gives  u   u 


    
(obtained from previous slide)   2u   y i 1, j  y i 1, j
   .......
 xy  2x
 i , j
  2u  u u u u
   i 1, j 1 i 1, j 1 i 1, j 1 i 1, j 1 ........
O(truncation error)
 xy   
 i , j 4 y x
2. Node at the boundary

flow Boundary, like a wall


j=3
Δy
j=2
Δy

j=1
A question may come up, what type of differencing are we
suppose to use when we have a node at a boundary (one direction
differencing only)?

The possible answer will be to use first order forward differencing


which is first order

But we learned that first order is not accurate, so we


need to use second order
Recall from previous slides, for a specific fluid property like
“B” in the “S” direction, second order differencing is

2B Bi 1  2 Bi  Bi 1 •
S 2
 f ( Bi , S i ) 
S 2 •i i+1

But we can see that we need a point


•i-1
beyond the required “i“ point. In other
words we need a point beyond the
boundary point
flow Boundary, like a wall
j=3
Δy
j=2
Δy
But this is not possible because it’s a
boundary and there is nothing to j=1
simulate beyond the boundary
j=?
We need to use different approach by developing another technique
alternative to Taylor series. The new technique is by using
polynomial approach.

Lets assume that the variation of “u” from the wall to j=3 (distance
from wall 2Δy) is expressed as
u= a+ by+ cy2, ……..(equation 1)
differentiating gives
2)

flow Boundary, like a wall


j=3
Δy
j=2
Δy

j=1
u= a+ by+ cy2……..(equation 1)

- At j=1, y=0, substitute in equation 1 above gives u1=a………*


- At j=2, y=Δy, substitute in equation 1 above gives u2=a+b Δy+c Δy2….**
- At j=3, y=2Δy, substitute in “1” above gives u3=a+b 2Δy+c (2Δy2)……***
Solving the above equation for b gives (you need to try to solve it)

flow Boundary, like a wall


j=3
Δy
2Δy
j=2
Δy

j=1
Equation 2 at the wall (y=0) gives

Substitute into equation 3 (from previous slide)

gives
Example
Consider the viscous flow of air over a flat plate. At a given station
in the flow direction, the variation of velocity “u” in the “y”direction
is given by

u in ft/second,
L is the characteristic length 1 inch,
viscosity μ=3.7373X10-7 slug/(ft.s)
4
0.1
flow 3
0.1
2
0.1

Evaluate the shear stress 1


Evaluate the shear stress by

1. Exact solution
2. By 1st order differencing
3. By the differencing developed for boundary
y = 1 inch C. By the method developed
3. Application to fluid flow (Couette Flow)

Couette flow represents an exact analytical solution of the Navier-


Stokes equations. The solution to Couette flow leads to partial
Differential Equation.
Remember Navier-Stokes equation in the x-direction

u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 

u: velocity in x direction
w: velocity in z direction
v: velocity in y direction
Long fixed plates
N= n
y

N=1 x
Assumptions:
1. 2D (any component z direction is zero), steady (no variation with time),
incompressible (density is constant), and no body force.
2. Couette flow
• No velocity vertical component (v=0)
• No change of velocity in the x direction (change of “u” in x direction = 0)
• No pressure gradient in x and y directions

Change (u) in x Zero, 2D No pressure Change (u) in x Zero, 2D


Zero, steady direction = 0 v =0 gradient direction = 0

u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 
Change (u) in x Zero, 2D No pressure Change (u) in x Zero, 2D
Zero, steady direction = 0 v =0 gradient direction = 0
u u u u pˆ   2u  2u  2u 
  u  v  w    2  2  2 
t x y z x  x y z 

 2u  2u
 2  0,   0, then 0
y y 2

This equation will be solved numerically


between plates by using CFD techniques
N= n

j+1 y
j
j-1
N=1 x
 2u
0
y 2

Divide the distance in y direction to “n” nodes and use second order differencing
 2u u j 1  2u j  u j 1
 0
y 2
y 2

u j 1  2u j  u j 1  0
N= 10
y

N=1
Take n=10 nodes and apply the developed equation in previous slide at
each node, from j=1 to j=10. But velocity at j=1 & j=10 are known
Its a boundary condition.
At j=0, u=0
At j=10, u=0
Then we will get 8 equations. For 10 nodes, number of equations (n-2)
= 10-2=8equations
 2u u j 1  2u j  u j 1
Use second order differencing  0
y 2
y 2
which you have learned in
previous lectures u j 1  2u j  u j 1  0

Zero (boundary condition)

Node 2 u3  2u2  u1  0
Node 3 u4  2u3  u2  0
Node 4 u5  2u4  u3  0

Node 5 u6  2u5  u4  0

Node 6 u7  2u6  u5  0
Node 7 u8  2u7  u6  0
Node 8 u9  2u8  u7  0
Node 9 u10  2u9  u8  0
Zero (boundary condition)
We have 8 equations and 8 unknowns, the unknowns can be
calculated by using matrix or iterations
a. By solving Matrix
 2 1 0 0 0 0 0 0  u2  0
 1 2 1 0 0 0 0 0   u  0 
  3   
0 1 2 1 0 0 0 0  u4  0
    
 0 0 1  2 1 0 0 0  u 5    0 
0 0 0 1 2 1 0 0  u6  0
    
0 0 0 0 1 2 1 0  u7  0
0 0 0 0 0 1  2 1  u8  0
    
 0 0 0 0 0 0 1  2 u9  0

[A] [u] [C]

Using matrix inversion gives: [u]=[A]-1[C]


Can be solved by using software or computer programing
b. By using iteration
We have 8 equations and 8 unknowns, the equations obtained
can be rearranged as follows
•To get the unknown u2, u3, u4…….n, assume values
as much as the assumption is logical close to reality
u3  2u2  u1 , u1  0  u3  2u2 (it will result in less iterations).
•The assumed values are known as iteration (0).
u4  2u3  u2
•Get the values of u2, u3, u4…….n, by substituting
u5  2u4  u3 the assumed values into the equations. The result
u6  2u5  u4 will be iteration 1.
•Based on the obtained values from iteration 1,
u7  2u6  u5 repeat iteration based on assuming new values
which can reduce the difference between the
u8  2u7  u6 assumed values and calculated from equation.
u9  2u8  u7 •The iteration will be converged when you get
values between the assumed and calculated very
u10  2u9  u8 , u10  0  u8  2u9 close (maybe 10-3).
The above iterations can be done using computer programming,
Microsoft Excel, EES (Engineering equation solver) or Matlab or
other software.
There are many iteration techniques which can improve the
solution.
Solving equations by iterations is what the Solver does in any CFD
software (this is what you will see in the CFD Lab when you run
the CFD simulation of your developed model)
Simplified Example on Iteration
N= 5

4 y
Upper plate moves at
3
1m/s, and v=0 at n=1
2
N=1 x
u2 u3 u4
First guess
0.3 0.3 0.3
0.15 0.3 0.65
0.15 0.4 0.65
u3
u3  2u2  u1  0  u2  0.2 0.4 0.7
2 0.2 0.45 0.7
u4  u2
u4  2u3  u2  0  u3  0.225 0.45 0.725
2 0.225 0.475 0.725
u5  2u4  u3  0  u4  (1  u3 ) / 2 0.237 0.475 0.737
Then repeat the calculations (same procedure for first 0.237 0.487 0.737
iteration) at each iteration until you find the velocity values 0.243 0.487 0.743
are not changing, where the solution is considered as
converged and no further iteration needed. 0.243 0.49 0.743

You might also like