# Basics of CFD

## Introduction to CFD

Computational Fluid Dynamics (CFD) is a powerful branch of fluid mechanics that employs mathematical models and numerical algorithms to simulate, analyze, and predict the behavior of fluid flows. By solving the fundamental governing equations, such as the Navier-Stokes equations and continuity equation, CFD enables engineers and scientists to study complex fluid flow problems that are difficult or impossible to analyze through experimental or analytical means.

Through the use of advanced computer software and high-performance computing, CFD offers a cost-effective and time-efficient method to investigate fluid dynamics in a wide range of applications. These include aerospace, automotive, water and wastewater treatment, chemical processes, and environmental engineering, among others. By providing detailed insights into fluid behavior, CFD assists in optimizing designs, enhancing performance, and improving safety in various industries.

As a multidisciplinary field, CFD integrates concepts from mathematics, physics, and computer science. Its continuous advancements in numerical methods, turbulence modeling, and computational resources have greatly expanded the scope and accuracy of fluid flow simulations, making it an indispensable tool in modern engineering and scientific research

## Governing equations

In fluid mechanics, the continuity, momentum, and energy equations are the primary governing equations that describe the behavior of fluids, including liquids and gases. Here is an explanation of each equation in simpler terms:

• Continuity Equation: The continuity equation represents the conservation of mass in a fluid system. It states that the mass of fluid entering a certain region must equal the mass of fluid leaving that region, plus any change in mass within the region. In other words, the fluid mass can neither be created nor destroyed. The continuity equation helps us understand how fluid density and velocity change with respect to time and space, ensuring that mass is conserved throughout the flow.
• Momentum Equation: The momentum equation, often represented by the Navier-Stokes equations, describes the conservation of momentum in a fluid. Momentum is the product of an object’s mass and velocity, and it represents the force needed to change an object’s motion. The momentum equation considers forces acting on the fluid, such as pressure, gravity, and viscous forces (due to fluid resistance). By balancing these forces, the momentum equation helps us determine how fluid velocity changes over time and space.
• Energy Equation: The energy equation represents the conservation of energy in a fluid system. It states that the total energy of a fluid (including its internal, kinetic, and potential energy) must be conserved as it flows through a system. The energy equation takes into account factors such as heat transfer, work done by external forces, and energy dissipation due to viscosity. By balancing these energy contributions, the energy equation helps us understand how the fluid’s temperature and internal energy change as it flows through a system.

Together, the continuity, momentum, and energy equations form the foundation of fluid mechanics, allowing us to model and analyze fluid flows in a wide range of applications, from aerodynamics to heat exchangers and beyond. By solving these equations, engineers and scientists can gain valuable insights into fluid behavior, optimize designs, and enhance overall system performance.

## Finite Volume Method

The Finite Volume Method (FVM) is a widely used numerical technique in Computational Fluid Dynamics (CFD) for solving the governing equations that describe fluid flow and heat transfer. This method is based on the conservation laws of mass, momentum, and energy, which are expressed as partial differential equations (PDEs). The FVM discretizes the domain into a finite number of control volumes or cells, transforming the continuous PDEs into a set of discrete algebraic equations that can be solved numerically.

The essential idea behind FVM is to integrate the governing equations over each control volume, ensuring that the conservation laws are satisfied within these finite volumes. This approach results in a local balance of fluxes at the boundaries of each control volume, leading to a stable and conservative numerical scheme.

The FVM process can be summarized in the following steps:

