CFD Assignment 2D Incompressible Flow

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

TRIBHUVAN UNIVERSITY

INSTITUTE OF ENGINEERING
PULCHOWK CAMPUS

AN ASSIGNMENT REPORT
ON
A Report on CFD Tutorial for a 2D Incompressible Flow

SUBMITTED BY: SUBMITTED TO:


Name: Praphul Mishra Assistant Professor Kamal Darlami
Roll no. : 076BAS027 Department of Mechanical and Aerospace
Engineering, IOE Pulchowk Campus

Date: 21 June, 2023


INTRODUCTION
Computational fluid dynamics (CFD) is the simulation of fluids engineering systems using
modeling (mathematical physical problem formulation) and numerical methods (discretization
methods, solvers, numerical parameters, and grid generations, etc.). Computational fluid
dynamics is an extension of classical fluid dynamics, originating from the amalgamation of
classical fluid dynamics and numerical analysis supported by powerful electronic digital
computers. Thousands of research workers, mathematicians, physicists and engineers all over the
world contributed towards its growth and development and the progress is remarkable. It has
created an atmosphere of confidence, even to the extent that almost no problem of fluid
dynamics is now considered unsolvable. The zeal that has been generated in the minds of
research workers and students of fluid dynamics is unparalleled.
Even though nearly all fluids are compressible in an absolute sense, incompressible flow
approximation can be made when the flow speed is insignificant everywhere in the flow field
compared to the speed of sound of the medium. Following this definition of incompressibility, a
large number of fluid dynamic problems can be classified as incompressible and, in most cases,
viscous. To name a few types of incompressible flows, there are problems related to low-speed
aerodynamics, hydrodynamics such as the flow around submerged vehicles, flow through pumps,
mixing of the flow in chemical reactors, coolant flow in nuclear reactors, and blood flow in the
human body. When the flow is assumed to be incompressible, mathematically the flow field
becomes elliptic, which introduces major challenges in computations. Incompressible flow can
be considered as a limiting case of compressible flow as the flow speed approaches to a
significantly low value compared to the speed of sound. There are a large number of flow
problems of practical importance in aerospace and other fields which belong in this category.
The incompressible Navier-Stokes equations, which govern these flows, pose a special problem
of satisfying the mass conservation equation because it is not coupled to the momentum
equations. Physically, these equations are characterized by the elliptic behavior of the pressure
waves, the speed of which are infinite.
Ansys is used as software to perform the 2D incompressible flow analysis using Fluent package
to solve all the problems.

PROBLEMS
1. Visit the following web site and download ANSYS Student 2019 R2 and install it on
your own computer.
http://www.ansys.com/academic/free-student-products

Ans: Installed

2. Ans: Everything was clear and I did not notice any mistakes.

1
3. a) PROBLEM STATEMENT

Solve the tutorial problem using air with the following properties defined in Fluent’s database

𝜌𝑎𝑖𝑟=1.225 kg/m3, 𝜇𝑎𝑖𝑟=1.7894×10-5 Pa⋅s


• Using 𝐻=0.1 m, determine 𝑈𝑖𝑛 that will give 𝑅𝑒=25.
• Provide the graph showing the pressure variation along the channel centerline. Calculate the
dimensional Δ𝑝.
• Calculate the non-dimensional Δ𝑝∗ and check whether it matches with the one calculated above.

METHODOLOGY

A Fluent analysis of the channel flow is completed in the following 6 steps:


1. Geometry: To draw the problem domain or export an already available CAD file
2. Mesh: To generate the computational mesh
3. Setup: To define the problem physics, boundary conditions, solver settings, etc., run the
analysis, i.e.
4. Solve the governing equations, and post-process the solution
5. Solution: To run the analysis
6. Results: To post-process the solution.

RESULTS
The fluid properties are given as:
𝜌𝑎𝑖𝑟 = 1.225 kg/m3, 𝜇𝑎𝑖𝑟 = 1.7894 × 10−5 Pa ⋅ s and Re =25
The value of uniform inlet velocity (Uin) is obtained as;
𝜌𝑈𝑖𝑛 𝐻
𝑅𝑒 =
𝜇
25×1.7894×10−5
𝑜𝑟, 𝑈𝑖𝑛 = = 0.00365 𝑚/𝑠.
0.1×1.225

