4.2 General Discretisation Methodologies 通用离散方法学[cfd-4-2]

在第4章的引言中,我们已经提到了定义控制体和布置流动变量的三种做法。这里我们将更详细地逐一介绍这三种做法,并讨论它们的优点与不足。en

In the introduction to Chapter 4, we already mentioned the three approaches for the definition of the control volume and for the location of the flow variables. Here, we shall present all three in more detail. We shall also discuss their advantages and shortcomings.

4.2.1 Cell-Centred Scheme 单元中心格式[cfd-4-2-1]

如果控制体与网格单元完全相同,且流动变量位于网格单元的形心处(如图4.3所示),我们称之为单元中心格式(cell-centred scheme)。在计算离散化流动方程(4.2)时,需要在单元的各个面上提供对流通量和黏性通量[6]。它们可以按以下三种方式之一来近似:

  • 通量平均(average of fluxes)——由单元面左右两侧网格单元形心处的值分别计算通量,再取平均,但使用同一面向量(一般只用于对流通量);
  • 变量平均(average of variables)——对与单元面左右两侧网格单元形心相关联的变量取平均;
  • 由分别插值到单元面左右两侧的流动量计算通量(只用于对流通量)。
en

We speak of a cell-centred scheme if the control volumes are identical with the grid cells and if the flow variables are located at the centroids of the grid cells as indicated in Fig. 4.3. When we evaluate the discretised flow equations (4.2), we have to supply the convective and the viscous fluxes at the faces of a cell [6]. They can be approximated in one of the three following ways:

  • by the average of fluxes computed from values at the centroids of the grid cells to the left and to the right of the cell face, but using the same face vector (generally applied only to the convective fluxes);
  • by using an average of variables associated with the centroids of the grid cells to the left and to the right of the cell face;
  • by computing the fluxes from flow quantities interpolated separately to the left and to the right side of the cell face (employed only for the convective fluxes).

图4.3:单元中心格式的控制体(二维)

图4.3:单元中心格式的控制体(二维)。图例:阴影四边形\(\Omega_{I,J}\)为控制体(即网格单元),其四个角点(实心圆点)为网格点\(i,j\)、\(i+1,j\)、\(i,j+1\)、\(i+1,j+1\);实心方块\(I-1,J\)、\(I,J\)、\(I+1,J\)、\(I,J+1\)、\(I,J-1\)表示各单元形心处流动变量的存储位置;\(\vec{n}_{I+1/2,J}\)、\(\vec{n}_{I-1/2,J}\)、\(\vec{n}_{I,J+1/2}\)、\(\vec{n}_{I,J-1/2}\)为控制体各面的单位法向量。

以图4.3中的单元面\(\vec{n}_{I+1/2,J}\)为例,第一种做法——通量平均——在二维中写作en

Thus, taking the cell face \(\vec{n}_{I+1/2,J}\) in Fig. 4.3 as an example, the first approach - average of fluxes - reads in two dimensions

\[\left(\vec{F}_c\,\Delta S\right)_{I+1/2,J} \approx \frac{1}{2}\left[\vec{F}_c(\vec{W}_{I,J}) + \vec{F}_c(\vec{W}_{I+1,J})\right]\Delta S_{I+1/2,J} \tag{4.15}\]

其中\(\Delta S_{I+1/2,J}\)由方程(4.6)与(4.7)计算。en

with \(\Delta S_{I+1/2,J}\) computed from Eqs. (4.6) and (4.7).

第二种可能的做法——变量平均——可以表述为en

The second possible approach - average of variables - can be formulated as follows

\[\left(\vec{F}\,\Delta S\right)_{I+1/2,J} \approx \vec{F}(\vec{W}_{I+1/2,J})\,\Delta S_{I+1/2,J}, \tag{4.16}\]

其中,控制体面\(\vec{n}_{I+1/2,J}\)上的守恒变量/因变量定义为两个相邻单元处数值的算术平均,即en

where the conservative/dependent variables at the face \(\vec{n}_{I+1/2,J}\) of the control volume are defined as the arithmetic average of values at the two adjacent cells, i.e.,

