Fluent - Laminar Flow into an Axisymmetric Inlet

Latest revision: 07 November, 2003, 5:40 p.m.

Introduction and Instructions:

This learning module contains a procedure to solve for laminar flow into an axisymmetric inlet with the CFD program, Fluent.

Note: This set of instructions assumes that the student has already run Gambit, and has generated a grid for the flow. The file axi_inlet.msh is assumed to exist on the user's Fluent directory

Log on and launch Fluent:

  1. If already logged in, enter "pwd". This Unix command will print your working directory. If your working directory is not Fluent, enter "cd ~/Fluent" to make Fluent your working directory. If logged in and at the correct Fluent working directory, skip to step 4.
  2. Log on to a computer which has access to the Fluent software, and open a Unix shell.
  3. Enter "cd Fluent" to change the working directory to Fluent. (Note: It is assumed that the grid was generated from the Fluent/Gambit subdirectory, and then moved to the Fluent directory, as instructed in the Gambit learning module.)
  4. Enter "fluent 2d &". After a few seconds, the main Fluent window should appear on your screen. (The & symbol lets Fluent run in background mode so that the Unix shell is still usable.)

Read the grid points and geometry of the flow domain:

  1. File-Read-Case. There should be a file listed on the right side called axi_inlet.msh. Highlight this file (i.e. click on it), and OK. Fluent will read in the grid geometry and mesh that was previously created by Gambit. Some information is displayed on the main screen. If all is read well, it should give no errors, and the word "Done" should appear. You may see some error messages concerning unbound variables - ignore these.
  2. Check the validity of the grid: Grid-Check. If the grid is valid, no errors should appear. If there are errors, you may have done something wrong in the grid generation, and will have to go back and regenerate the grid.
  3. Grid-Info-Size to see how many cells are in the computational domain. There should be around 2000 cells if you followed the Gambit directions carefully.
  4. Look at the grid to make sure it is correct. Display-Grid-Display. A new graphical display window opens up showing the grid. If this window is too big, re-scale it by dragging the edges of the window. It is best if the graphical display window is small enough that both it and the Fluent window are visible simultaneously. The Fluent window and/or the graphical display window may need to be moved to accomplish this.
  5. The graphical display can be zoomed-in or zoomed-out with the middle mouse button. If you start on the lower left and draw a rectangle with the middle mouse button towards the upper right, the display will zoom in on what is included in the rectangle. Meanwhile, the left mouse button can be used to drag the image to a new location. If you draw a rectangle backwards with the middle mouse button, i.e. from right to left, it will zoom out. Zoom in or out as necessary until the grid is shown nicely in the window. Close the Grid Display window; the display window itself will remain.

Record the properties of the fluid, air:

  1. The default fluid is air, so we don't have to change it. However, it is wise at this point to record the fluid density and viscosity. In the main Fluent window, Define-Materials. Check that air is the default for Fluid Materials.
  2. Write down the density and viscosity of air, which may be needed later to calculate Reynolds numbers, pressures, etc. Be sure to write down the units of these parameters as well.
  3. Now Close the Materials window.

Define the boundary conditions:

  1. The boundary conditions need to be specified. In Gambit, the boundary condition types were declared, i.e. wall, pressure outlet, etc., but actual values for the outlet pressures, etc. were never defined. This must be done now in Fluent. In the main Fluent window, click on Define-Boundary Conditions, and a new Boundary Conditions window will pop up.
  2. Select the Zone called fluid and Set. Verify that the default fluid is air, as appears in the Material Name drop-down list of material names. OK.
  3. The default boundary condition for the top wall of the hood, called "hood wall" is okay (wall), so nothing needs to be done to it.
  4. For a two-dimensional slot, the default boundary condition for the symmetry plane called "axis" (symmetry) is okay, but for an axisymmetric inlet (a circular inlet), as desired here, this boundary condition will need to be changed to an axis of rotation. Fluent requires that the horizontal x-axis be the axis of rotation for axisymmetric flows. Select the Zone called axis, and change Type to axis. Yes, and OK.
  5. Select the Zone called far-field, which was declared in Gambit to be a pressure inlet. Set. Note that the gage pressure is zero, i.e. atmospheric pressure conditions exist in the far field. That is what we desire, so OK.
  6. Finally, select the Zone called face, to which we had assigned a pressure outlet in Gambit. Set. The inlet must have a negative gage pressure, i.e. a vacuum pressure, so that air is sucked into the inlet. It is desired to have an average face velocity through the inlet of 10 m/s. The Bernoulli equation can be used to estimate the required pressure at the inlet. Change the Gage Pressure to the appropriate negative gage pressure in Pascals. OK.
  7. Boundary conditions are complete, so Close the Boundary Conditions window.