2
The pressure variation along the channel centerline is shown by the graph below obtained
using ANSYS fluent.

Figure 1 Static Pressure variation using air as fluid element along the centerline
From the plot, the static pressure drop (Δp) along the channel flow is found to be 8.0782
× 10-5 Pa.
The non-dimensional Δ𝑝∗ can be calculated as shown below:
Δ𝑝 0.000080782𝑃𝑎
Δ𝑝∗ = 2 = = 9.90 (≈ 9.92)
𝜌𝑈𝑖𝑛 /2 1.225 × 0.003652 × 0.5
Therefore, it matches the one calculated in the tutorial.

3 b) PROBLEM STATEMENT

This time use glycerin (a very viscous liquid) with the following properties defined in Fluent’s
database
𝜌 𝑔 𝑙 𝑦 𝑐 𝑒 𝑟 𝑖 𝑛 =1259.9 kg/m3, 𝜇 𝑔 𝑙 𝑦 𝑐 𝑒 𝑟 𝑖 𝑛 =0.799 Pa⋅s

•Using 𝐻 =0.1 m, determine 𝑈 𝑖 𝑛 that will give 𝑅 𝑒 =25.


•Provide the graph showing the pressure variation along the channel centerline. Calculate the
dimensional Δ𝑝 .
•Calculate the non-dimensional Δ𝑝 ∗ and check whether it matches with the one calculated
above.

3
Solution
The fluid properties are given as:
𝜌 𝑔 𝑙 𝑦 𝑐 𝑒 𝑟 𝑖 𝑛 =1259.9 kg/m3, 𝜇 𝑔 𝑙 𝑦 𝑐 𝑒 𝑟 𝑖 𝑛 =0.799 Pa⋅s and Re =25

Performing similar calculation as above,


The value of uniform inlet velocity (Uin) is obtained as;
𝜌𝑈𝑖𝑛 𝐻
𝑅𝑒 =
𝜇
25 × 0.799
𝑜𝑟, 𝑈𝑖𝑛 = = 0.1585 𝑚/𝑠
0.1 × 1259.9

The pressure variation along the channel centerline is shown by the graph below obtained
using ANSYS fluent.

Figure 2 Static Pressure variation using air as fluid element along the centerline
From the plot, the static pressure drop (Δp) along the channel flow is found to be 156.638
Pa.
The non-dimensional Δ𝑝∗ can be calculated as shown below:
Δ𝑝 156.638𝑃𝑎
Δ𝑝∗ = 2 = = 9.898 (≈ 9.92)
𝜌𝑈𝑖𝑛 /2 1259.9 × 0.15852 × 0.5

4
Therefore, it matches the one calculated in the tutorial.

c) Comment of your findings. What is the advantage of using non-dimensional parameters


instead of dimensional ones?
Ans: The main finding is the dimensionless parameters remain constant, even when variations
are made to the problem parameters while maintaining a constant Reynolds number.

Non-dimensional parameters allows for comparisons and generalizations across different


systems and scales. It also simplifies the governing equations by reducing the number of
variables involved. They help to uncover the fundamental physics driving the phenomena and
provide insight into the underlying mechanisms at play. The important role of non-dimensional
parameters is to facilitate the comparison of experimental and computational results as they
provide a common basis for evaluating and validating models and simulations.

d) Why is similitude and dimensional analysis more critical for experimental studies
compared to CFD simulations?
Ans: Similitude and dimensional analysis are more critical for experimental studies compared to
Computational Fluid Dynamics (CFD) simulations due to the need to accurately scale and
reproduce physical properties, forces, and phenomena in the laboratory setup. Experimental
studies rely on real-world interactions, where dimensional analysis helps identify relevant
parameters, scaling laws, and validate empirical correlations.