\[\vec{W}_{I+1/2,J} = \frac{1}{2}\left(\vec{W}_{I,J} + \vec{W}_{I+1,J}\right). \tag{4.17}\]

方程(4.16)中的通量向量\(\vec{F}\)既可以指对流通量,也可以指黏性通量。en

The flux vector \(\vec{F}\) in Eq. (4.16) stands either for the convective or for the viscous fluxes.

第三种做法先把流动量(大多为速度分量、压力、密度和总焓)分别插值到单元面的两侧。插值得到的量——称为左(left)状态与右(right)状态(见4.3节开头)——在两侧一般并不相同。通过单元面的通量随后利用某个非线性函数由左、右状态之差求出。于是en

The third methodology starts with an interpolation of flow quantities (being mostly velocity components, pressure, density and total enthalpy) separately to both sides of the cell face. The interpolated quantities - termed the left and the right state (see the begin of Section 4.3) - differ in general between both sides. The fluxes through the cell face are then evaluated from the difference of the left and right state using some non-linear function. Hence,

\[\left(\vec{F}_c\,\Delta S\right)_{I+1/2,J} \approx f_{Flux}\left(\vec{U}_L,\,\vec{U}_R,\,\Delta S_{I+1/2,J}\right), \tag{4.18}\]

其中en

where

\[\begin{aligned} \vec{U}_L &= f_{Interp}\left(\cdots,\,\vec{U}_{I-1,J},\,\vec{U}_{I,J},\,\cdots\right) \\ \vec{U}_R &= f_{Interp}\left(\cdots,\,\vec{U}_{I,J},\,\vec{U}_{I+1,J},\,\cdots\right) \end{aligned} \tag{4.19}\]

它们表示插值得到的状态。当然,与(4.15)–(4.19)类似的关系对其余单元面同样成立。en

represent the interpolated states. Of course, similar relations like (4.15)–(4.19) hold also for the other cell faces.

同样的近似也用于三维。例如,在单元面\(\vec{n}_{I+1/2,J,K}\)(例如与图4.1b中的\(\vec{n}_2\)相同)处,方程(4.15)的通量平均变为en

The same approximations are employed in three dimensions. For example, at the cell face \(\vec{n}_{I+1/2,J,K}\) (e.g., identical to \(\vec{n}_2\) in Fig. 4.1b) the average of fluxes in Eq. (4.15) becomes

\[\left(\vec{F}_c\,\Delta S\right)_{I+1/2,J,K} \approx \frac{1}{2}\left[\vec{F}_c(\vec{W}_{I,J,K}) + \vec{F}_c(\vec{W}_{I+1,J,K})\right]\Delta S_{I+1/2,J,K} \tag{4.20}\]

其中\(\Delta S_{I+1/2,J,K}\)按照与方程(4.8)和(4.9)相应的方式定义。变量平均则与方程(4.16)类似地写作en

with \(\Delta S_{I+1/2,J,K}\) being defined correspondingly to Equations (4.8) and (4.9). The average of variables reads similarly to Eq. (4.16) as

\[\left(\vec{F}\,\Delta S\right)_{I+1/2,J,K} \approx \vec{F}(\vec{W}_{I+1/2,J,K})\,\Delta S_{I+1/2,J,K} \tag{4.21}\]

其中en

with

\[\vec{W}_{I+1/2,J,K} = \frac{1}{2}\left(\vec{W}_{I,J,K} + \vec{W}_{I+1,J,K}\right). \tag{4.22}\]

经由流动变量插值的做法,则与方程(4.18)类似地给出en

The way over the interpolation of the flow variables results similarly to Eq. (4.18) in

\[\left(\vec{F}_c\,\Delta S\right)_{I+1/2,J,K} \approx f_{Flux}\left(\vec{U}_L,\,\vec{U}_R,\,\Delta S_{I+1/2,J,K}\right), \tag{4.23}\]

其中\(\vec{U}_L\)与\(\vec{U}_R\)是单元面上插值得到的数值。en

where \(\vec{U}_L\) and \(\vec{U}_R\) are the interpolated values at the cell face.

离散化流动方程(4.2)中尚待计算的最后一项是源项\(\vec{Q}\)。如引言中所述,源项通常假定在控制体内部为常数。因此,它用相应单元中心处的流动变量来计算。于是,我们可以定义en

