《icoFoam解析》中压力修正的代码问题
- 
							
							
							
							
补充一下。 公式乱码刷新一下就行。 fvc::div代码如下:template<class Type> tmp<GeometricField<Type, fvPatchField, volMesh> > div ( const GeometricField<Type, fvsPatchField, surfaceMesh>& ssf ) { return tmp<GeometricField<Type, fvPatchField, volMesh> > ( new GeometricField<Type, fvPatchField, volMesh> ( "div("+ssf.name()+')', fvc::surfaceIntegrate(ssf) ) ); }fvc::div(phiHbyA)就是对单元体表面的phiHbyA进行求和。这个依据高斯定理,相当于对 ∇∙(HbyA) 在单元体上进行积分。所以这个问题的关键是, div和laplacian等操作符是对
 \begin{equation}
 \nabla \cdot (HbyA^r) = \nabla \cdot(\frac{1}{A_{\mathrm{p},f}} \nabla p^r)
 \end{equation}
 这个半离散方程进行进一步的离散,即积分。
- 
							
							
							
							
另外, 
 参考
 fvc::div(u)=fvc::div(phi)。对应的代码如下: template<class Type> tmp < GeometricField <typename innerProduct<vector, Type>::type, fvPatchField, volMesh> > gaussDivScheme<Type>::fvcDiv ( const GeometricField<Type, fvPatchField, volMesh>& vf ) { tmp < GeometricField <typename innerProduct<vector, Type>::type, fvPatchField, volMesh> > tDiv ( fvc::surfaceIntegrate ( this->mesh_.Sf() & this->tinterpScheme_().interpolate(vf) ) ); tDiv().rename("div(" + vf.name() + ')'); return tDiv; }即 div(U)的计算方法也是先插值到单元体表面上,然后进行求和。
- 
							
							
							
							
我找到了一个对div和snGrad的理解,希望可以帮上忙,内容来源:Giskard's CFD Learning Tricks 
 https://wenku.baidu.com/view/838580050975f46527d3e1ff.html
 我的理解是fvc::div(phiHbyA)已经将原控制方程中的散度表示为高斯积分的求和形式了,不知道这样理解是否正确?
 
			


