# Computational Fluid Dynamics Applied to
## 2 Background  
In CFD, most of the methods solve the Navier-Stokes equations either in an Eulerian or a Lagrangian reference system. In addition, some methods solve the Boltzmann equations instead of Navier-Stokes equations [10]. The most popular mesh-based methods in CFD are the finite difference method (FDM), finite element method (FEM), and finite volume method (FVM) [10]. These mesh-based methods discretize the computational domain through a grid. After that, equations that represent the mass (Equation (1)), momentum (Equation (2)), and energy conservation are discretized into algebraic equations and solved [3]. \[\frac{\partial\rho}{\partial t}+\
abla(\rho u)=0 \tag{1}\]  
\[\frac{\partial(\rho u)}{\partial t}+\
abla(\rho uu)=-\
abla p+\
abla\Big{[} \mu\Big{(}\
abla u+\
abla u^{T}\Big{)}\Big{]}+\rho g+F \tag{2}\]Moreover, an additional equation can be considered when the study involves multiple phases, e.g., air and lubricant. In Equation (3), \(\alpha\) is a scalar quantity called volumetric fraction (or volume fraction). The averaged generic field property (\(\phi\)) of the mixture in each cell of the domain can be calculated as an \(\alpha\)-averaged value of the properties of the different fluids/phases, e.g., air and lubricant (Equation (4)). \[\frac{\partial}{\partial\mathbf{t}}\alpha+\frac{\partial}{\partial\mathbf{x}_ {\mathrm{i}}}(\alpha\mathbf{u}_{\mathrm{i}})=0 \tag{3}\]  
\[\phi=\ \phi_{lab}\alpha+\phi_{air}(1-\alpha) \tag{4}\]  
The concept behind of FDM is to replace the partial derivatives appearing in the governing equations of fluid dynamics with algebraic difference quotients, obtaining a system of algebraic equations which can be solved for the flow-field variables at the specific, discrete grid points in the flow [11]. Therefore, in FDM, the mesh has to be structured. With respect to the FEM, the computational domain is subdivided into cells, called elements, which form the mesh that can be structured or unstructured [11]. In FEM, the solution of the discrete problem is assumed a priori to have a prescribed form. More specifically, the solution is a function space, which is obtained by varying function values in a specific way, e.g., linear or quadratic, between values in nodal points. Therefore, the position of these nodes in the elements and in the computational domain affect the representation of the solution. Another essential characteristic of the FEM is that the partial differential equations are solved in an integral form and the most general integral form is obtained from a weighted residual formulation [11]. The most widespread mesh-based approach relies on finite volumes [3]. With respect to the FVM, the computational domain is discretized in finite volumes, also called cells, in which the flow is solved. The tridimensional cells can be tetrahedral, pyramidal, prismatic, or hexahedral, etc. The selection of appropriate cell types and the resulting mesh quality (e.g., mesh density, adjacent cell length/volume ratios, skewness) are important factors for the goodness of the solution. Indeed, the mesh quality (based on the cells type) is important for the rate of convergence (or even lack of convergence), to avoid (or at least limit) the occurrence of numerical errors, to achieve a proper solution accuracy and to reduce the computational effort [4]. However, the quality of the mesh or the reliability of the results can be jeopardized by the need to modify the computational domain in space and time to reproduce the kinematics of the mechanical components (and the consequent topological modification of the computational domain). The CFD approaches able to manage the discretization of the computational domain in this context are various. These approaches allow studying more or less faithfully the flows interaction/behavior to obtain results useful for the design of the studied systems/components. The main group of CFD approaches mesh-based are described in the following section.