The last term in the discretised flow equations (4.2) which remains to be evaluated is the source term \(\vec{Q}\). As we already stated in the introduction, the source term is usually supposed to be constant inside the control volume. For this reason, it is calculated using the flow variables from the corresponding cell centre. Hence, we may define

\[\left(\vec{Q}\,\Omega\right)_{I,J,K} = \vec{Q}(\vec{W}_{I,J,K})\,\Omega_{I,J,K}\,. \tag{4.24}\]

利用上述关系,可以算出通过各面的通量,并按照(4.2)完成对\(\Omega_{I,J,K}\)边界的数值积分。换言之,完整的残差\(\vec{R}_{I,J,K}\)便得到了。在4.3节和4.4节中,我们将进一步了解对流通量与黏性通量计算的细节。en

Using the above relations, the fluxes through the faces can be computed and the numerical integration over the boundary of \(\Omega_{I,J,K}\) may be performed according to (4.2). In other words, the complete residual \(\vec{R}_{I,J,K}\) is obtained. In Sections 4.3 and 4.4, we shall learn more about the details of the evaluation of the convective and viscous fluxes.

4.2.2 Cell-Vertex Scheme: Overlapping Control Volumes 单元顶点格式:重叠控制体[cfd-4-2-2]

在单元顶点格式中,所有流动变量都与计算网格的节点相关联。在基于重叠控制体的做法中,网格单元仍然充当控制体,与单元中心格式的情形一样。区别在于:此时为各控制体算出的残差必须分配到网格点上[4]、[7]、[8]。图4.4示意了这一情形。en

In a cell-vertex scheme, all flow variables are associated with the nodes of the computational grid. Within the approach based on overlapping control volumes, the grid cells still represent the control volumes, just as in the case of the cell-centred scheme. The difference is that now the residuals computed for the control volumes have to be distributed to the grid points [4], [7], [8]. The situation is sketched in Fig. 4.4.

考察图4.4中的控制体\(\Omega_{I,J}\),它由下列节点定义en

Let us consider the control volume \(\Omega_{I,J}\) in Fig. 4.4, which is defined by the nodes

\[(i,j)\quad (i+1,j)\quad (i+1,j+1)\quad (i,j+1)\,. \tag{1}\]

注意,点\((i,j)\)位于\(\Omega_{I,J}\)的左下角。对流通量——例如对面\(\Delta S_{I,J-1/2}\),它由点\((i,j)\)与\((i+1,j)\)给定——近似为en

Note that the point \((i,j)\) is located at the lower left corner of \(\Omega_{I,J}\). The convective fluxes, e.g., for the face \(\Delta S_{I,J-1/2}\), which is given by the points \((i,j)\) and \((i+1,j)\), are approximated as

\[\left(\vec{F}_c\,\Delta S\right)_{I,J-1/2} \approx \vec{F}_c(\vec{W}_{I,J-1/2})\,\Delta S_{I,J-1/2}\,. \tag{4.25}\]

面中点处的变量用定义该面的两个节点上变量的算术平均来计算,即en

The variables at the midpoint of the face are evaluated using an arithmetic average of the variables at the nodes defining the face, i.e.,

\[\vec{W}_{I,J-1/2} = \frac{1}{2}\left[\vec{W}_{i,j} + \vec{W}_{i+1,j}\right]. \tag{4.26}\]

面面积\(\Delta S_{I,J-1/2}\)由关系式(4.6)与(4.7)计算。en

The face area \(\Delta S_{I,J-1/2}\) is computed from the relations (4.6) and (4.7).

这一做法在三维中保持不变。例如,对于与图4.1b中法向量\(\vec{n}_3\)相关联的面,平均变量为en

The approach remains the same in three dimensions. For example, for the face associated with the normal vector \(\vec{n}_3\) in Fig. 4.1b, the averaged variables read

\[\vec{W}_{I,J,K-1/2} = \frac{1}{4}\left[\vec{W}_1 + \vec{W}_2 + \vec{W}_5 + \vec{W}_6\right]. \tag{4.27}\]

图4.4:单元顶点格式的重叠控制体(二维);箭头表示残差从单元形心向公共节点i,j的分配

