Вы находитесь на странице: 1из 38

Computer Aided Engineering

MCB3063 Computer Aided


Engineering (CAE)
Computational Fluid
Dynamics
May 2014 Dr. Mohammad Shakir Nasif
CFD Analysis
You have done the lab exercise and obtained results.
But the question is Are the results correct?
Anyone can get results if they play with the software, but how do we
know if the results are correct.
This is what you will learn in this week.
Probably this is one of the most important parts in learning CFD.
Maybe running the software is fun but your modelling results will be
questioned (and maybe rejected ) if you did not understand /implement
these lecture.
The elements are interconnected at points.
those points (so called nodes or nodal points) are
common to two or more elements and/or boundary lines
and/or surfaces.
The transfer of heat flux, flow,.etc between elements
occurred at the common nodes between elements.
Elements
Node
Reminder
Components of CFD
Governing partial
differential
equations (PDE)
Discritiszation
of PDEs and
the domain
(grid (nodes)
generation)
Algebraic
equations.
& Domain
described by
grids (nodes)
Algebraic
equations
solver
Solution of
Algebraic
equations
(obtain results
Analysis of
results
1. Pre processing
2. Solver
(Processing)
3. Post processing
1. Simulation time and cost saving
1. Do not do unnecessary mesh or simulation.
2. Use every option in CFD software to reduce time and cost
1.1 Do not do unnecessary mesh or simulation
First thing you will do in any CFD software is to generate the mesh.
You must mesh the region of interest (region you want to investigate). Do not mesh regions
which is not required in your analysis unless it has effect on the region of interest
Example
If you want to study the flow profile (velocity) here, then you need to mesh this region only
Air flow
Hot air
inlet
Do not mesh this region
because it has no effect on
region of interest flow
profile of
1.1 Do not do unnecessary mesh or simulation
Air flow
Hot air
inlet
You must mesh this region
because you need to study
the heat transferred from
this region due to hot air
flow in this region to region
of interest
But if you want to study the heat distribution in the flow region (region of interest) due to heat
transferred from adjacent space (mesh in blue) then you need mesh the adjacent space too.
Represent heat
transferred direction
in the figure
Using of Symmetry Boundary Condition:
It is very important in your professional career that you consider reducing the time
and cost for any project you work on without compromising the quality.
Reducing the time will make the cost lower and in any organization if the cost of
working on a project is low, it will make the service the organization offers very
competitive and profitable (many clients will approach this organization because it
does the work in a cost-effective way).
Building CFD model and running the simulation is time consuming which results
in high cost. Therefore it is very important to utilise every option in any CFD
software to reduce time.
1.2 Use every option in CFD software to reduce time and cost
Using of Symmetry Boundary Condition
It steady state heat transfer we spoke about this and we had the
following example
We can see from the above that nodes 1, 3, 5 & 7 are symmetry on both sides of nodes
2, 4, 6, and 8. Therefore we do not need to do the calculation twice, we can do it once
and multiply by two. In CFD software, there is symmetry boundary condition, which
makes the software understand that there are symmetry nodes to the other sides.
If we did not use the symmetry option, we will have to mesh all the area and this will
result in more nodes which requires longer time for the simulation to be performed
unnecessarily.
2. Grid (mesh) quality
Types of grid: There are two types of grid
1. Structures: is a grid with the same combinatorial structure
in which the cells are quadrilaterals with four sides.
2. Unstructured: its irregular grid with shapes, such as
triangles generated in an irregular pattern. The unstructured
grid has 3 sides.
Unstructured
Structured
Elements
Node
Unstructured mesh
Structured mesh
Flow
Flow
Usually structured grid has
higher accuracy than
unstructured grid.
In fluid flow, we can get
accurate solution (less
error) when we make the
flow aligned with elements
and it will only happen in
structured grid.
Obviously this will not
happen in unstructured grid
and hence the error is
higher
In addition, structured grid
calculations usually take less
time than an unstructured grid
calculation
So why we use unstructured grid?
There are certain configurations that cannot be meshed by using
structured grid, hence unstructured grid is used.
What you have used in lab exercise is structured grid.
However, most CFD software including ANSYS (the one you used)
has the option of using unstructured grid.
If we want to mesh a dinosaur surely we have to use
unstructured mesh
One of the few CFD software that only use structured grid is
Fire Dynamics Simulator software (FDS) which you will
learn how to use it in the lab FDS always use structured
grid.
If the model has curved shaped surface it will still use
structured grid although it didnt give the exact shape of
curve
is defined as the ratio of the longest dimension
to the shortest dimension of a quadrilateral element.
as the aspect ratio increases, the inaccuracy
of the solution increases.
Large aspect ratio moderate aspect ratio good aspect ratio
Cause of Error in Modelling Due to Mesh Quality
1. Aspect Ratio
2. Grid (mesh) quality
Aspect Ratio, (AR) = longest dimension/shortest dimension
exact solution
P
e
r
c
e
n
t

o
f

a
c
c
u
r
a
c
y

i
n

d
i
s
p
l
a
c
e
m
e
n
t
results
2 4 6 8 10 12 14 16 18 20 22 24 26 28 30
AR
1. Aspect Ratio
2. Grid (mesh) quality
2. Element shape
An element yields best results if its shape is
compact and regular (structured mesh).
Elements with poor shapes tend to yield
poor results.
in general, try to:
1. Maintain aspect ratio as low as
possible (below 5)
2. Aspect ratio 5 and above causes
error.
2. Grid (mesh) quality
Cause of Error in Modelling Due to Mesh Quality

0.025m
Example Problem for a concrete wall
kW/m
2
At= 1 s
o= 1.42E-07 m2/s k= 0.1 W/m C
Ax= 0.004167 Fo= 0.008184
Time 0.000 0.004 0.008 0.013 0.017 0.021 0.025
(s) Node #0 Node #1 Node #2 Node #3 Node #4 Node #5 Node #6
Fo=kt/Cp(x)
2
=t/(x)
2
=0.0081
Example on Aspect Ratio error
2mm
2 20.5 20.0273 20.0002 20.0000 20.0000 20.0000 19.9999 19.9864 19.5
3 20.5 20.0334 20.0006 20.0000 20.0000 20.0000 19.9997 19.9798 19.5
2 20.5 14.9908 24.6643 20.0000 20.0000 20.0000 17.6678 22.5046 19.5
3 20.5 47.7811 -6.3013 30.0736 20.0000 14.9632 33.1506 5.5695 19.5
Cp 1380 rouh 510
q= kW/m
2
At= 1 s h=
o= 1.35E-07 m2/s k= 0.095 W/m C Bi= 1.60E-07
Ax= 0.00025 Fo= 2.159704 Too=
Time 0.000 0.00025 0.00050 0.00075 0.00100 0.00125 0.00150 0.00175 0.002
Time (s) Node #0 Node #1 Node #2 Node #3 Node #4 (Mohammad) Node #5 Node #6 Node #7 Node #8
0.025m thick concrete wall
Now lets use 0.002m thick concrete wall
Solution unstable (some
negative values and other
unrealistic temperature)
0.01 0.01
0.01 0.01
Aspect ratio
0.01/0.0041=2.4
which is ok (below 5)
Aspect ratio
0.01/0.00025=40
Which is not ok (above 5)
Resulted in unstable
solution with errors
We have
6 nodes in
2mm
thick wall
We have 6 nodes in
0.025m thick wall
x
So what are we suppose to do if we have thin long wall?
CFD software has boundary condition which is called thin wall.
You can define the thin long wall you have as thin wall boundary
condition
When you select thin wall boundary, CFD software will consider that
the temperature at both sides of the wall are the same.
This is acceptable if you recall what you learned in heat transfer that if
thin wall (x is very small), the conduction heat transfer resistance will
be small and therefore the temperature on both sides of the wall will be
approximately the same.
In thin wall boundary condition you do not need to generate mesh
(nodes) inside the thin wall because the software will not do any
simulation inside the wall, it will only take the temperature on both side
of the wall as same temperature
Very large and very
small corner angles
Triangular quadrilateral
With Large and small angles
Examples of elements with poor shape
2. Element shape (Skewness)
|
|
.
|

\
|

|
|
.
|

\
|

=
equal
equal
equal
equal
or Skewness
u
u u
u
u u
min max
180
max
Where
min
is the minimum angle in the above cells,
max
is the maximum angle in the cells.

equal
is the angle between any two edges of an ideal equilateral cell with the same number of
edges. For triangular cell
equal
=60, and for quadrilateral
equal
=90.
Generally 0< Skewness<1, where 0 is the best and 1 is the worst, rule of thumb keep Skewness
below 0.7.
Cause of Error in Modelling Due to Mesh Quality
2. Grid (mesh) quality
2. Element shape (Skewness)
Generally 0< Skewness<1, where 0 is the best and 1 is the worst,
rule of thumb keep Skewness below 0.7.
High Skewness (above 0.7 causes error in the solution)
3. Mesh sensitivity study (mesh independent solution)
It is known that using finer mesh will give more accurate results,
coarse mesh will not give accurate results.
Lets see how increasing the number of nodes
gives more accurate results


0.02
0.02


0.01

0.01 0.01 0.01
With 0.02 distance between nodes
we get 3 nodes
Reducing the distance between nodes
resulted in increasing the number of
nodes to 5
Now lets implement this on a previous example and see what effect
decreasing the distance between nodes (i.e. increasing the number of
nodes) has on solution accuracy
Lets look at previous example
9511 . 0 ) 2 . 0 ( 2 sin ) 2 . 0 ( ) 22 . 0 (
) ( ) (
= = ~
=
A +
t f f
f f
x x x
( ) | | 9899 . 0 ) 02 . 0 ( 2 . 0 2 cos 2 ) 2 . 0 ( ) 22 . 0 (
) ( ) (
= + ~
A
|
.
|

\
|
c
c
+ ~
A +
t t f f
x
x
fx
f f
x x x
........
6 2
3
3
3 2
2
2
) ( ) (
+
A
|
|
.
|

\
|
c
c
+
A
|
|
.
|

\
|
c
c
+ A
|
.
|

\
|
c
c
+ =
A +
x
x
fx x
x
fx
x
x
fx
f f
x x x
1
3
4
2
5

f(x)
x
x
x+x x=0.02
( ) | | ( ) | |
9824 . 0 0075 . 0 0388 . 0 9511 . 0
2
02 . 0
2 . 0 2 sin 4 ) 02 . 0 ( 2 . 0 2 cos 2 ) 2 . 0 ( ) 22 . 0 (
2
2
2
2
2
2
) ( ) (
= + ~
+ ~
A
|
|
.
|

\
|
c
c
+ A
|
.
|

\
|
c
c
+ =
A +
t t t t f f
x
x
fx
x
x
fx
f f
x x x
If f(x)=sin 2x, x=0.2 and x=0.02
At x=0.2, f(x)=sin20.2=0.9511
x+x=0.2+0.02=0.22, f(x)=sin20.22=0.9823
1. If we take the first term only
This correspond to point 3,
error [(0.9823-0.9511)/0.9823]X100= 3.17%
2. If we take the first two terms
Exact solution
3. If we take the first three terms
This correspond to point 4, error 0.775% (better)
This correspond to point 5, error 0.01% much better
1
3
4
2
5

x
x+x x=0.02
f(x)
1
3
4
2
5

x
x+x x=0.02
Now lets take the same example and use closer
node (more nodes) x=0.01 instead of 0.02
9511 . 0 ) 2 . 0 ( 2 sin ) 2 . 0 ( ) 22 . 0 (
) ( ) (
= = ~
=
A +
t f f
f f
x x x
( ) | | 9705 . 0 ) 01 . 0 ( 2 . 0 2 cos 2 ) 2 . 0 ( ) 22 . 0 (
) ( ) (
= + ~
A
|
.
|

\
|
c
c
+ ~
A +
t t f f
x
x
fx
f f
x x x
........
6 2
3
3
3 2
2
2
) ( ) (
+
A
|
|
.
|

\
|
c
c
+
A
|
|
.
|

\
|
c
c
+ A
|
.
|

\
|
c
c
+ =
A +
x
x
fx x
x
fx
x
x
fx
f f
x x x
1
3
4
2
5

f(x)
x
x
x+x x=0.01
( ) | | ( ) | |
96853 . 0 00187 . 0 0194 . 0 9511 . 0
2
01 . 0
2 . 0 2 sin 4 ) 01 . 0 ( 2 . 0 2 cos 2 ) 2 . 0 ( ) 22 . 0 (
2
2
2
2
2
2
) ( ) (
= + ~
+ ~
A
|
|
.
|

\
|
c
c
+ A
|
.
|

\
|
c
c
+ =
A +
t t t t f f
x
x
fx
x
x
fx
f f
x x x
If f(x)=sin 2x, x=0.2 and x=0.01
At x=0.2, f(x)=sin20.2=0.9511
x+x=0.2+0.01=0.21, f(x)=sin20.21=0.9685
1. If we take the first term only
This correspond to point 3,
error [(0.9685-0.9511)/0.9823]X100= 1.8%
2. If we take the first two terms
Exact solution
3. If we take the first three terms
This correspond to point 4, error 0.2%
This correspond to point 5, error 0.003%
Error % if Error % if
If we take case 1
in previous slide
3.176 1.8%
If we take case 2
in previous slide
0.775 0.2%
If we take case 3
in previous slide
0.01
0.003%
f(x)
1
3
4
2
5

x
x+x
x=0.02
x=0.01
x=0.02
x=0.01
Reducing the distance
between nodes (from 0.02
to 0.01) will obviously
result in increasing the
number of nodes in any
model.


0.02
0.02


0.01

0.01 0.01 0.01
From previous example we can conclude that increasing the
number of nodes will provide better accuracy in the solution
(less error)
So how fine the mesh we suppose to use? taking into
consideration that the finer the mesh, the longer the simulation
will take. Longer simulation results in increasing the cost.
This is what you have learned in the lab when you used coarse
mesh the simulation runs very fast
CFD solutions to fluid dynamics and heat transfer problems always
contain errors due to the evaluation of continuous problems using
discrete analysis. In general, these errors can be minimised by
discretising the flow domain into a large number of mesh points
(cells).
In practice, there is a trade off between the accuracy of the solution
and the computing time; hence an optimum number of grid points
have to be used for the simulation domain.
Mesh sensitivity (refinement) investigation has been carried out to
optimise the number of cells used. It is apparent that the more cells
used in the model the more time consumed to complete the
simulation.
So how we can carry out mesh sensitivity study?
1. First start with coarse mesh and run the simulation and record the results
2. Then increase the number of mesh (nodes or cells) and run the simulation and
record the results again.
3. If the recorded results are different than the one in item 1 above, then increase the
number of mesh further and record the result again.
4. Continue doing this (increasing the number of mesh) until you realise that
increasing the number of mesh will not cause any change in the recorded results
5. When you reach this stage means you have reach Mesh I ndependent Solution
which means any increase in the number of mesh will not cause any change in the
results and hence there is NO point in increasing the mesh further.
Example on mesh sensitivity (refinement) investigation
Three types of mesh used in this study. It
can be seen that mesh 1 is the coarse
mesh. In mesh 2 the number of nodes
increased. Mesh 3 has the highest number
of nodes
It can be seen from the figure that the HRR in mesh
1 is different than mesh 2. But when the mesh
increased to 3, the recorded HRR was almost the
same as in mesh 2.
Hence we can use mesh 2 in the simulation because
although mesh 3 has higher number of nodes
however it will make the simulation runs longer
and the results will be the same as in mesh 2.
There is NO point in using mesh 3, hence mesh 2
can do the simulation with same accuracy as 3 but
with shorter time than 3.
This means that in mesh 2 we reached the mesh
independent status in the solution where
increasing the number of mesh further will not
change the results.
Mesh (grid or nodes):Things to remember
Remember to check aspect ration (must be below 5)
Check Skewness (must be below 0.7)
After completing the mesh use the software to check mesh for you, it
is available in ANSYS and other CFD software.
Perform mesh sensitivity (refinement) investigation.
Roughly: If you have 1 million elements (mesh), you need 1GB RAM
allocated in your computer to run the simulation
Meshing Quality
Practical considerations in the meshing can lead to
better accuracy of results and efficient computation.
Aspect ratio
Element shape
Mesh refinement
4. Analysing CFD results against engineering principles
As we have mentioned in previous slides that anyone with some knowledge in
using CFD software can get results.
But the question is Are the results correct?
In CFD, obtaining results do not mean that the results are correct and can be
used.
The first thing needs to be done is to validate the CFD model against experiment
and the CFD results should be in agreement with measurement. If this is done,
this means that the model is correct and can be used for future development
without the need to do another experimental work.
For example you can model a heat exchanger, but first you need to model a heat
exchanger with similar configurations and conditions to a heat exchanger that
has been tested in the lab. You can key-in the boundary conditions that is
measured in the lab, then run the simulation and if you get the outlet
temperatures in agreement with the lab measurement then you can say that your
CFD model has been validated against experiment.
You can also validate your CFD model against another CFD model which has been validated
against experiment.
However, validation is not the final decider whether your CFD model is correct or not. You
need to analyse your CFD results by using basic engineering principles.
For example, we expect that there will be flow recirculation in a duct with a step as follows:
If you did not get this in your model, it means your modelling is wrong!!
Another example, if you model heat exchanger and your modelling results shows that the hot
stream temperature is increasing NOT decreasing then you need to know that your modelling
is wrong.
The above are very simple examples, you can look at the simulation results and analyse it
carefully by using engineering principles before saying that your simulation is correct
5. Selecting & defining the correct conditions
You must make sure that you are defining/selecting the correct boundary
conditions:
1. Check if the flow is laminar or turbulent & choose the right
turbulence modelling.
2. Check if you have defined the boundary conditions correctly
Is the selected fluid air or water.
Symmetry boundary is correctly selected.
Wall boundary correctly selected.
Inlet and outlet boundary are correctly selected and defined.
Does the software solve the right equations for your model
And many more things to consider
Whatever we have mentioned in previous slides is called
Validation & Verification of the CFD model.
Validation & Verification must be done in every modelling
work to make sure that the results are correct.
Validation:
Validation against experiment.
Are the boundary condition appropriate
and correct.
Did you choose the right solver?
Did you validate your results against
correct experimental and/or other
modelling work?
Did you analyse your modelling results
against engineering principles and does
it make sense.
Verification:
Did you perform mesh sensitivity study and
achieved mesh independent solution?
Did you check Grid quality (such as aspect
ration, Skewness, unstructured mesh correctly
developed and usedetc)?
Did you achieve the correct iteration
convergence (selected acceptable error in your
iteration?
Did you choose correct time step?
Did you select correctly whether your solution
is Implicit or Explicit?
Validation & Verification

Вам также может понравиться