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

addCmptAvBoundaryDiag method

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 3 Post By santiagomarquezd
  • 1 Post By simrego

Reply
 
LinkBack Thread Tools Search this Thread 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: 452
Rep Power: 23
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.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) 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: 452
Rep Power: 23
santiagomarquezd will become famous soon enough
Any clues??
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D.
Research Scientist
Research Center for Computational Methods (CIMEC) - CONICET/UNL
Tel: 54-342-4511594 Int. 7032
Colectora Ruta Nac. 168 / Paraje El Pozo
(3000) Santa Fe - Argentina.
http://www.cimec.org.ar
santiagomarquezd is offline   Reply With Quote

Old   March 21, 2014, 06:36
Default
  #3
Member
 
hua1015's Avatar
 
Hua
Join Date: May 2012
Posts: 31
Rep Power: 13
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

Old   December 26, 2020, 08:29
Default
  #4
Senior Member
 
anonymous
Join Date: Jan 2016
Posts: 416
Rep Power: 14
simrego is on a distinguished road
Hi!


Facing the same problem (same in the H() operator).
Anyone knows it?
Thanks!


Regő
yueyun likes this.
simrego is offline   Reply With Quote

Reply


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Gmsh] discretizer - gmshToFoam Andyjoe OpenFOAM Meshing & Mesh Conversion 13 March 14, 2012 04: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 19:25


All times are GMT -4. The time now is 06:33.