return 0;
wmake

张量公式查询

如果打不开图像,请右键在新标签页打开图像后刷新几次


本文介绍笛卡尔坐标系下的张量操作。

基本操作

\begin{equation} \nabla p = \left[\begin{matrix} \frac{\partial p}{\partial x} \\ \frac{\partial p}{\partial y} \\ \frac{\partial p}{\partial z} \end{matrix} \right] \end{equation}
\begin{equation} \nabla \cdot(\nabla p)=\nabla ^2p=\frac{\partial^2p}{\partial x^2}+\frac{\partial^2p}{\partial y^2}+\frac{\partial^2p}{\partial z^2} \end{equation}
\begin{equation} \mathbf{U} \cdot \mathbf{V} =\mathbf{U}^\rT\cdot\mathbf{V}= [u_1, u_2, u_3] \left[\begin{matrix} v_1 \\ v_2 \\ v_3 \end{matrix} \right]=u_1v_1+u_2v_2+u_3v_3 \end{equation}
\begin{equation} \mathbf{U} \times \mathbf{V}=\left[ \begin{matrix} u_2v_3-u_3v_2\\ u_3v_1-u_1v_3\\ u_1v_2-u_2v_1\\ \end{matrix} \right] \end{equation}
\begin{equation} \nabla \cdot \mathbf{U} = \frac{\partial u_1}{\partial x}+\frac{\partial u_2}{\partial y}+\frac{\partial u_3}{\partial z} \end{equation}
\begin{equation}\label{gradientV} \nabla \mathbf{U} = \left[ \begin{matrix} \frac{\partial u_1}{\partial x} & \frac{\partial u_2}{\partial x} & \frac{\partial u_3}{\partial x}\\ \frac{\partial u_1}{\partial y} & \frac{\partial u_2}{\partial y} & \frac{\partial u_3}{\partial y} \\ \frac{\partial u_1}{\partial z} & \frac{\partial u_2}{\partial z} & \frac{\partial u_3}{\partial z}\\ \end{matrix} \right] \end{equation}
\begin{equation} \nabla \cdot(\nabla \mathbf{U})= \left[ \begin{matrix} \frac{\partial}{\partial x}\left(\frac{\partial u_1}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_1}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_1}{\partial z}\right)\\ \frac{\partial}{\partial x}\left(\frac{\partial u_2}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_2}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_2}{\partial z}\right)\\ \frac{\partial}{\partial x}\left(\frac{\partial u_3}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_3}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_3}{\partial z}\right)\\ \end{matrix} \right] \end{equation}
\begin{equation} \mathbf{U}\mathbf{V}=\mathbf{U}\otimes\mathbf{V}=\mathbf{U}\cdot\mathbf{V}^\rT=\left[ \begin{matrix} u_1 v_1 & u_1 v_2 & u_1 v_3\\ u_2 v_1 & u_2 v_2 & u_2 v_3\\ u_3 v_1 & u_3 v_2 & u_3 v_3 \end{matrix} \right] \end{equation}
\begin{equation} \nabla\times\mathbf{U}=\left[ \begin{matrix} \frac{\partial u_3}{\partial y}-\frac{\partial u_2}{\partial z}\\ \frac{\partial u_1}{\partial z}-\frac{\partial u_3}{\partial x}\\ \frac{\partial u_2}{\partial x}-\frac{\partial u_1}{\partial y}\\ \end{matrix} \right] \end{equation}
\begin{equation} \nabla \cdot \tau = \left[\begin{matrix} \frac{\partial\tau_{xx}}{\partial x}+\frac{\partial\tau_{yx}}{\partial y}+\frac{\partial\tau_{zx}}{\partial z} \\ \frac{\partial\tau_{xy}}{\partial x}+\frac{\partial\tau_{yy}}{\partial y}+\frac{\partial\tau_{zy}}{\partial z} \\ \frac{\partial\tau_{xz}}{\partial x}+\frac{\partial\tau_{yz}}{\partial y}+\frac{\partial\tau_{zz}}{\partial z} \end{matrix}\right] \end{equation}
\begin{equation} \tau:\tau=\tau_{11}\tau_{11}+\tau_{12}\tau_{21}+\tau_{13}\tau_{31}+ \tau_{21}\tau_{12}+\tau_{22}\tau_{22}+\tau_{23}\tau_{32}+ \tau_{31}\tau_{13}+\tau_{32}\tau_{23}+\tau_{33}\tau_{33} \end{equation}
\begin{equation} \mathrm{tr} \left(\tau\right)=\tau_{xx}+\tau_{yy}+\tau_{zz} \end{equation}
\begin{equation} \mathrm{symm} \left(\tau\right)=\frac{\tau+\tau^T}{2} \end{equation}
\begin{equation} \mathrm{skew} \left(\tau\right)=\frac{\tau-\tau^T}{2} \end{equation}
\begin{equation} \mathrm{dev} \left(\tau\right)=\tau-\frac{1}{3}\mathrm{tr}\left(\tau\right)\mathbf{I} \end{equation}
\begin{equation} \mathrm{dev}2 \left(\tau\right)=\tau-\frac{2}{3}\mathrm{tr}\left(\tau\right)\mathbf{I} \end{equation}
\begin{equation} \mathrm{hyd} \left(\tau\right)=\frac{1}{3}\mathrm{tr}\left(\tau\right)\mathbf{I} \end{equation}
\begin{equation} \tau=\mathrm{hyd}\left(\tau\right)+\mathrm{dev}\left(\tau\right) \end{equation}