Set up some parameters and initialize:

  1. In the main Fluent window, Define-Models-Solver. 2-D flow is the default, but we want axisymmetric instead; so under Space, select Axisymmetric. OK.
  2. In the main Fluent window, Define-Models-Viscous. Laminar flow is the default, so we really don't need to do anything here. Later on, however, you may wish to try turbulent flow calculations; this is where the turbulence models are specified in Fluent. OK.
  3. Now the convergence criteria need to be set. As the code iterates, "residuals" are calculated for each flow equation. These residuals represent a kind of average error in the solution - the smaller the residual, the more converged the solution. In the main Fluent window, Solve-Monitors-Residual. In the Residual Monitors window that pops up, turn on Plot in the Options portion of the window. The Print option should already be on by default. 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.
  4. Since there are three differential equations to be solved in a two-D incompressible laminar flow problem, there are three residuals to be monitored for convergence: continuity, x-velocity, and y-velocity. The default convergence criteria are 0.001 for all three of these. Experience has shown that this value is generally not low enough for proper convergence. Change the Convergence Criterion for each of these residuals from 0.001 to 0.00001 or 1.E-05.
  5. To apply the changes, OK, which will also close the Residual Monitors window.
  6. Experience has shown that for most problems, the solution converges better if the under-relaxation factors are reduced from their default values. Without going into a lot of detail, this is explained in a simple fashion here: Sometimes as the program is iterating, changes in the solution are too aggressive, and adversely affect convergence. Reduced under-relaxation factors damp out changes in the solution as the iterations progress, often leading to better overall convergence. In the main Fluent window, Solve-Controls-Solution. Reduce the Under-Relaxation Factors for pressure and momentum by a factor of two from their default values. OK.
  7. In the main Fluent window, Solve-Initialize-Initialize. The default initial values of velocity and gage pressure are all zero. These are good enough for this problem. Init and Close.
  8. 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 axi_inlet.cas, which may be changed to something more descriptive ("axi_unflanged.cas" is suggested to distinguish this case from a flanged case). Note that Case & Data refers to both the case file (the grid plus all boundary conditions and other specified parameters) and the data file (the velocity and pressure fields calculated by the code.) The code will actually write out two files, axi_unflanged.cas and axi_unflanged.dat.
  9. 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. The complete file name should be "axi_unflanged.cas.gz". OK to write the file onto your directory.

Iterate towards a solution:

  1. In the main Fluent window, Solve-Iterate to open up the Iterate window. Move the window to a blank portion of the computer screen for convenience. Change Number of Iterations to 100, and Iterate.
  2. While Fluent is iterating, the main screen will list the residuals after every iteration. Meanwhile, the graphical display window will plot the residuals as a function of iteration number. The residuals may rise at first, but should slowly start to fall. It is normal for the residuals to fluctuate up and down. Do not be concerned if there are reverse flow warnings; these usually disappear in time.
  3. At the end of 100 iterations, check to see how the solution is progressing. In the main Fluent window, Display-Vectors-Display. The graphical display window will show the velocity vectors.
  4. Zoom in with the middle mouse, as described above, to view the velocity field near the inlet in more detail. Is there any flow separation near the top corner of the inlet?
  5. In the main Fluent window, Display-Contours. The default is contours of pressure. Display. This shows contour lines of constant pressure (isobars).
  6. More interesting in this problem are the contours of constant velocity magnitude (isopleths), and contours of the stream function, (streamlines). Change Contours of to Velocity. The default value below that is Velocity Magnitude. Display. At this point, the solution has not converged sufficiently, so the isopleths are not realistic.
  7. Now look at the streamlines. Select Stream Function from the pull-down list right below the word Velocity under Contours of. Display. Since the solution has not yet converged, the streamlines are not yet correct.

