# FVM in CFD 学习笔记_第11章_对流项离散

2020年06月10日 阅读数：1485

Chapter 11 Discretization of the Convection Termhtml

# 2 稳态一维对流和扩散

$\frac{d(\rho u \phi)}{d x} - \frac{d}{dx}\left( \Gamma^{\phi}\frac{d \phi}{d x} \right)=0$

## 2.1 解析解

$\frac{d (\rho u)}{d x}=0$

$\rho u \frac{d \phi}{d x} - \frac{d}{dx}\left( \Gamma^{\phi}\frac{d \phi}{d x} \right)=0$
$x$积分，得
$\rho u \phi - \Gamma^{\phi}\frac{d \phi}{d x}=c_1$
$c_1$为积分常数，由边界条件来定。上面这个方程进一步写成
$\frac{d \phi}{d x}=\frac{\rho u}{ \Gamma^{\phi}} \phi - \frac{c_1}{ \Gamma^{\phi}}$

$\Phi=\frac{\rho u}{ \Gamma^{\phi}} \phi - \frac{c_1}{ \Gamma^{\phi}}$

$\frac{d\Phi}{dx}=\frac{\rho u}{\Gamma^\phi}\Phi$

$\frac{d\Phi}{\Phi}=\frac{\rho u}{\Gamma^\phi} dx$

$Ln(\Phi)=\frac{\rho u}{\Gamma^\phi} x + c_3$

$\Phi = c_2 e^{\frac{\rho u}{\Gamma^\phi} x }$

$\phi=\frac{c_2\Gamma^\phi e^{\frac{\rho u}{\Gamma^\phi} x }+ c_1}{\rho u}$

$\begin{cases} \phi=\phi_W&at&x=x_W \\ \phi=\phi_E&at&x=x_E \end{cases}$

$\frac{\phi-\phi_W}{\phi_E-\phi_W}=\frac{e^{Pe_L\frac{x-x_W}{L}}-1}{e^{Pe_L}-1}$

$Pe_L=\frac{\rho u L}{\Gamma^\phi}\quad\quad L = x_E-x_W$

ide

## 2.2 数值解

$\int_{V_C}[\nabla\cdot(\rho\bold v\phi)-\nabla\cdot(\Gamma^\phi\nabla\phi)]dV=0$

$\int_{V_C}\nabla\cdot(\bold J^{\phi,C}+\bold J^{\phi,D})dV=0$

$\int_{V_C}\nabla\cdot(\bold J^{\phi,C}+\bold J^{\phi,D})dV= \int_{\partial V_C}(\bold J^{\phi,C}+\bold J^{\phi,D})\cdot d\bold S= \int_{\partial V_C}\left(\rho u \phi \bold i-\Gamma^\phi \frac{d\phi}{dx}\bold i\right)\cdot d\bold S = 0$

$\sum_{f\sim nb(C)}\left(\rho u \phi \bold i-\Gamma^\phi \frac{d\phi}{dx}\bold i\right)_f\cdot \bold S_f=0$

$\left[(\rho u \Delta y\phi)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e\right]- \left[(\rho u \Delta y\phi)_w-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right]=0$

## 2.3 初步推导：中心差分格式（The Center Difference （CD） Scheme）

$\phi(x)=k_0+k_1(1-x_C)$

$\phi_e=\phi_C+\frac{\phi_E-\phi_C}{x_E-x_C}(x_e-c_C)$

$\phi_e=\frac{\phi_C+\phi_E}{2}$

\begin{aligned} \left[(\rho u \Delta y\phi)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e\right] & = (\rho u \Delta y)_e\frac{\phi_C+\phi_E}{2}-\left(\Gamma^\phi \frac{\Delta y}{\delta x}\right)_e(\phi_E-\phi_C) \\ & = FluxC_e\phi_C+FluxF_e\phi_E+FluxV_e \end{aligned}

\begin{aligned} & FluxC_e = \Gamma^\phi_e \frac{\Delta y_e}{\delta x_e}+\frac{(\rho u \Delta y)_e}{2} \\ & FluxF_e = -\Gamma^\phi_e \frac{\Delta y_e}{\delta x_e}+\frac{(\rho u \Delta y)_e}{2} \\ & FluxV_e = 0 \end{aligned}

