5.2.1 Cell-Centred Scheme 单元中心格式[cfd-5-2-1]

如果控制体与网格单元完全相同,且流动变量布置在各单元的形心处(如图5.6所示),我们就称之为单元中心格式。在计算离散化流动方程(5.2)时,需要在控制体各面的中点处提供对流通量和黏性通量,这对光滑网格上的二阶精度离散化已经足够(四边形面采用平均法向量)。通量可以用以下三种方式之一来近似:

  • 通量平均(average of fluxes):由单元面左右两侧网格单元形心处之值分别计算通量,再取平均,但使用同一单位法向量(一般只用于对流通量);
  • 变量平均(average of variables):采用单元面左右两侧相邻网格单元形心处变量的平均;
  • 由周围单元之值分别在单元面两侧重构(reconstructed)流动量,再由此计算通量(只用于对流通量)。
en

We speak of a cell-centred scheme if the control volumes are identical with the grid cells and if the flow variables are associated with their centroids, as it is sketched in Fig. 5.6. When we evaluate the discretised flow equations (5.2), we have to supply the convective and the viscous fluxes at the midpoints of the faces of the control volume, which is sufficient for a second-order accurate discretisation on smooth grids (averaged normal vector is employed for quadrilateral faces). The fluxes can be approximated in one of three 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 unit normal vector (generally applied only to the convective fluxes);
  • by using an average of variables associated with the centroids of the grid cells adjacent to the left and to the right side of the cell face;
  • by computing the fluxes from flow quantities reconstructed separately on both sides of the cell face from values in the surrounding cells (employed only for the convective fluxes).

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

图5.6:单元中心格式的控制体(二维)。图例:网格节点用圆点表示,单元中心用方块(C)表示;\(C_0\)、\(C_1\)、\(C_2\)、\(C_3\)为相邻单元的形心,\(M_{01}\)为面01的中点,\(\vec{n}_{01}\)为面01的单位法向量,\(\Omega\)为控制体(阴影部分)。

于是,以图5.6中具有单位法向量\(\vec{n}_{01}\)的单元面为例,第一种方法——通量平均——在二维情形下为en

Thus, considering for example the cell face with the unit normal vector \(\vec{n}_{01}\) in Fig. 5.6, the first approach - average of fluxes - reads in two dimensions

\[\left(\vec{F}_c\,\Delta S\right)_{01} \approx \frac{1}{2}\left[\vec{F}_c(\vec{W}_0,\vec{n}_{01}) + \vec{F}_c(\vec{W}_1,\vec{n}_{01})\right]\Delta S_{01} \tag{5.18}\]

其中面面积\(\Delta S_{01}\)由方程(5.6)和(5.7)计算。en

with the face area \(\Delta S_{01}\) computed from Eqs. (5.6) and (5.7).

第二种方法——变量平均——可以表述为en

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

\[\left(\vec{F}\,\Delta S\right)_{01} \approx \vec{F}(\vec{W}_{01},\vec{n}_{01})\,\Delta S_{01}, \tag{5.19}\]

其中在具有单位法向量\(\vec{n}_{01}\)的面上的守恒变量/因变量,定义为两个相邻单元处数值的算术平均,即en

where the conservative/dependent variables at the face with the unit normal vector \(\vec{n}_{01}\) are defined as the arithmetic average of values at the two adjacent cells. Thus,

\[\vec{W}_{01} = \frac{1}{2}\left(\vec{W}_0 + \vec{W}_1\right). \tag{5.20}\]

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

The flux vector \(\vec{F}\) in Eq. (5.19) represents either the convective or the viscous fluxes.

第三种方法首先把流动量(通常为速度分量、压力、密度和总焓)分别插值到单元面的两侧。重构得到的量——称为左状态(left)和右状态(right state)(参见5.3.3小节)——一般并不相同。随后,利用适当的非线性函数,由左、右状态之差计算通过单元面的通量,即en

The third methodology starts with an interpolation of flow quantities (usually velocity components, pressure, density and total enthalpy) separately to both sides of the cell face. The reconstructed quantities - termed the left and the right state (see Subsection 5.3.3) - differ in general. The fluxes through the cell face are then evaluated from the difference of the left and right state using an appropriate non-linear function. Hence,

\[\left(\vec{F}_c\,\Delta S\right)_{01} \approx f_{Flux}\left(\vec{U}_L,\vec{U}_R,\Delta S_{01}\right), \tag{5.21}\]