Iterate towards a final solution:

  1. Iterate some more - (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.) In the Iterate window, set Number of Iterations to about 200, Apply, and Iterate.
  2. After these iterations, check the velocity vectors and/or streamlines, as described above, to see how the flow is progressing towards a final solution.
  3. If the residuals have flattened out, (or if they oscillate up and down, but no longer decay), it usually means that either the solution has converged, or the grid resolution is not sufficient for an accurate solution - it may be necessary to adapt the grid. Grid adaption is a feature of Fluent which enables one to add grid points to regions in the flow where more grid points would be helpful. There are many options for the adaption process; we shall adapt by velocity gradient. In other words, a finer grid will be generated in locations where there is a large change in velocity, such as along the solid wall, and close to the inlet.
  4. To adapt the grid, from the main Fluent window, Adapt-Gradient. Select Gradients of to be Velocity. Under that, the default Velocity Magnitude is fine.
  5. In the Gradient Adaption window, Compute. This will display the minimum and maximum velocity gradients in the flow field. Change the Refine Threshold to about 1/10 of the value of the maximum gradient. Mark. The number of cells chosen for refinement are displayed in the main Fluent window.
  6. To see where the grid will be adapted, Manage-Display in the Grid Adaption window. Cells to be adapted will be highlighted. You may have to zoom out to see the whole domain.
  7. Fluent has chosen cells to be adapted, but has not actually adapted anything yet. To adapt, Adapt from the Gradient Adaption window, and Yes (Hanging nodes are acceptable).
  8. Back in the main Fluent window, Display-Grid-Display. See if you can spot where new cells were added to the grid.
  9. Iterate some more (a couple hundred iterations). The residuals will always jump up immediately after a grid adaption, as the flow needs to readjust. The residuals will quickly recover and begin to fall, hopefully to lower values than before the adaption.
  10. The adaption process can be repeated. Each time prior to adapting the grid, Compute to display the minimum and maximum velocity gradients in the flow field, and change the Refine Threshold to about 1/10 of the value of the maximum gradient. Keep in mind that every time the grid is refined, each iteration will take more computer time and memory. If one is not careful, the limits of the computer may be exceeded!
  11. Iterate and perhaps adapt some more as necessary until the solution converges. The residuals may bounce up and down. This is normal, as the code attempts to zero in on a solution. When the residuals all go below the convergence criteria, the calculations will stop. In some cases, however, the residuals reach a lower limit, and further iterations don't improve the solution.
  12. You should not need more than a couple thousand total iterations for this run to converge. Note that there may sill be some reverse flow warnings. This is normal for this case.
  13. In the main Fluent window, File-Write-Case & Data. In the Select File window which pops up, the default file name should be the same as previously entered. OK to write the file onto your directory. OK again since it is okay to overwrite these files.

Examine the streamlines and velocity vectors in detail, and save the image files:

  1. Once the solution has converged, the streamlines and velocity vectors will be examined in detail. First examine the streamlines: Display-Contours, choose Contours of to be Velocity, and below that Stream Function. Display.
  2. Zoom out so that the entire computational domain is shown. If the solution is correct, the streamlines should look nearly like rays (spokes of a wheel), as the streamlines from "far away" should resemble those of a potential flow sink. To display more than the default 20 streamlines, change Levels to 50, and Display. When the display is to your liking, the image file will be saved for printing out later.
  3. Before saving the image file, add a label. Click on the area just below the title at the bottom of the plot. A cursor will appear which will allow you to enter a more descriptive title. Put your name(s) or initials here, along with the words "Axisymmetric Unflanged Inlet", if you have room.
  4. In the main Fluent window, File-Hardcopy. Select the TIFF graphics format, which I have found to give the best results.
  5. Maximize the graphical display window so that the image files you create have the maximum possible resolution.
  6. Return to the main Fluent window by clicking on its box in the tool bar at the bottom of the screen.
  7. Change Coloring to Monochrome if your printer is black and white.
  8. Save, and name the file (something like "axi_unflanged_streamlines.tif" is appropriate). OK. Ignore the warning.
  9. Zoom in so that the field of view shows the inlet occupying about half the vertical distance of the plot window. Observe how the streamlines go into the inlet.
  10. Isopleths near the inlet should also be examined. In the Contours window, change the second entry under Contours Of from Stream Function to Velocity Magnitude. Display. The rapid decay of the velocity magnitude with distance from the inlet plane should be obvious.
  11. Also experiment with the other contour options provided in Fluent. In the Contours window, try changing Contours Of to Pressure. Display. This shows isobars, i.e. contours of constant pressure. Contours of constant residuals is an interesting plot - it can show the user where in the flowfield the solution has converged the most and the least. When done experimenting, Close the Contours window.
  12. Next, the velocity vector field near the inlet will be plotted and examined in detail.
  13. In the main Fluent window, Display-Vectors.
  14. In the window called Vectors, change Style to arrow, and select Vector Options. Change the default Scale Head from 0.1 to 0.3 so that the flow direction is easier to visualize. Apply and Close.
  15. Back in the Vectors window, Display.
  16. Zoom in around the hood face if necessary. The arrows may still be too small to see clearly, so change the Scale to about 2 or 3, and change Skip to 1 (i.e skip every other point), and Display.
  17. Play around with these velocity vector parameters such that the flow pattern can be more clearly seen, yet without much overlap from one vector to another. The flowfield should have converged enough that flow is clearly being sucked into the inlet.
  18. When the plot is to your liking, save the image as a TIFF file as previously (name it something like "axi_unflanged_vectors.tif"). OK.
  19. Also experiment with the color options provided in Fluent. In the Vectors window, try changing Color By to Pressure. Display. This enables the user to visualize the velocity field, while simultaneously viewing the pressure field, since pressure changes are indicated by color changes. Finally, Close the Vectors window.