• Discretize the domain: The computational domain is divided into a set of non-overlapping control volumes, typically by using a structured, unstructured, or hybrid mesh.
• Integrate the governing equations (PDE’s): The conservation equations are integrated over each control volume, resulting in an equation for each cell that represents the balance of mass, momentum, and energy.
• Discretize the PDE’s: The fluxes of conserved quantities across the control volume boundaries are approximated using various interpolation schemes, such as first-order upwind or higher-order schemes. These approximations help in estimating the values of variables at the cell faces, which are required for computing the fluxes.
• Solve the algebraic equations: The integrated conservation equations form a system of algebraic equations that can be solved iteratively using linear or nonlinear solvers. The solution process yields the values of variables (e.g., velocity, pressure, temperature) at the cell centers for each control volume.
• The Finite Volume Method is popular in CFD due to its inherent conservation properties, robustness, and flexibility to handle complex geometries through various mesh types. By converting the continuous governing equations into discrete algebraic forms, FVM enables the efficient numerical simulation of fluid flow and heat transfer problems, providing valuable insights for engineering design and analysis

## Mesh and grid types

A CFD simulation begins with a solution domain which specifies a region of space of interest, in which fluid dynamics equations are solved. The numerical mesh, also known as the grid or discretization, plays a crucial role in approximating the behavior of fluid flow within the solution domain. The mesh is a network of interconnected elements, which can be structured or unstructured, that subdivide the simulation domain into smaller regions. Each element in the mesh represents a discrete computational cell where fluid properties and governing equations are evaluated.

The primary purpose of the numerical mesh is to convert the continuous mathematical equations governing fluid flow, such as the Navier-Stokes equations, into a set of discrete algebraic equations that can be solved numerically. This process, called discretization, allows computers to efficiently solve complex fluid flow problems that would otherwise be analytically intractable.

Mesh quality and resolution are critical factors in the accuracy and stability of CFD simulations. A well-designed mesh should capture the essential flow features and geometry of the domain while minimizing computational costs. High-resolution meshes are often needed in regions with steep gradients or complex geometries, such as boundary layers and areas of flow separation. However, increasing mesh resolution also leads to a higher number of computational cells, which in turn increases the computational time and resources required for the simulation.

There are several types of numerical meshes used in CFD:

• Structured mesh: This type of mesh consists of regularly arranged elements, such as quadrilaterals in 2D or hexahedra in 3D. Structured meshes are generally easier to generate and offer better computational efficiency. However, they may not be suitable for complex geometries or regions with highly varying flow properties.
• Unstructured mesh: Unstructured meshes consist of irregularly arranged elements, such as triangles in 2D or tetrahedra in 3D. These meshes can conform more easily to complex geometries and adapt to varying flow features. However, they are typically more computationally demanding than structured meshes.
• Hybrid mesh: A hybrid mesh combines elements from both structured and unstructured meshes, often utilizing structured elements in regular regions and unstructured elements in more complex areas. This approach aims to balance the advantages of both mesh types.

## Boundary conditions

Boundary conditions in Computational Fluid Dynamics (CFD) refer to the specific constraints or values applied to the edges or limits of the domain being simulated. These conditions are essential for accurately modeling fluid flow problems, as they define the behavior of the fluid at the boundaries of the domain and help in approximating the real-world physical system under investigation.

There are several types of boundary conditions commonly used in CFD:

• Dirichlet boundary condition: This type of boundary condition specifies the exact value of a variable (e.g., velocity, temperature, or pressure) at the boundary. For example, in a pipe flow simulation, one may set a fixed inlet velocity at the entrance of the pipe.
• Neumann boundary condition: This type of boundary condition defines the spatial derivative or gradient of a variable at the boundary. For instance, the rate of heat transfer (temperature gradient) at a heated wall can be specified as a Neumann boundary condition.
• Periodic boundary condition: In this type, the values of variables at one boundary are equal to the values at another boundary. This is commonly used when simulating repeating patterns or structures, such as a flow through an array of identical objects.
• Inlet/outlet boundary condition: In these conditions, fluid is allowed to enter or exit the domain, respectively. Inlet conditions typically require specifying the velocity, pressure, or mass flow rate, while outlet conditions may involve setting a fixed pressure or using a zero-gradient assumption for certain variables.
• Wall boundary condition: This condition represents solid surfaces in contact with the fluid, where no-slip (zero velocity) or slip (non-zero velocity) conditions can be applied. Wall conditions may also include heat transfer or surface roughness effects.

