# Introduction to CFD – Part I : What is CFD ?

I know that there are may articles/ presentations/ blogs on this topic. I thought to share my views on the way I look at overall CFD process. This is just a first post on this topic. There would more to cover the complete introduction.

**Introduction :**

Computational Fluid Dynamics or simply CFD is an art/method/science/technique of solving mathematical equations governing different physics including flow of fluid, flow of heat, chemical reactions, phase change and many other phenomena.

There are two traditional methods for studying any physics, one the conventional experimental method and other the analytical method. As far as physics of fluid flow is concerned, the experimental method is called as Experimental Fluid Dynamics (EFD) and the analytical method is called as Analytical Fluid Dynamics (AFD).

In EFD, a typical approach followed is to create a prototype of device under study and put it in an appropriate test facility. The measurement of some properties like temperature and pressure (in case of fluid flow) which can give us an understanding of the physics is done through some measurement equipments. Many scientist around the world worked together to understand the physics of fluid and heat flow. Findings of the experimental methods helped to convert the given physics in to mathematical equations. In today’s advanced world also, there are many phenomena present which doesn’t have a definite mathematical formulation and many are relying on the experimental methods only to understand the physics of the phenomena. We will get into the details of EFD in later part of article. Experimental approach does have its own pros and cons. The disadvantage includes time and cost involved in such kind of studies. Also there might be errors in the experimental setup or measurement techniques. If the scaling of the prototype is not done accurately, it might lose the actual physical phenomena. The main advantage of experimental approach is that it replicates the exact physics under study without any approximation.

In AFD, we try to solve the mathematical equation (may be in differential, integral or any other form) governing the physics of phenomena under study. Analytical solutions (which are also termed as closed form of solutions), is an exact solution of governing equations. If the physics is simple and if the governing equations are simple, then we can obtain the solution of such equations by doing some mathematical manipulations. The example of simple physics could be static fluid. In case of static fluid, we can get a close form solution of governing equation (momentum equation), which can give us the variation of pressure in terms of depth (p = rho*g*z). Once we know the variation of pressure along the depth of fluid, we can calculation the load on dam which can be used while designing the dam structure. AFD has its own pros and cons. The main advantage of AFD is that it will give us the exact solution of governing equations. So there is no error involved in the calculation (except the error in mathematical model itself). The disadvantage of analytical method is that it can be applied for very simple governing equations. If the equations are very complicated, there is no specific method available to solve those equations (which are the most common case as far as industrial problems are concerned).

Experimental and analytical approaches are many time infeasible (may be because of cost, time involved or may be because of simplifications involved) to solve real life industrial problems. So now the “third approach” is emerging in engineering community which is called as Computational Fluid Dynamics (CFD). CFD is the technique, which can reduce the experimental cost and time without doing much approximation in the governing equations. In CFD, we solve the governing equations of given physics (may be differential form or integral form) using some numerical techniques like Finite Difference Method (FDM), Finite Element Method (FEM) or Finite Volume Method (FVM)

It is to be understood correctly that, CFD is not a replacement for experimental or analytical approach. There are many errors (like discritization error, round off error, algorithm error) involved in this approach. Once we get the CFD results, somewhere down the line we have to validate those results either with experimental results or with analytical result or with both. CFD is just an add-on tool to understand more about the flow. CFD can give overall qualitative (in terms of color plots etc) or quantitative (in terms of number) idea about the physics under study. CFD will be useful during initial design stage where many preliminary designs have to be evaluated for its performance. Once the couple of designs are shortlisted, we can do experiments only on those designs to evaluate its performance and validate our CFD results. This way the cost and time involved to evaluate all initial designs will be reduced.

All the three approaches EFD, AFD and CFD should go hand in hand.

Let’s take another view point to understand the process of studying any physics.

