Final Report

24
MAE 561 : COMPUTATIONAL FLUID DYNAMICS Final Project Lid Driven Cavity Neel Patel 1206392079

Transcript of Final Report

Page 1: Final Report

MAE 561 : COMPUTATIONAL FLUID DYNAMICS

Final Project

Lid Driven Cavity

Neel Patel

1206392079

Page 2: Final Report

2

Index

Sr.No Title Pg.No. 1. Abstract 3

2. Introduction to the Scheme 4

3. Task 1 ANSYS- FLUENT compared to

Ghia et al

6

4. Task 2 User compared to Ghia et al 10

5. Bonus 15

6. References 18

7. Appendix - Code Note: The code i.e. one with variable time step has been attached in the end after the report.

Page 3: Final Report

3

1. Abstract

To solve the 2-D incompressible Navier-Stokes equation we need a method/

algorithm that will include a pressure correction along with the fractional step

method on a staggered grid. The aim of the first phase of the project is to compare

the results obtained from ANSYS Fluent against the results reported by Ghia.

In the second phase we compare Ghia’s results against the results obtained from

the user’s algorithm. The aim of this phase is to compare the results of Ghia with

the user’s results.

Page 4: Final Report

4

2. Introduction to the Scheme

The FTCS method was used for solving the problem is as follows:

The equations given are non-linear in nature and hence these

Equation 4a and 4b cannot be used in this case. We will use the following set of

equations for this case (fractional method on a staggered Grid)

c

a

b

Page 5: Final Report

5

In our case the i+1/2,j serves as i,j and i-1/2,j servers as i-1,j. Similarly, for i,j+1/2

and i,j-1/2. The attached sheet of formulas for Task 3 contains the rest of the

formulations.

Now there are a few checks that should be kept in mind while solving these

equations. But first we need to derive the above equations.

d

Page 6: Final Report

6

Task 1 ANSYS- FLUENT compared to Ghia et al

The following steps were followed for calculating the solution in ANSYS –

FLUENT:

1.1. A surface was created in the Design Modeler using a sketch of a square (1x1).

The units were kept as meters. This can be in any other unit system but care should

be taken while performing any conversions.

1.2. A quadrilateral mesh was generated of size 128 x128, because the Ghia et al

have used a mesh similar to this mesh. Please provide appropriate names to the

boundaries.

1.3. This mesh was transferred into FLUENT.

1.3.1 Checked the mesh for quality and the boundary names.

1.3.2 All the models were kept as default; make sure that the flow is laminar.

1.3.3 In the materials tab add a new fluid with density=1 kg/m3 and

viscosity = 0.01Kg/m-s.

1.3.4 The cell zone conditions were set to the fluid (the fluid that we have

introduced in the materials tab).

1.3.5 Now set the boundary conditions such that the top wall is a moving

wall with a velocity of 1m/s.

1.3.6 The solution methods to be given are Simple with spatial discretization

options set as follows:

1.3.6.1 Gradient – Least Squares cell Based

1.3.6.2 Pressure – Standard

1.3.6.3 Momentum – Second Order Upwind

1.3.7 In the monitors edit the values for the convergence of the x-velocity, y-

velocity and continuity to 10-10. This value of residual was set to a lower

value as a lower value indicates that values at the new time step have

increased by a very small value as compared to the previous time step.

Page 7: Final Report

7

1.3.8 Initialize the hybrid solution.

1.3.9 Run calculations for 5000 iterations.

1.4. Results

1.4.1 The velocity Comparison

Now create a new iso-surface at the centre of the mesh for both X and Y

direction. This surface was created to plot the velocities at the center of the

grid. Concurrently the values of Ghia for U and V separately with the results

obtained from the FLUENT Analysis were plotted.

Fig. 1. Comparison of the Ghia values to the FLUENT values for the u-velocity

along a vertical line through the geometric center of the cavity

Page 8: Final Report

8

Fig. 2 : Comparison of the Ghia values to the FLUENT values for the v-velocity

along a horizontal line through the geometric center of the cavity

Note: The red dots are the Ghia velocities and the black dots are the

velocities obtained from the FLUENT solution.

1.4.2 The vorticity plot

Now introduce vorticity levels at the different values according to the Ghia

values. Since some of the values plotted by Ghia are negative, these values

will not be plotted by FLUENT. Also, the 0 value will not be plotted by

Fluent because the minimum value of vorticity is of 0.0003. The following

plot was obtained for vorticity.

Page 9: Final Report

9

Fig 3. Vorticity at the Ghia values.

Note: This plot is missing the plot for 0 on the bottom corners and at the

middle as all the values of FLUENT are greater than 0.

1.4.3. Streamline Plot

The streamline plot was plotted for the specific contour levels of Ghia by

creating iso-stream surfaces for the values provided in table 3 of the paper.

In order to obtain the contours at the two lower corners we offset the values

of Ghia by a specific value.

Fig 4. The Stream function Values for the FLUENT results.

Page 10: Final Report

10

Task 2 User compared to Ghia et al

In this section we have used fractional step defined on a staggered grid to get our

solution. The mesh used for this scheme was a 128 x 128 grid. This grid was

chosen as it closely resembles the Ghia grid. The Numerical Scheme used was

FTCS (Forward in Time Central in Space) for calculation of the Predictor step on

the staggered grid (Equations for this grid have been written in Task 2). Then we

