The Hong Kong Polytechnic University ME4414 Fluids Engineering Computational Fluid Dynamics (CFD) Tutorial Report
By Ali Jahan Zaib (12063189D) 27th October 27, 2014
Contents 1.
Objective: .............................................................................................................................................. 2
2.
Problem Definition: ............................................................................................................................... 3
3.
Methodology:........................................................................................................................................ 4 3.1 Mesh Generation: ............................................................................................................................... 4 3.2 Solver Setup: ....................................................................................................................................... 7
4.
Results and Discussion: ....................................................................................................................... 14 For Re=1 .................................................................................................................................................. 15 For Re=10 ................................................................................................................................................ 17 For Re=100 .............................................................................................................................................. 20
5.
Conclusion: .......................................................................................................................................... 24
References and Appendix: .......................................................................................................................... 25
1
1. Objective: The aim of this CFD tutorial is to familiarize with the mainstream CFD software ANSYS. The software used is ANSYS ICEM and FLUENT. Through solving a sample problem by CFD software, we will achieve the following objectives: 1. 2. 3. 4. 5. 6.
To be able to create a 2-D mesh To be able to troubleshoot basic meshing problems To be able to solve a sample problem via CFD To be able to change parameters to obtain different results To be able to run a simulation and generate meaningful reports To apple knowledge learnt to future fluid mechanics problems
2
2. Problem Definition: In this CFD tutorial, a sample problem has been provided which will be solved using CFD software. Let us define the problem. Air flows across a cylinder with a uniform velocity of 0.1 m/s in a wind tunnel. The length of the wind tunnel (i.e. Fluid Domain) is 2.5m long and 1m in height. The diameter of the cylinder is 0.1m. Below is the diagram of the model:
We have to make a few assumptions. We assume that the fluid is incompressible and that the problem is two dimensional. We also assume the cylinder to be a smooth cylinder.
3
3. Methodology: For the CFD, we will first require to make a mesh in ANSYS ICEM for the problem and then transport the mesh into ANSYS FLUENT to conduct the simulation. It is important to note that we need to carry out more than one simulation to obtain different results to ensure that the data obtained is reliable and match it with existing data available. The boundaries given by the tutorial sheet may or may not be enough to obtain correct results thus we have the following values we can adjust to obtain different sets of results. Test set up for Reynolds number Re= 1, 10 and 100 These different inputs will help us learn more about the CFD software as well as how the inputs affect the model at hand. By manipulating the inputs, we can have a better understanding of the fluid flows and become more confident in analyzing fluid simulations and making good judgment of fluid problems. In the following sections, we will discuss more about the usage of ANSYS ICEM for mesh generation and ANSYS FLUENT for the solver setup.
3.1 Mesh Generation:
The idea behind mesh generation is that CFD software utilize numerical methods to solve for complex fluid mechanics equations through an iterative process. This is a method that develops approximations of the governing equations of fluid mechanics and thus applies them onto the mesh which is essentially a grid that may be 2-dimensional or 3-dimensional. As system of equations are solved, the solutions correspond to a specific cell on the grid and after the simulation has ended, the whole mesh contains the various values. The data is post-processed to extract important information such as drag, lift or pressure. The mesh has various properties that can be adjusted to obtain varying degrees of accurate results and the mesh also needs to be altered based on the complexity of the model system. Parameters such as grid type (Hex or Quad), resolution of the grid, how many cells required or even if enough memory is 4
present all affect the accuracy of the results but also the time required to obtain the results. A higher resolution mesh may give a more accurate result but it is not always the case as there may be other limiting factors or one may have simply obtained an accurate result and further increasing the mesh resolution would be a waste of resources. For example problem at hand, we have the following mesh properties: Mesh Part Cylinder Inlet Outlet SideA SideB Diagonal edge near cylinder
Nodes 100 100 100 250 250 10 per edge Table 1 - Mesh Parameters
The nodes are basically points on the mesh which are used as points for the finite element analysis used by the solver to solve the under lying fluid mechanics equations. The more the number of modes, the higher the resolution of the mesh but this also requires a longer processing time to calculate the results. Thus, the above values represent the number of node an edge is divided into. Through ICEM, it is possible to add extra nodes to specific parts of the model to enhance the results obtained from those parts which are more essential such as areas near the cylinder. On the next page are images showing part of the setting in ICEM during meshing process.
5
Figure 2-Mesh setup showing cylinder as example
Figure 1 - Mesh parameters of Diagonal Edge
6
Figure 3 - Finished Mesh
3.2 Solver Setup:
For any given problem, when we move to the simulation phase, we have to set up our numerical model. This is very important as if our input is faulty, our results will be faulty thus we will not be able to solve the problem. We have to select appropriate physical models and then set the proper parameters for the turbulence and other factors. We have to define the material properties such as the density, flow rate, temperature etc. Then prescribe the operating conditions and boundary conditions at all boundary zones. We may need to provide an initial solution and then set up the solver controls and finally the convergence controls. It is important to set up a properly defined convergence monitor as sometimes we may not need to do 100 iterations to obtain accurate results. Thus we need to set up a proper monitor so that we can save time and resources. For example problem at hand, we have followed the FLUENT tutorial notes and the provided values from the problem to define all the parameters before starting the calculation. On the next few pages, the details of the Solver setup are discussed.
7
The list of parameters used are shown in the table below: Parameters Area (m2) Density (kg/m3) Depth (m) Enthalpy (j/kg) Length (m) Pressure (Pascal) Operating Pressure (Pascal) Temperature (K) Velocity (m/s) Viscosity (kg/m-s) Ratio of Specific Heats
Values 0.1 1.225001 1 0 1 0 101325 288.16 0.000146073 1.7894e-05 1.4 Table 2 - Solver Parameters
Figure 4 - Solver Parameters
8
One thing to note for the values shown on the previous page is that they are the values for the condition of Re=1 which is based on the following equation for Reynolds Number calculation: 𝑅𝑒𝑦𝑛𝑜𝑙𝑑𝑠 𝑁𝑢𝑚𝑏𝑒𝑟 (𝑅𝑒) =
𝜌𝑉𝐷 𝜇
where ρ is Density of fluid, V is free stream velocity, D is characteristic length of particle/object and 𝜇 is viscosity of fluid. Setting the Re=1 and finding the corresponding velocity that is required, 𝑅𝑒 = 1=
𝜌𝑉𝐷 𝜇
(1.225)𝑉(0.1) (1.7894𝑒 − 0.5)
∴ 𝑉 = 0.000146073 𝑚/𝑠 Therefore, the velocity is out controlled parameter that we adjust to obtain the results for the simulation at Re=1, Re=10 and Re=100. Rest of the values are kept constant. Reynolds Number 1 10 100
Velocity (m/s) 0.000146073 0.00146073 0.0146073 Table 3 - Reynolds number and corresponding Velocities
We set the solver to consider transient analysis as the patterns generated are changing with time and we want to be able to see the distinct patterns at a specific time.
9 Figure 5 - General Solver Settings
Then, the model chosen for this analysis is selected. We have selected Viscous Laminar flow situation which is suitable for this analysis.
Figure 6 - Model
We are using “Air” as the fluid in this analysis and we take the default values for the density and viscosity as provided by FLUENT which have been shown in Fig. 4.
10
We then select the Solution methods in which we select PISO method.The Transient formulation method employs Second Order Implicit finite element analysis model. This ensures accuracy for the results and required initial values to be provided. Thus the step after requires initialization of the values into the solver as shown in the figures below.
Figure 7 - Solution methods
Figure 8 - Solution Initialization
11
Next step involves setting the Monitors, also known as congerence monitors that alow the user to see if the soution has converged or not and it can also allow the user to monitor various other parameters such as the Drag and Lift coefficients. We have set our slver to monitor the Drag and Lift coeffitients at specific parameters such as every 5 time steps.
Figure 10 - Solver Monitors
An optional set is to include the recorder for the animation sequence. This is a feature that will allow us to generate an animation of the flow after the simulation has ended. This can be especially useful to visualize the flow and see how the flow acts around the object. We have set our solver to record the frames of the flow every 5 time steps that will allow us to generate an animation at the end.
Figure 9 - Animation Recorder
12
The final step is to run the calculation which is shown in the next page.
Figure 11 - Running the Calculation
This is the final and an important part of the simulation which determines how accurate and how long will the simulation run for. For all of our Re values, we have set the following values: Parameters Time Step (s) Number of Time Steps Max iterations per Time Step
Values 0.5 5000 20
Table 4 - Time Step Parameters
Finally, the solver it set to calculate and the results are generated. Time taken varies based on the complexity of the calculation. 13
4. Results and Discussion: After running all the simulations for the 3 Re values, the following results are obtained. The results have been divided by the Re values and they contain information for the Pressure Coefficients, Velocity Magnitudes and Path lines. They are also compared to the existing literature values and diagrams for accuracy of results. Results are shown starting next page for better visualization in landscape.
14
For Re=1,
Figure 13 - Re=1, Pressure Coefficient Contour
Figure 12 - Re=1, Velocity Contour
15
Figure 14 - Re=1, Pathlines
Figure 15 - Reference Diagram for Re<<1
16
For the results at Re=1, we can see that the Pressure contour reveals that the pressure is the highest at the front of the cylinder and that behind it is relatively low pressure. For the velocity contour, we can see a similar case that the velocity is actually the lowest in the front of the cylinder. Furthermore, seeing the Pathlines, we can see that the pattern is very similar to the reference diagram for the flow over a cylinder at low Re values such as around 1 or lower. This thus confirms that the results obtained are quite accurate and we have had a successful simulation for Re=1. Next we take a look at Re=10 with the velocity increased by a factor of 10. For Re=10,
Figure 16 - Re=10, Pressure Coefficient Contour
17
Figure 18 - Re=10, Velocity Contour
Figure 17 – Re=10, Pathlines
18
Figure 20 - Reference Diagram for Re=10
Figure 19 - Re=10, Pathlines Close-up
We can see above that the results at Re=10 are much more different as we can start to see a laminar wake region form behind the cylinder. The results are further confirmed when matched with the reference diagram for the flow at Re=10 over a cylinder. Thus simulation has been successful. Finally, we look at the Re=100 in the next part.
19
For Re=100,
Figure 22 - Re=100, Pressure Coefficient Contour
Figure 21 - Velocity Contour
20
Figure 24 - Re=100, Pathlines
Figure 23 - Re=100, Pathlines Close-up
21
Figure 25 - Reference Diagram for Re=100
Observing the results, we can see how the Karman Vortices have formed behind the cylinder at Re=100. This has caused a vibration in the object which is further revealed by the relation of the Drag and Lift coefficients. We can also see that the Pathlines closely adhere to the reference diagram for Re=100. Let’s take a look at the Drag and Life coefficient chart.
Figure 26 - Reference Chart of Cd and Cl w.r.t Time Figure 27 - FLUENT Cd and Cl relation w.r.t Time
22
The above charts comparison shows that the results of the variation of the Cd and Cl with respect to time are close to the reference values from the notes chart, thus overall the simulation has been accurate for Re=100. There may be errors in the chart or slight variances in the simulation results. This is normal as the simulation will calculate new each run and thus is bound to have some variances over time. These errors are negligible in this research as the results highly resemble the reference values and diagrams thus we can say that the simulation overall was very accurate.
23
5. Conclusion: To conclude, through this tutorial analysis on the flow over a cylinder at different Re values, we have managed to learn the basics of the CFD software. WE have learnt how to generate mesh with different parameters as well as how to adjust the solver to meet our needs and then calculate the results. We also found that the results highly depend on the input parameters and may show a significant change when varying different parameters. We were able to generate useful and accurate reports and charts which helped us analyze the problem more efficiently and we have been able to troubleshoot the simulation with the help of the lab staff and the professor’s guidance. We can now apply this knowledge learnt in future fluid mechanics problems to help us nurture our engineering sense by being able to visualize the fluid mechanics problems through the use of CFD software. For further research, we can adjust the domain size to see how it influences the results and also adjust the mesh configuration from QUAD to HEX and observe how the accuracy changes.
24
References and Appendix: CFD notes ANSYS ICEM tutorial notes ANSYS FLUENT tutorial notes
25