Selecting the appropriate boundary conditions is crucial for obtaining accurate and reliable CFD results. It is essential to have a thorough understanding of the physical system being simulated and the assumptions being made when applying boundary conditions to a CFD problem.

## Reynolds-Averaged Navier Stokes

The Reynolds-Averaged Navier-Stokes (RANS) equations are a set of partial differential equations that describe the motion of fluid substances, such as gases and liquids, in engineering and scientific applications. They are derived from the more general Navier-Stokes equations by applying the Reynolds decomposition, a mathematical technique that separates fluid flow variables into time-averaged and fluctuating components. This simplification is particularly useful in the study of turbulent flows, where the behavior of fluids can be highly complex and computationally expensive to model directly.

The RANS equations account for the effects of turbulence by incorporating additional terms called Reynolds stresses, which are functions of the fluctuating components of the velocity field. These stresses represent the additional momentum transfer caused by turbulence and must be modeled to close the system of equations. There are numerous turbulence models that can be used for this purpose, such as the k-epsilon, k-omega, and Reynolds stress models, each with its own strengths and limitations depending on the specific flow conditions.

## Turbulence modeling

In the realm of fluid dynamics, the study of turbulence is both a fascinating and challenging area that has attracted the attention of researchers and engineers for decades. Turbulent flows, characterized by their irregular and chaotic behavior, play a vital role in many natural and industrial processes. Accurate prediction and understanding of turbulent flow behavior are essential for optimizing the performance and efficiency of a wide range of engineering applications, such as aircraft design, combustion systems, and environmental modeling.

A turbulence model is a mathematical representation or approximation used to describe the complex behavior of turbulent flows in fluid dynamics simulations. Turbulence models aim to simplify the governing equations of fluid motion (such as the Navier-Stokes equations) to make them computationally tractable, while still capturing the essential features of turbulence. These models are based on certain assumptions and approximations of the underlying physics, striking a balance between computational efficiency and solution accuracy.

The primary purpose of turbulence models is to account for the effects of turbulence on flow variables, such as velocity, pressure, and temperature, without having to resolve all the turbulent fluctuations directly. This is typically achieved by introducing additional equations that describe the transport and dissipation of turbulent kinetic energy, turbulent viscosity, or other relevant quantities.

There are various types of turbulence models, each with its own set of assumptions, simplifications, and level of complexity. Some of the most common turbulence models include:

• Reynolds-Averaged Navier-Stokes (RANS) models: These models average the flow variables over time, separating them into mean and fluctuating components. RANS models, such as the k-epsilon and k-omega models, are widely used in engineering applications due to their computational efficiency.
• Large Eddy Simulation (LES) models: LES models filter the flow variables based on a spatial scale, resolving the larger-scale turbulent structures and modeling the smaller-scale, more universal fluctuations.
• Detached Eddy Simulation (DES) and hybrid RANS-LES models: These models combine the features of both RANS and LES approaches, providing a compromise between computational efficiency and solution accuracy.

The choice of a turbulence model depends on factors such as the specific flow scenario, the required level of accuracy, and the available computational resources. Each turbulence model has its own strengths and limitations, making it essential to understand their underlying assumptions and applicability in order to select the most suitable model for a given application

## In our videos we introduce CFD solutions for aeration and mass transfer

### CFD for chemical industry: analysis of a rushton turbine

CFD (Computational Fluid Dynamics) analysis of a Rushton Turbine by a time accurate simulation and LES (Large Eddy Simulation) turbulence model.

### CFD for water and wastewater industry: aeration tank

This multiphase simulation uses a Euler-Euler approach to analyse the gas-liquid system. Thanks to this kind of CFD simulation, not only the velocity and the pressure field can be analysed but also the total air hold-up and standard oxygen transfer rate can be calculated.

### CFD for water and wastewater industry: coarse bubble aerator

CFD Transient (time dependent) simulation of the coarse bubble iCBA®-Aeration System installed in a show and test tank used in the mixing and aeration laboratory.