
[Sponsors] 
March 16, 2011, 07:25 
The meanings of diag( ), source( ), psi( )

#1 
New Member
Xuan Cai
Join Date: Mar 2011
Location: Karlsruhe, Germany
Posts: 9
Rep Power: 6 
I am using the solver"porousSimpleFoam" to run simulations on a domain including porous media.
In the UEqn.H, the momentum equation is implemented as follows: // Construct the Momentum equation tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U) + turbulence>divDevReff(U) ); Then in the file: /src/finiteVolume/cfdTools/general/porousMedia/porousZone.C we have the following code: ================================================== ========== scalarField& Udiag = UEqn.diag(); vectorField& Usource = UEqn.source(); const vectorField& U = UEqn.psi(); ================================================== ========== Does anyone know the exact meanings of UEqn.diag(), UEqn.source(), UEqn.psi() in details, e.g. what do these functions return? Or could anyone give some hints about that? Thank you very much 

March 16, 2011, 10:46 

#2 
New Member
Alton Luder III
Join Date: Oct 2009
Location: Michigan
Posts: 22
Rep Power: 8 
See the source code documentation.
Here is the list of all members of fvMatrix since diag() is inheirited http://foam.sourceforge.net/docs/cpp...ixmembers.php 

March 16, 2011, 13:08 

#3  
Senior Member
Santiago Marquez Damian
Join Date: Aug 2009
Location: Santa Fe, Santa Fe, Argentina
Posts: 420
Rep Power: 15 
Hi,
Quote:
Regards.
__________________
Santiago MÁRQUEZ DAMIÁN, Ph.D. Postdoctoral Fellow Research Center for Computational Mechanics (CIMEC)  CONICET/FICHUNL T.E.: 543424511594 Ext. 1005 Güemes 3450  (3000) Santa Fe Santa Fe  Argentina http://www.cimec.org.ar 

March 17, 2011, 05:56 

#4  
New Member
Xuan Cai
Join Date: Mar 2011
Location: Karlsruhe, Germany
Posts: 9
Rep Power: 6 
Quote:
Hi Santiago. Thanks for your reply. In the openfoamwiki, I learn that disretization of PDE leads to an algebraic equation in the following form: AΨ = B So does UEqn.diag() mean the diagonal of A, UEqn.source() mean B and UEqn.psi() mean Ψ ? 

September 19, 2013, 13:53 

#5  
Member
Hassan
Join Date: Oct 2012
Location: Iran
Posts: 63
Rep Power: 5 
Quote:
Please attention to this post. ? Regards, Hassan 

June 17, 2015, 14:13 

#6  
Senior Member
Dongyue Li
Join Date: Jun 2012
Location: Torino, Italy
Posts: 710
Rep Power: 8 
Quote:
For example, if you are discritizing velocity, u will have an symmetry matrix. After discritization, u will have Ax = B, A will be symmetric, Then OpenFOAM will do: [A.diag()+A.offdiag()] x = B; A.diag() x = B  A.offdiag() x; For symmetric matrix, A.diag() will be the diagonal of A, A.offdiag() x will be the source of A. That means if your matrix equation is like this: A x = 0; U also have an source() term.
__________________
Im the translator of OpenFOAM User Guide Chinese Edition! But always newbie on CFD. Never too old to learn CFD. Worship these CFD experts. 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
swak4foam building problem  GGerber  OpenFOAM Installation  54  April 24, 2015 16:02 
pisoFoam compiling error with OF 1.7.1 on MAC OSX  Greg Givogue  OpenFOAM Programming & Development  3  March 4, 2011 18:18 
OpenFOAM on MinGW crosscompiler hosted on Linux  allenzhao  OpenFOAM Installation  127  January 30, 2009 20:08 
DxFoam reader update  hjasak  OpenFOAM PostProcessing  69  April 24, 2008 01:24 
DecomposePar links against liblamso0 with OpenMPI  jens_klostermann  OpenFOAM Bugs  11  June 28, 2007 17:51 