@李东岳 李老师,您好。volScalarField rAU(1.0/UEqn.A());这个重理论上分析应该是矢量才对,但是细节上的操作确实做成了体标量场。
 template<class Type>
 Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
 {
     tmp<volScalarField> tAphi
     (
         volScalarField::New
         (
             "A("+psi_.name()+')',
             psi_.mesh(),
             dimensions_/psi_.dimensions()/dimVol,
             extrapolatedCalculatedFvPatchScalarField::typeName
         )
     );
 
     tAphi.ref().primitiveFieldRef() = D()/psi_.mesh().V();
     tAphi.ref().correctBoundaryConditions();
 
     return tAphi;
 }
$ A=\frac{A_p}{\Delta V}$
在计算系数Diag的过程中,将边界对主对角线的系数进行了平均更新:
 template<class Type>
 Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const
 {
     tmp<scalarField> tdiag(new scalarField(diag()));
     //这里进行了平均处理并修正了主对角线系数。
     addCmptAvBoundaryDiag(tdiag.ref());
     return tdiag;
 }
为什么这样操作呢?这样会使得系数矩阵不一样了!