• No results found

term, which can be dependent or independent of φ.

∂ρφ

The Gauss theorem [140] is applied to transform eqn. 4.1 into the integral form:

∂ According to the Gauss theorem, the volume integral of the divergence of a vector field is related to a net flux of the vector field over the closed surface S of the corresponding volume. In Equation, 4.3 the divergence operators are replaced by the surface fluxes, where nf de-notes the vector normal to the surface S. The subscripts f and P denote the corresponding values evaluated either at the cell face or at the cell centre.

The information is transferred from cell to cell by the face fluxes, therefore the value of φ depends on the neighbouring cells. This leads to a coupled system of equations - one equation for each dependent variable of the control volume. One way to solve this set of equations is by linearization and conversion into algebraic equations of the following form [189]:

apφP +X

N

aNφN = RP (4.4)

In eqn. 4.4, the subscript N denotes all neighbouring cells of the cell P and RP the source terms. The coefficients ap and aN depend on the approximations of the diffusion and convection fluxes of eqn. 4.3.

4.2 Spatial discretization

According to eqn. 4.3, the face fluxes are evaluated at the face centres. Since the values of the dependent variables are stored in the middle of the cell within the FVM approach, the cell value has to be interpolated on the face. Several approximations exist with different stability and accuracy properties. If we consider an upwind differencing scheme (UDS), the value of the face would be calculated only by the upstream cell. This assumption might be correct for super-sonic flows (Ma>1), where the transport of any information is only affected by the upstream side (hyperbolic problem). For small Mach-numbers (Ma1), a point in the domain will be affected by all surrounding points (elliptic problem). Figure 4.2 shows three cells P, W and E, with the corresponding interfaces w and e. Assuming that the values of φ at the grid points are known, the value φe at the interface e can be obtained by linear interpolation:

φe= feφP+ (1 − feE (4.5)

4. Numerical Approach 34

Figure 4.2: Three cells with interfaces w and e.

where fedenotes the interpolation function and reads for a central differencing scheme (CDS):

fe= δxeE

δxPE (4.6)

This scheme is second-order in space, but can lead to oscillations for abrupt changes of the fluxes. A more robust, but also more dissipative scheme, is the upwind differencing scheme (UDS), which assigns directly the cell value to the interface [95] dependent of the flow direction Fx:

φe= φE, Fx< 0 (4.7)

φe= φP, Fx≥ 0 (4.8)

The Total Variation Diminishing (TVD) schemes combine a high-order (HO) numerical scheme and a lower-order (LO) differencing scheme by a weighting coefficient Φ(r) accord-ing to the followaccord-ing equation [95]:

φe= (φ)LO+ Φ(r) [(φ)HO− (φ)LO] (4.9) For Φ(r) a vast number of different limiter functions exist. A detailed description of the limiter functions can be found in the books of Ferziger and Perić [59] or Versteeg and Malalasekera [189]. Within this work the Sweby limiter [179] was chosen, which reads:

Φ(r) = max



max 2r k , 1

 , 0



(4.10) where k is an user defined 0 ≥ k ≥ 1. For k=1, eqn. 4.9 is TVD conforming (meaning that the total variation of the discrete solution has to diminish with the time) and working at the edge of the Sweby TVD limit region. The weighting Φ(r) can be interpreted as a flux-limiting function, with r being the consecutive gradients of the dependent variable.

Following the notation introduced in figure 4.2, the function for r reads [95]:

r = φP − φW

φE− φP (4.11)

35 4.2. Spatial discretization

Also the gradients need to be evaluated at the interfaces between the cells. The gradient of φ on an orthogonal grid is obtained from:

nf (∇φ)f = |nf||φP − φE|

P E , (4.12)

where P E denotes the distance between the cells P and E.

Non-orthogonal correction

Figure 4.3 illustrates a case with a non-orthogonal grid, which requires a correction in order to maintain the second-order accuracy. In particular during the valve motion, the

Figure 4.3: Correction procedure for the calculation of the gradients on the cell faces for non-orthogonal grids.

mesh non-orthogonality may increase [95]. The gradient on the faces of a non-orthogonal grid can be calculated by:

nf  ∂φ

∂xj



f

= αdf φP − φE

|d|



| {z }

orthogonal

+ (nf− αdf) φP − φE

|d|



| {z }

non-orthogonal

(4.13)

In eqn. 4.13, nf denotes the surface normal vector of the interface, d the distance vector between the cell centres of cell P and E, df is the projection of nf on d and α a weighting coefficient defined as a function of the mesh orthogonality θno as:

α = 1

cos(θno) (4.14)

As the mesh non-orthogonality increases, the stability decreases, because the non-orthogonal correction part is treated explicitly, whereas the orthogonal part is treated implicitly. It is therefore recommended to use the correction only for θno < 60. For higher values of θno, the correction can be switched off. A detailed description of the discretization methods implemented in OpenFOAM can be found in the PhD thesis of Jasak [95].

CDS-TVD switch for engine simulations

The discretization of the divergence of ρui in the momentum equation has to be approxi-mated as accuratly as possible, because it will be used for the convective transport in all consecutive transport equations. It is inevitable to discretize this term with a CDS-scheme for an accurate LES of a reactive flow. A TVD-scheme would be already too diffusive, which may lead to an incorrect turbulent intensity inside the combustion chamber, thus leading to weak flame wrinkling and therefore to a wrong flame propagation.

Unfortu-4. Numerical Approach 36

nately, for steep velocity gradients or even high velocities (M a > 0.3), a CDS-scheme can lead to strong oscillations, which can lead to unphysical results, too. Inside an engine, the velocities are usually quite low (M a < 0.1), but can exceed a Mach-number of one at the opening and closing events. In this case, a CDS-scheme might not be appropriate due to possible numerical oscillations. Therefore, a CDS-TVD switch was implemented as a function of the local Mach-number. It is based on the limitedLinear discretisation scheme of OpenFOAM, which is basically a TVD-scheme that uses a CDS-scheme for the higher order discretization term (eqn. 4.9) and for Φ(r), it uses the Sweby limiter (eqn. 4.10) function. For M a > 0.3, Φ(r) is set to 1 and the LO-scheme of 4.9 will be cancelled out.

CDS is imposed everywhere else in the domain.

Figure 4.4: Maximum Mach-number plotted over theCA within the intake stroke, for a pure CDS-scheme (green) and the CDS-TVD switch (black) [145].

The scheme was first tested for a cold flow LES engine simulation [145] of the optical research engine of the University of Duisburg-Essen. In Figure 4.4, the evolution of the maximum Mach-number is plotted over a few crank angle degrees within the intake stroke with opened intake valves. The Mach-number is oscillating and peaking with the CDS-scheme, but stays rather smooth for the CDS-TVD scheme. It must be stressed that, the switch only kicks in at the valve seat region during the opening and closing events, so that a TVD-scheme is applied. The CDS-scheme is applied everywhere for the convective fluxes of the momentum equation.