SRF->Su()
是和坐标系相关的源项,就是你公式的最后两项,fvOptions(Urel)
是自定义的源项。
Voynich
帖子
-
fvOptions(Urel)和SRF->Su()具体说明在哪儿? -
发现虚拟机上openfoam12的一个bug虚拟机上openfoam10和11没有问题
-
发现虚拟机上openfoam12的一个bug发现东岳流体虚拟机上openfoam12的一个bug,用string初始化一个IStringStream在运行时会报“段错误”,用其他方法初始化都是正常的。没在物理机上试过,不知道是虚拟机的问题还是openfoam12本身的问题。以下代码wmake没问题,运行时报“段错误(核心已转储)”。有没有大佬在物理机上试一下
#include "IStringStream.H" using namespace Foam; int main() { const string name = "good"; const string buffer1 = "5"; const char *buffer2 = "6"; IStringStream stream1(buffer1); //段错误(核心已转储) IStringStream stream2(buffer2); //正常 IStringStream stream3(name, buffer1); //正常 return 0; }
-
OpenFOAM怎么保证Sf是由owner指向neighbour的?@李东岳 感谢回复。我是想先写个简单的特定算例学习一下算法,格式边界条件啥的都直接写死,然后再慢慢做的通用一点,能搞出来肯定开源。
-
OpenFOAM怎么保证Sf是由owner指向neighbour的?@Cp_Zhao 感谢回复
-
OpenFOAM怎么保证Sf是由owner指向neighbour的?想用python编一个简单的非结构网格simple算法加深理解,发现openfoam网格的Sf计算出来后不需要判断方向自然就是由owner指向neighbour的,这是怎么保证的?其他网格软件也有类似的feature吗?
-
动量方程中viscous term的离散,书里写的有点问题?@李东岳 明白了,谢谢李老师。排版排了好久,清楚一点方便讨论
-
动量方程中viscous term的离散,书里写的有点问题?@李东岳 感谢大佬回复,我说的可能有点乱,核心问题就是,$\nabla\cdot\{\tau\}$拆成两部分:
\begin{equation}
\begin{aligned}
&\int_\limits{V_C}\nabla\cdot\{\tau\}dV\\
=&\int_\limits{V_C}\nabla\cdot\{\mu\nabla\mathbf v\}dV+\int_\limits{V_C}\nabla\cdot\{\mu(\nabla\mathbf v)^\top\}dV\\
=&\sum\limits_f\Box\cdot\mathbf{S}_f+\sum\limits_f\Box\cdot\mathbf{S}_f
\end{aligned}
\end{equation}不管$\Box$里面是分子布局还是分母布局,反正可以得到下面两项:
\begin{equation}
\sum\limits_f\Box\cdot\mathbf{S}_f=\sum\limits_f\left[
\begin{matrix}
\frac{\partial u}{\partial x}S_f^x + \frac{\partial u}{\partial y}S_f^y + \frac{\partial u}{\partial z}S_f^z\\
\frac{\partial v}{\partial x}S_f^x + \frac{\partial v}{\partial y}S_f^y + \frac{\partial v}{\partial z}S_f^z \\
\frac{\partial w}{\partial x}S_f^x + \frac{\partial w}{\partial y}S_f^y + \frac{\partial w}{\partial z}S_f^z\\
\end{matrix}
\right]
\end{equation}\begin{equation}
\sum\limits_f\Box\cdot\mathbf{S}_f=\sum\limits_f\left[
\begin{matrix}
\frac{\partial u}{\partial x}S_f^x + \frac{\partial v}{\partial x}S_f^y + \frac{\partial w}{\partial x}S_f^z\\
\frac{\partial u}{\partial y}S_f^x + \frac{\partial v}{\partial y}S_f^y + \frac{\partial w}{\partial y}S_f^z \\
\frac{\partial u}{\partial z}S_f^x + \frac{\partial v}{\partial z}S_f^y + \frac{\partial w}{\partial z}S_f^z\\
\end{matrix}
\right]
\end{equation}应该是前面一个,式(8)作为diffusion处理,对每个分量都有$\nabla\phi\cdot\mathbf S_f=\frac{\phi_F-\phi_C}{d_{CF}}S_f$(正交网格)。是这样吗?
-
动量方程中viscous term的离散,书里写的有点问题?@李东岳
问题可能在这儿,Moukalled书p589这两个式子有问题,应该像下面这样写:\begin{equation}
\int_\limits{V_C}\nabla\cdot\{\mu(\nabla\mathbf{v})^\top\}dV=\sum_\limits{f\sim nb(C)}\mathbf{S}_f\cdot\{\mu(\nabla\mathbf{v})_f^\top\}
\end{equation}\begin{equation}
\mathbf{S}_f\cdot\{\mu(\nabla\mathbf{v})^\top_f\} = \left[
\begin{matrix}
\frac{\partial u}{\partial x}S_f^x + \frac{\partial v}{\partial x}S_f^y + \frac{\partial w}{\partial x}S_f^z\\
\frac{\partial u}{\partial y}S_f^x + \frac{\partial v}{\partial y}S_f^y + \frac{\partial w}{\partial y}S_f^z \\
\frac{\partial u}{\partial z}S_f^x + \frac{\partial v}{\partial z}S_f^y + \frac{\partial w}{\partial z}S_f^z\\
\end{matrix}
\right]
\end{equation}就是说,把$\nabla\cdot\{\mu\nabla\mathbf v\}$作为diffusion,把$\nabla\cdot\{\mu(\nabla\mathbf v)^\top\}$作为source处理是对的。diffusion term用高斯定理积分后应该是
\begin{equation}
\int_\limits{V_C}\nabla\cdot\{\mu(\nabla\mathbf{v})\}dV=\sum_\limits{f\sim nb(C)}\mathbf{S}_f\cdot\{\mu(\nabla\mathbf{v})\}
\end{equation}\begin{equation}
\mathbf{S}_f\cdot\{\mu(\nabla\mathbf{v})\} = \left[
\begin{matrix}
\frac{\partial u}{\partial x}S_f^x + \frac{\partial u}{\partial y}S_f^y + \frac{\partial u}{\partial z}S_f^z\\
\frac{\partial v}{\partial x}S_f^x + \frac{\partial v}{\partial y}S_f^y + \frac{\partial v}{\partial z}S_f^z \\
\frac{\partial w}{\partial x}S_f^x + \frac{\partial w}{\partial y}S_f^y + \frac{\partial w}{\partial z}S_f^z\\
\end{matrix}
\right]
\end{equation}$\nabla\cdot\{\mu\nabla\mathbf v\}$和(5)的第$i$分量分别和Ferziger的Computational Method for Fluid Dynamics p185式(7.8)的微分形式和积分形式一致。
其中
\begin{equation}
\nabla u_i\cdot\mathbf ndS=\frac{\partial u_i}{\partial x}S_f^x + \frac{\partial u_i}{\partial y}S_f^y + \frac{\partial u_i}{\partial z}S_f^z
\end{equation}
总结,$\nabla\cdot\{\mu\nabla\mathbf v\}$是扩散项没问题,可以应用中心差分等数值格式计算。Moukalled书p589的式(15.65)张量形式的高斯定理写错了,$\mathbf{a}\cdot\{\tau\}$写成了$\{\tau\}\cdot\mathbf{a}$,式(15.66)展开成分量也就跟着错了。麻烦大佬看看我理解的对不对? -
动量方程中viscous term的离散,书里写的有点问题?《The finite volume in computational fluid dynamics》中,$\nabla\mathbf v$写成
\begin{equation}
\nabla \mathbf{v} = \left[
\begin{matrix}
\frac{\partial u}{\partial x} & \frac{\partial v}{\partial x} & \frac{\partial w}{\partial x}\\
\frac{\partial u}{\partial y} & \frac{\partial v}{\partial y} & \frac{\partial w}{\partial y} \\
\frac{\partial u}{\partial z} & \frac{\partial v}{\partial z} & \frac{\partial w}{\partial z}\\
\end{matrix}
\right]
\end{equation}
在书中15.5.1节对SIMPLE的推导中,把$\nabla\cdot\{\mu\nabla\mathbf v\}$作为扩散项离散,把$\nabla\cdot\{\mu(\nabla\mathbf v)^\top\}$作为源项处理,是不是弄反了? -
梯度场的correctBoundaryConditions()是什么意思?@李东岳 李老师,您是说
gGrad.correctBoundaryConditions();
的作用就是根据gGrad的边界条件更新gGrad的边界值,是吗? -
梯度场的correctBoundaryConditions()是什么意思?最近开始学OpenFOAM源码,发现在src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C中的gradf函数最后面(下面代码块的65行),对计算出来的梯度场gGrad调用了GeometricField的成员函数correctBoundaryConditions(),这是什么意思呢?是根据梯度场自己的边界条件更新边界值吗?那梯度场自己的边界条件是在哪一步得到的呢?:
template<class Type> Foam::tmp < Foam::VolField<typename Foam::outerProduct<Foam::vector, Type>::type> > Foam::fv::gaussGrad<Type>::gradf ( const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf, const word& name ) { typedef typename outerProduct<vector, Type>::type GradType; const fvMesh& mesh = ssf.mesh(); tmp<GeometricField<GradType, fvPatchField, volMesh>> tgGrad ( GeometricField<GradType, fvPatchField, volMesh>::New ( name, mesh, dimensioned<GradType> ( "0", ssf.dimensions()/dimLength, Zero ), extrapolatedCalculatedFvPatchField<GradType>::typeName ) ); GeometricField<GradType, fvPatchField, volMesh>& gGrad = tgGrad.ref(); const labelUList& owner = mesh.owner(); const labelUList& neighbour = mesh.neighbour(); const vectorField& Sf = mesh.Sf(); Field<GradType>& igGrad = gGrad; const Field<Type>& issf = ssf; forAll(owner, facei) { GradType Sfssf = Sf[facei]*issf[facei]; igGrad[owner[facei]] += Sfssf; igGrad[neighbour[facei]] -= Sfssf; } forAll(mesh.boundary(), patchi) { const labelUList& pFaceCells = mesh.boundary()[patchi].faceCells(); const vectorField& pSf = mesh.Sf().boundaryField()[patchi]; const fvsPatchField<Type>& pssf = ssf.boundaryField()[patchi]; forAll(mesh.boundary()[patchi], facei) { igGrad[pFaceCells[facei]] += pSf[facei]*pssf[facei]; } } igGrad /= mesh.V(); gGrad.correctBoundaryConditions(); // 调用GeometricField成员函数 return tgGrad; }
-
求推荐多相流的有限体积法教材《The Finite Volume Method in Computational Fluid Dynamics》囫囵吞枣地翻了一遍,但是对多相流的有限体积法还是一头雾水,各位大神有没有相关的教材推荐呢?
-
可以直接提取energy dissipation rate吗?@李东岳 明白了,感谢李老师!
-
可以直接提取energy dissipation rate吗?准备用pisoFoam做LES,想知openFoam有没有定义好的变量可以直接提取$\epsilon$?还是要自己算?
-
拉格朗日中的湍流分散力模型@嵇何劫康 您好,Chen et al. 2011这篇文献里的湍流分散力模型是基于RANS的Hinze-Tchen模型,请问在LES中有类似的模型吗?
-
气液欧拉多相流中的SGS viscosity问题在气液欧拉多相流的大涡模拟中,有没有什么模型是把liquid或者particle相的SGS viscosity和主相的SGS viscosity联系起来的?
就像RANS中的一种模型:
$\begin{equation}
\frac{\nu_{t,particle}}{\nu_{t,gas}}=(\frac{k_{particle}}{k_{gas}})^2=\frac{1}{1+\frac{t_p}{t_{fl}}}
\end{equation}$
其中$\nu_t$是湍流粘度,k是湍动能,$t_p$是particle relaxation time,$t_{fl}$是Lagarangian fluid time scale。
现在像找一个类似的模型用在LES上,但是翻了好久也没翻到