CFD ensures the accuracy and validity of results by accounting for physical properties and
forces, while CFD simulations offer more flexibility in adjusting parameters numerically.
However, for experimental studies, similitude and dimensional analysis play a crucial role in
ensuring the accuracy, relevance, and applicability of the findings as compared to CFD
simulations

5
4) PROBLEM STATEMENT
Let’s add a second inlet to the channel problem of the first tutorial as follows

Geometry of the channel

Solution
Setup and Solution
The analysis in ANSYS FLUENT involved the use of a Pressure-based solver with an absolute
velocity formulation. The study focused on steady, planar 2D flow without considering
gravitational effects. The analysis was specific to a single-phase, laminar flow with no heat
transfer, and all other model settings were turned off except for the laminar model.

To simulate the flow, a new fluid material with a density of 1 kg/m³ and a viscosity of 0.0001
Pa.S was created and employed. The named sections or zones in the domain were assigned with
the appropriate boundary conditions based on the given problem statement. There were two
inlets as shown in the figure. The inlet sections were set as a Velocity-inlet type boundary with a
specified velocity magnitude of 0.025 m/s and 0.1 m/s respectively. The outlet section was
assigned as a Pressure-outlet type boundary with a default pressure of 0 Pa. The walls of the
domain were defined as Wall type boundaries with stationary wall conditions and no-slip.

For the solution process, a default pressure-velocity coupling method was used, along with
default relaxation factors. The report definitions were set to obtain the x-component of velocity
at the midpoint of the outlet edge, referred to as "outlet-velocity." The residual tolerance values
were set to 0.001, and the solution was initialized using Hybrid Initialization. Subsequently, the
calculations were performed for 1000 iterations, with convergence monitored. Scaled residuals
and outlet-velocity plots were obtained to analyze the solution. These plots are shown below:

6
Figure 3: Console data 1

The solution converged at the iteration number of 33. As soon as the residuals of all three
equations (continuity, x-velocity, and y-velocity) drop below the specified tolerance (0.001),
solution is considered to be converged and it is terminated. The final value of the x-velocity at
the mid-point of the exit plane is reported as 0.112 m/s.

Figure 4: Solution Convergence 1

7
Residual plot is given above. These are scaled (the default option), but not normalized residuals.
They are a measure of how good the calculated approximate solution satisfies the continuity, x-
momentum, y- momentum equations that are solved. There is one curve for each of the solved
equations. Blue curve is for the continuity equation and it is the one that converges the slowest.
This is typically the case for most incompressible flows, i.e. continuity equation is the hardest to
satisfy.

Figure 5: X-Velocity at the center of Outlet plane

The plot for the monitored x-velocity at the center of the outlet plane is shown above. It starts
from the initial value of 0.0856 m/s and reaches the stabilized speed of 0.112 m/s at 28th
iterations.

❐ Contour plot of velocity magnitude. Discuss the flow physics you see in the plot.

8
Figure 6: Velocity magnitude Contour

The velocity magnitude contour plot was generated to distinguish between the developing and
fully developed regions at both inlets. In the plot, the flow velocity predominates at the bottom
inlet, although it is overshadowed in the contour. The legend indicates that red color represents
high-speed regions, while blue color represents low-speed regions. As the flow develops, fluid
particles near the walls experience deceleration, indicated by the presence of green and blue
colors, due to the no-slip condition. Conversely, fluid particles closer to the channel centerline
accelerate, represented by the presence of orange and red colors, to conserve mass.

Furthermore, the contour plot reveals the mixing of the initially low-speed flow from one inlet
with the high-speed flow from the bottom inlet. This mixing results in a rapid jump in fluid
velocity at the center of the channel, while the flow along the walls remains slower due to the
application of the no-slip boundary condition.

9
❐ Contour plot of the static pressure. Discuss the flow physics you see in the plot.

Figure 7: Static Pressure Contour

