CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

addCmptAvBoundaryDiag method

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   May 30, 2011, 13:50
Default addCmptAvBoundaryDiag method
  #1
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
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()

Code:
00638 template<class Type>
00639 Foam::tmp<Foam::volScalarField> Foam::fvMatrix<Type>::A() const
00640 {
00641     tmp<volScalarField> tAphi
00642     (
00643         new volScalarField
00644         (
00645             IOobject
00646             (
00647                 "A("+psi_.name()+')',
00648                 psi_.instance(),
00649                 psi_.mesh(),
00650                 IOobject::NO_READ,
00651                 IOobject::NO_WRITE
00652             ),
00653             psi_.mesh(),
00654             dimensions_/psi_.dimensions()/dimVol,
00655             zeroGradientFvPatchScalarField::typeName
00656         )
00657     );
00658 
00659     tAphi().internalField() = D()/psi_.mesh().V();
00660     tAphi().correctBoundaryConditions();
00661 
00662     return tAphi;
00663 }
D() method is called, which is:

Code:
00605 template<class Type>
00606 Foam::tmp<Foam::scalarField> Foam::fvMatrix<Type>::D() const
00607 {
00608     tmp<scalarField> tdiag(new scalarField(diag()));
00609     addCmptAvBoundaryDiag(tdiag());
00610     return tdiag;
00611 }
BC's contribution is done via addCmptAvBoundaryDiag:

Code:
00134 template<class Type>
00135 void Foam::fvMatrix<Type>::addCmptAvBoundaryDiag(scalarField& diag) const
00136 {
00137     forAll(internalCoeffs_, patchI)
00138     {
00139         addToInternalField
00140         (
00141             lduAddr().patchAddr(patchI),
00142             cmptAv(internalCoeffs_[patchI]),
00143             diag
00144         );
00145     }
00146 }
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.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   June 1, 2011, 18:18
Default
  #2
Senior Member
 
santiagomarquezd's Avatar
 
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 418
Rep Power: 14
santiagomarquezd will become famous soon enough
Any clues??
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Post-doctoral Fellow
Research Center for Computational Mechanics (CIMEC) - CONICET/FICH-UNL
T.E.: 54-342-4511594 Ext. 1005
Güemes 3450 - (3000) Santa Fe
Santa Fe - Argentina
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   March 21, 2014, 07:36
Default
  #3
New Member
 
hua1015's Avatar
 
Hua
Join Date: May 2012
Posts: 25
Rep Power: 5
hua1015 is on a distinguished road
maybe because the internalCoeff are (1,1,1) or (0,0,0),and the Ap is the same for U,V,W equation,
so using cmptAv is reasonable.
hua1015 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
discretizer - gmshToFoam Andyjoe Open Source Meshers: Gmsh, Netgen, CGNS, ... 13 March 14, 2012 05:35
Comparison: Finite Volume Method vs. Analytic Method m-fry Main CFD Forum 1 April 20, 2010 14:40
Code for most powerfull FDV Method D.S.Nasan Main CFD Forum 6 September 4, 2008 02:08
Help about the preconditioner in gmres method Dan Gao Main CFD Forum 3 July 5, 2008 01:18
hess-smith method and fvm method yangqing FLUENT 0 March 20, 2002 20:25


All times are GMT -4. The time now is 05:20.