# Computational Fluid Dynamics

In this tutorial, you will learn what is Computational Fluid Dynamics or CFD, how it works and various approaches to solve fluid dynamics problems. You will also learn about the types of fluid, governing equations, NS equation and basics of thermodynamics.

Contents:

## What is Computational Fluid Dynamics?

Computational Fluid Dynamics or CFD has three parts:

• Fluid: Fluid is a matter which flows under influence of force. (Note: matters are of 2 types, solid & fluid). It has certain properties, for example, density, viscosity, compressibility etc.
• Dynamics: The word “Dynamics”, comes from the Greek word “Dynamis”, which means Force or Power. So, when said, Fluid Dynamics, people only deal with the Force & Power applied on the fluid.
• Computational: Using the power and capabilities of computers to determine the forces and power on a fluid body is known as Computational Fluid Dynamics (CFD).

Hence, Computational Fluid Dynamics is a process where mathematically modeling of a physical phenomenon involving fluid flow and solved numerically using the computational power of computers.

## Prediction Approaches

Prediction Approaches are various ways or methods to solve a natural phenomenon. There are 3 types of prediction approaches:

advertisement
advertisement
• Experimental Approach:
Experiment by hand is done in this approach to get some results or data sets. Hence, it is a very reliable approach of solving any natural phenomenon. Though, Analysis of operations like boiling, combustion can’t be done using this approach. Hence, the field of this approach becomes very restricted.
• Theoretical Approach:
• It works using mathematical models. Where the mathematical models usually consist of some partial differential equations. Hence, this approach reduces cost to almost zero.
• One of the major drawbacks of this approach is that most of the times the problem becomes so complex that assumptions have to be done in order to proceed further and hence in spite of getting results it cannot used in real life applications.
• CFD Approach:
As both experimental and theoretical approaches have many disadvantages, CFD came into existence, where CFD takes the experimental data from experimental approach and takes the mathematical models from theoretical approach. And then it combines them with the power of computation to achieve better results.

The following figure explains the relation between all approaches of prediction:

Analysis of any fluid behavior or phenomenon can be done in three ways, using pure theory (Theoretical Approach) or pure experiment (Experimental Approach) or CFD (Some theory and some virtual experiment). All of these together is also known as 3 Dimensions of Fluid Mechanics.

## Experimental vs Theoretical Approach

The following table describes the difference between Experimental and Theoretical Method of Prediction:

Parameters Experimental Approach Theoretical Approach
Definition When full scale equipment is used to investigate any natural phenomenon, it is called experimental approach of prediction. When mathematical models are used to investigate any natural phenomenon, it is called Theoretical approach of prediction.
Cost As full scale equipment is used, it is a very costly approach. As no equipment is used, the cost is almost zero.
Accuracy As it’s a real time experiment by hand, there is always an accuracy issue. Hence accuracy is a little bit low. If there are no assumptions, this approach gives most accurate result.
Reliability If there is no experimental issue or equipment issue, this is the most reliable approach. Also keep in mind that experiment is also another way of validation. Hence result obtained from experiment can be marked as 100% true. As this approach works on basis of mathematical models, there is no guarantee that nature and mathematics will work side by side all time. Hence always less reliable, we can’t say that the result is 100% true.
Model-Size Faces problem for very small and big sized models. As it is a mathematical based approach, there is no issue regarding the size of models.
Time of Operation Huge time of operation is required for getting the experimental results. Very less time of operation is required, as it is done mathematically.
Time of Operation Huge time of operation is required for getting the experimental results. Very less time of operation is required, as it is done mathematically.
Any Condition/Problem Its very hard to simulate various conditions as every time a new setup is needed which is very costly. Solving mathematical equations can be sometimes easy & sometimes hard. Hence, this approach cannot be used for all condition.

## Types of Fluid

Fluids can be divided based on Power Law, which is described below:

• Power Law: According to Power Law, behavior of all fluids can be represented by this single equation:
τ = $$K(\frac{δu}{δy})^n$$
Where:
• K is the flow consistency index (SI units Pa.sn)
• $$\frac{δu}{δy}$$ is the shear rate or the velocity gradient perpendicular to the plane of stress (SI unit s-1)
• n is the flow behavior index (dimensionless).

Various types of Fluids are described below via graph:

