||May 30, 2011 13:50
Hi FOAMers, I would like to do a question about the A() method in fvMatrix class. From the theory we know it represents the values of matrix diagonal coefficients, which, I suppose, have the contribution of BC's. Usually, before linear systems are solved BC contributions are added to diagonal coeffs. via addBoundaryDiag method so you can recover the same matrix as you can assemble by hand. Nevertheless is you take this coeffs. they will be different of those you can obtain by the A() method. Checking the code in fvMatrix.C we have, for A()
00638 template<class Type>
00639 Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
00641 tmp<volScalarField> tAphi
00643 new volScalarField
00659 tAphi().internalField() = D()/psi_.mesh().V();
00662 return tAphi;
D() method is called, which is:
00605 template<class Type>
00606 Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const
00608 tmp<scalarField> tdiag(new scalarField(diag()));
00610 return tdiag;
BC's contribution is done via addCmptAvBoundaryDiag:
00134 template<class Type>
00135 void Foam::fvMatrix<Type>::addCmptAvBoundaryDiag(scalarField& diag) const
00137 forAll(internalCoeffs_, patchI)
which calls cmptAv. This method assigns the average of vector contribution components as the number that is added to diagonal coefficients.
My questions are:
1. Why "true" BC influenced diagonal coeffs aren't used?
2. Why the contributions are calculated this way instead?
All help will be appreciated. Regards.