Advanced workshop on Computational Fluid Dynamics
Discretization
Schemes
Dr.D.PrakashSenior Assistant Professor, School of Mechanical Engineering, SASTRA university
Discretization
- Domain is discretized into a finite set of control volumes or cells. The discretized domain is called the “grid” or the “mesh.”
- General conservation (transport) equations for mass, momentum, energy, etc., are discretized into algebraic equations.
- All equations are solved to render flow field.
Not convenient to solve problem with complex geometry
Mathematical sense FDM rely on expansion of a function in Taylor’s series.Requirement of discretization Conservativeness Boundedness Tran sportiveness
Advanced workshop on Computational Fluid Dynamics FEA Relatively more complicated than FDM Have strong mathematical sense- Principle of error minimization Principle Minimization of function is the minimization of potential energy
Eg- Structural problem: Structure at equilibrium tends to minimization
of potential energy. But the governing principles of a fluid flow , heat transfer and mass transfer is the conservation of mass momentum , energy.Does not the carry the sense of conservativeness explicitly However it can handle more complex geometries.
Advanced workshop on Computational
Fluid Dynamics Governing differential equation:
- = 0
Centroid Boundary grid point
x Step 1: Divide into no of subdomains 1 2 3 4 5 6
Isolate any control volume from the domain In addition to 3 centroid, two grind point at the boundaries should be considered. e E
W w P
Step 2: Integrate the GDE for each control volume xw xe
Faces of the control volume
- – e = 0
- and w Main grind points- Upper case letter
- −
Advanced workshop on Computational Fluid Dynamics Step 3: Convert to algebraic equation using profile variation function Assume the variation of T wrt x
(1) Simple assumption as piece wise linear (Constant)
w P e W E
(2) Non constant linear
w P e W E
Advanced workshop on Computational
Fluid Dynamics- = 0 − = +
- = 0
Advanced workshop on Computational Fluid Dynamics W P E w e
(3) Piece wise linear between control grids −
− −
W P E w e
(4) Higher order interpolation function
W W E E Typical control volume
- The net flux through the control volume boundary is the sum of integrals over the four control volume faces (six in 3D). The control volumes do not overlap.
- The value of the integrand is not available at the control volume faces and is determined by interpolation.
x
N NE NW
y
n n
P E W
e
wy
s
y
s j,y,v
S SW SE i,x,u
x x
w e
8 Discretization example
- To illustrate how the conservation equations used in CFD can be discretized
- The continuity equation is given by:
- (1)
Introduce control volume integral- Gauss divergence theorem (2)
(3)
9 Discretization example - continued The face velocity are located midway between each of the control volume centroid.
The face velocities are determined from the values located at the centroids
(4) Substituting the equation 4 in equation 2, 3 and in continuity equation
(5)
10 Discretization example - continued
(6) (7) (8)
11 Discretization (Interpolation Methods)
• Field variables (stored at cell centers) must be interpolated to the faces of
the control volumes in the FVM:- FLUENT offers a number of interpolation schemes:
- – First-Order Upwind Scheme • easiest to converge, only first order accurate.
- – Power Law Scheme
- more accurate than first-order for flows when Re
cell < 5 (typ. low Re flows).
- – Second-Order Upwind Scheme
- uses larger ‘stencil’ for 2nd order accuracy, essential with tri/tet mesh or when flow is not aligned with grid; slower convergence
- – Quadratic Upwind Interpolation (QUICK)
- applies to quad/hex and hyrbid meshes (not applied to tri’s), useful
- This is the simplest numerical
interpolated scheme.
(x) value
at the
- Assume that the value of
upstream of the face is the same as
e P
the cell centered value in the cell
E
- The main advantages are that it is easy to implement and that it
e E P
results in very stable calculations, but it also very diffusive. Gradients in the flow field tend to be smeared out
Flow direction
- This is often the best scheme to start calculations
13 Central differencing scheme
- This scheme determines the value
interpolated
of at the face by linear
(x) value
interpolation between the cell centered values.
P
- This is more accurate than the first
e
order upwind scheme, but it leads
E
to oscillations in the solution or
e E P
divergence if the local Peclet number is larger than 2.
- It is common to then switch to first order upwind in cells where Pe>2. Such an approach is called a hybrid scheme.
uL
Pe
D
14 Power law scheme
- This is based on the analytical solution of the one-dimensional convection-diffusion equation.
interpolated (x) value
- The face value is determined from
P
an exponential profile through the cell values. The exponential profile
e
is approximated by the following
E
power law equation:
e E 5 P
Pe 1 .
1
x
e P E P
Pe • Pe is again the Peclet number.
L
- For Pe>10, diffusion is ignored and first order upwind is used.
15 Second-order upwind scheme
from
- We determine the value of the cell values in the two cells upstream of the face.
- This is more accurate than the first order upwind scheme, but in
regions with strong gradients it can W
interpolated (x)
result in face values that are outside
value of the range of cell values. It is then
P necessary to apply limiters to the predicted face values.
e
E
- There are many different ways to
e
implement this, but second-order
P E W
upwind with limiters is one of the more popular numerical schemes because of its combination of accuracy and stability.
Flow direction
16 QUICK scheme
- QUICK stands for Quadratic Upwind Interpolation for Convective Kinetics.
- A quadratic curve is fitted through
W
two upstream nodes and one
interpolated (x) value downstream node.
P
- This is a very accurate scheme, but in regions with strong gradients,
e
E overshoots and undershoots can
occur. This can lead to stability
e P E W problems in the calculation.
Flow direction
17 Accuracy of numerical schemes
- Each of the previously discussed numerical schemes assumes some shape of the function . These functions can be approximated by Taylor series
polynomials: n
x x x
' ( ) '' ( ) ( ) n P P
2 P x x x x x x x x
( ) ( ) ( ) ( ) .... ( ) ...
e P e P e P e P n1 ! 2 ! !
- The first order upwind scheme only uses the constant and ignores the first derivative and consecutive terms. This scheme is therefore considered first order accurate.
- For high Peclet numbers the power law scheme reduces to the first order upwind scheme, so it is also considered first order accurate.
- The central differencing scheme and second order upwind scheme do include the first order derivative, but ignore the second order derivative. These schemes are therefore considered second order accurate. QUICK does take the second order derivative into account, but ignores the third order derivative. This is then considered third order accurate.
18
- Higher order schemes will be more accurate. They will also be less stable and will increase computational time.
- It is recommended to always start calculations with first order upwind and after 100 iterations or so to switch over to second order upwind.
- This provides a good combination of stability and accuracy.
- The central differencing scheme should only be used for transient
calculations involving the large eddy simulation (LES) turbulence
models in combination with grids that are fine enough that the Peclet number is always less than one.
19 Solution accuracy
Finite volume solution methods
• The finite volume solution method can either use a “segregated”
or a “coupled” solution procedure.- With segregated methods an equation for a certain variable is solved for all cells, then the equation for the next variable is solved for all cells, etc.
• With coupled methods, for a given cell equations for all variables
are solved, and that process is then repeated for all cells.- The segregated solution method is the default method in most commercial finite volume codes. It is best suited for incompressible flows or compressible flows at low Mach number.
- Compressible flows at high Mach number, especially when they involve shock waves, are best solved with the coupled solver.
20
Advanced workshop on Computational Fluid Dynamics consistency stability convergence
Discretized equation is a good replica of PDE Check the Discretized equation is having a property of amplifying errors or errors get suppressed Confirm that the computed solution is how much close to the exact solution of PDE Advanced workshop on Computational Fluid Dynamics
Advanced workshop on Computational Fluid Dynamics consistency nce nde stability epe check nd d i Gri convergence
Advanced workshop on Computational Fluid Dynamics