\begin{aligned} -\left[(\rho u \Delta y\phi)_w-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right] &= -\left[ (\rho u \Delta y)_w\frac{\phi_C+\phi_W}{2}-\left(\Gamma^\phi \frac{\Delta y}{\delta x}\right)_w(\phi_C-\phi_W) \right] \\ & = FluxC_w\phi_C+FluxF_w\phi_W+FluxV_w \end{aligned}

\begin{aligned} & FluxC_w = \Gamma^\phi_w \frac{\Delta y_w}{\delta x_w}-\frac{(\rho u \Delta y)_w}{2} \\ & FluxF_w = -\Gamma^\phi_w \frac{\Delta y_w}{\delta x_w}-\frac{(\rho u \Delta y)_w}{2} \\ & FluxV_w = 0 \end{aligned}

$a_C\phi_C+a_E\phi_E+a_W\phi_W=0$

\begin{aligned} & a_E=FluxF_e=-\Gamma^\phi_e \frac{\Delta y_e}{\delta x_e}+\frac{(\rho u \Delta y)_e}{2} \\ & a_W=FluxF_w=-\Gamma^\phi_w \frac{\Delta y_w}{\delta x_w}-\frac{(\rho u \Delta y)_w}{2} \\ & a_C=FluxC_e+FluxC_w=\Gamma^\phi_e \frac{\Delta y_e}{\delta x_e}+\frac{(\rho u \Delta y)_e}{2}+ \Gamma^\phi_w \frac{\Delta y_w}{\delta x_w}-\frac{(\rho u \Delta y)_w}{2} \end{aligned}

\begin{aligned} & a_E=-\frac{\Gamma^\phi}{x_E-x_C}+\frac{(\rho u)_e}{2} \\ & a_W=-\frac{\Gamma^\phi}{x_C-x_W}-\frac{(\rho u)_w}{2} \\ & a_C=-(a_E+a_W) \end{aligned}

$\frac{\phi_C-\phi_W}{\phi_E-\phi_W}=\frac{a_E}{a_E+a_W}$

$\frac{\phi_C-\phi_W}{\phi_E-\phi_W}=\frac{1}{2}\left( 1- \frac{Pe_L}{4} \right)$

$\frac{\phi_C-\phi_W}{\phi_E-\phi_W}=\frac{e^{Pe_L/2}-1}{e^{Pe_L}-1}$
$Pe_L$从-10变化到10，数值解和解析解给出的结果展现在下图中，当 $Pe_L$值（绝对值）较小时，数值解和解析解很是接近，当 $Pe_L$的值（绝对值）逐渐增大并跨过阈值后，中心差分格式给出的数值解就和解析解产生了很大误差，其变得不受约束（无界）呈现出不符合物理意义的特性。即，解析解对于正的和负的 $Pe_L$分别逐渐趋近于0和1，中心差分格式给出的数值解则随着 $Pe_L$ $-\infin$增大到 $+\infin$而从 $+\infin$线性减少到 $-\infin$。这代表前面离散过程当中采用的某些假设是不切实际的或者说是不符合物理意义的，究竟是什么缘由形成的呢？学习

$a_E=-\Gamma^\phi_e \frac{\Delta y_e}{\delta x_e}+\frac{(\rho u \Delta y)_e}{2}>0 \Rightarrow \frac{(\rho u)_e\delta x_e}{\Gamma_e^\phi} > 2$

$Pe=\frac{\rho u\delta x}{\Gamma^\phi}$

$Pe>2$

## 2.4 迎风格式（Upwind Scheme）

$\phi_e=\begin{cases} \phi_C & if & \dot m_e > 0 \\ \phi_E & if & \dot m_e < 0 \end{cases} \quad\quad\quad \phi_w=\begin{cases} \phi_C & if & \dot m_w > 0 \\ \phi_W & if & \dot m_w < 0 \end{cases}$
（注意，这里的 $\phi_w$没有写反，由于质量流量 $\dot m$跟速度 $u$是不一样的，看下面说明）

\begin{aligned} & \dot m_e=(\rho \bold v \cdot \bold S)_e=(\rho u S)_e=(\rho u \Delta y)_e \\ & \dot m_w=(\rho \bold v \cdot \bold S)_w=-(\rho u S)_w=-(\rho u \Delta y)_w \end{aligned}

