Nabla Logo user
  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.

2.2 Stress analysis of a plate with a hole

This tutorial describes how to pre-process, run and post-process a case involving linear-elastic, steady-state stress analysis on a square plate with a circular hole at its centre. The plate dimensions are: side length 4 m  \special {t4ht= and radius R  =  \special {t4ht= 0.5 m  \special {t4ht=. It is loaded with a uniform traction of s =  \special {t4ht= 10  k  \special {t4ht=Pa  \special {t4ht= over its left and right faces as shown in Figure 2.21. Two symmetry planes can be identified for this geometry and therefore the solution domain need only cover a quarter of the geometry, shown by the shaded area in Figure 2.21.


                              y
s=10kPa         symmetry plane         x                         s =  10 kPa



                      R = 0.5 m




                                  symmetry plane


                              4.0 m
\special {t4ht=


Figure 2.21: Geometry of the plate with a hole.


The problem can be approximated as 2-dimensional since the load is applied in the plane of the plate. In a Cartesian coordinate system there are two possible assumptions to take in regard to the behaviour of the structure in the third dimension: (1) the plane stress condition, in which the stress components acting out of the 2D plane are assumed to be negligible; (2) the plane strain condition, in which the strain components out of the 2D plane are assumed negligible. The plane stress condition is appropriate for solids whose third dimension is thin as in this case; the plane strain condition is applicable for solids where the third dimension is thick.

An analytical solution exists for loading of an infinitely large, thin plate with a circular hole. The solution for the stress normal to the vertical plane of symmetry is

               (     R2    3R4 )
           { s   1 + --2-+ ---4    for |y| > R
(sxx)x=0 =           2y     2y
             0                     for |y| < R
\special {t4ht=
(2.14)

Results from the simulation will be compared with this solution. At the end of the tutorial, the user can: investigate the sensitivity of the solution to mesh resolution and mesh grading; and, increase the size of the plate in comparison to the hole to try to estimate the error in comparing the analytical solution for an infinite plate to the solution of this problem of a finite plate.

2.2.1 Mesh generation

The domain consists of four blocks, some of which have arc-shaped edges. The block structure for the part of the mesh in the x - y  \special {t4ht= plane is shown in Figure 2.22. As already mentioned in subsubsection 2.1.1.1, all geometries are generated in 3 dimensions in OpenFOAM even if the case is to be as a 2 dimensional problem. Therefore a dimension of the block in the z  \special {t4ht= direction has to be chosen; here, 0.5 m  \special {t4ht= is selected. It does not affect the solution since the traction boundary condition is specified as a stress rather than a force, thereby making the solution independent of the cross-sectional area.


  8          up         7                 up                   6





left

                                                               right
            4                             3

      x2


  9      x1
                          x2
left
            0          4                                       3
                             x1
            x
 10          2     x
                    1                         2                right
             5          1
          hole
      y             x2            x2


         x        0    x1        1    x1    down              2
                        down
\special {t4ht=


Figure 2.22: Block structure of the mesh for the plate with a hole.


The user should start up FoamX as normal and open the plateHole case in their own $OpenFOAM_RUN/tutorials/stressedFoam directory. Open the blockMesh utility as described previously in subsubsection 2.1.1.1 and press the Edit Dictionary button. Until now, we have only specified straight edges in the geometries of previous tutorials but here we need to specify curved edges. The user should select edges to view how they are specified as shown in Figure 2.23. All 8 curved edges in this example are listed in a table; each can be edited which opens a selection window offering different types of curve, including arc, simpleSpline, polyLine etc., described further in subsection 6.3.1. In this example, all the edges are circular and so can be specified by the arc keyword entry. Editing the arc selection opens a window in which the user specifies the labels of the start and end vertices of the arc and a point vector through which the circular arc passes.



\special {t4ht=


Figure 2.23: Specifying curved edges in blockMesh.


The blocks in this blockMeshDict do not all have the same orientation. As can be seen in Figure 2.22 the x2   \special {t4ht= direction of block 0 is equivalent to the -  x1   \special {t4ht= direction for block 4. This means care must be taken when defining the number and distribution of cells in each block so that the cells match up at the block faces.

5 patches are defined, one for each side of the plate and one for the hole. The blockMeshDict dictionary entries are given below.


31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  convertToMeters 1;
34  
35  vertices
36  (
37      (0.5 0 0)
38      (1 0 0)
39      (2 0 0)
40      (2 0.707107 0)
41      (0.707107 0.707107 0)
42      (0.353553 0.353553 0)
43      (2 2 0)
44      (0.707107 2 0)
45      (0 2 0)
46      (0 1 0)
47      (0 0.5 0)
48      (0.5 0 0.5)
49      (1 0 0.5)
50      (2 0 0.5)
51      (2 0.707107 0.5)
52      (0.707107 0.707107 0.5)
53      (0.353553 0.353553 0.5)
54      (2 2 0.5)
55      (0.707107 2 0.5)
56      (0 2 0.5)
57      (0 1 0.5)
58      (0 0.5 0.5)
59  );
60  
61  blocks
62  (
63      hex (5 4 9 10 16 15 20 21) (10 10 1) simpleGrading (1 1 1)
64      hex (0 1 4 5 11 12 15 16) (10 10 1) simpleGrading (1 1 1)
65      hex (1 2 3 4 12 13 14 15) (20 10 1) simpleGrading (1 1 1)
66      hex (4 3 6 7 15 14 17 18) (20 20 1) simpleGrading (1 1 1)
67      hex (9 4 7 8 20 15 18 19) (10 20 1) simpleGrading (1 1 1)
68  );
69  
70  edges
71  (
72      arc 0 5 (0.469846 0.17101 0)
73      arc 5 10 (0.17101 0.469846 0)
74      arc 1 4 (0.939693 0.34202 0)
75      arc 4 9 (0.34202 0.939693 0)
76      arc 11 16 (0.469846 0.17101 0.5)
77      arc 16 21 (0.17101 0.469846 0.5)
78      arc 12 15 (0.939693 0.34202 0.5)
79      arc 15 20 (0.34202 0.939693 0.5)
80  );
81  
82  patches
83  (
84      symmetryPlane left
85      (
86          (8 9 20 19)
87          (9 10 21 20)
88      )
89      patch right
90      (
91          (2 3 14 13)
92          (3 6 17 14)
93      )
94      symmetryPlane down
95      (
96          (0 1 12 11)
97          (1 2 13 12)
98      )
99      patch up
100      (
101          (7 8 19 18)
102          (6 7 18 17)
103      )
104      patch hole
105      (
106          (10 5 16 21)
107          (5 0 11 16)
108      )
109      empty frontAndBack
110      (
111          (10 9 4 5)
112          (5 4 1 0)
113          (1 4 3 2)
114          (4 7 6 3)
115          (4 9 8 7)
116          (21 16 15 20)
117          (16 11 12 15)
118          (12 13 14 15)
119          (15 14 17 18)
120          (15 18 19 20)
121      )
122  );
123  
124  mergePatchPairs
125  (
126  );
127  
128  // ************************************************************************* //

The mesh should be generated using blockMesh and can be viewed in dxFoam as described in subsection 2.1.2. It should appear as in Figure 2.24.



\special {t4ht=

Figure 2.24: Mesh of the hole in a plate problem.


2.2.1.1 Boundary and initial conditions

Once the mesh generation is complete, load the mesh into FoamX: remember this is done by clicking the right mouse button on Mesh in the case directory tree and selecting the Read Mesh function. The names of the patches will appear in a dictionary named Patches which should be set as follows: left and down patches are both symmetryPlane; the undefinedFaces are the front and back planes of the 2D geometry and should therefore be declared empty; the other patches are traction boundary conditions, set by traction boundary type.

The Fields must be set as before; here, the displacement U and temperature T. The traction boundary conditions are specified by a linear combination of: (1) a boundary traction vector; (2) a pressure that produces a traction normal to the boundary surface that is defined as negative when pointing out of the surface. The up and hole patches are zero traction so the boundary traction and pressure are set to zero. For the right patch the traction should be (1e4, 0,0)  \special {t4ht= Pa  \special {t4ht= and the pressure should be 0 Pa  \special {t4ht= as shown in Figure 2.25. All the displacement initial conditions should be set to (0,0,0)  \special {t4ht= m  \special {t4ht=.


Set boundary traction
\special {t4ht=


Figure 2.25: Setting the traction boundary condition.


2.2.1.2 Mechanical properties

The physical properties for the case are set in the mechanicalProperties dictionary. For this problem, we need to specify the mechanical properties of steel given in Table 2.1. In the mechanical properties dictionary, the user must also set planeStress to yes.


Property Units Keyword Value




Density kgm -3   \special {t4ht= rho 7854
Young’s modulus Pa  \special {t4ht= E       11
2×  10   \special {t4ht=
Poisson’s ratio -- nu 0.3





Table 2.1: Mechanical properties for steel

2.2.1.3 Thermal properties

The temperature field variable T is present in the stressedFoam solver since the user may opt to solve a thermal equation that is coupled with the momentum equation through the thermal stresses that are generated. The user specifies at run time whether OpenFOAM should solve the thermal equation by the thermalStress switch in the thermalProperties dictionary. This dictionary also sets the thermal properties for the case, e.g. for steel as listed in Table 2.2.


Property Units Keyword Value




Specific heat capacity J  \special {t4ht=kg -1   \special {t4ht=K -1   \special {t4ht= C 434
Thermal conductivity W  \special {t4ht=  -1
m   \special {t4ht=  -1
K   \special {t4ht= k 60.5
Thermal expansion coeff. K -1   \special {t4ht= alpha 1.1×  10-5   \special {t4ht=





Table 2.2: Thermal properties for steel

In this case we do not want to solve for the thermal equation. Therefore we must set the thermalStress keyword entry to no in the thermalProperties dictionary.

2.2.1.4 Control

As before, the information relating to the control of the solution procedure are read in from the controlDict dictionary. For this case, the startTime is 0 s  \special {t4ht=. The time step is not important since this is a steady state case; in this situation it is best to set the time step deltaT to 1 so it simply acts as an iteration counter for the steady-state case. The endTime, set to 100, then acts as a limit on the number of iterations. The writeInterval can be set to 20  \special {t4ht=.

The controlDict entries should be saved as follows:


31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  applicationClass stressedFoam;
34  
35  startFrom       startTime;
36  
37  startTime       0;
38  
39  stopAt          endTime;
40  
41  endTime         100;
42  
43  deltaT          1;
44  
45  writeControl    timeStep;
46  
47  writeInterval   20;
48  
49  cycleWrite      0;
50  
51  writeFormat     ascii;
52  
53  writePrecision  6;
54  
55  writeCompression uncompressed;
56  
57  timeFormat      general;
58  
59  timePrecision   6;
60  
61  runTimeModifiable yes;
62  
63  
64  // ************************************************************************* //

2.2.1.5 Discretisation schemes and linear-solver control

Let us turn our attention to the fvSchemes dictionary. Firstly, the problem we are analysing is steady-state so the user should select SteadyState for the time derivatives in timeScheme. This essentially switches off the time derivative terms. Not all solvers work for both steady-state and transient problems but stressedFoam does work, since the base algorithm is the same for both types of simulation.

The momentum equation in linear-elastic stress analysis includes several explicit terms containing the gradient of displacement. The calculations benefit from accurate and smooth evaluation of the gradient. Normally, in the finite volume method the discretisation is based on Gauss’s theorem, as discussed in subsection 4.4.3 and 2.4.6 of the Programmer’s Guide. The Gauss method is sufficiently accurate for most purposes but, in this case, the least squares method will be used. The user should therefore open the fvSchemes dictionary and select leastSquares for the default gradient discretisation scheme.


31  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32  
33  timeScheme      SteadyState;
34  
35  gradSchemes
36  {
37      default         Gauss linear;
38      grad(U)         leastSquares;
39      grad(T)         leastSquares;
40  }
41  
42  divSchemes
43  {
44      default         none;
45      div(sigma)      Gauss linear;
46  }
47  
48  laplacianSchemes
49  {
50      default         none;
51      laplacian(DU,U) Gauss linear corrected;
52      laplacian(DT,T) Gauss linear corrected;
53  }
54  
55  interpolationSchemes
56  {
57      default         linear;
58  }
59  
60  snGradSchemes
61  {
62      default         corrected;
63  }
64  
65  fluxRequired
66  {
67      default         no;
68      U;
69      T;
70  }
71  
72  
73  // ************************************************************************* //

The fvSolution dictionary controls the linear equation solvers and algorithms used in the solution. The user should first look at the solvers subdictionary and select the ICCG solver for U. The solver tolerance (the scalar following the solver name) should be set to   -6
10   \special {t4ht= for this problem. The solver relative tolerance (the following scalar) sets the required reduction in the residuals within each iteration. It is uneconomical to set a high relative tolerance within each iteration since a lot of terms are explicit and are updated as part of the segregated iterative procedure. Therefore a reasonable value for the relative tolerance is 0.01  \special {t4ht=, or possibly even higher, say 0.1  \special {t4ht=.

The fvSolution dictionary contains a subdictionary, stressedFoam that contains some control parameters specific to the application solver. Firstly there is nCorrectors which specifies the number of outer loops around the complete system of equations, including traction boundary conditions within each time step. Since this problem is steady-state, we are performing a set of iterations towards a converged solution with the ’time step’ acting as an iteration counter. We can therefore set nCorrectors to 1.

The U keyword specifies a convergence tolerance for the outer iteration loop, i.e. sets a level of initial residual below which solving will cease. It should be set to the desired solver tolerance specified earlier,   -6
10   \special {t4ht= for this problem.

2.2.2 Running the code

The user should run the code here in the background, either from FoamX or from the command line as specified below, so he/she can look at convergence information in the log file afterwards.


    cd $OpenFOAM_RUN/tutorials/stressedFoam
    nohup nice -n 19 stressedFoam . plateHole > log &
The user should check the convergence information by viewing the generated log file which shows the number of iterations and the initial and final residuals of the displacement in each direction being solved. The final residual should always be less than 0.1 times the initial residual as this iteration tolerance set. Once both initial residuals have dropped below the convergence tolerance of 10- 6   \special {t4ht= the run has converged and can be stopped by killing the batch job.

2.2.3 Post-processing

Post processing can be performed as in subsection 2.1.4. The stressedFoam solver decomposes the stress tensor field    \special {t4ht= into individual scalar field components, sxx  \special {t4ht=, sxy  \special {t4ht= etc. for purposes of post-processing. The viewer can therefore select the sxx  \special {t4ht= stresses from the volScalarField menu of the Field 1 visualisation window in dxFoam. It is perhaps worth reiterating that variables in the OpenFOAM solvers are usually represented by the mathematical symbol by which they are represented, In the case of Greek symbols, the variable is named phonetically, e.g. sxx  \special {t4ht= is named sigmaxx.


  30


  25

  20

  15
sxx (kPa)

  10

   5

   0
\special {t4ht=


Figure 2.26: sxx  \special {t4ht= stress field in the plate with hole.


We would like to compare the analytical solution of Equation 2.14 to our solution. We therefore must output a set of data of sxx  \special {t4ht= along the left edge symmetry plane of our domain. The user should therefore open the Graph window from Window Control. The graph line can be set as described in subsubsection 2.1.5.7, e.g. here we could set the Grid Point to be (0,1.25,0)  \special {t4ht= and the Vector to be (0, 0.75, 0)  \special {t4ht=. The user should check the Do Plot and Reveal Line boxes and, in order to see the graph line, may need to turn the opacity of all the mesh components to 0 in the Options window. The user should see the stress fall from approximately 3 × \special {t4ht= the applied load to the applied load along the y  \special {t4ht=-axis.

In order to compare the results with the analytical solution, the user must write the graph data to file by going to the Graph window and clicking the Write Now box in the Data Writing panel. The data is written to a file which the user can locate on his/her machine. Note that using the default settings, the file will be written to the working directory from where dxFoam was launched on the command line. The data is written as a simple text file that the user can load into a graph drawing package and simply compare with the analytical solution of Equation 2.14.

The user may also generate the required graph data using the sample utility. In the FoamX case server, the user should select select sample from the postProcessing -> miscellaneous sub-menu of the from the Foam Utilities menu. The user should select Edit Dictionary which opens a sampleDict dictionary, pre-specified in the tutorial case. The dictionary contains the entries as follows and summarised in Table 7.7. The sample line specified in sampleSets is set between (0.0, 0.5001, 0.25)  \special {t4ht= and (0.0,2.0,0.25)  \special {t4ht=. Clicking Start Run will execute the sample utility.

The writeFormat is raw 2 column format. In an application such as GnuPlot, one could type the following at the command prompt would be sufficient to plot both the numerical data and analytical solution:


    plot [0.5:2] '<datafile>', 1e4*(1+(0.125/(x**2))+(0.09375/(x**4)))
An example plot is shown in Figure 2.27.


PICT\special {t4ht= PICT\special {t4ht=

Figure 2.27: Normal stress along the vertical symmetry (sxx)x=0   \special {t4ht=


2.2.4 Exercises

The user may wish to experiment with stressedFoam by trying the following exercises:

2.2.4.1 Increasing mesh resolution

Increase the mesh resolution in each of the x  \special {t4ht= and y  \special {t4ht= directions. Use mapFields to map the final coarse mesh results from subsection 2.2.3 to the initial conditions for the fine mesh.

2.2.4.2 Introducing mesh grading

Grade the mesh so that the cells near the hole are finer than those away from the hole. Design the mesh so that the ratio of sizes between adjacent cells is no more than 1.1 and so that the ratio of cell sizes between blocks is similar to the ratios within blocks. Mesh grading is described in subsection 2.1.6. Again use mapFields to map the final coarse mesh results from subsection 2.2.3 to the initial conditions for the graded mesh. Compare the results with those from the analytical solution and previous calculations. Can this solution be improved upon using the same number of cells with a different solution?

2.2.4.3 Changing the plate size

The analytical solution is for an infinitely large plate with a finite sized hole in it. Therefore this solution is not completely accurate for a finite sized plate. To estimate the error, increase the plate size while maintaining the hole size at the same value.