张量运算

\begin{equation} \mathbf{U}+\mathbf{V}=\mathbf{V}+\mathbf{U} \end{equation}
\begin{equation} \alpha\mathbf{U}=\mathbf{U}\alpha \end{equation}
\begin{equation} \mathbf{U}\cdot\mathbf{V}=\mathbf{V}\cdot\mathbf{U} \end{equation}
\begin{equation} \mathbf{U}\times\mathbf{V}=-\mathbf{V}\times\mathbf{U} \end{equation}
\begin{equation} \mathbf{U}\times\left(\mathbf{V}\times\mathbf{W}\right)\neq\left(\mathbf{U}\times\mathbf{V}\right)\times\mathbf{W} \end{equation}
\begin{equation} \nabla\cdot\left(\nabla\times\mathbf{U}\right)=0 \end{equation}
\begin{equation} \nabla\times\nabla\alpha=0 \end{equation}
\begin{equation} \nabla (\alpha p)=\alpha\nabla p+p\nabla\alpha \end{equation}
\begin{equation} \nabla \cdot(\alpha \mathbf{U})=\alpha\nabla\cdot \mathbf{U}+\mathbf{U} \cdot \nabla\alpha=\alpha\nabla\cdot\mathbf{U}+\nabla\alpha\cdot\mathbf{U} \end{equation}
\begin{equation} \nabla \times (\alpha \mathbf{U})=\alpha\nabla\times \mathbf{U}+\left(\nabla\alpha\right) \times\mathbf{U} \end{equation}
\begin{equation} \nabla(\mathbf{U}\cdot\mathbf{V})=\mathbf{U}\times(\nabla\times\mathbf{V})+\mathbf{V}\times(\nabla\times\mathbf{U})+(\mathbf{U}\cdot\nabla)\mathbf{V}+(\mathbf{V}\cdot\nabla)\mathbf{U} \end{equation}
\begin{equation} \nabla\cdot(\mathbf{U}\times\mathbf{V})=\mathbf{V}\cdot(\nabla\times\mathbf{U})-\mathbf{U}\cdot(\nabla\times\mathbf{V}) \end{equation}
\begin{equation} \nabla\times(\mathbf{U}\times\mathbf{V})=\mathbf{U}(\nabla\cdot\mathbf{V})-\mathbf{V}(\nabla\cdot\mathbf{U})+(\mathbf{V}\cdot\nabla)\mathbf{U}-(\mathbf{U}\cdot\nabla)\mathbf{V} \end{equation}
\begin{equation} \nabla\times(\nabla\times\mathbf{U})=\nabla(\nabla\cdot\mathbf{U})-\nabla^2\mathbf{U} \end{equation}
\begin{equation} (\nabla\times\mathbf{U})\times\mathbf{U}=\mathbf{U}\cdot(\nabla\mathbf{U})-\nabla(\mathbf{U}\cdot\mathbf{U}) \end{equation}
\begin{equation} \nabla\cdot\nabla\mathbf{U}=\nabla(\nabla\cdot\mathbf{U})-\nabla\times(\nabla\times\mathbf{U}) \end{equation}
\begin{equation} \nabla\cdot(\mathbf{U} \mathbf{U})=\mathbf{U} \cdot \nabla \mathbf{U}+\mathbf{U} \nabla \cdot \mathbf{U} \end{equation}
\begin{equation} \nabla\cdot(\alpha \tau)=\tau \cdot\nabla \alpha + \alpha \nabla \cdot \tau \end{equation}
\begin{equation} \mathrm{tr}\left(\nabla\mathbf{U}\right)=\nabla\cdot\mathbf{U}=\mathrm{tr}\left(\nabla\mathbf{U}^{\mathrm{T}}\right) \end{equation}
\begin{equation} \tau=\frac{1}{2}\left(\tau+\tau^\mathrm{T}\right)+\frac{1}{2}\left(\tau-\tau^\mathrm{T}\right)=\mathrm{symm}\left(\tau\right)+\mathrm{skew}\left(\tau\right) \end{equation}

