Simulation of Laminar Pipe Flows
57:020 Mechanics of Fluids and Transport Processes
CFD PRELAB 1
By Tao Xing and Fred Stern
IIHR-Hydroscience & Engineering
The University of Iowa
C. Maxwell Stanley Hydraulics Laboratory
Iowa City, IA 52242-1585
1. Purpose
The Purpose of CFD PreLab 1 is to teach students how to use the CFD educational interface (FlowLab 1.2.10), be familiar with the options in each step of CFD Process, and relate simulation results to AFD concepts. Students will simulate laminar pipe flow following the “CFD process” by an interactive step-by-step approach. Students will have “hands-on” experiences using FlowLab to compute axial velocity profile, centerline velocity, centerline pressure, and friction factor. Students will compare simulation results with AFD data, analyze the differences and possible numerical errors, and present results in CFD Lab 1 report.
Flow chart for ISTUE teaching module for pipe flow (red color illustrates the options you will use in CFD PreLab 1)
2. Simulation Design
In EFD Lab 2, you conducted experimental study for turbulent pipe flow. The data you have measured will be used for CFD Lab 1. In CFD PreLab 1, simulation will be conducted only for laminar circular pipe flows, i.e. the Reynolds number is less than 2300. Reynolds number based on pipe diameter and mean inlet velocity is 654.75 in the current simulation. CFD predictions of friction factor and fully developed axial velocity profile will be compared with AFD data.
Since the flow is axisymmetric we only need to solve the flow in a single plane from the centerline to the pipe wall. Boundary conditions need to be specified include inlet, outlet, wall, and axis, as will be described in details later. Uniform flow is specified at inlet, the flow will reach the fully developed regions after a certain distance downstream. No-slip boundary condition will be used on the wall and constant pressure for the outlet. Symmetric boundary condition will be applied on the pipe axis. Since the flow is laminar, turbulence models are not necessary.
3. CFD Educational Interface
Right after you launch FlowLab 1.2.10, you will see the following interface:
Select “pipe” and click “start”, the following interface will be shown. The top right corner illustrates the CFD processes: GeometryàPhysicsàMeshàSolveàReportsàPost-processing. There is also a sketch window that shows the definition of all boundary conditions and coordinates.
If you close the sketch window and want to show it, you can click <FileàProblem Overview>.
You MUST save your work regularly to avoid any possible lost of your data and jobs. <FileàSave As>. Then use the <Browse> button to locate the directory where you want to save. It is recommended that you created your own folder in the FlowLab working directory: C:\Documents and Settings\Fluidslab\myflowlab\YOURNAME\.
4. CFD Process
Step 1: (Geometry)
1. Radius of pipe (0.02619 m)
2. Length of pipe (7.62 m)
Click <Create>, after you see the pipe geometry created, click <Next>.
Step 2: (Physics)
1. With or without Heat Transfer?
Since we are dealing only with the flow and not with the thermal aspects of the flow like heat transfer etc, switch the heat transfer > button OFF.
2. Incompressible or compressible
Use “Incompressible”, which is the default setup.
3. Flow Properties
use the values shown in the above figure. Input the values and click <OK>.
4. Viscous Model
In CFD PreLab 1, Choose laminar model and click <OK>.
5. Boundary Conditions
At “Inlet”, we use zero gradient for pressure and fix the velocity to be 0.2m/s.
At “Axis”, FlowLab uses zero gradient for axial velocity and Pressure and specify the magnitude for radial velocity to be zero. Read all the values and click <OK>.
At “Outlet”, FlowLab uses magnitude for pressure and zero gradients for axial and radial velocities. Input “0” for the Gauge pressure and click <OK>.
At “Wall”, no-slip boundary conditions are fixed for both axial and radial velocities, gradient for pressure is zero. Read the panel and click <OK.
6. Initial Conditions
Use the following setup for initial conditions.
After specifying all the above parameters, click <Compute> button and FlowLab will automatically calculate the Reynolds number based on the inlet velocity and pipe diameter you input. Click the <Next>, this takes you to the next step, “Mesh”.
Step 3: (Mesh)
For CFD PreLab 1, “Structured” meshes will be generated using “Automatic” generations. NR and NX are the numbers of intervals in axial and radial directions. For “Automatic” generation, choose the mesh density to be “Medium”, and click <Create>, FlowLab will automatically generate the mesh you required and display the grid information NR, NX. Manually generation of mesh is NOT required in this course.
Step 4: (Solve)
The flow is steady, so turn ON the “Steady” option and the “Unsteady” option will automatically be turned OFF. Specify the iteration number and convergence limit to be 10000 and 10-6, respectively. Use 10, 20, 40, 60, 100 for radial profile x/D positions and choose “Double precision” with “2nd order upwind scheme”. Use “New” calculation for this Lab.
Then click <Iterate>, FlowLab will start the calculation, whenever you see the window, “Solution Converged”. Click <OK>.
NOTE: FlowLab determine when to stop a calculation based on the iteration number and convergent limit you specified. If: 1. The maximum iteration number is reached, but convergent limit is not reached, or 2. Convergent limit is satisfied, but maximum iteration number is not reached, FlowLab will terminate the computation.
The iterative history of residuals for continuity equation and X and Y momentum equations will be shown automatically during the computation.
To turn OFF the X and Y grids in the figure, you can click <Axes> and the following window will appear. Turn OFF the <Major Rules> and <Minor Rules> for both X and Y axis, click <Apply> and <Ok>.
To save the XY plot and pasted into WORD, you can click the XY plot, press and hold the <Alt> key and press <Print Screen Sys>, then in WORD, click <Paste>.
If you want to save the XY plot as a *.JPG, *.TIFF, or *.BMP file, you can click <Hardcopy, choose the figure format you need and use the <Browse> button to specify the folder you need (NOT the path shown in the figure). It is strongly recommended that you choose the “Printer Friendly Colors” before you <Save>.
Step 5: (Reports)
“Reports” provides information of “Total Pressure Drop” and “Wall Friction Force”. It also enables the users to plot XY plots and conduct “verification and Validation” (not required in this course).
Create the XY plot for “Wall Friction Factor Distribution” and record the “wall friction factor” in the developed region (near outlet) and compare its value with the AFD data. Import AFD data for axial velocity profile and compare with “Profiles of Axial Velocity” (For details, see exercises at the end of this document).
“XY Plots” provide options to plot axial velocity profile (axial velocity vs. radial distance from the centerline), centerline pressure/velocity distribution (pressure/velocity vs. streamwise location, x). The following figure shows the example for axial velocity profiles at different streamwise locations you specified at Step 4 “Solve”.
To import the AFD data and put on top of the above CFD results, just click <File> button and use the browse button to locate the file you want and click <Import.
You can also click <Curves> to choose which curve will be displayed. You can press and hold <Ctrl on your keyboard and use the left button of mouse for multiple choices.
In this Lab:
1. AFD data for fully developed laminar axial velocity profile is available on class website in the name of “axialvelocityAFD-laminar-pipe.xy.” You need download it to your local folder:
C:\Documentsa and Settings\Fluidslab\myflowlab\YOURNAME\
In exercise 2, you will be asked to export the fully developed velocity profile at x=100*d. To do that, you need first ONLY activate the curve at x/d=100 and click <Ok>.
Then, click <FileàExport Data, <Export Active Data Only>. And then use the <Browse> button to specify the folder and file name you want export, and click <Export>.
Step 6: (Post-Processing)
In Step 5, there is no <Next> button in the panel. You need click the post-processing button at the top right corner. FlowLab will provide three post-processing objectives: “Contour”, “Vector” and “Streamline”. To show contour, choose “Contour”, click <Activate>, contour for axial velocity will be shown. You can then click <Modify> button to select different variables if you need. For a better view, press and hold the right button of the mouse and drag towards you, you will have a close-up view of certain region of the pipe.
NOTE: If you happen to rotate the figure, such as the following:
You can always use the button to align the pipe with the coordinate and use to view the full size of the pipe.
To view velocity vectors, click Close> on the modify panel, and select “Vector” with <Activate>, if you don’t want pressure contour you plotted before to be shown, just choose “Contour” and then click <Deactivate>. The following figure shows an example for velocity vectors. Due to the large ratio of pipe length and pipe diameter, you need zoom in to view the velocity vectors.
You can press and hold the middle button of the mouse and move the graphic displayed to left or right, in order to choose the region where flow begins to become fully developed flows, just as shown above. You can also use the <Edit> button for vectors to specify an appropriate “scale” value.
Function of plotting streamlines will be introduced in CFD PreLab2.
5. Exercises
You must complete all the following assignments and present results in your CFD Lab 1 reports following the CFD Lab Report Instructions.
Simulation of Laminar Pipe Flow
· You must save separate case file for each exercise using “file”à “save as”
· You need use CFDLab1-template.doc to save all the figures and data
1. Compare CFD with AFD on friction factor
Use “automatic” “medium” mesh, and all other default values in the instructions, iterate the simulation until it converges. Find the relative error between AFD friction factor (0.097747231) and friction factor computed by CFD, which is computed by:
To get the value of, you need first generate XY plot for “Wall Friction Factor Distribution”, then use <File>àExport data>àBrowse> to create the data file. Then use EXCEL to open the data file and pick the value close to the pipe exit or inside the fully developed region.
· Figures need to be saved: 1. residual, 2. centerline pressure distribution, 3. centerline
velocity distribution, 4. wall friction factor distribution, 5. profiles of axial velocity at all
streamwise locations (x/D=10,20,40, 60,100) with AFD data, 6. contour of radial velocity,
and 7. velocity vectors (pick up the region where flow begins to become fully developed).
· Data need to be saved: friction factor in the developed region, developing length. Here, developing length is defined as the length from pipe inlet to the axial location where the centerline velocity does not change any more.
2. Normalized developed axial velocity profile
2.1. Export the axial velocity profile data at x=100d following the instructions in Step 5.
2.2. Use EXCEL to open the file you exported and normalize the profile using the
centerline velocity magnitude, which is the maximum value on that profile. Plot the
normalized velocity profile in EXCEL and paste the figure into WORD, together with
other figures you made in Exercise 1.
3. Questions need to be answered when writing CFD Lab 1 report
3.1. Can you use centerline pressure distribution to determine the “developing length”?
Why?
3.2. What is the value for radial velocity at developed region?
3.3. Summarize your findings in CFD Lab report and try to relate them to your
classroom lectures or textbooks.
13