Figure 1.2 explains typical process of understanding any physics. Let’s take a case of physics of fluid and heat flow. Both these phenomena are involved in many devices like heat exchangers, high speed gas flows, heat ventilation and air conditioning (HVAC) devices and many more. Let’s say we want to study the performance of a new heat exchanger to design and optimize for maximum possible heat exchange. A good heat exchanger will give maximum rise in the cold fluid temperature (or maximum drop in hot fluid temperature) with minimum pressure drop (minimum pumping power for these fluids). Let’s say that based on understanding of heat exchanger device and fluid and heat flow physics, one has come up with a new design of heat exchanger. Now the task given is to find out the increase/decrease in the temperature of cold/hot fluid as well as pressure drop across inlet and outlet. This task can be done using following approaches

**1) Experimental Approach :**

In this approach, we will create a prototype of heat exchangers and will carry out the experiment. The parameters measured during the experiments could be inlet and outlet temperature of cold and hot fluid as well as inlet and outlet pressure. Once these parameters are measured, this can give us an idea about the performance of the new heat exchanger. We can compare this existing design or any other alternate design to conclude which one is better.

In this particular approach, we have to do the similarity study (dimensional analysis). Similarity study will make sure that the scale down prototype of the heat exchanger will have same physics as that of full scale working model. If this is not carried out, then the performance of actual full scale model will not be same as that of prototype used in experimental study.

So the fluid and heat flow physics can be studied using experimental approach. In this approach, we have to be concerned about following points:

- Similarity Study (Dimensional Analysis)
- Time involved in the study
- Cost involved in the study
- Availability of experimental facility and measurement devices
- Errors like human error, measurement error, surrounding atmosphere conditions error etc involved in the study

**2) Analytical Approach :**

If you have a careful look at the Figure 1.2, it shows that analytical approach is something after we could able to convert the physics under consideration in to set of mathematical equations. Once the physics under consideration is converted into mathematical equations, we can solve those equations by doing mathematical manipulations. There are many physical phenomena still unexplored and no definite mathematical formulation is available. We cannot use analytical approach for studying such physical phenomena.

As far as physics of fluid and heat flow is concerned, based on physical principles like conservation of mass, momentum and energy, we can convert the physics of fluid and heat flow into set of mathematical equations (May in differential or integral from). These mathematical equations will correlate basic properties of fluid like pressure, velocity, density and temperature to each other. It’s always not true that we can solve any mathematical equation using analytical approach. The feasibility of using analytical approach depends on complexity of equations, the complexity of boundary conditions and off course the complexity of geometry involved. If we consider the general fluid and heat flow governing equations, the resulting mathematical equations are second order nonlinear partial differential equations. It’s very difficult to get closed form solution for such equations for complex geometries like heat exchanger, flow over car, flow over an aircraft etc. So, if you refer any standard text book on fluid mechanics, most of the books explain solving the governing equations for simple geometries like circular cylinder, flat plate, airfoil etc.

To make analytical approach feasible, we do many assumptions based on problem under consideration. The typical assumptions made to simplify the governing equations are incompressible flow, steady flow, invicisid flow, laminar flow etc. All these assumptions removes some terms from general governing equations and simplified equations can then be solved. We have to be very careful during making such assumptions as one wrong assumption can give very wrong result. The validity of assumption depends on the aim and objective of the problem under consideration and the physics involved. For example, we often make assumption of incompressible flow in case of liquid flows. We know that very large about of force (pressure gradient) is needed to compress the liquid. We don’t come across such kind of high forces in real life engineering problems (for example flow of water through centrifugal pump). In most of the cases, although everything in the universe is compressible, we can make assumptions of incompressible flow in case of liquid flows as it will not give that much difference in the solution. In case of gas, we can definitely not make assumption of incompressible flow as very less amount of force (pressure gradient) is required to compress the gas. So assumption of incompressible flow in case of gas flows will become invalid if the speed gas flows is high (example: flow over an aircraft). But if the gas speed is less (means less pressure gradient), we can make an assumption of incompressible flow. If the Mach number of the gas flow is less than 0.3, we can make assumptions of incompressible flow. Although there is compressibility effect, this is not going to make that much difference in the calculations with an assumption of incompressible flow. So every assumption is some kind of approximation, but we should be careful about the validity of such an assumption.