其中en

where

\[\begin{aligned} \vec{U}_L &= f_{Rec}\left(\ldots,\vec{U}_2,\vec{U}_0,\ldots\right),\\ \vec{U}_R &= f_{Rec}\left(\ldots,\vec{U}_1,\vec{U}_0,\ldots\right) \end{aligned} \tag{5.22}\]

它们表示重构得到的(左、右)状态。en

represent the reconstructed states.

当然,类似的关系对控制体的其他面同样成立。上述近似同样可以用于三维情形,此时面向量\(\vec{S}\)分别用公式(5.11)或(5.13)计算。en

Of course, similar relations hold for the other control volume faces as well. The above approximations can be employed in the same way in three dimensions. The face vector \(\vec{S}\) is then evaluated using the formulae (5.11) or (5.13), respectively.

正如本节开头所指出的,描述元素的基本数据结构必须以适当的方式加以扩展,以支持相应的离散化方法。从上面的讨论可以清楚地看出,数值运算主要是利用元素(控制体)的面以及相邻单元中心处的值来进行的。因此,很自然地应在空间离散化中采用基于面(face-based)的数据结构。这种数据结构对网格中每个具体的面(见图5.6)存储:

  • 指向共享该面的两个单元的指针——借此可以访问与这两个单元(\(C_0\)、\(C_1\))相关联的流动变量;
  • 面向量(\(\vec{S}_{01} = \vec{n}_{01}\Delta S_{01}\))——必须一致地指向外侧或内侧;
  • 从各单元形心指向面中点\(M_{01}\)的两个向量,即(\(C_0-M_{01}\))、(\(C_1-M_{01}\))——把流动变量精确插值到面上时需要。对纯四面体网格无需此项,此时可用简单的外插公式[26]、[2](参见方程(5.44))。
en

As we already stated in the introduction to this section, the basic data structure which describes the elements has to be extended in an appropriate way to support the discretisation methodology. It is obvious from the previous discussion that numerical operations are carried out using mainly the faces of the elements (control volumes) together with values at the centres of the adjacent cells. It is therefore quite natural to employ a face-based data structure for the spatial discretisation. Such data structure stores for each particular face in the grid (see Fig. 5.6):

  • pointers to the two cells which share the respective face - this allows us to access the flow variables associated with the two cells (\(C_0\), \(C_1\));
  • the face vector (\(\vec{S}_{01} = \vec{n}_{01}\Delta S_{01}\)) - must point consistently either outwards or inwards;
  • two vectors from the centroid each cell to the midpoint of the face \(M_{01}\), i.e., (\(C_0-M_{01}\)), (\(C_1-M_{01}\)) - required for an accurate interpolation of flow variables to the face. This is not necessary for purely tetrahedral grids, where a simple extrapolation formula can be used [26], [2] (cf. Eq. (5.44)).

于是,通量的积分(例如按照方程(5.19))可以实现为对网格中所有(即内部的和边界的)面的一个循环:en

Hence, the integration of the fluxes (e.g., according to Eq. (5.19)) would be implemented as a loop over all (i.e., internal and boundary) faces contained in the grid:

DO face = 1, nfaces
    I = pointer_to_left_cell( face )
    J = pointer_to_right_cell( face )
    (F dS)_IJ = F(W_IJ, n_IJ) dS_IJ   (approx.)
    R_I = R_I + (F dS)_IJ
    R_J = R_J - (F dS)_IJ
ENDDO
    

循环结束后,再加上源项\(\vec{Q}_I\Omega_I\),就得到所有单元内的最终残差(\(\vec{R}\))。效率较低的替代做法是对元素作循环,因为这样面向量必须存储两次,且通量要计算两次(边界除外)。此外,由于我们使用完全相同的面向量\(\vec{S}_{IJ}\)来计算流入体积\(\Omega_I\)和\(\Omega_J\)的部分通量,控制方程的守恒性质自动得以保持。en

After the loop is completed and the source term \(\vec{Q}_I\Omega_I\) is added, we obtain the final residuals (\(\vec{R}\)) in all cells. A less efficient approach would be to loop over elements because the face vectors would have to be stored twice and the fluxes would be computed twice (with the exception of the boundaries). Furthermore, because we use exactly the same face vector \(\vec{S}_{IJ}\) in order to to evaluate the partial fluxes into the volumes \(\Omega_I\) and \(\Omega_J\), the conservation properties of the governing equations are automatically retained.