have considered a Poisson pressure equation to calculate the pressure and in the

corrector step we have used the pressure equation and velocities calculated in the

predictor step to calculate the final velocities after every time step.

The residuals were calculated for the pressure Poisson and the velocities after the

iterative solution had been performed on these solutions. Also, residual was

calculated on the stream function.

The Convergence criteria used was 10-6 for the residuals. The reason was that for a

low value of residual was that the change in the quantities with time step after a

certain point of time does not change significantly. This provides a stable solution

for the given boundary conditions. However the best method to check for stability

is to determine that the solution has reached the asymptotic region of convergence.

We can use GCI (Grid Convergence Index) to determine e the steady state solution

but in our case since the time step is varying and we don’t have a stable time step

value we cannot use GCI to determine the steady state of the solution. MMS

(Method of Manufactured Solutions) can be used to determine the stable solution.

Fig 5. Staggered Grid for our considerations

Page 11: Final Report

11

2.1 The Vorticity Plot

The plot for vorticity was obtained by solving the eq.11 in task 3. The levels that

were used in the plot were obtained from Ghia paper.

Fig 6. Comparison of Ghia Vorticity to results obtained by the code.

The figure above shows a good match between the plots shown obtained by Ghia

and by the code. The circles in the users figure represent the Ghia values.

Page 12: Final Report

12

2.2. The U-Velocity along the vertical line.

Fig 7. Comparison of the Ghia values to the user values for the u-velocity along a

vertical line through the geometric center of the cavity

The plot of the U-Velocity shows a good match between the Ghia and the user’s

values. Some Values however seem to be off by a small value is due the fact that

the Ghia values are not completely accurate. This may be due to the computing

limitation about 30 years ago. Also, compiler errors were also a big issue back then

so it is difficult to determine the specific reason or to pin point the reason.

Page 13: Final Report

13

2.3. The V-Velocity Plot along the horizontal line

Fig 8. Comparison of the Ghia values to the user values for the the v-velocity along

a horizontal line through the geometric center of the cavity

The plot of the V-Velocity shows a good match between the Ghia and the user’s

values. Some Values however seem to be off by a small value is due the fact that

the Ghia values are not completely accurate. The user’s values are accurate as we

have used a fractional step along with pressure correction to calculate the solution.

This may be due to the computing limitation about 30 years ago. Also, compiler

errors were also a big issue back then so it is difficult to determine the specific

reason or to pin point the reason.

Page 14: Final Report

14

2.4 The Stream Function Plot

The stream function was plotted by adding an extra equation for the calculation of

the psi values on the grid.

Fig. 9 : Comparison of the Ghia values to the user values for the stream function

along a horizontal line through the geometric center of the cavity

This Figure and comparison indicates that there is a good comparison between the

user results and the Ghia Results.

Page 15: Final Report

15

Bonus

Re =1000

5.1 The Vorticity Plot

The plot for vorticity was obtained by solving the eq.11 in task 3. The levels

that were used in the plot were obtained from Ghia paper.

Fig 10. Comparison of Ghia Vorticity to results obtained by the code.

The figure above shows a good match between the plots shown obtained by

Ghia and by the code. The circles in the users figure represent the Ghia

values.

Page 16: Final Report

16

5.2. The U-Velocity along the vertical line.

Fig 11. Comparison of the Ghia values to the user values for the u-velocity along a

vertical line through the geometric center of the cavity

The plot of the U-Velocity shows a good match between the Ghia and the user’s

values. Some Values however seem to be off by a small value is due the fact that

the Ghia values are not completely accurate. This may be due to the computing

limitation about 30 years ago. Also, compiler errors were also a big issue back then

so it is difficult to determine the specific reason or to pin point the reason.

Page 17: Final Report

17

5.3. The V-Velocity Plot along the horizontal line

Fig 12. Comparison of the Ghia values to the user values for the v-velocity along a

horizontal line through the geometric center of the cavity

The plot of the V-Velocity shows a good match between the Ghia and the user’s

values. Some Values however seem to be off by a small value is due the fact that

the Ghia values are not completely accurate. The user’s values are accurate as we

have used a fractional step along with pressure correction to calculate the solution.

Page 18: Final Report

18

This may be due to the computing limitation about 30 years ago. Also, compiler

errors were also a big issue back then so it is difficult to determine the specific

reason or to pin point the reason.

5.4 The Stream Function Plot

The stream function was plotted by adding an extra equation for the calculation of

the psi values on the grid.

Fig. 13: Comparison of the Ghia values to the user values for the stream function

along a horizontal line through the geometric center of the cavity

This Figure and comparison indicates that there is not a good comparison between

the user results and the Ghia Results. The primary reason is that the grid is half the

size of the grid used in Ghia.

References

1. Ghia, Urmila, Kirti N. Ghia, and C. T. Shin. "High-Re solutions for

incompressible flow using the Navier-Stokes equations and a multigrid method."

Journal of computational physics 48, no. 3 (1982): 387-411.

2. Bruneau, Charles-Henri, and Mazen Saad. "The 2D lid-driven cavity problem

revisited." Computers & Fluids 35, no. 3 (2006): 326-348.

3. Dr. Marcus Hermann MAE 561: Computational Fluid Dynamics Notes.

Page 19: Final Report
Page 20: Final Report
Page 21: Final Report
Page 22: Final Report
Page 23: Final Report
Page 24: Final Report