Nabla Logo programmer
  Advanced Search
  
  Send us a comment/query
 
  Back to main web site
 
  OpenFOAM guides
  - User guide
  - Programmer’s guide
 
  Index
 
  Changes from OpenFOAM 2.2 to 2.3
 
  Trademarks in the guides
  ©2000-2007 Nabla Ltd.

3.2 Steady turbulent flow over a backward-facing step

In this example we shall investigate steady turbulent flow over a backward-facing step. The problem description is taken from one used by Pitz and Daily in an experimental investigation [**] against which the computed solution can be compared. This example introduces the following OpenFOAM features for the first time:

  • generation of a mesh using blockMesh using full mesh grading capability;
  • steady turbulent flow.

3.2.1 Problem specification

The problem is defined as follows:

Solution domain
The domain is 2 dimensional, consisting of a short inlet, a backward-facing step and converging nozzle at outlet as shown in Figure 3.4.
     Inlet: Ux = 10.0 m/s                                      Outlet: p = 0 Pa


           y
50.8                                                                             33.2
              x



      20.6                       206.0                               84.0

                                                          Dimensions--in-mm---
\special {t4ht=

Figure 3.4: Geometry of backward-facing step


Governing equations
 
  • Mass continuity for incompressible flow
     \~/  •U = 0
           \special {t4ht=
    (3.4)

  • Steady flow momentum equation
     \~/  • (UU) +  \~/  •R = -  \~/ p
           \special {t4ht=
    (3.5)

    where p  \special {t4ht= is kinematic pressure and (in slightly over-simplistic terms) R =  neff \~/ U  \special {t4ht= is the viscous stress term with an effective kinematic viscosity neff  \special {t4ht=, calculated from selected transport and turbulence models.

Initial conditions
U  = 0 m/s  \special {t4ht=, p = 0 Pa  \special {t4ht= -- required in OpenFOAM input files but not necessary for the solution since the problem is steady-state.
Boundary conditions
 
  • Inlet (left) with fixed velocity U  = (10, 0,0)  \special {t4ht= m/s;
  • Outlet (right) with fixed pressure p = 0 Pa  \special {t4ht=;
  • No-slip walls on other boundaries.
Transport properties
 
  • Kinematic viscosity of air                     -6                 2
n = m/r =  18.1× 10   /1.293 = 14.0 mm  /s  \special {t4ht=
Turbulence model
 
  • Standard k -  e  \special {t4ht=;
  • Coefficients: Cm = 0.09;C1  = 1.44;C2 = 1.92;ak =  1;ae = 0.76923  \special {t4ht=.
Solver name
simpleFoam: an implementation for steady incompressible flow.
Case name
pitzDaily, located in the $OpenFOAM_TUTORIALS/simpleFoam directory.

The problem is solved using simpleFoam, so-called as it is an implementation for steady flow using the SIMPLE algorithm [**]. The solver has full access to all the turbulence models in the incompressibleTurbulenceModels library and the non-Newtonian models incompressibleTransportModels library of the standard OpenFOAM release.

3.2.2 Mesh generation

We expect that the flow in this problem is reasonably complex and an optimum solution will require grading of the mesh. In general, the regions of highest shear are particularly critical, requiring a finer mesh than in the regions of low shear. We can anticipate where high shear will occur by considering what the solution might be in advance of any calculation. At the inlet we have strong uniform flow in the x  \special {t4ht= direction and, as it passes over the step, it generates shear on the fluid below, generating a vortex in the bottom half of the domain. The regions of high shear will therefore be close to the centreline of the domain and close to the walls.

The domain is subdivided into 12 blocks as shown in Figure 3.5.


                                      upperWall
                9                           15
      3
           2                             7   14        12
inlet 2           8                                                      21
           1                             6   13        11                20
                  7                                                      19
      1                                                                     10 outlet
      0  0  5  6                         4   12        9                 1178
               5
                                         3   11        8
                                                                         16
               4
                                            10
                                      lowerWall
\special {t4ht=


Figure 3.5: Blocks in backward-facing step


The mesh is 3 dimensional, as always in OpenFOAM, so in Figure 3.5 we are viewing the back plane along z = - 0.5  \special {t4ht=. The full set of vertices and blocks are given in the mesh description file below:


1  // The OpenFOAM Project // File: blockMeshDict
2  /*
3  -------------------------------------------------------------------------------
4   =========         | dictionary
5   \\      /         |
6    \\    /          | Name:   blockMeshDict
7     \\  /           | Family: FoamX configuration file
8      \\/            |
9      F ield         | OpenFOAM version: 2.3
10      O peration     | Product of Nabla Ltd.
11      A and          |
12      M anipulation  | Email: Enquiries@Nabla.co.uk
13  -------------------------------------------------------------------------------
14  */
15  // FoamX Case Dictionary.
16  
17  FoamFile
18  {
19      version         2.0;
20      format          ascii;
21  
22      root            "";
23      case            "";
24      instance        "";
25      local           "";
26  
27      class           dictionary;
28      object          blockMeshDict;
29  }
30  
31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  convertToMeters 0.001;
34  
35  vertices
36  (
37      (-20.6 0 -0.5)
38      (-20.6 3 -0.5)
39      (-20.6 12.7 -0.5)
40      (-20.6 25.4 -0.5)
41      (0 -25.4 -0.5)
42      (0 -5 -0.5)
43      (0 0 -0.5)
44      (0 3 -0.5)
45      (0 12.7 -0.5)
46      (0 25.4 -0.5)
47      (206 -25.4 -0.5)
48      (206 -8.5 -0.5)
49      (206 0 -0.5)
50      (206 6.5 -0.5)
51      (206 17 -0.5)
52      (206 25.4 -0.5)
53      (290 -16.6 -0.5)
54      (290 -6.3 -0.5)
55      (290 0 -0.5)
56      (290 4.5 -0.5)
57      (290 11 -0.5)
58      (290 16.6 -0.5)
59      (-20.6 0 0.5)
60      (-20.6 3 0.5)
61      (-20.6 12.7 0.5)
62      (-20.6 25.4 0.5)
63      (0 -25.4 0.5)
64      (0 -5 0.5)
65      (0 0 0.5)
66      (0 3 0.5)
67      (0 12.7 0.5)
68      (0 25.4 0.5)
69      (206 -25.4 0.5)
70      (206 -8.5 0.5)
71      (206 0 0.5)
72      (206 6.5 0.5)
73      (206 17 0.5)
74      (206 25.4 0.5)
75      (290 -16.6 0.5)
76      (290 -6.3 0.5)
77      (290 0 0.5)
78      (290 4.5 0.5)
79      (290 11 0.5)
80      (290 16.6 0.5)
81  );
82  
83  blocks
84  (
85      hex (0 6 7 1 22 28 29 23) (18 7 1) simpleGrading (0.5 1.8 1)
86      hex (1 7 8 2 23 29 30 24) (18 10 1) simpleGrading (0.5 4 1)
87      hex (2 8 9 3 24 30 31 25) (18 13 1) simpleGrading (0.5 0.25 1)
88      hex (4 10 11 5 26 32 33 27) (180 18 1) simpleGrading (4 1 1)
89      hex (5 11 12 6 27 33 34 28) (180 9 1) edgeGrading (4 4 4 4 0.5 1 1 0.5 1 1 1 1)
90      hex (6 12 13 7 28 34 35 29) (180 7 1) edgeGrading (4 4 4 4 1.8 1 1 1.8 1 1 1 1)
91      hex (7 13 14 8 29 35 36 30) (180 10 1) edgeGrading (4 4 4 4 4 1 1 4 1 1 1 1)
92      hex (8 14 15 9 30 36 37 31) (180 13 1) simpleGrading (4 0.25 1)
93      hex (10 16 17 11 32 38 39 33) (25 18 1) simpleGrading (2.5 1 1)
94      hex (11 17 18 12 33 39 40 34) (25 9 1) simpleGrading (2.5 1 1)
95      hex (12 18 19 13 34 40 41 35) (25 7 1) simpleGrading (2.5 1 1)
96      hex (13 19 20 14 35 41 42 36) (25 10 1) simpleGrading (2.5 1 1)
97      hex (14 20 21 15 36 42 43 37) (25 13 1) simpleGrading (2.5 0.25 1)
98  );
99  
100  edges
101  (
102  );
103  
104  patches
105  (
106      patch inlet
107      (
108          (0 22 23 1)
109          (1 23 24 2)
110          (2 24 25 3)
111      )
112      patch outlet
113      (
114          (16 17 39 38)
115          (17 18 40 39)
116          (18 19 41 40)
117          (19 20 42 41)
118          (20 21 43 42)
119      )
120      wall upperWall
121      (
122          (3 25 31 9)
123          (9 31 37 15)
124          (15 37 43 21)
125      )
126      wall lowerWall
127      (
128          (0 6 28 22)
129          (6 5 27 28)
130          (5 4 26 27)
131          (4 10 32 26)
132          (10 16 38 32)
133      )
134      empty frontAndBack
135      (
136          (22 28 29 23)
137          (23 29 30 24)
138          (24 30 31 25)
139          (26 32 33 27)
140          (27 33 34 28)
141          (28 34 35 29)
142          (29 35 36 30)
143          (30 36 37 31)
144          (32 38 39 33)
145          (33 39 40 34)
146          (34 40 41 35)
147          (35 41 42 36)
148          (36 42 43 37)
149          (0 1 7 6)
150          (1 2 8 7)
151          (2 3 9 8)
152          (4 5 11 10)
153          (5 6 12 11)
154          (6 7 13 12)
155          (7 8 14 13)
156          (8 9 15 14)
157          (10 11 17 16)
158          (11 12 18 17)
159          (12 13 19 18)
160          (13 14 20 19)
161          (14 15 21 20)
162      )
163  );
164  
165  mergePatchPairs
166  (
167  );
168  
169  // ************************************************************************* //

A major feature of this problem is the use of the full mesh grading capability of blockMesh that is described in 6.3.1 of the User Guide. The user can see that blocks 4,5 and 6 use the full list of 12 expansion ratios. The expansion ratios correspond to each edge of the block, the first 4 to the edges aligned in the local x1   \special {t4ht= direction, the second 4 to the edges in the local x2   \special {t4ht= direction and the last 4 to the edges in the local x3   \special {t4ht= direction. In blocks 4, 5, and 6, the ratios are equal for all edges in the local x1   \special {t4ht= and x3   \special {t4ht= directions but not for the edges in the x2   \special {t4ht= direction that corresponds in all blocks to the global y  \special {t4ht=. If we consider the ratios used in relation to the block definition in 6.3.1 of the User Guide, we realize that different gradings have been prescribed along the left and right edges in blocks 4,5 and 6 in Figure 3.5. The purpose of this differential grading is to generate a fine mesh close to the most critical region of flow, the corner of the step, and allow it to expand into the rest of the domain.

The mesh can be generated using blockMesh from the command line or from within FoamX and viewed as described in previous examples.

3.2.3 Boundary conditions and initial fields

The case files can be viewed, or edited from within FoamX or by hand. In this case, we are required to set the initial and boundary fields for velocity U  \special {t4ht=, pressure p  \special {t4ht=, turbulent kinetic energy k  \special {t4ht= and dissipation rate e  \special {t4ht=. The boundary conditions can be specified by setting the physical patch types in FoamX: the upper and lower walls are set to Wall, the left patch to Inlet and the right patch to Outlet. These physical boundary conditions require us to specify a fixedValue at the inlet on U  \special {t4ht=, k  \special {t4ht= and e  \special {t4ht=. U  \special {t4ht= is given in the problem specification, but the values of k  \special {t4ht= and e  \special {t4ht= must be chosen by the user in a similar manner to that described in 2.1.8.1 of the User Guide. We assume that the inlet turbulence is isotropic and estimate the fluctuations to be 5%  \special {t4ht= of U  \special {t4ht= at the inlet. We have

 '     '    '   -5--
Ux = U y = Uz = 100 10 = 0.5 m/s
\special {t4ht=
(3.6)

and

     3     2          2  2
k =  2(0.5) = 0.375 m  /s
\special {t4ht=
(3.7)

If we estimate the turbulent length scale l  \special {t4ht= to be 10%  \special {t4ht= of the width of the inlet then

    C0.75k1.5         0.75     1.5
e = --m------=  -0.09---0.375----=  14.855m2/s3
        l       0.1× 25.4 × 10- 3
\special {t4ht=
(3.8)

At the outlet we need only specify the pressure p = 0Pa  \special {t4ht=.

3.2.4 Case control

The choices of fvSchemes are as follows: the timeScheme should be SteadyState; the gradScheme and laplacianScheme should be set as default to Gauss; and, the divScheme should be set to UD to ensure boundedness.

Special attention should be paid to the settings of fvTolerances. Although the top level simpleFoam code contains only equations for p  \special {t4ht= and U  \special {t4ht=, the turbulent model solves equations for k  \special {t4ht=, e  \special {t4ht= and R  \special {t4ht=, and tolerance settings are required for all 5 equations. A solverTolerance of 10- 5   \special {t4ht= and solverRelativeTolerance of 0.1 are acceptable for all variables with the exception of p  \special {t4ht= when 10 -6   \special {t4ht= and 0.01 are recommended. Under-relaxation of the solution is required since the problem is steady. A relaxationFactor of 0.7 is acceptable for U  \special {t4ht=, k  \special {t4ht=, e  \special {t4ht= and R  \special {t4ht= but 0.3 is required for p  \special {t4ht= to avoid numerical instability.

Finally, in controlDict, the time step deltaT should be set to 1 since in steady state cases such as this is effectively an iteration counter. With benefit of hindsight we know that the solution requires 1000 iterations reach reasonable convergence, hence endTime is set to 1000. Ensure that the writeFrequency is sufficiently high, e.g. 50, that you will not fill the hard disk with data during run time.

3.2.5 Running the case and post-processing


PIC\special {t4ht=
(a) Velocity vectors after 50 iterations
PIC\special {t4ht=
(b) Velocity vectors at 1000 iterations
PIC\special {t4ht=
(c) Streamlines at 1000 iterations

Figure 3.6: Development of a vortex in the backward-facing step.


Run the case and post-process the results. After a few iterations, e.g. 50, a vortex develops beneath the corner of the step that is the height of the step but narrow in the x  \special {t4ht=-direction as shown by the vector plot of velocities is shown Figure 3.6(a). Over several iterations the vortex stretches in the x  \special {t4ht=-direction from the step to the outlet until at 1000 iterations the system reaches a steady-state in which the vortex is fully developed as shown in Figure 3.6(b-c).