小例子

首先来看CFD中的不可压缩流体动量方程(在这里假定粘度为$1$):

\begin{equation} \frac{\partial \mathbf{U}}{\partial t}+\nabla \cdot (\mathbf{U}\mathbf{U})=-\nabla \frac{p}{\rho}+\nabla \cdot(\nabla \mathbf{U}) \label{mom} \end{equation}

其中的$\mathbf{U}$为速度矢量,$p$为压力,$\rho$为密度。该公式实际上表示3个公式。一般来讲,CFD文献中通常采用公式\eqref{mom}的形式(紧凑形式)而并不进行展开。这对CFD新手可能会引起困惑,接下来,我们看如何将其展开为可理解的形式。

公式\eqref{mom}的第一项,因为$\mathbf{U}$为矢量,故展开为:

\begin{equation}\label{time} \frac{\partial \mathbf{U}}{\partial t}= \left[ \begin{matrix} \frac{\partial u_1}{\partial t} \\ \frac{\partial u_2}{\partial t} \\ \frac{\partial u_3}{\partial t} \\ \end{matrix} \right] \end{equation}

其中$u_1$表示$x$方向速度,$u_2$表示$y$方向速度,$u_3$表示$z$方向速度。这样拆分之后的公式,即为各个方向的速度针对时间的偏导数。

公式\eqref{mom}的第二项$\nabla \cdot (\mathbf{U}\mathbf{U})$中的$\mathbf{U}\mathbf{U}$是一种简写,完整形式为$\mathbf{U}\otimes \mathbf{U}$,$\otimes$是一个张量运算符(dyadic product)。那么有:

\begin{equation} \mathbf{U}\mathbf{U}=\mathbf{U} \otimes \mathbf{U}=\left[\begin{matrix} u_1\\ u_2\\ u_3 \end{matrix}\right][u_1, u_2, u_3]=\left[ \begin{matrix} u_1 u_1 & u_1 u_2 & u_1 u_3\\ u_2 u_1 & u_2 u_2 & u_2 u_3\\ u_3 u_1 & u_3 u_2 & u_3 u_3 \end{matrix} \right] \end{equation}

接下来看$\nabla \cdot$,其也被称之为散度($\mathrm{div}$)算符。对一个矢量($1$阶张量)做散度的结果为一个标量($0$阶张量),对一个$2$阶张量做散度的结果为矢量($1$阶张量)。因此,对任意$n$阶张量做散度操作之后,结果为$n-1$阶张量。举例,对一个矢量做散度有:$\nabla \cdot \mathbf{U} = \frac{\partial u_1}{\partial x}+\frac{\partial u_2}{\partial y}+\frac{\partial u_3}{\partial z}$。因此,公式\eqref{mom}中的第二项$\nabla \cdot (\mathbf{U}\mathbf{U})$即为对一个$2$阶张量做散度:

