Professional Documents
Culture Documents
ME 448/548 Notes Gerald Recktenwald Portland State University Department of Mechanical Engineering gerry@me.pdx.edu February 9, 2012
ME 448/548 SIMPLE
Overview
CFD modelling involves these steps 1. Dene the geometry of the uid volume 2. Locate boundary regions and assign values to boundary condition parameters 3. Specify uid physics (e.g., buoyancy, turbulence, radiation) and thermophysical properties 4. Create the mesh 5. Dene parameters that control the solution 6. Solve the ow model 7. View the results Commercial CFD packages have preprocessors that help with setting up the model and viewing the results. The order of preprocessing steps may be dierent for dierent CFD packages. Step 6 is usually performed without direct user intervention. The user controls the solution and views the results after the solution has been obtained.
ME 448/548 SIMPLE page 1
Staggered Mesh Basic Discretization Velocity and Pressure Corrections Algorithm Summary Convergence
The staggered mesh is not absolutely required, but it is the simplest strategy for incompressible ow calculations. Many codes use non-staggered or unstructured meshes. We only use a staggered mesh here to explain pressure-velocity coupling. Reference: Ferziger and Peri, ,7.5.1, pp. 188196 c Tu, Yeoh, and Liu, 4.3.3
ME 448/548 SIMPLE
page 2
y
... Ly 3 2 j=1 i=1 x 3 ...
nx
Each cell has the same number of neighbors. The connectivity is regular and uniform.
ME 448/548 SIMPLE page 3
Unstructured Meshes: Cells and nodes are not arranged in rows and columns.
ME 448/548 SIMPLE
page 4
ME 448/548 SIMPLE
page 5
Staggered Grid
Main control volume
Elementary CFD codes use staggered mesh Velocities are computed at cell faces Pressure is computed at cell centers
N n W uw P s S ue E W
N P s S E
ME 448/548 SIMPLE
page 6
aS ui,j1 aW ui1,j + aP ui,j aE ui+1,j aN ui,j+1 = aS vi,j1 aW vi1,j + aP vi,j aE vi+1,j aN vi,j+1 ui+1,j ui,j vi,j+1 vi,j + =0 x y
v v v v v
where b(u) and b(v) are source terms due to non-uniform viscosity, gravity, and other o o eects. These equations are nonlinear. For example, if the central dierence scheme is used,
u bo
bu o
u=b
(u) (v)
(v)
v=b
where the momentum source terms consist of pressure terms and other terms due to velocity gradients and non-uniform viscosity.
(u) (v)
= bo bp = bo bp
(v)
(u)
(u)
(v)
b(u) and b(v) are contributions due to the frozen pressure eld (p). p p
ME 448/548 SIMPLE page 9
A(u) is the coecient matrix, and b(u) is the source term (vector) for the u equation when v and p are frozen. A(v) is the coecient matrix, and b(v) is the source term (vector) for the v equation when u and p are frozen. Momentum equations are nonlinear, so A(u) and A(v) depend on u and v . Nonlinearity requires iterative solution: A(u) and A(v) are updated with new values of u and v , and the systems are solved again.
What about the continuity equation? Where is the equation for pressure?
ME 448/548 SIMPLE page 10
(u)
u=b
(u)
where where
(u)
= bP + bo
(v)
(u)
(u)
du(pW pP ) + . . . + bo dv (pS pP ) + . . . + bo
(u)
(v)
v=b
(v)
(v)
= bP + bo
(v)
(v)
The du and dv are coecients that depend on the geometry of of the control volume. Note: The symbol is meant to convey the basic features of the terms, and allows a degree of notational abuse. To make these expressions more precise, read the symbol as contains terms like.
Pressure does not have its own natural equation for incompressible ow.
ME 448/548 SIMPLE
page 11
(u)
u=b v=b
(u) (v)
(v)
In general these new u and v elds will not satisfy the continuity equation for each cell
ME 448/548 SIMPLE
page 12
uw = uw + uw vs = vs + vs uw and vs are the velocity components that satisfy the continuity equation. uw and vs are the velocity components obtained by satisfying the momentum equations. uw and vs are the corrections to the velocity components needed to satisfy the continuity equation.
(1) (2)
Equations (1) and (2) dene uw , and vs values for each cell in the domain. The uw and vs elds are obtained by solving the momentum equations. We need to develop another procedure for computing the uw and vs elds. Ultimately the uw and vs elds are obtained by requiring each cell to satisfy the continuity equation.
ME 448/548 SIMPLE page 13
Assume that the velocity corrections can be derived from suitable pressure corrections
pP = pP + pP
(3)
pP is the desired pressure at the cell center, i.e., the one that brings the velocity eld into balance so that continuity equation is satised for each cell. pP is the current guess at the pressure at the cell center. pP is the change in pP needed to satisfy the continuity equation.
ME 448/548 SIMPLE
page 14
uw cw (pW pP ) vs cs(pS pP )
where cw and cs are coecients that depend on terms from the momentum equation (weve skipped a couple of steps here).
(4) (5)
ME 448/548 SIMPLE
page 15
A
where
(p )
p =b
(p )
(p )
In words: The source term for the p eld is the local error in the continuity equation.
ME 448/548 SIMPLE
page 16
(u)
u=b
(u)
(v)
v=b
(v)
( )
A
Momentum and pressure corrections
(p )
p =b
(p )
u=u+u
v =v+v
p=p+p
u and v are the solutions to Equations ( ) obtained when the previous eld variables (u, v , and p) are used to compute A(u), b(u), A(v) and b(v). p is the pressure eld from the previous global iteration. p is the solution to Equation ( and v .
ME 448/548 SIMPLE
page 17
SIMPLE Algorithm
Initialize the velocity and pressure elds, then iterate until convergence: 1. Compute A(u) and b(u), and solve A(u)u = b(u) to obtain u, a tentative guess at the x-direction velocity eld. 2. Compute A(v) and b(v), and solve A(v)v = b(v) to obtain v , a tentative guess at the (v) (v) y -direction velocity eld. Note that A and b use the most recently available u eld, and the v eld from the previous iteration 3. Compute A(p ) and b(p ), and solve A(p )p = b(p ) to obtain the pressure correction eld p . 4. Correct the velocities and pressures.
pP pP + pP
uw uw + uw
v s vs + vs
5. Test for convergence, and return to Step 1 if not converged. The SIMPLE algorithm is described by Patankar [2] and Ferzier and Peri [1, 7.5.1], and c Yao et al., 4.3.3.
ME 448/548 SIMPLE page 18
A
compute the residual
(u)
u=b
(u)
r =b A u If r (u) is small, then the old u is a good approximation to the system of equations dened by the newly updated coecients in A(u) and b(u).
Similarly,
(v) (v) (v)
(u)
r =b A v is a measure of how well the old v satises the linearized equations based on the newly updated coecients in A(v) and b(v)
ME 448/548 SIMPLE
page 19
ru ru,ref
v =
rv rv,ref
and rv,ref
ME 448/548 SIMPLE
page 20
c =
Recall that x
b(p ) b(p )
,ref
ME 448/548 SIMPLE
page 21
Monitoring Residuals
Convergence history for one case of the Tesla valve analysis:
Residuals 1
0.1
1E4
1E5 0
100
200 Iteration
300
400
500
ME 448/548 SIMPLE
page 22
Summary
SIMPLE is a segregated solution method: The u, v , w, and p elds are solved separately. Coupling between these eld variables is achieved via velocity and pressure corrections. Convergence occurs when the residuals for each of the equations is reduced to a value below a tolerance. The residuals are normalized scalars. The normalization is chosen so that 1 on the rst iteration. c is the largest local (cell-wise) error in the continuity equation before the pressure-based corrections to the velocity elds are applied. After the velocity eld is corrected, local mass conservation is obtained for all cells. Thus, at the end of each iteration of SIMPLE, both global and local mass conservation is guaranteed. In version 6.06 of StarCCM+, the default stopping criterion is to run the simulation for 1000 outer iterations. Turning on convergence checking requires user action.
ME 448/548 SIMPLE
page 23
To add a convergence criterion in Star-CCM+ 1. Right click on Stopping Criteria 2. Select Create from Monitor and select one of the eld variables. I recommend using Continuity as a baseline convergence constraint. For harder problems, one of the turbulence eld variables or temperature might also be used as a convergence contraint.
ME 448/548 SIMPLE
page 24
Recommendations
Always inspect the residual plot after each run. If the residual tolerances have not been met, restart the solution, using the last iteration as a starting point. (Dont start from scratch.) For some hard problems, other adjustments to the solution parameters might be necessary in order obtain convergence.
References
[1] Joel H. Ferziger and Milovan Peri. Computational Methods for Fluid Dynamics. Springer-Verlag, Berlin, third edition, 2001. c [2] S.V. Patankar. Numerical Heat Transfer and Fluid Flow. Hemisphere, Washington D.C., 1980.
ME 448/548 SIMPLE
page 25