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

Addressing matrix element and reuse of system matrix

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2008, 03:36
Default Hi everybody. I was searching
  #1
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
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
marziolettich is offline   Reply With Quote

Old   February 19, 2008, 03:44
Default Where can I find a complete li
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Where can I find a complete list of these functions?. Obviously, in the class definition:

OpenFOAM-1.4.1-dev/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
hjasak is offline   Reply With Quote

Old   February 19, 2008, 05:04
Default Thank you Hrvoje... I've alrea
  #3
New Member
 
Marzio Lettich
Join Date: Mar 2009
Posts: 14
Rep Power: 17
marziolettich is on a distinguished road
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 re-use 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
marziolettich 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
Matrix shuo OpenFOAM Running, Solving & CFD 4 October 23, 2006 03:09
Roe matrix srinath Main CFD Forum 2 March 26, 2003 10: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


All times are GMT -4. The time now is 07:38.