
[Sponsors] 
January 21, 2005, 08:20 
Hi all,
Have you got any sug

#1 
Guest
Posts: n/a

Hi all,
Have you got any suggestios about how to calculate the eigenvalues of a scalar matrix with OpenFoam? Thanks. Regards tommaso 

January 21, 2005, 08:23 
How big is the matrix? If it

#2 
Guest
Posts: n/a

How big is the matrix? If it's a 3x3 tensor then the functionality is already provided but for larger matrices it is not currently available. However there are algorithms in Numerical Recipies (and other books) to do this and the latest C++ edition of the book is pretty good and the code is quite easy to integrate with OpenFOAM.


July 10, 2006, 09:19 
Can anyone tell me somthing ab

#3 
Member
Ralph
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
Can anyone tell me somthing about manipulating the coefficients in a linear system in OpenFOAM.
1) Can the central coefficients of a system be manipulated by using lduMatrix::diag()? 2) Can the rhs coefficients be manipulated by using lduMatrix::source()? 3) If yes, the manipulated system xyEqn.diag() *= factor; xyEqn.source() *= factor; should be equal to the initial system (left + right side multiplicated with a diagonal matrix). If that is the case, Iīm doing something wrong, because the solutions of the two systems show a big difference. Thanks in advance Ralph 

July 10, 2006, 09:46 
You need to be more careful: w

#4 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,783
Rep Power: 22 
You need to be more careful: what class are you using and what exactly happens.
Class lduMatrix has got the membr functions for const scalarField& lower() const; const scalarField& diag() const; const scalarField& upper() const; but it does not hold the source. That means you are using a derived class (which?) and this may do additional things. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

July 10, 2006, 10:07 
Hi Hrvoje,
Iīm using fvMatrix

#5 
Member
Ralph
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
Hi Hrvoje,
Iīm using fvMatrix class (with scalar type). Iīm actually doing: 1) Creating a linear system of type fvMatrix (e.g. xyEqn) 2) Applying: xyEqn.diag() *= factor; xyEqn.source() *= factor; 3) Solving: xyEqn.solve() (The residuum is lowered about 5 orders of magnitudes during the solution procedure) 4) Again creating the system (with the unknowns of the former solution as "start values"). 5) Solving (without any manipulations). The problem is, that the start residuum for (5) is about that of (3). But if Manipulation in (2) works well, the start residuum should be lower, as (3) should produce similar results to (5) and therefore a good starting solution should be available. Am I doing somthing fundamental wrong? Ralph 

July 10, 2006, 10:12 
No, it's all fine. The matrix

#6 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,783
Rep Power: 22 
No, it's all fine. The matrix normalisation is based on the diagonal and source and it's different in the two cases. You could safely ignore this and carry on.
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

July 10, 2006, 10:21 
Itīs doing good to hear thatīs

#7 
Member
Ralph
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
Itīs doing good to hear thatīs all fine.
But if itīs fine I would expect the first result similiar to the second one and therefore the start residuum of the second one to be much lower (as the result should already nearly be reached). Donīt you agree? 

July 10, 2006, 12:57 
Let's think about it: in terms

#8 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,783
Rep Power: 22 
Let's think about it: in terms of absolute residuals, you are quite right: boosting the diagonal and the source will mean that you are closer to the solution. However, the reported residuals are normalised (i.e. divided by something) and the normalisation factor is calculated from the matrix itself. Quoting from the code:
//  Calculate reference value of psi scalar psiRef = gAverage(psi_); //  Calculate A.psi and A.psiRef matrix_.Amul(wA, psi_, coupleBouCoeffs_, interfaces_, cmpt_); matrix_.Amul ( pA, scalarField(psi_.size(), psiRef), coupleBouCoeffs_, interfaces_, cmpt_ ); //  Calculate normalisation factor scalar normFactor = gSum(mag(wA  pA) + mag(source_  pA)) + matrix_.small_; You can see the normalisation factor in the last line above. The wa and pa bit is multiplied by the diagona and source_ is source :)If you increase the diagonal and source, the normalisation factor changes  which explains what you see. Clear? Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

July 10, 2006, 13:48 
Thanks a lot Hrvoje,
I got it

#9 
Member
Ralph
Join Date: Mar 2009
Posts: 40
Rep Power: 9 
Thanks a lot Hrvoje,
I got it. 

July 17, 2007, 08:38 
Hi,
I need to know the diffe

#10 
New Member
Rachid bannari
Join Date: Mar 2009
Location: Quebec, Canada
Posts: 12
Rep Power: 9 
Hi,
I need to know the difference between BICCG and BiCGSTAB. and if it's possible the article of Vorst. best regards 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Addressing matrix element and reuse of system matrix  marziolettich  OpenFOAM Running, Solving & CFD  2  February 19, 2008 06:04 
Matrix Algebra  Tommaso Lucchini (Lucchini)  OpenFOAM Running, Solving & CFD  0  January 21, 2005 10:33 
Roe matrix  srinath  Main CFD Forum  2  March 26, 2003 11:39 
Elemtary matrix to CSR global matrix  xueying  Main CFD Forum  2  September 24, 2002 09:44 
FEM/Linear algebra question  clifford bradford  Main CFD Forum  7  May 4, 2001 23:47 