图4.4:单元顶点格式的重叠控制体(二维);箭头表示残差从单元形心向公共节点\(i,j\)的分配。图例:四个单元\(\Omega_{I-1,J-1}\)、\(\Omega_{I,J-1}\)、\(\Omega_{I-1,J}\)、\(\Omega_{I,J}\)(阴影四边形)共享公共节点\(i,j\)(实心圆点);各单元形心以实心方块标记\(I-1,J-1\)、\(I,J-1\)、\(I-1,J\)、\(I,J\);箭头表示把各单元(形心)的残差分配到公共节点;外圈网格点标记为\(i-1,j-1\)、\(i,j-1\)、\(i+1,j-1\)、\(i-1,j\)、\(i+1,j\)、\(i-1,j+1\)、\(i,j+1\)、\(i+1,j+1\)。

如果假定边1-2沿\(i\)方向、边1-5沿\(j\)方向、边1-4沿\(k\)方向,并把点\((i,j,k)\)与图4.1b中的角点1相关联,则方程(4.27)中的平均也可以写成en

If we assume the edge 1-2 being oriented in the \(i\)-direction, edge 1-5 in the \(j\)-direction, edge 1-4 in the \(k\)-direction, and if we finally associate the point \((i,j,k)\) with the corner 1 in Fig. 4.1b, the average in Eq. (4.27) can also be written as

\[\vec{W}_{I,J,K-1/2} = \frac{1}{4}\left[\vec{W}_{i,j,k} + \vec{W}_{i+1,j,k} + \vec{W}_{i,j+1,k} + \vec{W}_{i+1,j+1,k}\right]. \tag{4.28}\]

对流通量于是同样由下式得到en

The convective flux is then again obtained from

\[\left(\vec{F}_c\,\Delta S\right)_{I,J,K-1/2} \approx \vec{F}_c(\vec{W}_{I,J,K-1/2})\,\Delta S_{I,J,K-1/2}, \tag{4.29}\]

其中面面积\(\Delta S_{I,J,K-1/2}\)由公式(4.8)与(4.9)得出。黏性通量通常采用与对偶控制体格式相同的方法计算[9]、[10],这样得到的格式更为紧凑(即涉及的节点值更少)。en

where the face area \(\Delta S_{I,J,K-1/2}\) results from the formulae (4.8) and (4.9). The viscous fluxes are normally computed employing the same approach as for the dual control-volume scheme [9], [10], which results in a more compact scheme (i.e., one which involves fewer nodal values).

把关系式(4.25)、(4.26)与(4.28)、(4.29)给出的所有面的贡献分别求和,便得到所有网格单元的中间残差\(\vec{R}_{I,J,K}\)。为了把基于单元的残差与基于节点的残差联系起来,还需要作进一步近似,即采用残差分布公式(residual distribution formula)。它基本上是一个函数,由共享该网格节点的所有单元的加权和来计算未知的基于节点的残差。已经提出的分布公式有:

  • Ni的体积加权和[7];
  • Hall的非加权求和[8];
  • Rossow的特征(上风)加权方法[11]、[12]。
en

Summing up all face contributions given by relations (4.25), (4.26) and (4.28), (4.29), respectively, we obtain intermediate residuals \(\vec{R}_{I,J,K}\) for all grid cells. In order to relate the cell-based to the node-based residuals, a further approximation is made using a residual distribution formula. It is basically a function, which evaluates the unknown node-based residual from a weighted sum of all cells having the particular grid node in common. The following distribution formulae were devised:

  • volume weighted sum due to Ni [7];
  • non-weighted sum due to Hall [8];
  • characteristic (upwind) weighting procedure of Rossow [11], [12].

对截断误差的理论研究[4]表明,Ni的格式比Hall的方法更精确。然而在实践中,Ni的分布公式在网格强烈扭曲和拉伸的地方会导致问题。例如,使用O型网格时,曾观察到翼型后缘附近压力场的强烈振荡[13]、[4]。此外,只有把数值黏性加大很多才能获得收敛。上风加权方法[11]、[12]的基本思想与脉动分裂(fluctuation-splitting)格式[14]-[17]相当类似(参见3.1.5小节),但其数值实现要简单得多。从根本上说,残差只沿特征方向向上游发送。en