\begin{equation}\label{conv} \nabla \cdot \left(\mathbf{U}\mathbf{U}\right) = \nabla \cdot \left[ \begin{matrix} u_1 u_1 & u_1 u_2 & u_1 u_3\\ u_2 u_1 & u_2 u_2 & u_2 u_3\\ u_3 u_1 & u_3 u_2 & u_3 u_3 \end{matrix} \right]=\left[ \begin{matrix} \frac{\partial u_1 u_1}{\partial x}+\frac{\partial u_2 u_1}{\partial y}+\frac{\partial u_3 u_1}{\partial z} \\ \frac{\partial u_1 u_2}{\partial x}+\frac{\partial u_2 u_2}{\partial y}+\frac{\partial u_3 u_2}{\partial z} \\ \frac{\partial u_1 u_3}{\partial x}+\frac{\partial u_2 u_3}{\partial y}+\frac{\partial u_3 u_3}{\partial z} \end{matrix} \right] \end{equation}

公式\eqref{mom}第三项也存在$\nabla$算子,这一项中没有了$\cdot$符号。$\nabla$我们称之为梯度($\mathrm{grad}$)。对一个标量($0$阶张量)做梯度的结果为一个矢量($1$阶张量),对一个矢量做梯度的结果为$2$阶张量。因此,对任意$n$阶张量做梯度之后的结果为$n+1$阶张量。举例,对一个标量,$p$,做梯度有:

\begin{equation}\label{p} \nabla p = \left[ \begin{matrix} \frac{\partial p}{\partial x} \\ \frac{\partial p}{\partial y} \\ \frac{\partial p}{\partial z} \\ \end{matrix} \right] \end{equation}

现在分析公式\eqref{mom}的第四项$\nabla \cdot(\nabla \mathbf{U})$。依据上文的分析,其即为对速度$\mathbf{U}$先做梯度再做散度。$\nabla \cdot \nabla$通常也写为$\nabla^2$,并称为拉普拉斯算子。有了上面的介绍,对这一项展开是很明了的:

\begin{equation}\label{diff} \nabla \cdot(\nabla \mathbf{U})=\nabla \cdot \left[ \begin{matrix} \frac{\partial u_1}{\partial x} & \frac{\partial u_2}{\partial x} & \frac{\partial u_3}{\partial x}\\ \frac{\partial u_1}{\partial y} & \frac{\partial u_2}{\partial y} & \frac{\partial u_3}{\partial y} \\ \frac{\partial u_1}{\partial z} & \frac{\partial u_2}{\partial z} & \frac{\partial u_3}{\partial z}\\ \end{matrix} \right]= \left[ \begin{matrix} \frac{\partial}{\partial x}\left(\frac{\partial u_1}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_1}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_1}{\partial z}\right)\\ \frac{\partial}{\partial x}\left(\frac{\partial u_2}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_2}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_2}{\partial z}\right)\\ \frac{\partial}{\partial x}\left(\frac{\partial u_3}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_3}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_3}{\partial z}\right)\\ \end{matrix} \right] \end{equation}

结合公式\eqref{time}、\eqref{conv}、\eqref{p}、\eqref{diff},我们有三个公式。下面仅列出$x$方向:

\begin{equation}\label{result} \frac{\partial u_1}{\partial t} + \frac{\partial u_1 u_1}{\partial x}+\frac{\partial u_2 u_1}{\partial y}+\frac{\partial u_3 u_1}{\partial z} = -\frac{1}{\rho}\frac{\partial p}{ \partial x} + \frac{\partial}{\partial x}\left(\frac{\partial u_1}{\partial x}\right)+\frac{\partial}{\partial y}\left(\frac{\partial u_1}{\partial y}\right)+\frac{\partial}{\partial z}\left(\frac{\partial u_1}{\partial z}\right) \end{equation}

公式\eqref{result}即为$u_1$的方程。$\frac{\partial}{\partial t}$无非是导数。除了$u_1$之外,如果所有的变量均为已知,那么就可以求出$u_1$关于时间的步进。很遗憾,公式\eqref{result}中的压力$p$和$u_1$是耦合在一起的,对这个方程的求解非常复杂,这也是CFD中SIMPLE算法等要处理的问题。本文中,理解到公式\eqref{result}的形式即可,顺便要知道,其很难解,甚至解析解是否存在都无从考证(改变数学历史的百万美元大奖)。

更新历史
2018.04.20经G8S7指正修正公式\eqref{gradientV},重整页面

东岳流体®版权所有
勘误、讨论、补充内容请前往CFD中文网