\begin{aligned} \dot m_e \phi_e &= ||\dot m_e,0||\phi_C-||-\dot m_e,0||\phi_E \\ &= FluxC_e^{Conv}\phi_C+FluxF_e^{Conv}\phi_E+FluxV_e^{Conv} \end{aligned}

\begin{aligned} &FluxC_e^{Conv}= ||\dot m_e,0|| \\ &FluxF_e^{Conv}=-||-\dot m_e,0|| \\ &FluxV_e^{Conv}=0 \end{aligned}

\begin{aligned} \dot m_w \phi_w &= ||\dot m_w,0||\phi_C-||-\dot m_w,0||\phi_W \\ &= FluxC_w^{Conv}\phi_C+FluxF_w^{Conv}\phi_W+FluxV_w^{Conv} \end{aligned}

\begin{aligned} &FluxC_w^{Conv}= ||\dot m_w,0|| \\ &FluxF_w^{Conv}=-||-\dot m_w,0|| \\ &FluxV_w^{Conv}=0 \end{aligned}

\begin{aligned} (FluxC_e^{Conv}&+FluxC_e^{Diff}+FluxC_w^{Conv}+FluxC_w^{Diff})\phi_C\\ &+(FluxF_e^{Conv}+FluxF_e^{Diff})\phi_E+(FluxF_w^{Conv}+FluxF_w^{Diff})\phi_W=0 \end{aligned}

$a_C\phi_C+a_E\phi_E+a_W\phi_W=b_C$

\begin{aligned} a_E&= FluxF_e^{Conv}+FluxF_e^{Diff} \\ &= -||-\dot m_e,0|| - \Gamma^\phi_e \frac{S_e}{\delta x_e} \\ a_W&= FluxF_w^{Conv}+FluxF_w^{Diff} \\ &=-||-\dot m_w,0|| -\Gamma^\phi_w \frac{S_w}{\delta x_w} \\ a_C&= \sum_f \left( FluxC_f^{Conv} + FluxC_f^{Diff} \right)\\ &=||\dot m_e,0||+||\dot m_w,0||+\Gamma^\phi_e \frac{S_e}{\delta x_e}+\Gamma^\phi_w \frac{S_w}{\delta x_w} \\ &=-(a_E+a_W)+\underbrace{(\dot m_e + \dot m_w)}_{=0} \\ b_C&=-\sum_f \left( FluxV_f^{Conv} + FluxV_f^{Diff} \right)\\ &=0 \end{aligned}

$a_C=-(a_W+a_E)$

$\frac{\phi_C-\phi_W}{\phi_E-\phi_W} =\frac{2+||-Pe_L,0||}{4+||-Pe_L,0||+||Pe_L,0||} =\frac{2+||-Pe_L,0||}{4+|Pe_L|}$

## 2.5 背风格式（Downwind Scheme）

$\phi_e=\begin{cases} \phi_E & if & \dot m_e>0 \\ \phi_C & if & \dot m_e<0 \end{cases} \quad\quad\quad \phi_w=\begin{cases} \phi_W & if & \dot m_w>0 \\ \phi_C & if & \dot m_w<0 \end{cases}$

\begin{aligned} \dot m_e\phi_e & = - ||-\dot m_e,0||\phi_C+||\dot m_e,0||\phi_E \\ &= FluxC_e^{Conv}\phi_C+FluxF_e^{Conv}\phi_E+FluxV_e^{Conv} \\ \dot m_w\phi_w & = - ||-\dot m_w,0||\phi_C+||\dot m_w,0||\phi_W \\ &= FluxC_w^{Conv}\phi_C+FluxF_w^{Conv}\phi_W+FluxV_w^{Conv} \end{aligned}

\begin{aligned} (FluxC_e^{Conv}&+FluxC_e^{Diff}+FluxC_w^{Conv}+FluxC_w^{Diff})\phi_C\\ &+(FluxF_e^{Conv}+FluxF_e^{Diff})\phi_E+(FluxF_w^{Conv}+FluxF_w^{Diff})\phi_W=0 \end{aligned}

$a_C\phi_C+a_E\phi_E+a_W\phi_W=b_C$