Theoretical investigations of the truncation error [4] suggest that Ni's scheme is more accurate than Hall's approach. However, in practice Ni's distribution formula leads to problems in places, where the grid is strongly distorted and stretched. For example, strong oscillations of the pressure field near the trailing edge of an airfoil were observed when using O-grids [13], [4]. Furthermore, convergence could only be achieved when the numerical viscosity was increased considerably. The underlying idea of the upwind weighting procedure [11], [12] is quite similar to that of the fluctuation-splitting schemes [14]-[17] (cf. Subsection 3.1.5), but the implementation is numerically much simpler. Basically, the residuals are sent only upstream in the characteristic direction.

在这三种做法中,Hall的分布格式被证明最为稳健。在Hall的格式中,某一节点处的残差由共享该节点的所有单元的中间残差\(\vec{R}_{I,J,K}\)直接求和得到。于是,在图4.4所示的二维情形中,我们得到en

Of the three approaches, Hall's distribution scheme proved to be the most robust. In Hall's scheme, the residual at a particular node results from a simple sum of all intermediate residuals \(\vec{R}_{I,J,K}\), which cells share the node. Thus, in the 2-D case rendered in Fig. 4.4, we get

\[\vec{R}_{i,j} = \vec{R}_{I,J} + \vec{R}_{I-1,J} + \vec{R}_{I-1,J-1} + \vec{R}_{I,J-1}\,. \tag{4.30}\]

在三维中,必须以同样的方式把总共八个基于单元的残差求和。仔细考察(4.30)可以发现,\(\vec{R}_{i,j}\)恰好就是穿过超级单元(supercell)边界的净通量en

In three dimensions, in total eight cell-based residuals have to be summed up in the same way. A close inspection of (4.30) reveals that \(\vec{R}_{i,j}\) is just the net flux through the boundary of the supercell

\[\Omega_{i,j} = \Omega_{I,J} + \Omega_{I-1,J} + \Omega_{I-1,J-1} + \Omega_{I,J-1}, \tag{4.31}\]

这是因为穿过内部各面的通量互相抵消。超级单元也代表以点\((i,j)\)为中心的“总”控制体。在三维情形中,总体积由以下单元构成en

due to the fact that the fluxes across the inner faces cancel each other. The supercell also represents the "total" control volume, centred at the point \((i,j)\). In the 3-D case, the total volume consists of the cells

\[\begin{aligned} \Omega_{i,j,k} = {}& \Omega_{I,J,K} + \Omega_{I-1,J,K} + \Omega_{I-1,J-1,K} + \Omega_{I,J-1,K} \\ & + \Omega_{I,J,K-1} + \Omega_{I-1,J,K-1} + \Omega_{I-1,J-1,K-1} + \Omega_{I,J-1,K-1}\,. \end{aligned} \tag{4.32}\]

从图4.4可以看出,这些控制体至少重叠一个单元,该格式正因此得名。en

As it can be seen from Fig. 4.4, the control volumes overlap by at least one cell, which gave the scheme its name.

源项用相应网格节点处的流动变量计算,即en

The source term is calculated using the flow variables from the corresponding grid node, i.e.,

\[\left(\vec{Q}\,\Omega\right)_{i,j,k} = \vec{Q}(\vec{W}_{i,j,k})\,\Omega_{i,j,k}\,. \tag{4.33}\]

采用上述定义后,方程(4.2)中的时间推进格式变为en

With the above definitions, the time-stepping scheme in Eq. (4.2) becomes

\[\frac{d\vec{W}_{i,j,k}}{dt} = -\frac{1}{\Omega_{i,j,k}}\,\vec{R}_{i,j,k}\,. \tag{4.34}\]

这代表一个常微分方程组,它必须在每个网格点\((i,j,k)\)上求解,方式与单元中心格式相同。注意,方程(4.34)中分别使用总体积(4.31)或(4.32)。en

This represents a system of ordinary differential equations, which has to be solved in each grid point \((i,j,k)\) in the same way as for the cell-centred scheme. Note that the total volume (4.31) or (4.32), respectively, is utilised in Eq. (4.34).