Varying the n and K in power law, we can get different kind of fluids:

• If, n < 1; the fluid is called as Pseudo plastic Fluid.
• If, n = 1; the fluid is called as Newtonian Fluid.
• If, n > 1; the fluid is called as Dilatant Fluid.

advertisement

## Governing Equations

Governing equations are those equations, on which the whole CFD is built. They are the fundamental equations to solve any natural phenomenon. The governing equations are described below:

• Conservation of Mass (Continuity Equation):
The Conservation of Mass states that, difference between the mass going out and in of a specified control volume is equal to the mass stored inside the control volume.

The equation of conservation of mass is specified as:

$$\frac{Dρ}{Dt}$$+ ρ(∇.v)=0

Where, ρ is the density, v is the velocity and ∇ is the gradient operator.
∇=i$$\frac{δ}{δx}$$+ j$$\frac{δ}{δy}$$+ k$$\frac{δ}{δz}$$

• Conservation of Momentum (Newton’s Second Law):
The Conservation of Momentum states that, total momentum of a system always remains constant. The equation of conservation of momentum is specified as:

advertisement

∑pbefore = ∑pafter
Where, P is momentum of the system.

• Conservation of Energy (Steady Flow Energy Equation):
The Conservation of Energy states that, difference between the energy going out and in of a specified control volume is equal to the energy stored inside the control volume.

The equation of conservation of energy is specified as:
$$\frac{dE}{dt}$$= Qc.v. – Wc.v. + minein – mouteout

Where,
Q = limdt→0$$\frac{δQ}{δt}$$ is rate of energy transfer to the system as heat
W = limdt→0$$\frac{δW}{δt}$$ is rate of work done by the system

## Navier-Stokes Equation

Navier-Stokes equation or NS equation is an extension to the Conservation of Momentum equation. It is the most basic equation out of all conservation equation in fluid mechanics. It is specified as:
$$\frac{δu}{δt}$$+ u. ∇u = –$$\frac{ߜP}{p}$$+ v∇2u

Where,

• u is velocity of fluid
• P is pressure
• v (mu) is the kinetic viscosity of the fluid
• (rho) (below gradP) is density of the fluid.

## Basics of Thermodynamics

Basics of Thermodynamics includes 1st and 2nd law, which are stated below:

• 1st Law of Thermodynamics:

The 1st law of thermodynamics states that, change in internal energy of a system is equal to the heat added to the sytem minus work done by the system.

U = Q – W
Where,

• U is the internal energy of the system
• Q is the heat added to the system
• W is work done by the system
• 2nd Law of Thermodynamics:
The 2nd law of thermodynamics states that, heat cannot flow itself from colder body to hotter body.
dS=$$\frac{dQ}{T}$$ Where,
• S is entropy of system
• Q is heat added or released
• T is temperature of system
• ## How CFD Works?

Working of an average CFD Project can be described as following:

• Step 1: Stating the Problem: Stating problem means to define the control volume (CV) or system on which the analysis is to be done and also deciding the surrounding conditions (Including Boundary Conditions).
• Step 2: Drafting the Model & Applying the Solver Code: Drafting a model means making the system or CV virtually using CAD. After that, we apply the solver code made using programming language to divide the system into small parts and solve all of them individually using the governing equations.
• Step 3: Processing of Result: Processing of result means to rearrange the results in a presentable manner using graphs, tables, charts etc.

## Key Points to Remember

Here is the list of key points we need to remember about “Computational Fluid Dynamics”.

• At its core, CFD means evaluating the dynamic behavior of any fluid at any space and at any time, using the power of computation.
• Experimental approach uses real life equipment based experiments to solve any natural phenomenon.
• Theoretical approach uses mathematics to develop differential equations for any natural phenomenon and then gets result by solving those differential equations.
• Experimental approach is costly, time consuming, error prone and sensitive to model size. Hence cannot use for all scenarios.
• Theoretical approach is very tough to solve, cannot be trusted, uses approximation, hence results become ineffective for real life situation.
• CFD is neither a theoretical approach, nor an experimental approach. It’s a third-approach or a new kind of approach, where we take all the benefits of the previous approaches to create better stuffs.
• All fluid behaviors can be defined by power law and all fluid flows can be defined by universal governing equations.

If you find any mistake above, kindly email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.