3.1.1 Finite Difference Method 有限差分法[cfd-3-1-1]

有限差分法是最早应用于微分方程数值求解的方法之一,由 Euler 于1768年(大概)首先使用。有限差分法直接应用于控制方程的微分形式。其原理是利用 Taylor 级数展开来离散流动变量的导数。为便于说明,考察下面的例子。en

The finite difference method was among the first approaches applied to the numerical solution of differential equations. It was first utilised by Euler, probably in 1768. The finite difference method is directly applied to the differential form of the governing equations. The principle is to employ a Taylor series expansion for the discretisation of the derivatives of the flow variables. Let us for illustration consider the following example.

假设我们想计算某个标量函数\(U(x)\)在点\(x_0\)处的一阶导数。若把\(U(x_0+\Delta x)\)按\(x\)作 Taylor 级数展开,便得到en

Suppose we would like to compute the first derivative of a scalar function \(U(x)\) at some point \(x_0\). If we develop now \(U(x_0+\Delta x)\) as a Taylor series in \(x\), we obtain

\[U(x_0+\Delta x)=U(x_0)+\Delta x\left.\frac{\partial U}{\partial x}\right|_{x_0}+\frac{\Delta x^{2}}{2}\left.\frac{\partial^{2} U}{\partial x^{2}}\right|_{x_0}+\cdots \tag{3.1}\]

据此,\(U\)的一阶导数可近似为en

With this, the first derivative of \(U\) can be approximated as

\[\left.\frac{\partial U}{\partial x}\right|_{x_0}=\frac{U(x_0+\Delta x)-U(x_0)}{\Delta x}+\mathcal{O}(\Delta x)\,. \tag{3.2}\]

上述近似是一阶的,因为截断误差(记作\(\mathcal{O}(\Delta x)\))与余项中最大的项成正比,并随\(\Delta x\)的一次方趋于零(关于精度的阶的讨论见第10章)。同样的步骤也可用来推导更精确的有限差分公式,以及得到高阶导数的近似。en

The above approximation is of first order, since the truncation error (abbreviated as \(\mathcal{O}(\Delta x)\)), which is proportional to the largest term of the remainder, goes to zero with the first power of \(\Delta x\) (for a discussion on the order of accuracy see Chapter 10). The same procedure can be applied to derive more accurate finite difference formulae and to obtain approximations to higher-order derivatives.

有限差分方法学的一个重要优点是其简单性;另一个优点是容易获得高阶近似,从而实现空间离散的高阶精度。另一方面,由于该方法要求结构网格,应用范围明显受限。此外,有限差分法不能直接在贴体(曲线)坐标中使用,而必须先把控制方程变换到笛卡尔坐标系——换言之,从物理空间变换到计算空间(图3.2)。这里的问题在于坐标变换的雅可比行列式会出现在流动方程中(例如见附录A.1)。为避免引入额外的数值误差,必须对该雅可比量进行一致地离散。因此,有限差分法只能应用于相当简单的几何。如今,它有时用于湍流的直接数值模拟(DNS),但很少用于工业应用。关于有限差分法的更多细节,例如可参见[43]或有关偏微分方程求解的教科书。en

An important advantage of the finite difference methodology is its simplicity. Another advantage is the possibility to easily obtain high-order approximations, and hence to achieve high-order accuracy of the spatial discretisation. On the other hand, because the method requires a structured grid, the range of application is clearly restricted. Furthermore, the finite difference method cannot be directly applied in body-fitted (curvilinear) coordinates, but the governing equations have to be first transformed into a Cartesian coordinate system - or in other words - from the physical to the computational space (Fig. 3.2). The problem herewith is that the Jacobian of coordinate transformation appears in the flow equations (see, e.g., Appendix A.1). This Jacobian has to be consistently discretised in order to avoid the introduction of additional numerical errors. Thus, the finite difference method can be applied only to rather simple geometries. Nowadays, it is sometimes utilised for the direct numerical simulation of turbulence (DNS), but it is only very rarely used for industrial applications. More details to the finite difference method can be found for example in [43], or in textbooks on the solution of partial differential equations.