The Turbulent Pipe Flow Example - Low-Re
The purpose of the Cornell tutorials with OpenFOAM® is to give a few easy examples which are well known for the CFD users. The original tutorials were written by Rajesh Bhaskaran. They give the user a practical guide on software usage (FLUENT / ANSYS) and the bacground is also explained well. Therefore it is recommended to read the particular Cornell tutorial first. In my tutorials I show the same steps using OpenFOAM® and other open software so that the reader can produce comparable results. I made these calculations on a Linux operating system (Ubuntu 11.04) using OpenFOAM-2.0.0, Octave, gnuplot and xmgrace.
The original tutorial can be found here.
The case will be calculated with a Low-Re turbulence model.
A similar mesh can be used as the one in the turbulent High-Re case finally. The mesh will be 8 m long again as in the laminar case. According to the Cornell tutorial we need high resolution in the radial direction. The Cornell tutorial use 30 cells in radial direction and a bias of 10 is applied. This means that ratio of cell length of the first and last cell in the radial direction is 10 (towards the side of the pipe cells are getting smaller).
cp -rv <turbulent_High-Re_case_directory> <turbulent_Low-Re_case_directory>
Change the blockMeshDict file:
Run the meshing again:
As in the High-Re tutorial do not forget to remove the default patch.
The boundary and initial conditions will be the same for the flow field variables (velocity and pressure), but the turbulence boundary conditions need some changes.
A usual set up would use a small fixed value for k at the walls (small BUT NOT 0, e.g. 1e-10) and zeroGradient for epsilon . For nut we will use the nutUSpaldingWallFunction wall function. According to the description in its header file: "Wall function boundary condition for walls, based on velocity, using Spaldings law to give a continuous nut profile to the wall (y+ = 0)". The path of the header file is: /opt/openfoam200/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.H. This wall function therefore can be used at low y+ values. The usage of nutLowReWallFunction should give similar results as this is the standard low-Re wall function.
See the changes in the k,epsilon and nut files:
Initialize the velocity field to the inlet value (according to the shown turbulence fields).
Turbulence boundary conditions at the inlet can be specified using the definitions in the Fluent Help:
These values should be put to the inlet value and to the value at the wall functions also.
Summary of all the boundary conditions:
We shall change now the value of viscosity in the transportProperties file (located in the constant directory):
Set the followings in the file (keep the fluid type Newtonian):
We will use a low-Re k-epsilon turbulence model: LaunderSharmaKE (see available turbulence models here > RAS turbulence models for incompressible fluids). Modify the turbulence model in the RASProperties file:
Launder Sharma description in its header file: "Launder and Sharma low-Reynolds k-epsilon turbulence model for incompressible flows.". Header file path: /opt/openfoam200/src/turbulenceModels/incompressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H.
fvSolution: we keep the file as it was used in the high-Re case. The changes are:
fvSchemes: according to a change in the solver code in OpenFoam® 2.0.0 one term should be changed in the fvSchemes file:
Change only the endTime and writeInterval in the controlDict file (both to 1500):
Launch the solver the same way as in the laminar flow example:
user@machine:~$ simpleFoam > log &
Monitor the log file:
user@machine:~$ tail -200f log
Use the same gnuplot script as in the High-Re example.
Residual history for this calculation:
Download the Residuals-turb gnuplot script.
Start with checking the axial velocity profile. Exporting the profile using the sample utility (use the sampleDict1 file from the laminar flow example files) one will get the following (as datasets were written to the format of Grace, it is enough to double-click on the axial_profile_U.agr in the file manager e.g. in nautilus when using Ubuntu):
We can see that the axial velocity finally converged to the value of 1.25 m/s. The comparable Fluent result can be checked here. The converged axial velocity obtained with ANSYS 12 is 1.19 m/s (according to the chart shown).
We should check the height of the near wall cells now. The non-dimensional measure for this is the y+ (definition @ cfd-online). Using a High-Re turbulence model y+ should be ~=30. The yPlus field is not written by default, we should generate it using the yPlusRAS utility:
user@machine:~$ yPlusRAS -latestTime
We will need the wallShearStress for checking the skin friction coefficient (definition @ cfd-online), therefore create it now:
user@machine:~$ wallShearStress -latestTime
One may find the definition of skin friction coefficient
The following new files are created:
Load the yPlus plot the same way as in the High-Re tutorial:
We can see that y+ is in the appropriate range.
Create the skin friction coefficient now from the wallShearStress plot the same way as in the High-Re tutorial. This is what you should get:
The value at the developed flow range (end of pipe) is ~0.00867. The corresponding Fluent result is close to 0.01 (according to the graph shown).
The radial profile is already created together with the axial profile when using the sampleDict1 file with the sample utility. Create the radial velocity profile the same way as in the High-Re tutorial:
Comparing it with the Fluent radial profile we can see that the max velocity is predicted to be higher with OpenFOAM®. In addition the profile is not as flat in the center as in the Fluent result.
Let's check the velocity profile in a non dimensional form which gives a good posibility of validation against measurements. For reference please read through this wikipedia article.
Version: 1.1, 2012-01-28