correctBoundaryConditions里修正面心梯度的公式没看明白
-
代码在
src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C144行:template<class Type> void Foam::fv::gaussGrad<Type>::correctBoundaryConditions ( const GeometricField<Type, fvPatchField, volMesh>& vsf, GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh >& gGrad ) { typename GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh >::Boundary& gGradbf = gGrad.boundaryFieldRef(); forAll(vsf.boundaryField(), patchi) { if (!vsf.boundaryField()[patchi].coupled()) { const vectorField n ( vsf.mesh().Sf().boundaryField()[patchi] / vsf.mesh().magSf().boundaryField()[patchi] ); gGradbf[patchi] += n * ( vsf.boundaryField()[patchi].snGrad() - (n & gGradbf[patchi]) ); } } }里面
vsf应该是待求梯度的场吧、然后gGradbf是根据体心梯度插值得到的面心梯度、n是面单位法向、.snGrad()是$\frac{\phi_{f}-\phi_{C}}{d_{Cf}}$ ?
这个面心梯度的修正公式怎么来的我还是没看懂:gGradbf[patchi] += n * ( vsf.boundaryField()[patchi].snGrad() - (n & gGradbf[patchi]) ); -
@Cp_Zhao 在 correctBoundaryConditions里修正面心梯度的公式没看明白 中说:
自己翻书找到答案了
,《The FVM in CFD(OpenFOAM, Matlab)》那本书Page 303有讲到:

老哥好,这个面梯度的修正公式有在openfoam内部面梯度计算代码中出现吗? 还是只在边界面出现?