To get an idea about the assumptions and simplifications, let’s consider the simple equation like Bernoulli’s equation. We have used Bernoulli’s equation to calculate the discharge through pipe. The typical procedure used to calculate discharge is as follows:

- Put the venture meter in line with pipe
- Measure the pressure at two sections
- Use Bernoulli’s equation along with continuity equation to find velocity at any section
- Calculate discharge using the velocity

If we have look at Bernoulli’s equation, it’s very easy to solve. Bernoulli’s equation is a very simplified form of general momentum or energy equation. If we make following assumptions, we can get Bernoulli’s equation:

- Inviscid flow
- Steady flow
- Incompressible flow
- No energy addition and subtraction during two sections
- One dimensional flow

If all of the above assumptions are valid (means if it does not make major difference in the results we are interested in), then we can use Bernoulli’s equation for getting desired result. But many of the above assumptions are very restrictive (inviscid flow is the major limitation). We cannot definitely use Bernoulli’s equation for general cases like flow of gas through pipe (not incompressible), drag on a car (not inviscid) and so on.

While using analytical approach for any problem we have to give attention to following points:

- Is mathematical equation available for physical phenomena under consideration?
- Is mathematical method available for solving the governing equations?
- Can I make some assumptions to simplify the governing equations?
- Are those assumptions valid for the problem under consideration?

Although it looks like, analytical approach is very restrictive for general case; we still use many analytical correlations and formulas in advanced studies of fluid mechanics and heat transfer. These correlations are combination of some experimental studies (typically carried out to find the values of constants in the correlations) and analytical studies. Following is one of the examples where drag on flat plate is specified in terms of velocity distribution, geometry parameters and density.

Analytical correlation for drag on flat plate

The above formula is derived using simplified form momentum equation with assumption of steady and incompressible. In the above formula, drag is specified in terms of velocity profile at downstream end of the plate, boundary layer thickness and density of fluid. This is simple analytical correlation. To get an exact value of drag on the plate, we can use experimental method to get velocity profile at downstream end and boundary layer thickness. Once we get both these values, we can get the drag on flat plate.

For heat exchanger under consideration, we can use analytical methods like LMTD or NTU to find the temperatures at inlet and outlet. There are certain analytical corrections which can be used to find the pressure drop. You can refer any heat transfer book to get an idea about these analytical approaches.

**3) Numerical Approach :**

If you have careful look at the above figure, it shows that numerical approach is something after we could able to convert the physics under consideration in to set of mathematical equations. The use of numerical approach also depends on availability of numerical method to solve the governing equations. It might happen that, the governing equations are well defined, but no specific numerical method is available for solving those governing equations. We can use numerical method only when:

- Physics is well captured in set of governing equations
- Numerical method is available for solving the governing equations
- Computational resources are available for numerical algorithms

There are many numerical methods available to solver set of partial or integral form of equations. Following are very regularly used methods and have their own advantages and disadvantages:

- Finite Difference Method (FDM)
- Finite Element Method (FEM)
- Finite Volume Method (FVM)

All the above methods are going to be discussed in detail in subsequent chapters. The overall idea of all above methods is to break the complicated domain in small parts and solver all the equations governing physics under consideration on each and every part. All above method uses following philosophy:

Solution of entire flow = Solution in all small parts

The basic ingredients of all the above methods are:

- Discritization of set partial differential or integral form of governing equations (equation discritization)
- Discritization of given domain into small parts (grid generation)
- Solution of discritized form of governing equations on discritized geometry
- Visualization of different properties in the domain

For all above methods, we have to also talk about:

- Stability of the method
- Convergence of the method
- Conservativeness of the method
- Computational resources needed

I know that many of the “first readers” gathering CFD knowledge may not able to understand most of the terms written above; all those terms will be made clear in subsequent posts (the only condition is that you have to keep on reading).