Generate an isopleth contour plot:

  1. In this section, we generate isopleths (contours of constant normalized velocity magnitude).
  2. In the main Fluent window, Define-Custom Field Functions.
  3. Select Field Functions to be Velocity, and immediately below that, Velocity Magnitude. Select. Note that "|V|" appears in the Definition of the custom field function.
  4. Click on the "/" sign (divide) on the calculator pad, and click on "1" and "0" so that we divide the velocity magnitude by the average speed through the hood face, i.e. 10.0 m/s. Then click on "x" and "1", "0", and "0" to multiply our value by 100 to convert to percent.
  5. Change the name of the custom field function to "isopleths", and Define. We have now successfully created a custom field function that is the normalized velocity magnitude, expressed as a percentage of face velocity. Close.
  6. In the Contours window, select Contours of to be Custom Field Functions.
  7. Turn off Auto Range, and enter "0" and "100" as the Min and Max limits. Change the number of contour levels to 20, and Display.
  8. Adjust the sizes and locations of the graphics display window and the main Fluent window such that both are clearly visible.
  9. Click with the right mouse button on a contour line. Its value will be displayed in the Fluent window.
  10. Draw a sketch of several contour values so that you can later add labels to your hardcopy printout.
  11. Zoom in or out as necessary so that approximately three half-slot heights are visible in front of the face of the inlet, and save the image as a TIFF file. (Be sure to name it appropriately.)

Examine the decay of velocity along the centerline:

  1. The velocity magnitude along the centerline of the inlet (i.e. along the x axis) will be plotted and examined in detail.
  2. In the main Fluent window, select Plot-XY Plot. A window called Solution XY Plot will open up. In this window, select axis under Surfaces. This will select the line in front of the hood face, along the centerline.
  3. In the upper left corner of the window, the default Position on X Axis, should be on, and Position on Y Axis should be off. This will make the x-axis the x position on the plot, and we will have to select a variable for the y-axis for plotting versus x position.
  4. In the upper middle part of that window, the default Plot Direction should be X = 1 and Y = 0. This will make the x-coordinate position appear on the x-axis, as desired for the plot.
  5. The upper right part of the window selects the variable to be plotted. Select the Y Axis Function to Custom Field Functions, and below that, Isopleths. For the X Axis Function, the default choice of Direction Vector is fine as is. Plot.
  6. If done properly, the plot should show the normalized velocity magnitude decaying from a face value of around 100% at the inlet face to nearly zero far away.
  7. The plot can be made a little nicer looking, and the axes limits can be changed as follows: Axes. Choose X if necessary (X should already be the default). Unselect Auto Range, and select Major Rules. Set Range from 0 to 1, which is about 5 inlet diameters away. Apply. (Nothing will happen to the plot yet, so don't panic.)
  8. Now choose the Y axis. Unselect Auto Range and select Major Rules for this axis as well. Set the range from 0 to around 100 (%).
  9. To make the scale more readable, change Type under Number Format to Float, and change Precision to 0. Apply. Close.
  10. Back in the Solution XY Plot window, Plot. Adjust the axes limits and/or number format as desired to obtain a nice-looking plot.
  11. The data points created for this plot will be written out to an ASCII (text) file for later use. For example, they can be imported into Mathcad or into a spreadsheet for further analysis. In the Solution XY Plot window, turn on the option called Write to File, and then Write.
  12. Type in an appropriate file name, like " axi_unflanged_data_points.txt", and OK.
  13. Finally, a hardcopy file of this plot will be saved. In the main Fluent window, File-Hardcopy-Save, name the file (something like "axi_unflanged_decay.tif" is appropriate). As before, OK, and Close.

Save your calculations and exit Fluent:

  1. In the main Fluent window, File-Write-Case & Data. OK. It is okay to overwrite the files, so OK again.
  2. Exit Fluent by File-Exit. This will return you to the Unix shell.

Print the image files:

  1. Check that four image files exist on your directory - streamlines, velocity vectors, isopleths, and the decay of velocity magnitude along the centerline axis. Enter "ls -la" from the Unix shell to see a list of files.
  2. Make a printout of each of these images. You have several options here. The easiest is to print directly to the default printer in the SGI lab. Alternately, you can save the files on a floppy disk, and print them out somewhere else.
  3. To print to the GCL lab printer, follow these directions:
  4. To write to a floppy disk, put in a floppy, right-click on the desktop, and then Disks-Floppy. The floppy drive will then appear as a link on the desktop, to which you can drag and drop files. NOTE: before you eject the floppy disk, be sure to right-click the desktop, then de-select Floppy.