The static pressure contour plot provides valuable insights into the pressure distribution within
the system. It is observed that the pressure is highest at the inlets, as depicted by the red color. As
the flow progresses along the channel, the pressure gradually decreases, eventually reaching a
value of zero at the outlet. This pressure decrease is represented by the color gradient shifting
towards blue.
By examining the pressure contour figure shown below, the iso-pressure lines at the
inlets become more apparent. These lines represent regions with constant pressure, and their
distribution can be clearly seen in the plot. The colors assigned to these lines indicate the
corresponding pressure values, offering a visual representation of the pressure distribution
throughout the domain.
Notably, the curved contour lines at the inlets demonstrate the impact of the flow interacting with
the no-slip walls. This interaction causes a sudden deceleration of the flow at the corners, leading
to changes in the pressure distribution in those areas. Consequently, the pressure contours
provide valuable information about the flow behavior and the effects of wall boundaries on the
pressure distribution.

10
Figure 8: Static Pressure contour lines along the channel flow

Moreover, the contour plot allows for the observation of pressure contours resulting from the
mixing of different flow streams. These contours enable us to analyze the pressure distribution
and variations within the flow region, giving further insights into the flow behavior and its
interaction with the boundaries.

❐ Contour plot of the stream function. What information does this plot tell us?

Figure 9: Streamlines originated from inlet sections 1 and 2

The streamlines obtained from the inlets reveal important flow characteristics within the channel.
It can be observed that as the fluid enters the channel near the corners, it experiences
deceleration due to the application of the no-slip condition at the walls. Consequently, the fluid
redirects towards the centerline, resulting in an increase in velocity along the centerline before
the mixing region. Within the flow mixing region, a notable sudden increase in velocity occurs

11
along the central region. This can be attributed to the combination of different flow streams
coming from the inlets and their interaction within this region.

These streamlines provide valuable insights into the flow behavior, illustrating how the fluid
undergoes changes in velocity and direction as it moves through the channel.

❐ 𝑢 velocity plot along the main channel centerline. Discuss what happens physically in
different parts of the plot.

Figure 10: X-Velocity along the centerline

In the initial inlet region, the flow velocity experiences a significant increase as it develops along
the channel. This can be observed between the region from 0 to 0.2. As the flow progresses,
there is a subsequent jump in velocity at the mixing point where it interacts with the flow from
the high-speed bottom inlet. This mixing process and flow development result in another velocity
jump at the entrance region. Following the mixing and development, the flow velocity
experiences a slight drop before stabilizing to an approximate value of 0.112 m/s as it propagates
further through the channel section. This stabilization indicates that the flow has reached a
relatively steady state, with the velocity maintaining a relatively constant value.

12
Analyzing the variations in flow velocity along the channel provides valuable insights into how
the flow evolves and develops as it interacts with different inlet streams. Understanding these
velocity changes is essential for comprehending the flow behavior and its impact on the overall
fluid dynamics within the channel.

❐ Pressure plot along the main channel centerline. Discuss what happens physically in
different parts of the plot.

Figure 11: Static Pressure Plot along the centerline

The plot depicting the static pressure along the center line of the flow reveals interesting pressure
variations. Initially, within the developing region influenced by the first inlet, a slight excessive
pressure drop is observed. However, this pressure drop gradually stabilizes and exhibits a linear
behavior until approximately 0.2 along the center line. Between the region of 0.2 and 0.3, a rapid
pressure drop occurs, primarily attributed to the mixing of different flow streams. Subsequently,
the pressure drop undergoes further development and tends to follow a near-linear trend.
Eventually, as the flow reaches the outlet, the pressure drops to 0 Pa, aligning with the expected
behavior for a pressure outlet boundary condition.

13
❐ 𝑢 profile plot at the outlet. What is the maximum speed? What should be the maximum
speed of the analytical fully developed profile?

Figure 12: X-Velocity profile along the outlet

14
Figure 13: Velocity vectors at the outlet plane
The velocity profile along the outlet exhibits parabolic shape, which is a characteristic feature in
fluid dynamics. The maximum velocity, approximately 0.112 m/s, is observed at the center line
of the outlet. This parabolic velocity profile signifies the distribution of velocities within the flow
as it exits the channel. The highest velocity occurs at the center line, while the velocities decrease
gradually towards the channel walls. This pattern is commonly observed in fully developed flows
and is a result of the interaction between the fluid and the channel boundaries.

