Cover Page for Precalculations – Individual Portion Introduction to Computational Fluid Dynamics Prepared by Professor J. M. Cimbala, Penn State University Latest revision: September 18, 2014 by Corey Breznak, Guangsheng Zhang and Prof. Chao-Yang Wang Name: ________________________________________ Date: ________________________________________ Section number: ME 325._____ Group # _____ Score (For instructor or TA use only): Precalculations _____ / 30 Comments (For instructor or TA use only): 1 Precalculations A. Flow over a Cylinder In the first part of this lab, the instructional CFD code FLUENT (now part of ANSYS) will be used to calculate the drag force FD on a two-dimensional cylinder whose radius is 2 cm. (4) 1. Calculate the drag coefficient CD, per unit depth, given the drag force is 7.2 µN and a velocity of .0003 m/s. Note the flow is perpendicular to the axis of the cylinder (see the figure on page 8 of the Tutorial attached at the end). (3) 2. In the first CFD exercise, where should the computational mesh be the finest and why? (3) 3. When choosing a mesh size there are tradeoffs one must consider. What are the tradeoffs of picking a finer mesh over a courser one? B. Laminar Boundary Layer Flow over a Flat Plate In the second part of this lab, you will use the CFD code FLUENT (now part of ANSYS) to simulate the growth of a boundary layer along a flat plate aligned parallel to the flow. Laminar flow is assumed. You will generate the computational domain, specify boundary conditions, and generate the grid using the software provided in ANSYS. The physical geometry and the computational domain are sketched in Figure 8. 3 Boundary layer Flat plate (x) V Computational Domain 4 2 H V L x (a) 5 Flat plate xleading L 1 x (b) Figure 8. (a) physical geometry and (b) computational domain (blue shaded area) for CFD calculation of the boundary layer growing on a flat plate (not to scale). 2 (5) (5) 1. 2. For each numbered face on the computational domain of Figure 8b, specify the most appropriate boundary condition: Boundary condition 1 = . Boundary condition 2 = . Boundary condition 3 = . Boundary condition 4 = . Boundary condition 5 = . The CFD calculations for flow over a laminar flat plate boundary layer will be compared to the simple similarity solution 1 U 2 u of Blasius (1908). His solution is in terms of nondimensional variables as a function of y . Because of this U x clever nondimensionalization, any laminar flat plate boundary layer for any Newtonian fluid at any Reynolds number should collapse onto the same universal Blasius profile. Fill in the blank spaces to complete this predicted laminar flat plate boundary layer velocity profile, and show where you obtained your data: Table 1. Blasius velocity profile in nondimensional form (valid for all flat plate laminar boundary layers). 1 U 2 y x 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 u U (at the wall) (far outside the boundary layer) 0.0 0.06641 0.13277 0.19894 ________ 0.32979 0.39378 ________ 0.51676 ________ ________ 0.68132 0.72899 0.77246 ________ 0.84605 0.87609 0.90177 ________ 0.94112 0.95552 0.96696 0.97587 0.98269 0.98779 0.99155 1.00000 (no slip condition) (freestream velocity) Data are from the following Reference (author, title, publisher, copyright date, page number(s), table number, etc.): 3 (5) 3. Create a plot (Excel is recommended) of the Blasius boundary layer profile. The horizontal axis should be the normalized 1 U 2 axial velocity u/U, and the vertical axis should be the similarity variable y . Use a line (no symbols) for your plot, x and attach it to your Precalculations. After the lab is finished, you will plot the data predicted by CFD on this same plot (as symbols, no line), so be sure to save your Excel file for future use. See Figure (2) 4. . For the computer code, the grid over a two-dimensional flat plate will be generated. The freestream velocity U, above the flat plate is specified as 0.10 m/s. The plate length is L = 0.50 m in the streamwise direction. Assuming the fluid is water at 20oC (density is nearly 1000 kg/m3 and kinematic viscosity is about 1.0 10-6 m2/s), estimate the Reynolds number Rex at the end of the plate, showing your calculations below: Rex = ______________________ . (3) 5. For the conditions above, and assuming the boundary layer remains laminar, estimate the laminar boundary layer thickness at the end of the plate, showing your calculations below: = _________________ mm. Experimental Objectives a. b. c. d. e. Get familiar with operation of the CFD code FLUENT in ANSYS Workbench. Determine the velocity and pressure fields produced when a fluid flows over a cylinder and calculate drag force exerted by the fluid over the cylinder using the CFD code FLUENT. Generate a grid for calculation of a laminar flat plate boundary layer, using the grid generating code in ANSYS. Define the boundary conditions, fluid properties, and numerical properties for flow over a flat plate using the CFD code FLUENT. Calculate laminar boundary layer profiles on a flat plate using FLUENT, and compare to published data, namely those of Blasius. 4 Appendix: To be performed during the lab session Flow over a Cylinder – Two Dimensional Case Using ANSYS Workbench Simple Mesh Latest revision: September 18, 2014 The primary objective of this Tutorial is to guide the student using the CFD code FLUENT for first time through the very basics of CFD simulation using ANSYS Workbench. The objective of this simulation is to determine the velocity and pressure fields produced when a fluid flows over a cylinder. In addition, the drag force exerted by the fluid over the cylinder is computed. Streamline plots are also available. Summary: In this exercise, the flow over a cylinder is modeled. The flow is assumed to be two dimensional therefore the cylinder can be represented by a circle. A flow domain surrounding the cylinder is created and meshed. Boundary conditions are applied to the simulation to obtain plots of static pressure, velocity magnitude, and streamlines. The drag coefficient can be calculated using the forces exerted by the fluid on the cylinder as computed by the software. 5 1. Starting ANSYS Workbench Click on the Start Menu, and then select Workbench 14.0. Close Getting Started window. Left click on the tab corresponding to FluidFlow (FLUENT) and without releasing the mouse button drag the icon to the Project Schematic window (central big window). Click twice on the lower tab and rename the project to Cylinder1 Now right click on the Geometry tab and select the properties option, a Properties of Schematic window will open. Change the Analysis Type under the Advanced Geometry Options from 3D to 2D. Back to the Project Schematic Window, click twice on the Geometry tab. This action will launch ANSYS Design Modeler (green logo DM). 2. Create Geometry Set units to centimeters (cm) and click ok. Right click on icon corresponding to XYPlane and select look at. Down below the Tree Outline window you will see the Sketching and Modeling tabs. Select the Sketching tab. A Sketching Toolboxes window will replace the Tree Outline window with a new set of tabs, select the Settings tab. Select Grid and activate the buttons Show in 2D and Snap. Make sure that Major Grid Spacing is set to 5 cm, Minor–Steps per Major is 5, and Snaps per Minor is 1. Click on the icon corresponding to New Sketch to create sketch 1. Click again on the icon to create Sketch 2. Click on the Modeling tab and you will notice that you have created Sketch 1 and Sketch 2. 6 Click on Sketch 1 and then click on the Sketching tab. Select the Draw tab and choose circle . Draw a circle with center at the origin (at this point the size of the circle is not important, it will be adjusted in the next step), and then click on Generate. Once the circle has been created select the tab corresponding to Dimensions and choose Radius. Left click on the circle you just drew and drag the mouse outwards without releasing the mouse button until you see an arrow indicating the radius of the circle, then release button. On the new window that appears (Details View window) adjust the radius to 2 cm, and click on Generate. Select now Sketch 2 and click on the Draw tab. Choose Rectangle. Then create a rectangle with vertices (-30, 20) and (50, - 20). Click on Generate to create this entity. Now go to the Concept tab and select Surfaces From Sketches. 7 Use the Ctrl key select Sketch 1 and Sketch 2. The rectangle and the circle must become yellow. Click on Apply on the Details View window. The circle and the rectangle will become cyan. Now, click on Generate. You have created a circular and a rectangular surface. The next step consists in subtracting the circle from the rectangle so we create the geometry that we will use to generate our mesh. Click on the Create tab and select Boolean. In the Details window, select the Operation tab and choose Subtract. Click on the Target Bodies tab. Going back up to the Tree Outline window, under 2 Parts, 2 Bodies. Select the Surface Body tab that highlights in yellow the rectangle. Then click Apply. The rectangle will become cyan. Now click on Tool Bodies, select the Surface Body tab that highlights in yellow the circle and click Apply. The circle will become cyan. Make sure that the tab corresponding to Preserve Tool Bodies? Is set No. Click on Generate. Our geometry is almost ready to be meshed. But before that we need to specify the entities of our geometry, that is, the inlet, the outlet, the walls and the cylinder. 8 On the upper tools bar, select the icon corresponding to Selection Filter: Edges. Place the mouse near the left end of the rectangle and left click to highlight it (green). Once it is green right click to select Named Selection. Then click on Apply, and finally on Generate. Right click on the new entity created, NamedSel1, and choose Rename. Type Inlet and hit enter. Follow same procedure for the right end of the rectangle to define the outlet. Place the mouse near the right end of the rectangle; left click to highlight it (green). Then right click to select Named Selection. Then click on Apply, and finally on Generate. Right click on the new entity created, NamedSel2, and choose Rename. Type Outlet and hit enter. Finally we follow the same procedure to create the cylinder. Always using the Selection Filter: Edges tool, left click on the circle to highlight it on green, then right click to choose Named Selection, click on Apply, click on Generate and rename it to be Cylinder. Click on the Save Project icon to save your work. 9 The layout out of our DM should look like this: Close DM and go back to the Workbench. 10 3. Mesh Generation On your Ansys Workbench, double click on the tab corresponding to mesh. Select Mesh from the outline window. In the Details of Mesh window, click the plus sign next to Sizing to expand it. Change Relevance Center to Fine. Click on Update. Close the window. Save your work on the Workbench 4. Setting up Physics and Solution of the Problem using Fluent Double click on the Setup tab, and then click OK on the Fluent Launcher window. Once Fluent opens you will see the mesh you just created displayed on the central window. On the left side you will see a menu showing three main sections: Solution Setup, Solution, and Results. Let’s start by setting up our problem. Activate the gravity effects by checking the button next to Gravity. Set Gravitational Acceleration equal to -9.81 on the section corresponding to Y–direction. Select the tab corresponding to Units… under Quantities select Length and set it to cm. Then click Close. Next, click on Models and make sure that everything on the Models window is off except the third option corresponding to viscous, this must be Viscous–Laminar. Next, click on Materials, highlighting the option corresponding to Fluid, click on Create/Edit. Select Fluent Data Base on the window that opened. Select Water–Liquid (h2o<l>). Click on Copy, and then Close. Also close the Create/ Edit Materials window. 11 Now click on the Cell Zone Conditions tab and click on the Edit… button. Change the Material Name from air to water–liquid. Click OK. Now we input the boundary conditions. Select Inlet and click on Edit. Set the Magnitude of the Velocity (m/s) to 0.0003. Click OK. On the outlet make sure that the Type is set to pressure-outlet. Click on Edit… and make sure that the Gauge Pressure (pascal) is 0. Click OK. Make sure that cylinder and wall-surface_body are defined as Type wall. Under Solution, select Solution Initialization and click on Initialize. Go to Run Calculation, set Number of Iterations to 1000, Reporting Interval to 10 and click on Calculate. Once the solution has converged we proceed to review the results. Under the Results section click on Graphics and Animations. On the window that gets activated select Contours and Set Up. A new window will open, select the option Filled, and select Contours of Velocity with the option Velocity Magnitude. Then click on Display. From the main menu, File then Save Picture, select TIFF, and then Save. Give a unique, descriptive name (like “flow_over_cylinder_yourname.tif”) to the file, OK and Close. This picture file will be used in your group report later. Now still under the Graphics option select Vectors, then click on Display. Then save the plot as described in above step. The file will be used in your group report. A number of parameters are available through the contour plots, in our case, pressure is also a relevant parameter. Plot the contour of pressure and save the plot as described above. The file will be used in your group report. Finally we can determine the drag exerted by the fluid on the cylinder using the Reports section 12 under Results. Click on Reports, select Forces and press the Set Up … button. Select only the Wall Zone corresponding to Cylinder by highlighting it. Click on Print. A print out with all the forces acting on the cylinder will be shown in the command window. Then click on Write to save the report as .txt file (name it like “flow_over_cylinder_forces.txt”). In this example, we obtained that the total drag force acting on the cylinder is 6.9852347 ×10-6 N, th corresponds to a CD = 3.88. In this case Re = 11.94. What does the experimental data say? Now we will finish this exercise by doing an apparently minor change. Go back to the Boundary Conditions and select wall-surface_body. Change the Type to Symmetry and accept on the two windows that will open. Initialize the problem again and Run Calculation. Plot and save the new velocity and pressure contour plots for your group report. What differences do you find in the velocity and pressure contours? Calculate the new forces. Print and save the new results. What is the CD now? 13