\begin{aligned} a_E&= FluxF_e^{Conv}+FluxF_e^{Diff} \\ &= ||\dot m_e,0|| - \Gamma^\phi_e \frac{S_e}{\delta x_e} \\ a_W&= FluxF_w^{Conv}+FluxF_w^{Diff} \\ &=||\dot m_w,0|| -\Gamma^\phi_w \frac{S_w}{\delta x_w} \\ a_C&= \sum_f \left( FluxC_f^{Conv} + FluxC_f^{Diff} \right)\\ &=-||-\dot m_e,0||-||-\dot m_w,0||+\Gamma^\phi_e \frac{S_e}{\delta x_e}+\Gamma^\phi_w \frac{S_w}{\delta x_w} \\ &=-(a_E+a_W)+\underbrace{(\dot m_e + \dot m_w)}_{=0} \\ b_C&=-\sum_f \left( FluxV_f^{Conv} + FluxV_f^{Diff} \right)\\ &=0 \end{aligned}

$\frac{\phi_C-\phi_W}{\phi_E-\phi_W} =\frac{2-||Pe_L,0||}{4-||-Pe_L,0||-||Pe_L,0||} =\frac{2-||Pe_L,0||}{4-|Pe_L|}$

# 3 截断偏差：数值扩散和反扩散（Truncation Error: Numerical Diffusion and Anti-Diffusion）

## 3.1 迎风格式

$\phi_e=\phi_C\quad\quad\quad\phi_w=\phi_W$

$(\rho u \Delta y)_e\phi_C-(\rho u \Delta y)_w\phi_W- \left[\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right]=0$
$\phi_C$作一维Taylor展开，以单元面 $e$的值为基准，得
\begin{aligned} \phi_C&=\phi_e+\left( \frac{d\phi}{dx} \right)_e(x_C-x_e)+\frac{1}{2}\left( \frac{d^2\phi}{dx^2} \right)_e(x_C-x_e)^2+...\\ &=\phi_e-\left( \frac{d\phi}{dx} \right)_e(x_e-x_C)+... \end{aligned}

$\phi_C=\phi_e-\left( \frac{d\phi}{dx} \right)_e\frac{(\delta x)_e}{2}+\frac{1}{2}\left( \frac{d^2\phi}{dx^2} \right)_e\left(\frac{(\delta x)_e}{2}\right)^2+...$

$\phi_W=\phi_w-\left( \frac{d\phi}{dx} \right)_w\frac{(\delta x)_w}{2}+\frac{1}{2}\left( \frac{d^2\phi}{dx^2} \right)_w\left(\frac{(\delta x)_w}{2}\right)^2+...$

\begin{aligned} &(\rho u \Delta y)_e\phi_C-(\rho u \Delta y)_w\phi_W- \left[\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right]=\\ &(\rho u \Delta y)_e\left[ \phi_e-\left( \frac{d\phi}{dx} \right)_e\frac{(\delta x)_e}{2} \right]-(\rho u \Delta y)_w\left[ \phi_w-\left( \frac{d\phi}{dx} \right)_w\frac{(\delta x)_w}{2} \right]-\\ &\left[\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right] \end{aligned}

\begin{aligned} &(\rho u \Delta y)_e\phi_C-(\rho u \Delta y)_w\phi_W- \left[\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right]=\\ &(\rho u \Delta y)_e\phi_e-(\rho u \Delta y)_w\phi_w-\left[\left(\Gamma^\phi +\rho u\frac{\delta x}{2}\right)_e\left(\frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi +\rho u\frac{\delta x}{2}\right)_w\left(\frac{d\phi}{dx}\Delta y\right)_w\right] \end{aligned}

$\Gamma^\phi_{truncation}=\rho u \frac{\delta x}{2}$

## 3.2 背风格式

$\phi_e=\phi_E\quad\quad\quad\phi_w=\phi_C$

$(\rho u \Delta y)_e\phi_E-(\rho u \Delta y)_w\phi_C- \left[\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_e-\left(\Gamma^\phi \frac{d\phi}{dx}\Delta y\right)_w\right]=0$

$\begin{array}{rl}& {\varphi }_{E}={\varphi }_{e}+{\left(\frac{d\varphi }{dx}\right)}_{e}\frac{\left(\delta x{\right)}_{e}}{2}+\frac{1}{2}{\left(\frac{{d}^{2}\varphi }{d{x}^{2}}\right)}_{e}{\left(\frac{\left(\delta x{\right)}_{e}}{2}\right)}^{2}+\mathrm{.}\mathrm{.}\mathrm{.}\end{array}$