DISCUSSION & VERIFICATION


The analysis of the developing flow in a channel has provided valuable insights into the velocity
profile, pressure distribution, and flow behavior. The velocity profile exhibits parabolic
characteristics along the outlet, with the maximum velocity observed along the center line. The
pressure distribution showcases gradual drops along the flow, with notable changes occurring at
mixing regions. The streamlines depict how the flow undergoes redirection and acceleration as it
interacts with the channel walls.

15
Figure 14: Conservation of mass report

Also, for the conservation of mass, the difference between mass coming out from the inlets and
the mass going out of the outlets is in the order of 10-8 indicating high level of accuracy which
concludes that the mass is conserved.

TUTORIAL- QUESTIONS AND TO DO

Defining the Reynolds number based on the channel length is not meaningful. Why?
Solution
Reynolds number defined by channel length is not meaningful because the diameter of the
channel represents a characteristic dimension of flow geometry and is directly related to the flow
area. Also, diameter provides a convenient and practical measure for characterizing pipe flow. It
allows for easy comparison of flow condition in different pipes of varying sizes and ensures
consistency in interpolation of flow regimes and transition points. Also, diameter is easily
measurable parameters in pipe flow.

We know that if the Reynolds number is high enough the flow turns into turbulent. For a
circular pipe the critical Reynolds number for transition to turbulence is about 2300. At
what Reynolds number do you think the flow in our 2D channel will turn into turbulent?
Solution
If the Reynolds number > 4000, the flow in our 2D channel will be turbulent.

To Do: Change the Mesh Metric to other available options, such as aspect ratio or
orthogonal quality and examine the mesh quality in terms of them. Read the related parts
of Fluent’s User Guide and learn how they are calculated, what their numerical values
correspond to and what their acceptable ranges are.
16
Solution
Aspect Ratio
The aspect ratio is a measure of the stretching of a cell. It is computed as the ratio of the
maximum value to the minimum value of any of the following distances: the distances between
the cell centroid and face centroids, and the distances between the cell centroid and nodes. For a
unit cube (see Figure below), the maximum distance is 0.866, and the minimum distance is 0.5,
so the aspect ratio is 1.732. This type of definition can be applied on any type of mesh, including
polyhedral.

Figure 15: Calculating Aspect Ratio for a unit cube

Aspect ratio calculation for Triangle


The aspect ratio of a triangle provides a comparison of the “height” and “width” of a triangle. It
varies from 1 to infinite. A value of 1.0 indicates an equilateral triangle. The image below shows
triangles with aspect ratios of 1 and 20.

Figure 16: Triangles with Aspect Ratios

Aspect ratio calculation for Quadrilateral


The aspect ratio of quadrilaterals provides a comparison of a long side to a short side of the
quadrilateral. It varies from 1 to infinite. A value of 1.0 indicates a square. The image below
shows quadrilaterals with aspect ratios of 1 and 20.
17
Figure 17: Triangles with Aspect Ratios

Figure 18: Aspect ratio of 2D channel flow

Figure 19: Statistics of Aspect ratio

The plot above shows that our mesh have the minimum aspect ratio of 1.003 which is fairly
perfect and excellent. The maximum aspect ratio is 2.4682, which is good. The average Aspect
ratio of our mesh is 1.2458 which is excellent. Overall, the mesh quality is excellent, and this can
produce accurate results.

18
Figure 20: Elements with Aspect ratio 1

This is the mesh showing elements having aspect ratio of 1 in our flow channel. The figure
below shows the closeup view of the mesh having aspect ratio 1. The mesh is equilateral triangle.

Figure 21: Closeup view of elements with Aspect ratio of 1

Orthogonal Quality
An important indicator of mesh quality is an entity referred to as the orthogonal quality. The
worst cells will have an orthogonal quality close to 0 and the best cells will have an orthogonal
quality closer to 1.
Mesh orthogonality is the angular deviation of the vectors S (located at the face center f) from
the vector d connecting the two cell centers P and N. In this case is 20 degrees.

