
[Sponsors] 
February 19, 2008, 04:36 
Hi everybody.
I was searching

#1 
New Member
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 8 
Hi everybody.
I was searching for informations about how to address system matrix elements. I've noticed that some solvers (e.g. simpleFoam) use some functions to retrieve, for instance, the main diagonal (matrix_name.A()) or the sum of the neighbours' coefficients for each cell (matrix_name.H())... at least, I can imagine this is their use. Where can I find a complete list of these functions? Another question for which I wasn't able to find an answer in the message board: where is saved the result when I use "solve"? I think the default behaviour is an updating of the dependent variable (e.g.: solve(fvm::laplacian(K, T)==Q) will solve the system and put the result in T). How can I make "solve" to save the result in a variable named in another way? Thanks in advance and please let me know if my questions aren't clear, Marzio 

February 19, 2008, 04:44 
Where can I find a complete li

#2 
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,769
Rep Power: 21 
Where can I find a complete list of these functions?. Obviously, in the class definition:
OpenFOAM1.4.1dev/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.H How can I make "solve" to save the result in a variable named in another way? Wellm you said you were solving for T, right? This is why the code puts th answer into T  why don't you just take it out of T and put it whereever you want it. Beware, the system of equations [A][x] = [b] is not as trivial as it looks  you've got boundary conditions, coupled and processor boundaries and all kinds of other things that functionally contribute to \fixed[A]} or [b]. Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk 

February 19, 2008, 06:04 
Thank you Hrvoje... I've alrea

#3 
New Member
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 8 
Thank you Hrvoje... I've already watched the class definition, probably I missed something.
As for the second question, it arises when you want to reuse a system matrix with another right hand vector without recalculating it. In this case, the problem with "solve" behaviour is that you alter the result previously obtained. I was thinking of a sort of adjoint method sensitivity analysis: the adjoint system matrix (the one solved for the multipliers) in this case should be the transpose of the original problem matrix (at least, if the problem is linear... that's why I'm working on a simple heat conduction problem). The right hand vector should be the derivative of the objective function w.r.t. the state variable (since hopefully you know the analytic expression of the objective function, it shouldn't be a problem to calculate this one). Mind, I don't know if this can work at all in OF (I've only used this kind of method with FE discretization), but I had to start somewhere and yesterday I met this difficulty so I asked. Thanks again and bye, Marzio 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Matrix  shuo  OpenFOAM Running, Solving & CFD  4  October 23, 2006 03:09 
Roe matrix  srinath  Main CFD Forum  2  March 26, 2003 11:39 
about Roe matrix !  Root Willow  Main CFD Forum  2  October 15, 2002 04:26 
Elemtary matrix to CSR global matrix  xueying  Main CFD Forum  2  September 24, 2002 09:44 
solver for linear system with large sparse matrix  Yangang Bao  Main CFD Forum  1  October 25, 1999 04:22 