correctBoundaryConditions里修正面心梯度的公式没看明白
-
代码在
src/finiteVolume/finiteVolume/gradSchemes/gaussGrad/gaussGrad.C
144行: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]) );