Figure 22: Mesh Orthogonality

19
Figure 23: Orthogonal quality of 2D flow channel

Figure 24: Statistics of Orthogonal quality

The graph shows the orthogonal quality of our mesh. The plot describes that the
maximum orthogonal quality is 0.999999 which is nearly equal to 1. The minimum
orthogonal quality is 0.65841 which is good. The average mesh quality is 0.95438. This
indicates the excellent mesh quality. Our mesh is highly accurate.

Figure 25: Mesh having orthogonal quality 1

This is the mesh in a 2D flow channel having orthogonal quality of 1. The figure below
shows the closeup views of mesh having orthogonal quality 1

20
Figure 26: Closeup view of mesh having orthogonal quality 1

To Do: After finishing this tutorial you can come back to this step and play with
other mesh generation and mesh sizing options.

Figure 27: Meshing of 2D flow channel

Figure 28: Statistics of Meshing

Firstly , automatic meshing was done using ANSYS solver. Then, the edge sizing was
done on left and right edge with the element size of 0.001m. The bottom and top edges
were given the number of divisions of 150. The figure below shows meshing before
applying quadrilateral face meshing. The figure above shows the refine mesh after
applying quadrilateral face meshing. The number of nodes and elements were 1661 and
1500 respectively.

Figure 29: Mesh before applying face meshing

21
Figure 30: Mesh quality (Element quality)

Figure 31: Orthogonal quality

The statistics above shows mesh quality of our meshing. The element quality has
an average mesh metric of 0.92255. Similarly, the average orthogonal quality of
our meshing is 1 which is perfect. This concludes that the mesh quality of our 2D
channel flow is excellent.

To Do: When you are done with this tutorial, go back to the Meshing
application, make the mesh finer close to the outlet, re-solve the problem and
see if these unphysical oscillations disappear or not.

Figure 32: Quadrilateral Face Meshing in 2D channel flow

First the automatic meshing was done by ANSYS solver. Then, we did face
meshing on the frontal area (front face) of the 2D flow channel. The quadrilaterals
method was selected in face meshing.

22
Figure 33: Statistics on Meshing

The number of nodes and elements were 3042 and 2856 respectively.

Figure 34: Meshing using All triangular method (Before)

By doing so, the centerline velocity throughout the channel after the position 0.2m
was stable with no oscillations throughout the channel which can be seen in the
figure below

Figure 35: Face meshing using Quadrilateral(After)


23
CONCLUSION
In a nutshell, we utilized ANSYS CFD software to model the fluid movement within a channel.
Various aspects of the flow were examined, including the distribution of velocity and pressure,
as well as the values of velocity and pressure at the outlet and along the centerline. The velocity
was specified as the inlet condition for both entrances, with the outlet condition assuming zero
pressure as the boundary. The wall boundary condition was set as no slip, meaning the fluid does
not slip along the channel walls.
The obtained results closely resemble what would typically be anticipated in an open channel
flow. To enhance the accuracy of our calculations, several considerations could have been
implemented, such as the utilization of adaptive meshing techniques to achieve more precise
outcomes. We learned the basics of CFD using ANSYS to analysis the fluid flow in 2D channel.
Furthermore, a key inference that can be derived is that the dimensionless parameters remain
constant, even when variations are made to the problem parameters while maintaining a constant
Reynolds number.

REFERENCES
[1] Pradip Niyogi, Sunil Kumar Chakrabartty, and Manas Kumar Laha, Introduction to
Computational Fluid Dynamics: Pearson Education India.

[2] J. Tu, Guan Heng Yeoh, and Chaoqun Liu, Computational fluid dynamics a practical
approach. Oxford Butterworth-Heinemann, 2018.

[3] ThéveninD. and JanigaG., Optimization and computational fluid dynamics. Berlin: Springer
Verlag, 2008.

[4] A. Sharma, Introduction to Computational Fluid Dynamics Development, Application and


Analysis. Cham: Springer International Publishing AG, 2021.

***

24

You might also like