Fill out the form to download

Required field
Required field
Not a valid email address
Required field
Required field
  • Set up your own cloud-native simulation in minutes.

  • Documentation

    What is CFD | Computational Fluid Dynamics?

    Computational Fluid Dynamics (CFD) is the process of mathematically modeling a physical phenomenon involving fluid flow and solving it numerically using the computational prowess.

    When an engineer is tasked with designing a new product, e.g. a winning race car for the next season, aerodynamics play an important role in the engineering process. However, aerodynamic processes are not easily quantifiable during the concept phase. Usually, the only way for the engineer to optimize his designs is to conduct physical tests on product prototypes. With the rise of computers and ever-growing computational power (thanks to Moore’s law!), the field of Computational Fluid Dynamics became a commonly applied tool for generating solutions for fluid flows with or without solid interaction. In a CFD software analysis, the examination of fluid flow in accordance with its physical properties such as velocity, pressure, temperature, density and viscosity is conducted. To virtually generate an accurate solution for a physical phenomenon associated with fluid flow, those properties have to be considered simultaneously.

    A mathematical model of the physical case and a numerical method are used in a CFD software tool to analyze the fluid flow. For instance, the Navier-Stokes (N-S) equations are specified as the mathematical model of the physical case. This describes changes in all those physical properties for both fluid flow and heat transfer. A mathematical model varies in accordance with the content of the problem such as heat transfer, mass transfer, phase change, chemical reaction, etc. Moreover, the reliability of a CFD analysis highly depends on the whole structure of the process. The verification of the mathematical model is extremely important to create an accurate case for solving the problem. Besides, the determination of proper numerical methods is the key to generate a reliable solution. The CFD analysis is a key element in generating a sustainable product development process, as the number of physical prototypes can be reduced drastically.

    Streamlines around an F1 car
    Figure 1: Streamlines showing airflow around the F1 car obtained using N-S equations

    History of Computational Fluid Dynamics

    From antiquity to present, humankind has been eager to discover phenomena based on fluid flow. So, how old is CFD? Experimental studies in the field of CFD have one big disadvantage: if they need to be accurate, they consume a significant amount of time and money. Consequently, scientists and engineers wanted to generate a method that enabled them to pair a mathematical model and a numerical method with a computer for faster examination.

    The brief story of Computational Fluid Dynamics can be understood below:

    • Until 1910: Improvements on mathematical models and numerical methods.
    • 1910 – 1940: Integration of models and methods to generate numerical solutions based on hand calculations\(^1\).
    • 1940 – 1950: Transition to computer-based calculations with early computers (ENIAC)\(^3\). Solution for flow around a cylinder by Kawaguti with a mechanical desk calculator in 1953\(^8\).
    • 1950 – 1960: Initial study using computers to model fluid flow based on the Navier-Stokes equations by Los Alamos National Lab, US. Evaluation of vorticity – stream function method\(^4\). First implementation for 2D, transient, incompressible flow in the world\(^6\).
    • 1960 – 1970: First scientific paper “Calculation of potential flow about arbitrary bodies” was published about computational analysis of 3D bodies by Hess and Smith in 1967\(^5\). Generation of commercial codes. Contribution of various methods such as k-ε turbulence model, Arbitrary Lagrangian-Eulerian, SIMPLE algorithm which are all still broadly used\(^6\).
    • 1970 – 1980: Codes generated by Boeing, NASA and some have unveiled and started to use several yields such as submarines, surface ships, automobiles, helicopters and aircrafts\(^{4,6}\).
    • 1980 – 1990: Improvement of accurate solutions of transonic flows in the three-dimensional case by Jameson et. al. Commercial codes have started to implement through both academia and industry\(^7\).
    • 1990 – Present: Thorough developments in Informatics: worldwide usage of CFD virtually in every sector.

    The Bigger Picture

    The central mathematical description for all theoretical fluid dynamics models is given by the Navier-Stokes equations, which describe the motion of viscous fluid domains. The history of their discoveries is quite interesting. It is a bizarre coincidence that the famous equation of Navier-Stokes has been generated by Claude-Louis Navier (1785-1836) and Sir George Gabriel Stokes (1819-1903) who had never met. At first, Claude-Louis Navier conducted studies on a partial section of equations up until 1822. Later, Sir George Gabriel Stokes adjusted and finalized the equations in 1845\(^9\).

     Claude-Louis Navier (left) and Sir George Gabriel Stokes (right)
    Figure 2: Claude-Louis Navier\(^{14}\) (left) and Sir George Gabriel Stokes\(^{15}\) (right)

    Governing Equations

    The main structure of thermo-fluids examination is directed by governing equations that are based on the conservation law of fluid’s physical properties. The basic equations are the three laws of conservation\(^{10,11}\):

    1. Conservation of Mass: Continuity Equation
    2. Conservation of Momentum: Newton’s Second Law
    3. Conservation of Energy: First Law of Thermodynamics or Energy Equation

    These principles state that mass, momentum, and energy are stable constants within a closed system. Basically everything must be conserved.

    The investigation of fluid flow with thermal changes relies on certain physical properties. The three unknowns which must be obtained simultaneously from these three basic conservation equations are the velocity \(\vec{v}\), pressure \(p\) and the absolute temperature \(T\). Yet \(p\) and \(T\) are considered the two required independent thermodynamic variables. The final form of the conservation equations also contains four other thermodynamic variables; density \(\rho\), enthalpy \(h\), viscosity \(\mu\), and thermal conductivity \(k\); the last two of which are also transport properties. These four properties are uniquely determined by the value of \(p\) and \(T\).

    Fluid flow should be analyzed to know \(vec{v}\), \(p\) and \(T\) throughout every point of the flow regime. This is most important before designing any product which involves fluid flow. Furthermore, the method of fluid flow observation based on kinematic properties is a fundamental issue. Movement of fluid can be investigated with either Lagrangian or Eulerian methods. Lagrangian description of fluid motion is based on the theory to follow a fluid particle that is large enough to detect properties. Initial coordinates at time \(t_0\) and coordinates of the same particle at time \(t_1\) have to be examined. To follow millions of separate particles through the path is almost impossible. In the Eulerian method instead of following any specific particle across the path, the velocity field is examined as a function of space of time. This missile example precisely explains the two methods.

    Observation of fluid motion with the methods of Lagrange and Euler
    Figure 3: In lagrangian approach the man is steady with respect to the missile which is otherwise in the Eulerian approach

    Langrangian: We take up every point at the beginning of the domain and trace its path until it reaches the end.
    Eulerian: We consider a window (Control Volume) within the fluid and analyze the particle flow within this volume.

    Lagrangian formulation of motion is always time-dependent. As \(a\), \(b\), and \(c\) are the initial coordinates of a particle; \(x\), \(y\), and \(z\) are coordinates of the same particle at time \(t\). Description of motion for a Lagrangian flow:

    $$ x=x(a,b,c,t) \quad y=y(a,b,c,t) \quad z=z(a,b,c,t) \tag{1}$$

    In the Eulerian method, \(u\), \(v\), and \(w\) are the components of velocity at the point \((x,y,z)\) at the time \(t\). Thus, \(u\), \(v\), and \(w\) are the unknowns which are functions of the independent variables \(x, y, z\) and \(t\). Description of motion for an Eulerian flow for any particular time \(t\):

    $$ u=u(x,y,z,t) \quad v=v(x,y,z,t) \quad w=w(x,y,z,t) \tag{2}$$

    Understanding the Equations

    The equation for the Conservation of Mass is specified as:

    $$ \frac{Dρ}{Dt} +\rho (\nabla \cdot \vec{v}) =0 \tag{3}$$

    where \(\rho\) is the density, \(\vec{v}\) the velocity and \(\nabla\) the gradient operator.

    $$ \vec{\nabla} = \vec{i} \frac{\partial}{\partial x} + \vec{j} \frac{\partial}{\partial y} + \vec{k} \frac{\partial}{\partial z} \tag{4}$$

    If the density is constant, the flow is assumed to be incompressible and the the continuity equation reduces to:

    $$ \frac{D\rho}{Dt} = 0 \rightarrow \nabla \cdot \vec{v} = \frac{\partial u}{\partial x} + \frac{\partial v}{\partial y} + \frac{\partial w}{\partial z} = 0 \tag{5}$$

    Conservation of Momentum which can be referred to as the Navier-Stokes Equation is given by:

    $$ \overbrace{\frac{\partial}{\partial t} (\rho \vec{v})}^{I} + \overbrace{\nabla \cdot (\rho \vec{v} \vec{v})}^{II}= \overbrace{-\nabla p}^{III} + \overbrace{\nabla \cdot \left(\overline{\overline{\tau}}\right)}^{IV} + \overbrace{\rho \vec{g}}^{V} \tag{6}$$

    where \(p\) is static pressure, \(\overline{\overline{\tau}}\) is viscous stress tensor and \(\rho \vec{g}\) is the gravitational force per unit volume. Here, the roman numerals denote:

    I: Local change with time
    II: Momentum convection
    III: Surface force
    IV: Diffusion term
    V: Mass force

    Viscous stress tensor \(\overline{\overline{\tau}}\) can be specified as below in accordance with Stoke’s Hypothesis:

    $$ \tau_{ij} = \mu \frac{\partial v_i}{\partial x_j} + \frac{\partial v_j}{\partial x_i} – \frac{2}{3}(\nabla \cdot \vec{v}) \delta_{ij} \tag{7}$$

    If the fluid is assumed to be incompressible with constant viscosity coefficient \(\mu\) is assumed constant the Navier-Stokes equation simplifies to:

    $$ \rho \frac{D\vec{v}}{Dt} = -\nabla p + \mu \nabla^2 \vec{v} + \rho \vec{g} \tag{8}$$

    Conservation of Energy is the first law of thermodynamics which states that the sum of the work and heat added to the system will result in the increase of the energy in the system:

    $$ dE_t=dQ + dW \tag{9}$$

    where \(dQ\) is the heat added to the system, \(dW\) is the work done on the system and \(dE_t\) is the increment in the total energy of the system. One of the common types of an energy equation is:

    $$ \rho \left[\overbrace{\frac{\partial h}{\partial t}}^{I} + \overbrace{\nabla \cdot (h\vec{v})}^{II} \right] = \overbrace{-\frac{\partial p}{\partial t}}^{III} + \overbrace{\nabla \cdot (k\nabla T)}^{IV} + \overbrace{\phi}^{V} \tag{10}$$

    I: Local change with time
    II: Convective term
    III: Pressure work
    IV: Heat flux
    V: Source term

    Partial Differential Equations (PDEs)

    The Mathematical model merely gives us interrelation between the transport parameters which are involved in the whole process, either directly or indirectly. Even though every single term in those equations has a relative effect on the physical phenomenon, changes in parameters should be considered simultaneously through the numerical solution which comprises differential equations, vector, and tensor notations. A PDE comprises more than one variable and is denoted with “\(\partial\)”. If the derivation of the equation is conducted with “\(d\)”, these equations are called as Ordinary Differential Equations (ODE) that contain a single variable and its derivation. The PDEs are implicated to transform the differential operator (\(\partial\)) into an algebraic operator in order to get a solution. Heat transfer, fluid dynamics, acoustic, electronics and quantum mechanics are the fields that PDEs are highly used to generate solutions.

    Example of ODE:

    $$ \frac{d^2 x}{dt^2} = x \rightarrow x(t) \quad \text{where T is the single variable} \tag{11}$$

    Example of PDE:

    $$ \frac{\partial f}{\partial x} + \frac{\partial f}{\partial y} = 5 \rightarrow f(x,y) \quad \text{where both x and y are the variables} \tag{12}$$

    What is the significance of PDEs to seeking a solution on governing equations? To answer this question, we initially examine the basic structure of some PDEs as to create connotation. For instance:

    $$ \frac{\partial^2 f}{\partial x^2} + \frac{\partial^2 f}{\partial y^2} = 0 \rightarrow f(x,y) \rightarrow \text{Laplace Equation} \tag{13}$$

    A quick comparison between equation (5) and equation (13) specifies the Laplace part of the continuity equation. What is the next step? What does this Laplace analogy mean? To start solving these enormous equations, the next step comes through discretization to ignite the numerical solution process. The numerical solution is a discretization-based method used to obtain approximate solutions to complex problems that cannot be solved with analytic methods. As seen in Figure 3, solution processes without discretization merely give you an analytic solution which is exact but simple. Moreover, the accuracy of the numerical solution highly depends on the quality of the discretization. Broadly used discretization methods might be specified such as finite difference, finite volume, finite element, spectral (element) methods and boundary element.

    Different stages in the CFD process
    Figure 4: Accurate numerical discretization helps linearize the PDEs and capture the sensitive variable gradients

    Mesh Convergence

    Multitasking is one of the plagues of the century that generally ends up with procrastination or failure. Therefore, having planned, segmented and sequenced tasks is much more appropriate to achieving goals: this has also been working for CFD. In order to conduct an analysis, the solution domain is split into multiple sub-domains which are called cells. The combination of these cells in the computational structure is named mesh.

    Mesh of a Formula one car with refinement
    Figure 5: Variable mesh density (refinement levels) on an F1 car helps to capture maximum variations associated with the flow characteristics

    Meshing is the process of discretization of the domain into small cells or elements to apply the mathematical model under the assumption of linearity pertaining to each cell. This means that we need to ensure that the behavior of the variables that need to be solved can be assumed linear within each cell. This requirement also implies that a finer mesh is needed for areas where the physical properties to be predicted are suspected to be highly mercurial. To know more about mesh readers are highly encouraged to visit What is a mesh?.

    Errors based on mesh structure are an often encountered issue that results in the failure of the simulation. This might happen because the mesh is too coarse and doesn’t cover all effects that happen in this single cell element one by one, but rather covers multiple effects that then change as the mesh gets finer. Therefore, a study of independence needs to be carried out. The accuracy of the solution enormously depends on the mesh structure. To conduct accurate solutions and obtaining reliable results, the analyst has to be extremely careful about the type of cell, the number of cells and the computation time. The optimization of these restrictions is defined as mesh convergence which might be sorted as below:

    1. Generate a mesh structure that has a satisfactory number of elements and assure that the mesh quality and coverage of the CAD model is reasonable to examination. Carry out the analysis.
    2. Regenerate mesh structures with a higher number of elements. Conduct analysis again and compare the results accordingly. For instance, if a case is an examination of internal flow through a channel, comparing pressure drop at critical regions might be critical.
    3. Keep refining the mesh until the results converge satisfactorily with the previous one(s).

    Therefore, errors, based on the mesh structure, can be eliminated and optimum value for the number of elements might virtually be achieved to make computation an efficient process. Figure 6 looks into static pressure change at imaginary region X through the increase in the number of mesh elements. According to Figure 6, around 1,000,000 elements would have been sufficient to conduct a reliable study.

    Static pressure in an arbitrary region X and its variation with respect to the mesh refinement.
    Figure 6: This example of a mesh convergence analysis shows how important it is to select optimum mesh sizing to save computational expenses

    Convergence in CFD

    Creating a sculpture requires a highly talented artist with the ability to imagine the final product from the beginning. Yet a sculpture can be a simple piece of rock in the beginning but might become an exceptional artwork in the end. Completely gradual processing throughout carving is an important issue to obtain the desired unique shape. Keep in mind that in every single process, some of the elements, such as stone particles, leftovers, are thrown away from the object. CFD also has a similar structure that relies on gradual processing during the analysis. In regions that are highly critical to the simulation results (for example a spoiler on a Formula 1 car) the mesh is refined into smaller elements to make the simulation more accurate. Refer Figure 5 to observe the refined edges in the mesh of the F1 car.

    Convergence is a major issue for computational analysis. The movement of fluid has a non-linear mathematical model with various complex models such as turbulence, phase change, and mass transfer and convergence is heavily influenced by them. Apart from the analytical solution, the numerical solution goes through an iterative scheme where results are obtained by the reduction of errors among previous stages. The differences between the last two values specify the error. When the absolute error is descending, the reliability of the result increases, which means that the result converges towards a stable solution.

    How do analysts decide when the solution is converged? Convergence should go on and on until a steady-state condition has been obtained, even if the aimed case is transient, which indicates results changing through time. Convergence has to be realized for each time-step as if they all are a steady-state process. What are the criteria for convergence? The residuals of equations, like stone leftovers, change over each iteration. As iterations get down to a threshold value, convergence is achieved. For a transient case, those processes have to be achieved for each of the time steps. Furthermore, convergence might be diversified as follows:

    • Can be accelerated by parameters as initial conditions, under-relaxation, and Courant number.
    • Doesn’t always have to be correct, yet the solution can converge; preferred mathematical model and mesh would be incorrect or have ambiguities.
    • Can be stabilized within several methods like reasonable mesh quality, mesh refinement, using discretization schemes first- to second-order.
    • Ensure that the solution is repeatable if necessary as to refrain ambiguity.

    Join SimScale today!

    All the applications mentioned below can be simulated within the SimScale platform. If you want to solve and visualize the equations described earlier in the form of colourful and informative results without having to buy a license sign up with our community plan.

    Applications of CFD

    Where there is fluid, there is CFD. Having mentioned before, the initial stage to conduct a CFD simulation is specifying an appropriate mathematical model of reality. Rapprochements and assumptions give direction through solution processes to examine the case in the computational domain. For instance, fluid flow over a sphere/cylinder is a repetitive issue that has been taught by the lecturer as an example in fluids courses. The same phenomenon is virtually available in the movement of clouds in the atmosphere which is indeed tremendous (as seen in figure 7).

    Examples of Karman vortex streets; numerical result (top) and real life example of clouds (bottom)
    Figure 7: Transient effects obtained from numerical result (top) of a cylinder placed in fluid and a similar real life example of clouds\(^{12}\) (bottom)

    Incompressible and Compressible flow

    If compressibility becomes a non-negligible factor, this type of analysis helps you to find solutions in a very robust and accurate way. One example would be a Large Eddy Simulation of flow around a cylinder.

    Laminar and Turbulent flow

    Different turbulence models play a role in this type of analysis. A lot of computing power is required to solve turbulence simulations and its complex numerical models. The difficulty of turbulence is the simulation of changes over time. The entire domain where the simulation takes place needs to be recalculated after every time step.

    The valve is one possible application of a turbulent flow analysis.

    Mass and Thermal transport

    Mass transport simulations include smoke propagation, passive scalar transport or gas distributions. To solve these kinds of simulations, OpenFOAM solvers are used.

    Heat exchanger simulations are one possible application.

    Different Types of CFD Applications

    Computational Fluid Dynamics tools diversify in accordance with mathematical models, numerical methods, computational equipment, and post-processing facilities. As a physical phenomenon could be modeled with completely different mathematical approaches, it would also be integrated with unlike numerical methods simultaneously. Thus, a conscious rapprochement is an essential factor on the path to developing CFD tools. There are several licensed commercial software solutions, along with open source software. One of the most used open-source solvers for CFD is OpenFOAM\(^{12}\).

    OpenFOAM is also one of the solvers integrated within the SimScale simulation platform.

    CFD using SimScale

    Computational Fluid Dynamics (CFD) is the branch of CAE that allows you to simulate fluid motion using numerical approaches. The cloud-based CFD software facility of SimScale allows the analysis of a wide range of problems related to laminar and turbulent flows, incompressible and compressible fluids, multiphase flows and more. Those engineering problems are solved using multiple integrated numerical solvers and technologies.

    Streamlines of fluid flow through a Ball Valve
    Animation 1: This Ball Valve streamline animation from SimScale shows one of the various simulation possibilities on the SimScale platform

    Last updated: July 27th, 2022

    What's Next