








































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!









































Department of Chemistry, Materials, and Chemical Engineering “G. Natta”, Politecnico di Milano
1 Introduction 2
2 Finite-Difference Method (FDM) 2 2.1 First-order derivative............................... 4 2.2 Second-order derivative............................. 7 2.3 Mixed derivatives................................. 9 2.4 Source terms................................... 9 2.5 Boundary conditions............................... 9 2.6 Systems of Non-Linear Equations (NLS).................... 11
3 Finite-Volume Method (FVM) 12 3.1 Surface Integrals................................. 14 3.2 Volume Integrals................................. 16 3.3 Interpolations................................... 17 3.4 Summary..................................... 20 3.5 Systems of Non-Linear Equations (NLS).................... 20
4 Unsteady cases 21 4.1 Methods for IVP (Initial Value Problems)................... 21 4.2 Runge-Kutta Methods.............................. 25 4.3 Other Methods.................................. 27
5 Application to Transport Equations 27 5.1 Explicit methods................................. 28 5.2 Implicit methods................................. 33
6 Velocity-pressure coupling 36 6.1 Computational Grid (or Mesh)......................... 37 ∗Please consider that these notes have been automatically translated from Italian. The quality of the translation is not very high.
6.2 Momentum Transport Equations........................ 40 6.3 SIMPLE algorithm................................ 43 6.4 SIMPLEC algorithm............................... 46 6.5 Final remarks................................... 48
Most of the content of this document (including the Figures) has been extracted and rearranged from the following books on Computational Fluid Dynamics:
In the previous lectures, we derived the conservation equations for mass, momentum, spe- cies, and energy. Alongside these primary equations, we also highlighted the possibility of identifying, to varying levels of complexity, transport equations for other quantities, such as turbulent kinetic energy, turbulent kinetic energy dissipation rate, Reynolds stresses, etc. In all cases, these are partial differential equations (with time and space as indepen- dent variables), sharing a common form characterized by the presence of an accumulation term, a convective term, a diffusive term, and a source term. In the remainder of this document, we will refer to the generic variable ϕ , which is governed by the following equation:
∂ ( ρϕ ) ∂t
For simplicity, we will consistently refer to an orthogonal Cartesian coordinate system, allowing us to express the same equation explicitly as follows:
∂ ( ρϕ ) ∂t
∂xj ( ρvj ϕ ) =
∂xj
( Γ ∂ϕ ∂xj
)
Various approaches exist for solving partial differential equations such as the one men- tioned above. The most commonly used methods include finite differences, finite volumes, and spectral methods. In this document, we will exclusively focus on the first two me- thods, which are the most widely employed in commercial fluid dynamics codes. In the initial part, we will address the resolution of transport equations under steady-state con- ditions. Subsequently, we will transition to consider the more general case corresponding to unsteady conditions. Finally, in the last section, we will delve into the velocity-pressure coupling problem for solving the Navier-Stokes equations.
The starting point for the application of the finite difference method is the construction of an appropriate computational grid, typically structured (refer back to the Introduction
Figura 2.2: Geometric Interpretation of the Derivative
and xi. The solid line, on the other hand, represents a centered derivative, constructed using the two points near xi , cioè xi − △ xi e xi + △ xi. From Figure 2.2, it’s quite evident that some approximations are better than others. For example, the centered derivative has a slope that is very close to the exact one. If the function ϕ ( x ) were locally a second-order polynomial at point xi , and if the grid nodes were equally spaced, the slopes would be exactly the same. From the same Figure 2.2, it’s also easy to understand that the quality of the approximation improves as the grid points get closer. The approximations shown in Figure 2.2 are just some of the many possibilities, which will be better illustrated later on. For simplicity, we will only refer to the one-dimensional case. However, it should not be thought of as too restrictive. In fact, when using Cartesian (or at most curvilinear) grids, the finite difference method ultimately reduces to calculating derivatives along the three spatial directions, effectively making it a one-dimensional case for derivative calculations.
In Equation (1.2), there is first a need to approximate the first derivative corresponding to the convective term. Therefore, the ability to have approximations of varying accuracy for describing the first derivative is a fundamental aspect of applying the finite difference method.
Taylor’s expansion
Any continuously differentiable function ϕ ( x ) around the point xi can be expressed th- rough a Taylor series expansion as follows:
ϕ ( x ) = ϕ ( xi )+( x − xi )
( ∂ϕ ∂x
)
xi
( x − xi )^2 2!
( ∂^2 ϕ ∂x^2
)
xi
( x − xi )^3 3!
( ∂^3 ϕ ∂x^3
)
xi
( x − xi ) n n!
( ∂nϕ ∂xn
)
xi
where H represents higher-order terms. By substituting x with xi − 1 or xi +1 in this equation, we can obtain expressions solely in terms of the variable ϕ ( x ) and its derivatives
evaluated at the points xi. This concept can be extended to points near xi , such as xi − 2 and xi +2. Using such expressions, it is possible to derive approximate expressions for the first derivative and higher-order derivatives at the point xi using only the values of the function at neighboring points. For example, utilizing the equation provided above for ϕ ( x ) at xi +1, it can be shown that:
( ∂ϕ ∂x
)
xi
ϕi +1 − ϕi xi +1 − xi
xi +1 − xi 2
( ∂^2 ϕ ∂x^2
)
xi
( xi +1 − xi )^2 6
( ∂^3 ϕ ∂x^3
)
xi
A different expression can be obtained when evaluating ϕ ( x ) at the point xi − 1 :
( ∂ϕ ∂x
)
xi
ϕi − ϕi − 1 xi − xi − 1
xi − xi − 1 2
( ∂^2 ϕ ∂x^2
)
xi
( xi − xi − 1 )^2 6
( ∂^3 ϕ ∂x^3
)
xi
Finally, a third expression is obtained when using Equation [eq:Taylor-expansion] at the nodes xi − 1 and xi +1:
( ∂ϕ ∂x
)
xi
ϕi +1 − ϕi − 1 xi +1 − xi − 1
( xi +1 − xi )^2 − ( xi − xi − 1 )^2 2 ( xi +1 − xi − 1 )
( ∂^2 ϕ ∂x^2
)
xi
( xi +1 − xi )^3 − ( xi − xi − 1 )^3 6 ( xi +1 − xi − 1 )
( ∂^3 ϕ ∂x^3
)
xi
The three expressions mentioned above are all exact if all terms on the right-hand side are retained in the expression. However, if the distance between the points xi is small, higher-order terms beyond the first become small (unless the local higher-order derivatives are extraordinarily large). If we disregard this latter possibility, we can obtain approximations of the first derivative by truncating each of these series, stopping at the first-order terms: ( ∂ϕ ∂x
)
xi
ϕi +1 − ϕi xi +1 − xi
( ∂ϕ ∂x
)
xi
ϕi − ϕi − 1 xi − xi − 1
( ∂ϕ ∂x
)
xi
ϕi +1 − ϕi − 1 xi +1 − xi − 1
The three approximations mentioned above are respectively the forward differences (FDS), backward differences (BDS), and centered differences (CDS). The terms that have been neglected are referred to as truncation errors. They directly measure the accuracy of the approximation and determine how quickly the error decreases as the grid point spacing decreases. In general, the lowest-order term among those omitted is the largest and thus represents the primary contribution to the truncation error. The truncation error is equal to the sum of products between powers of the grid spacing and higher-order derivatives at point xi :
ϵT = (△ x ) m^ αm +1 + (△ x ) m +1^ αm +2 + ... + (△ x ) n^ αn +1 (2.9) Where △ x is the distance between two points (assumed constant), and αi represents higher-order derivatives multiplied by appropriate constants. From this expression of the
( ∂ϕ ∂x
)
xi
− ϕi +2 + 6 ϕi +1 − 3 ϕi − 2 ϕi − 1 6 △ x
( (△ x )^3
) (2.13)
These two approximations are commonly referred to as third-order BDS and third-order FDS. The following is a fourth-order approximation obtained using a fourth-order polynomial, still on a uniform grid, which is generally referred to as fourth-order CDS: ( ∂ϕ ∂x
)
xi
− ϕi +2 + 8 ϕi +1 − 8 ϕi − 1 + ϕi − 2 612 △ x
( (△ x )^4
) (2.14)
The expressions mentioned above can be generalized to grids with non-uniform spacing; their form remains largely the same, with changes primarily occurring in the coefficients that multiply the function values at the grid nodes xi − 2 , xi − 1 , xi , xi +1 and xi +2. In derivatives of the BDS and FDS type, there is a preferred side for constructing the approximation. Specifically, BDS approximations favor points to the left of xi , while FDS approximations favor points to the right of xi. These methods are commonly used to discretize the first derivative of convective terms in conservation equations in a way that respects the physics of the problem, i.e., the direction of information propagation. Therefore, BDS methods are used when the velocity field direction is from xi − 1 to xi , while FDS schemes are applied when the motion is from xi to xi +1. Approaches based on this concept are commonly referred to as "upwind" schemes (UDS). First-order upwind derivatives are generally not very accurate. The truncation error they introduce effectively results in an additional diffusive term that adds to the actual diffusion term. In the most extreme cases, the diffusive contribution associated with the truncation error in the upwind scheme can even be greater than the actual diffusion term. Higher-order upwind schemes are much more accurate, but it’s worth noting that it’s possible to implement CDS schemes of the same order without significant difficulty, so the advantage of using upwind schemes is not always apparent. The polynomial fitting approach can actually be extended to two or three dimensions by using appropriate interpolating functions. The only constraint is that the number of grid nodes used to calculate the coefficients of the interpolating function must be equal to the number of available coefficients. This approach is particularly useful when the finite difference method needs to be applied to irregular grids.
Second-order derivatives certainly appear in the diffusive terms of the conservation and transport equations. It is possible to approximate these derivatives by applying the pre- viously derived approximations for the first derivative twice, as the second derivative of a function is equal to the first derivative of its first derivative. This is the only feasible approach when fluid properties are not constant because we need the first derivative of the product between an appropriate diffusion coefficient and the first derivative of the examined function. Let’s delve into the specific details of the approximations resulting from this approach. From a geometric perspective, the second derivative represents the slope of the tangent line to the curve corresponding to the first derivative of the function ϕ ( x ). If we introduce suitable approximations for the first derivative at the points xi and xi +1, it becomes easy to obtain an approximation for the second derivative. In particular, if we use a first-order Forward Difference Scheme ( FDS ) for the external derivative and a first-order Backward Difference Scheme ( BDS ) for the internal derivative, we obtain the following expression:
( ∂^2 ϕ ∂x^2
)
xi
ϕi +1 ( xi − xi − 1 ) + ϕi − 1 ( xi +1 − xi ) − ϕi ( xi +1 − xi − 1 ) ( xi +1 − xi )^2 ( xi − xi − 1 )
Similarly, the Central Difference Scheme ( CDS ) can be used for both derivatives. How- ever, it proves more effective to evaluate ∂ϕ∂x at points halfway between xi − 1 and xi and between xi and xi +1. In this case, we obtain the following two expressions:
( (^) ∂ϕ ∂x
)
xi + 12 ∆ x
ϕi +1 − ϕi xi +1 − xi
( ∂ϕ ∂x
)
xi − 12 ∆ x
ϕi − ϕi − 1 xi − xi − 1
When properly combined, these expressions yield the desired second derivative:
( ∂^2 ϕ ∂x^2
)
xi
( (^) ∂ϕ ∂x
) xi + 12 ∆ x
( (^) ∂ϕ ∂x
) xi − 12 ∆ x 1 2 ( xi +1^ −^ xi −^1 )^
ϕi +1 ( xi − xi − 1 ) + ϕi − 1 ( xi +1 − xi ) − ϕi ( xi +1 − xi − 1 ) 1 2 ( xi +1^ −^ xi −^1 ) ( xi +1^ −^ xi ) ( xi^ −^ xi −^1 ) (2.18) If the grid has a uniform spacing, the equation becomes: ( ∂^2 ϕ ∂x^2
)
xi
ϕi +1 + ϕi − 1 − 2 ϕi (∆ x )^2
Higher-order approximations of the second derivative can also be obtained by consider- ing other grid nodes, such as xi − 2 and xi +2. Furthermore, it is possible to use the Taylor series expansion to derive approximate expressions for the second derivative. For example, using this approach, it can be shown that:
( ∂^2 ϕ ∂x^2
) xi^ =^
ϕi +1( xi − xi − 1 )+ ϕi − 1 ( xi +1− xi )− ϕi ( xi +1− xi − 1 ) 1 2 ( xi +1− xi −^1 )( xi +1− xi )( xi − xi −^1 )^
( ∂^3 ϕ ∂x^3
) xi^ +^ H Higher-order approximations can be obtained by considering additional nodes in the grid, such as xi − 2 and xi +2. Finally, it is possible to use the technique of polynomial fitting by fitting a polynomial of degree n to n + 1 support points. It becomes relatively simple to derive the analytical expression for the second derivative as well as derivatives of any order. In general, the truncation error of the second derivative approximation obtained through polynomial fitting is of the order of the employed polynomial degree minus one (first order for parabolic functions, second order for cubic functions, etc.). An order can be recovered if a uniform grid is adopted simultaneously with a polynomial of even degree. For example, using a fourth-degree polynomial on five equispaced support points results in the following fourth-order approximation:
( ∂ϕ ∂x
)
xi
− ϕi +2 + 16 ϕi +1 − 30 ϕi + 16 ϕi − 1 − ϕi − 2 12 (∆ x )^2
( (∆ x )^4
) (2.20)
Now, let’s return to the diffusive term appearing in equation (1.2) and assume that the diffusion coefficient is not
Figura 2.3: Peter Gustav Lejeune Dirichlet (1805-1859) e Carl Neumann (1832-1925)
need five support points, which can only be: { x 1 , x 2 , x 3 , x 4 , x 5 }. The expressions can be derived as follows:
( ∂ϕ ∂x
)
x 2
− ϕ 5 + 6 ϕ 4 + 18 ϕ 3 + 10 ϕ 2 − 33 ϕ 1 60∆ x
( ∆ x^4
) (2.23)
( ∂^2 ϕ ∂x^2
)
x 2
− 21 ϕ 5 + 96 ϕ 4 + 18 ϕ 3 − 240 ϕ 2 + 147 ϕ 1 180∆ x^2
( ∆ x^3
) (2.24)
( ∂ϕ ∂x
)
x 1
ϕ 2 − ϕ 1 x 2 − x 1
This condition simplifies to ϕ 1 = ϕ 2. Alternatively, if you opt for a polynomial derivative fitting scheme, the following expression can be derived for a non-uniform grid:
( ∂ϕ ∂x
)
x 1
− ϕ 3 ( x 2 − x 1 )^2 + ϕ 2 ( x 3 − x 1 )^2 − ϕ 1
[ ( x 3 − x 1 )^2 − ( x 2 − x 1 )^2
]
( x 2 − x 1 ) ( x 3 − x 1 ) ( x 3 − x 2 )
On a uniformly spaced grid, this expression simplifies to: ( ∂ϕ ∂x
)
x 1
− ϕ 3 + 4 ϕ 2 − 3 ϕ 1 2∆ x
Figura 2.4: Examples of computational molecules in 2D and 3D
The finite difference approximation transforms the partial differential equation (1.1) into a system of algebraic equations, one for each grid node, corresponding to a single un- known. Each of these equations includes the unknown associated with the node to which the equation refers and the unknowns in the neighboring nodes. The equations are gen- erally nonlinear, so their solution is not immediate and requires appropriate techniques. Consequently, in the end, we obtain a system of nonlinear algebraic equations, which can be succinctly written as follows:
AP ϕP +
∑ Alϕl = QP (2.28) Here, P denotes the node at which the differential equation is approximated, and the index l refers to all the neighboring nodes involved in the finite difference approxima- tions used for discretizing the variables. The node P and its neighbors together form the so-called "computational molecule." In Figure 2.4, two simple examples are shown, referring to a two-dimensional case with second and third-order approximations and a three-dimensional case with second-order approximations. The coefficients Al involve ge- ometric quantities and fluid properties and, for nonlinear equations, the unknowns them- selves. The QP terms contain all the terms that do not explicitly depend on the unknown variable. The number of equations and unknowns must obviously be equal, meaning that there must be a dedicated equation for each unknown. In general, we have a system of large- dimensional equations that must be solved numerically. The resulting system is sparse, meaning that each equation contains only a limited number of unknowns, those associated with neighboring nodes. In matrix terms, we can write it as:
A ϕ = Q (2.29) Here, A is the matrix of the system, square and sparse, ϕ is the vector containing the unknowns in all the nodes of the grid, and Q is the vector containing the terms corresponding to the right-hand side of equation (2.28). The structure of the matrix A depends on how the grid points are ordered. For struc- tured grids, if the grid points are ordered starting from one corner of the computational domain in a sequential manner along each line (lexicographic ordering), the matrix has a
any equation can always be reduced to the following form, written using the operator ∇, in a way that does not tie it to any specific reference system (this is the generic transport equation, rewritten for convenience):
∂ ( ρϕ ) ∂t
In other words, for the conservation or transport of any variable ϕ , it is always possible to write an equation that has an accumulation term, a convective transport term (associated with fluid velocity proper), a diffusive transport term, and finally, a production term. The finite-volume method first requires that the equation above be rewritten in integral terms through the application of Gauss’s theorem to a generic control volume V bounded by the surface S :
∫
V
∂ ( ρϕ ) ∂t dV +
∫
S
ρϕ v · n ˆ dS =
∫
S
Γ∇ ϕ · n ˆ dS +
∫
V
SϕdV (3.2)
It is important to note that equations above are exactly the same. Equation (3.2) actually refers to a volume of any shape. The fundamental idea behind the finite-volume method is quite simple. The computational domain is divided into a finite number of small control volumes (CVs, control volumes) through the construction of an appropriate grid. There are many analogies with the finite difference method, but the substantial difference is that in the latter case, the equations will be solved at the grid nodes, whereas in the case of finite volumes, the solution will be carried out on the control volumes. For simplicity, we will only refer to Cartesian grids in the following to avoid excessive and unnecessary complications in the discretization process of equation (3.2). The conventional approach followed is to determine the value of the unknown variable ϕ at the center (or better, centroid) of each control volume. However, it is possible to define the centroids of the computational grid first and then build the control cells around them or proceed exactly in the opposite direction: first construct the control volumes and then identify the centroid of each of them. Let’s now consider a somewhat more concrete example of a grid designed for finite volume calculations. In Figure 3.1, two structured grids on a rectangular two- dimensional domain are shown. In one case, the centroid of each cell is placed exactly in the middle of each side of the control cell, while in the second case, the face separating two cells is placed exactly in the middle between two neighboring centroids. The advantage of the first case is that it allows for very accurate volume integrals on individual cells, as the centroid is exactly in the center of each cell. In the second case, the approximation of volume integrals is certainly less accurate, but there is an advantage in constructing approximations of derivatives on the boundary faces of control cells that are more accurate than in the first case. In general, it should be noted that in most cases, the first type of solution is used. There are various variants of the finite volume method. We will consider only the basic formulation, which nevertheless represents the starting point for more complex formula- tions as well. In this initial phase, we also consider only the case of steady-state equations and focus our attention on the following equation (as was done for finite differences): ∫
S
ρϕ v · n ˆ dS =
∫
S
Γ∇ ϕ · n ˆ dS +
∫
V
SϕdV (3.3)
This conservation equation can be written and applied for all control volumes and, in reality, over the entire computational domain. If we were to sum all the equations for individual control volumes, we would obtain the global conservation equation, since the integrals over the internal faces of the control volumes cancel each other out. The property
Figura 3.1: Examples of structured two-dimensional grids: nodes centered (left) and faces centered (right)
Figura 3.2: Structured Cartesian 2D grid
of global conservation is therefore guaranteed a priori through the application of the finite volume method, and this is one of the main advantages that has made it so important in the field of computational fluid dynamics. To obtain an algebraic equation for each individual control volume, the surface and volume integrals must be discretized appropriately using quadrature formulas. Depending on the approximations used, the discretized equations may be equivalent or not to those obtained through the finite difference method.
Figures 3.2 and 3.3 show typical two-dimensional and three-dimensional Cartesian control volumes, respectively. These control volumes consist of four (in 2D) or six (in 3D) flat faces, which are referred to using lowercase letters corresponding to their directions (e=east, w=west, n=north, s=south, t=top, b=bottom) relative to the central node, denoted as P. The 2D case can always be thought of as a special case of 3D, where the variables are independent of z. For simplicity, we will only refer to 2D cases; however, the extension to three dimensions is relatively straightforward.
appropriate interpolation. If you wanted to find a second-order accurate approximation to maintain the quality of the midpoint rule approximation, you would need to use interpo- lation formulas to determine the value of fe that is second order accurate. We will return to this aspect later. An alternative approximation of the surface integral is to use the trapezoidal rule:
Fe =
∫
Se
f dS ≈
fne + fse 2 Se (3.6)
This formula assumes that the function is determined at the corners of the control volumes. If you want even higher-order approximations, you need to evaluate the function f at more than two points on each face. For example, a fourth-order approximation is given by Simpson’s rule, which leads to the following estimate of the surface integral:
Fe =
∫
Se
f dS =≈ fne + 4 fe + fse 6
Se (3.7)
In this case, the function f needs to be evaluated at three points: at the center of the face and at the two ends of the face. Of course, this assumes that these values of the function have been obtained with third-order accurate interpolations (e.g., using cubic polynomial interpolations). For the 3D case, similar considerations can be made. For example, the midpoint rule is second-order accurate in this case as well. Higher-order approximations, which obviously require knowledge of the function f at more points on the face, are possible but certainly more difficult and challenging to implement.
The production terms in conservation and transport equations require volume integrals. The simplest approach that can be considered, accurate to the second order, is to replace the volume integral with the product of the average value of the integrand function and the volume of the control volume. The problem, of course, is determining this average value. The most logical thing to do is to take it equal to the value of the function exactly at the centroid of the control volume:
∫
V
qdV = qV ≈ qP V (3.8)
This value is immediately available since all the main variables and their derivatives are known at the centroids of the computational grid without the need for any interpolation. The approximation mentioned above becomes exact in the case where q is constant or varies linearly throughout the control volume; otherwise, it results in a second-order error. A higher-order approximation requires knowing the value of the function q at more points. This information can only be obtained by interpolating the nodal values using ap- propriate interpolation formulas. In 2D, volume integrals are technically surface integrals. A fourth-order approximation can be obtained by using a biquadratic function:
q ( x, y ) = a 0 + a 1 x + a 2 y + a 3 x^2 + a 4 y^2 + a 5 xy + a 6 x^2 y + a 7 xy^2 + a 8 x^2 y^2 (3.9)
The nine coefficients appearing in this equation can be obtained by fitting the function at nine points (nw, w, sw, n, P, s, ne, e, and se), as shown in Figure 3.2. This way, the integral can be evaluated without too much difficulty:
∫
V
qdV ≈ △ x △ y
[ a 0 +
a 3 12 (△ x )^2 +
a 4 12 (△ y )^2 +
a 8 144 (△ x )^2 (△ y )^2
] (3.10)
It is clear that out of the nine coefficients, only four are necessary in the integration formula, but these depend on the values of the function at all nine support points. If the grid were uniform, you would get:
△ x △ y 36
[16 qP + 4 qs + 4 qn + 4 qw + 4 qe + qse + qsw + qne + qnw ] (3.11)
The values qi are obtained through interpolation formulas, using only the values of the variables at the nodal points. Of course, it is advisable to use fourth-order accurate interpolation formulas to maintain the level of accuracy guaranteed by the integration formula. Some possibilities will be described in the following sections. This approximation, used as a volume integral for a 2D grid, can obviously be used as a fourth-order quadrature formula for 3D surface integrals. Expressions for true 3D volume integrals on cells can be obtained using similar techniques, with the obvious difference that the formulas involved become much more complicated.
As we have emphasized in the previous sections, the possibility of writing volume and surface integrals as functions of variables evaluated only at the centroids of control volumes requires knowledge of the values of these variables at different points (especially on the boundaries of the control volumes). The integrand function f indicates the product of various variables and/or gradients of these variables: for the convective contribution, we have f = ρϕ vˆn , while for the diffusive contribution, we have f = Γ∇ ϕ ˆn. In order to calculate these quantities, the value of ϕ and its gradient in the direction normal to the control surface under consideration must be expressed, in an obviously approximate form, in terms of only the values of ϕ at the centroids. On the other hand, volume integrals may also require the need for such values. The most obvious possibility is to express these values through interpolations. Numerous solutions are possible; we will consider only the main ones, from which more complex expressions can be formulated. Furthermore, as for surface integrals, we will focus only on the east face of the control volume; the other faces of the control volume can be treated similarly by making simple substitutions.
Upwind interpolation (UDS)
The simplest solution to obtain an approximation of ϕe consists of constructing a linear interpolation of the backward or forward type (depending on the direction of the veloc- ity vector). This solution is called the Upwind discretization ( UDS ). According to this approximation, we have:
ϕe =
{ ϕP if ( v · n ˆ) e > 0 ϕE if ( v · n ˆ) e < 0
This is the only solution that unconditionally satisfies the boundedness criterion (i.e., it never leads to the possibility of oscillating solutions). However, it is a relatively inaccurate approximation that introduces a significant numerical diffusivity. To better understand
( ∂ϕ ∂x
)
e
ϕE − ϕP xE − xP
By using the Taylor series expansion around ϕe , it is possible to show that the truncation error of the expression above is:
ϵT =
( xe − xP )^2 − ( xE − xe )^2 2( xE − xP )
( ∂^2 ϕ ∂x^2
)
e
( xe − xP )^3 − ( xE − xe )^3 6( xE − xP )
( ∂^3 ϕ ∂x^3
)
e
As you can see, the leading term in the truncation error is second order. With respect to the upwind method, the centered linear interpolation has a major advantage: it does not introduce numerical diffusion. It is easy to understand this by comparing the equation for Γ e of the upwind method with the analogous equation for the CDS method:
Γ e = ( ρu ) e
△ x 2 (upwind) (3.20)
Γ e =
( ρu ) e (△ x )^2 ( xE − xP )
From equations (10) and (11), it is clear that the expression of Γ e of the centered linear interpolation retains the second-order term in the truncation error, unlike the upwind method. This means that the centered linear interpolation introduces an error of the second order, as in the case of finite differences. It should be noted, however, that in multidimensional flows the CDS method introduces a "numerical cross-diffusion" term. Despite this, it remains one of the most used methods for approximating the gradient and the diffusive flux.
Linear interpolation with limiters
As we have emphasized in the previous sections, boundedness of solutions is a necessary condition for the existence of a physically admissible solution. This property can be vio- lated when using second-order or higher schemes, such as the centered linear interpolation. In this case, we speak of "spurious oscillations." It is therefore necessary to resort to the introduction of appropriate "limiters" in the interpolation process to prevent such oscil- lations. Several methods have been proposed in the literature. We mention some of the most widely used. The linear interpolation of the CDS type will still be taken as a refer- ence. The problem is that its solution produces spurious oscillations near discontinuities of ϕ ; for example, the occurrence of negative values of ϕ in a region where ϕ is always positive, as shown in Fig. 3.4. In this context, "limiters" are used to limit the slope of the interpolation near such regions, as shown in Fig. 3.5. A number of different limiting functions can be used to construct the limiter:
( ∂ϕ ∂x
)
e
= θ ( r )
ϕE − ϕP xE − xP ( CDS with limiter) (3.22)
As we can see, θ is a function of r (vector indicating the position), which is defined such that it tends to 1 when the interpolation is free from oscillations (e.g., in regions with monotonic ϕ variations), while it tends to 0 in the presence of oscillations. The actual expression of θ depends on the specific limiter used. The main limiting functions proposed in the literature include the MINMOD , Van Leer , Superbee , and Van Albada limiters.
The limiters take into account the values of ϕ at adjacent nodes (e.g., W , P , and E ) and decide whether the interpolation of ϕ at point e should be based solely on points P and E or if it should be limited by the values at neighboring points. The choice of which limiter to use depends on the specific problem and numerical stability considerations.
QUICK scheme
Another scheme that allows us to go beyond the limitations of the linear interpolation is the so-called QUICK scheme, an acronym for Quadratic Upwind Interpolation for Convective Kinematics. This scheme is based on a quadratic interpolation of ϕ using three neighboring points: W , P , and E. The interpolation formula is as follows:
ϕe =
ϕP +
ϕW −
ϕE (3.23)
The QUICK scheme is third-order accurate and is designed to minimize numerical dif- fusion while maintaining bounded solutions. It is particularly effective in capturing sharp gradients and discontinuities in the flow field. However, it is also more computationally intensive compared to lower-order schemes like CDS. The main disadvantage of the QUICK scheme is its complexity and computational cost, as it requires interpolation using three neighboring points. Additionally, it can introduce some oscillations in the solution near steep gradients or discontinuities, although these oscillations are generally less pronounced than those in linear interpolation schemes without limiters.
In this section, we have discussed various interpolation schemes commonly used in com- putational fluid dynamics (CFD) to approximate the values of a variable ϕ at the faces of control volumes. These interpolation schemes play a crucial role in discretizing the govern- ing equations of fluid flow and heat transfer. The choice of interpolation method depends on the specific requirements of the problem, including the desired level of accuracy and the presence of discontinuities in the solution. The Upwind interpolation ( UDS ) is a simple and robust method that avoids oscillations but introduces numerical diffusion. The centered linear interpolation ( CDS ) provides second-order accuracy without numerical diffusion but may produce spurious oscillations near discontinuities. Limiters can be applied to CDS to mitigate these oscillations. The QUICK scheme offers third-order accuracy and is effective at capturing sharp gradients but is computationally more expensive. The choice of interpolation method should be made carefully, considering the trade-offs between accuracy, stability, and computational cost, based on the specific characteristics of the flow problem being studied.
As highlighted previously, considering all the equations associated with all the computa- tional cells leads to a system of algebraic equations (generally nonlinear). The number of equations must, of course, be equal to the number of unknowns (one for each cell, corre- sponding to the value of ϕ at the centroid). Each equation also involves the variable ϕ related to the control volume to which the equation refers and the variables associated with neighboring control volumes or, more precisely, control volumes belonging to the same computational molecule. The algebraic equation for a generic control volume has