Fluent - Turbulent Flat Plate Boundary Layer
Introduction and Instructions:
This learning module contains a procedure to solve for the turbulent boundary layer on a flat plate with the CFD program, Fluent.
Note: This set of instructions assumes that the student has already run Fluent for the laminar flat plate boundary layer, and has generated case and data files for the laminar case. The files laminar_bl.cas (or laminar_bl.cas.gz) and laminar_bl.dat (or laminar_bl.dat.gz) are assumed to exist on the user's Fluent directory.
It is assumed that the student is already logged on to a Unix computer, and that the Fluent directory is set as the working directory.
Launch Fluent and read the case file from the laminar boundary layer run:
- From the Fluent subdirectory, enter "fluent 2d &". After a few seconds, the main Fluent window should appear on your screen.
- Select File-Read-Case. There should be a file shown on the right side called laminar_bl.cas (or laminar_bl.cas.gz if the file was saved in compressed format), which is the case file for the laminar flat plate boundary layer. Highlight this file (i.e. click on it), and OK. Fluent will read in the grid geometry, mesh, and boundary conditions, etc. that were previously created by Gambit and Fluent. Some information is displayed on the main screen. If all is read well, it should give no errors, and the word "Done" should appear.
Define the model as turbulent:
- The default model is laminar, but we wish to run a turbulent case this time. Define-Models-Viscous- k-epsilon (2 eqn). Under Near Wall Treatment, select Two-Layer Zonal Model, which is Fluent's version of integration of a turbulent flow to the wall without wall functions.
- Click the Help button to read about the wall function options. In our case, we do not want to use any wall functions, since we have a grid that will be highly resolved near the wall. Close the Help Viewer window.
- In the Viscous Model window, OK to set the model and close the Viscous Model window.
Define the boundary conditions:
- Most of the boundary conditions from the laminar case are still valid, but we will specify a higher freestream velocity, and we need to specify some of the turbulence properties as well. In the main Fluent window, click on Define-Boundary Conditions - the Boundary Conditions window will pop up.
- Select the Zone called inlet, and Set. The "Velocity Specification Method" should be "Magnitude and Direction". The Velocity Magnitude should still be 2.0 m/s, and the direction to the right, as were set in the laminar case.
Leave the freestream velocity at 2.0 m/s. This will enable us to directly compare a laminar and turbulent boundary layer at the same Reynolds number.
- Additional turbulence parameters, namely Turb. Kinetic Energy and Turb. Dissipation Rate now appear since we are using the k-epsilon turbulence model.
We will assume a very low turbulence level in the freestream.
Change Turb. Kinetic Energy to 1.E-02 m2/s2, and change Turb. Dissipation Rate to 1.E-02 m2/s3. OK.
- In like manner, select the Zone called outlet, and Set. Change Backflow Turb. Kinetic Energy to 1.E-02 m2/s2, and change Backflow Turb. Dissipation Rate to 1.E-02 m2/s3. OK. (This ensures that any backflow that comes into the computational domain has a low turbulence intensity as well.)
- The boundary condition for the top of the computational domain should be changed from pressure outlet to symmetry to produce better convergence. (For some unknown reason, the pressure outlet boundary condition at the top does not lead to a converged solution for this turbulent boundary layer).
The symmetry boundary condition will make the top of the domain like the center of a channel, ensuring no flow through the top of the domain.
- Boundary conditions are complete, so Close the Boundary Conditions window.
Set up some parameters and initialize:
- The convergence criteria need to be checked. In the main Fluent window, Solve-Monitors-Residual. In the Residual Monitors window that pops up, make sure that both Print and Plot are on in the Options portion of the window. Here, Print refers to text printed in the main Fluent window, and Plot causes the code to plot the residuals on the screen while the code is iterating.
- There were three differential equations to be solved in the two-D incompressible laminar flow problem, and thus three residuals to be monitored for convergence: continuity, x-momentum, and y-momentum. With the k-epsilon turbulence model, there are five differential equations, and thus five residuals to be monitored. The default convergence criteria are 0.001 for the two new ones. There is no need to change any of these, since continuity usually has the highest residual, and it's convergence criterion was previously set to 1.E-06. OK to exit the Residual Monitors window.
- In the main Fluent window, Solve-Controls-Solution. Reduce the Under-Relaxation Factors for Turbulence Kinetic Energy and Turbulence Dissipation Rate by factors of 2 to ensure better convergence (the factors for pressure and momentum had already been reduced previously in the laminar flow solution, so these don't need to be changed here). OK.
- In the main Fluent window, Solve-Initialize-Initialize. Gage Pressure, X Velocity, and Y Velocity should be set to 0.0 pascal, 2.0 m/s, and 0.0 m/s respectively. Note that we will try to speed up convergence by setting the x-component of velocity to the freestream value everywhere, since the flow will be nearly equal to the freestream throughout most of the computational domain.
- In addition, we must initialize the turbulence properties. Scroll down and change Turbulence Kinetic Energy to 1.E-02 m2/s2, and change Turbulence Dissipation Rate to 1.E-02 m2/s3. Init and Close.
- At this point, and every so often, it is wise to save your work. In the main Fluent window, File-Write-Case & Data. In the Select File window which pops up, the default file name is laminar_bl.cas, which must be changed to something more descriptive of the turbulent flow case being calculated. ("turbulent_bl.cas" is suggested to distinguish this case from the laminar flat plate case already calculated). Note that Case & Data refers to both the case (the grid plus all boundary conditions and other specified parameters) and the data (the velocity and pressure fields calculated by the code. The code will actually write out two files, turbulent_bl.cas and turbulent_bl.dat.
- If not on by default, turn on the option to Write Binary Files (to save disk space). To save even more disk space, the files can be compressed by adding a "gz" at the end of the file name, if not already present. The complete file name should be "turbulent_bl.cas.gz". OK to write the file onto your directory.
Iterate towards a solution:
- In the main Fluent window, Solve-Iterate to open up the Iterate window. The turbulent case will converge more slowly than did the laminar case. Change Number of Iterations to about 600. Iterate. The main screen will list the residuals after every iteration, while the graphical display window will plot the residuals as a function of iteration number. The residuals may rise and fall as the code seeks a solution, but should slowly start to fall. Do not be concerned if there are reverse flow warnings; these will disappear in time. Also, do not worry about messages concerning the turbulent viscosity limit, which occur because velocity gradients are so small in the freestream portion of the flow.
- At the end of these iterations, check to see how the solution is progressing. In the main Fluent window, Display-Velocity Vectors-Display. The graphical display window will show the velocity vectors. Zoom in with the middle mouse, as described above, to view the velocity field in more detail if desired. In particular, view the boundary layer near the end of the plate. Is it starting to look like a turbulent boundary layer profile?
- Iterate some more if necessary. (To restart the iteration, either find the Iterate window, which is probably hidden under some other windows at this point, or click again on Solve-Iterate to re-open the Iterate window.) Iterate.
- Check the velocity vectors, as described above after another 500 or 600 iterations. It is wise to move the Iterate window someplace out of the way of the other windows so you can easily restart the iteration. The residuals may go up sometimes. This is normal, as the code attempts to zero in on a solution - after a while the residuals should again decay or level off. If the residuals all go below the convergence criteria, the calculations will stop. In most cases, however, the residuals reach a lower limit, and further iterations don't improve the solution.
- 1000 iterations should be sufficient for the first attempt. Before iterating further, we will examine the boundary layer profiles more closely.
Examine the velocity profiles in detail:
- At this point, the velocity profiles at three desired downstream locations (x = 0.10 m, x = 0.30 m, and x = 0.50 m) will be plotted and examined in detail, as was done previously in the laminar flow case.
- In the main Fluent window, select Plot-XY Plot. In the Solution XY Plot window, at the lower right corner, select (highlight) the three surfaces where the boundary layer profiles will be compared, i.e. profile0.10, profile0.30, and outlet.
- In the upper left corner of the window, turn off Position on X Axis, and turn on Position on Y Axis. This will make the y-axis the y position on the plot, as desired.
- In the upper middle part of that window, set Plot Direction to X = 0 and Y = 1. This will make the y-coordinate position appear on the y-axis, as desired for a standard velocity profile plot.
- The upper right part of the window selects the variable to be plotted. The Y Axis Function will be set automatically to Position, and should be left alone. For the X Axis Function, select Velocity and X-Velocity. Plot.
- The axes limits can be changed as follows: Axes. Choose X if necessary (X should already be the default). Unselect Auto Range. Set the range from 0 to 2.2 m/s. Select Major Rules. Apply.
- Now choose the Y axis. Unselect Auto Range and select Major Rules for this axis as well. Set the range from 0 to around 0.01 m or so, such that the entire boundary layer will be visible on the plot.
- To make the scale more readable, change the Number Format to Type = Float and Precision = 3. Apply.
- Back in the Solution XY Plot window, Plot. Adjust the axes and/or number format as desired to obtain a nice plot of the three boundary layer profiles.
Iterate towards a final solution:
- At this point, the boundary layer should be reasonable, but more grid refinement and iteration may be required. If there are less than about 10 data points within the thickness of any of the three boundary layers, the grid should be refined again.
- Refine the grid and re-iterate as necessary to obtain a final solution. See the laminar flow learning module for details about how to adapt the grid. You may adapt either by the gradient method or by the boundary method.
- Iterate for several hundred iterations after each grid adaption. The residuals will rise dramatically after an adaption, but will decay as the solution adjusts itself to the newly refined grid.
- After refinement and iteration, look again at the velocity profiles (Plot-XY Plot-Plot from the main Fluent window, or simply Plot if the Solution XY Plot window is still available on the screen).
Save your velocity profile and your calculations:
- In the main Fluent window, File-Write-Case & Data. In the Select File window which pops up, the default file name should be "turbulent_bl.cas.gz", as previously entered. OK to write the file onto your directory. OK again since it is okay to overwrite these files.
- From the Solution X-Y Plot window, Plot. When the plot is to your liking, the plot of the boundary layer profile will be saved. In the main Fluent window, File-Hardcopy-Save, name the file (something like "turbulent_profiles.ps" is appropriate), OK, and Close. The postscript file generated can be printed out from the Unix shell later.
- The data points along the x = 0.50 m line (the outlet) will now be saved to an ASCII file for further analysis and comparison to predictions. From the Solution XY Plot window, select only the outlet line. Write to File, and Write. Name the file something ("turbulent_profile.txt" is suggested) and OK.
- Finally, save a plot of the residuals. In the main Fluent window, Plot-Residuals-Plot. Then, File-Hardcopy. It is suggested that Coloring be changed to Monochrome since the printer prints in black and white only. Save, name the file (something like "turbulent_residuals.ps" is appropriate), OK, and Close.
Calculate the drag force and drag coefficient on the body:
- Follow the directions for calculating drag and drag coefficient from the laminar flow learning module.
- Record the drag and drag coefficient for this turbulent case. The drag coefficient will be compared to empirical equations obtained from the literature.
Examine the turbulent kinetic energy (k) profile in detail:
NOTE: ME 83 students - This portion is not necessary for your lab. Include it only if you have time.
- Go to the Solution XY Plot window if it is still visible on the screen. (If not, re-open it: in the main Fluent window, select Plot-XY Plot.)
- Change the X Axis Function to Turbulence and Turbulent Kinetic Energy. Plot.
- Adjust the axes limits as necessary to create nice-looking profiles: Axes. Choose X. Set the Maximum Range to something that will yield a nice k profile. Apply. The Y axis limits and other parameters should be okay as set previously.
- Back in the Solution XY Plot window, Plot. Adjust the axes and/or number format as desired to obtain a nice plot of the turbulent kinetic energy profiles at the three x locations.
- NOTE: Turbulent kinetic energy must go to zero at the wall, due to the no-slip condition at the wall. If the solution is converged well enough, with good enough grid resolution near the wall, the turbulent kinetic energy should drop off towards zero very near the wall. If it does not, but rather starts off at some high value and decays from there, your grid is probably not refined enough. Adapt the grid and iterate further as needed until k approaches zero near the wall.
- When the plot is to your liking, the plot of turbulent kinetic energy profiles will be saved. In the main Fluent window, File-Hardcopy-Save, name the file (something like "tke_bl.ps" is appropriate), OK, and Close. The postscript file generated can be printed out from the Unix shell later.
- The data points along the outlet (x = 0.50 m) line will now be saved to an ASCII file for further analysis and comparison to predictions. From the Solution XY Plot window, select only the outlet line. Write to File, and Write. Name the file something ("tke_bl.txt" is suggested) and OK.
- If you had to do some more grid adaption and iteration, re-plot and re-save the velocity profiles as well.
Save your calculations and exit Fluent:
- In the main Fluent window, File-Write-Case & Data-OK. It is okay to overwrite the files. OK.
- Exit Fluent by File-Exit. This will return you to the Unix shell.
- To logout completely from the computer, in the Global window on the upper left of the screen, Choose Desktop-Log Out, and answer Yes.