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

ldumatrix

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree9Likes
  • 4 Post By henrik
  • 5 Post By zaratustra

Reply
 
LinkBack Thread Tools Display Modes
Old   August 15, 2009, 04:35
Default ldumatrix
  #1
New Member
 
Markus
Join Date: Aug 2009
Posts: 3
Rep Power: 7
zaratustra is on a distinguished road
Hi folks,

i've got my own Algebraic Multigrid solver and try to use it as a solver in openFoam. Therefore i adapted the interface of GAMG, at least tried it. I'm new to OpenFoam and its very hard for me to understand the at most undocumented code. So my first question, to avoid a "RTFM"-answer

1) Is there somewhere a hidden (to me) Source-Code documentation?

I found the doxygen docu, but without comments in the code, it isnt very helpful. In fact I dont understand the most simplest issues:

2) What is the ldumatrix storage-format?

Ok, I found 3 arrays containing the data for the diagonal, the upper triangular und lower triangular part of the matrix. in addition there are 2 addressing arrays. More Precise:

2)' How does the LDU-Adressing work?

I browsed the source code for several hours, but i dont get it. I'm using a Compressed Row-Format for my matrices; but things are strange here. For example in the ldumatrix class something about "faces", "nodes" etc. is said; is the class strictly dependend on some geometry information? A mesh? I hope thats not true...

Please help me; i'm not really motivated to invest lots of more time in such a simple problem; for example building a demo-laplace-problem on a regular grid, to generate a matrix, from which i know, how it looks like...

Best regards ;-),
Markus
zaratustra is offline   Reply With Quote

Old   August 15, 2009, 08:28
Default
  #2
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
Dear Marcus,

the key to understand OpenFOAM's addressing and linear solvers is understanding "face addressing".

There is no documentation apart from what's in the source code and a few threads on this forum. But I think it provides a good starting point.

FvMatrix coefficients
Questions about addressing
New linear system solvers

Happy foaming,

Henrik
henrik is offline   Reply With Quote

Old   August 17, 2009, 04:27
Default Thanks!
  #3
New Member
 
Markus
Join Date: Aug 2009
Posts: 3
Rep Power: 7
zaratustra is on a distinguished road
Hallo Henrik!

Thanks for your reply. I read the Threads you mentioned, and i think, the information i needed is very simple. So, to be sure, i quickly write, what i found out.

A ldumatrix consists of
1) diag() -> Array of diag elements
2) lower() -> Array of lower-triangular elements
3) upper() -> --------upper-------------------
4) lowerAddr(), upperAddr() -> Coefficient position for off-diag entries.

All off-diag in the upper-triagonal matrix are numbered, say from 1 to n.
Now holds:

i = lowerAddr()[k] -> Row of k'th off-diag-entry in upper-triagonal
j = upperAddr()[k] -> Columns of k'th off-diag-entry in upper triagonal
a_ij = upper()[k]
a_ji = lower()[k]

It holds: lowerAddr()[k] < upperAddr()[k] ; maybe that explains the names "lowerAddr, upperAddr".

Because in fact the addressing is only stored for one half of the matrix, this storage format seems perfectly fitted to symmetric matrices. In this case upper() == lower() holds.
Considering a non-symmetric matrix, this format generates overhead, because an explicit "0" is stored for each a_ij, for which a_ji <> 0, and the other way round.

In Addition the matrix storage seems to have a corresondence for the mesh numbering and the other way round, so matrix addressing can be obtained from the mesh(addressing). But that seems irrelevant for purely algebraic purposes.

Is this right?

Thanks again,
Markus
zaratustra is offline   Reply With Quote

Old   August 17, 2009, 08:40
Default
  #4
Senior Member
 
Henrik Rusche
Join Date: Mar 2009
Location: Braunschweig, Niedersachsen, Germany
Posts: 275
Rep Power: 9
henrik is on a distinguished road
Hallo Markus,

yes, all correct! Also note that the mesh is stored such that face k is the face between the cells i and j.

@overhead: Correct, but in reality there is negligible overhead because most schemes add to a_ij and a_ji. In fact, only the matrix for pure upwind convection without any diffusion will have overhead.

There are other pieces of addressing in lduAddressing. For example losortAddr() for sweeps going from row n to row 0 as well as ownerStartAddr() and losortStartAddr() for individual row/column access.

Best Regards,

Henrik
henrik is offline   Reply With Quote

Old   August 19, 2009, 21:59
Default Convection Heat Transfer
  #5
New Member
 
rodrigo
Join Date: Aug 2009
Posts: 7
Rep Power: 7
augusto_bassan is on a distinguished road
hi someone have or know where I can found the solution manual of book Convection Heat Transfer, third edition of author Adrian Bejan, because I need very much in my pos- graduate , thanks.
my e mail is augusto_bassan@yahoo.com.br
augusto_bassan is offline   Reply With Quote

Old   August 19, 2009, 22:01
Default
  #6
New Member
 
rodrigo
Join Date: Aug 2009
Posts: 7
Rep Power: 7
augusto_bassan is on a distinguished road
Quote:
Originally Posted by henrik View Post
Hallo Markus,

yes, all correct! Also note that the mesh is stored such that face k is the face between the cells i and j.

@overhead: Correct, but in reality there is negligible overhead because most schemes add to a_ij and a_ji. In fact, only the matrix for pure upwind convection without any diffusion will have overhead.

There are other pieces of addressing in lduAddressing. For example losortAddr() for sweeps going from row n to row 0 as well as ownerStartAddr() and losortStartAddr() for individual row/column access.

Best Regards,

Henrik
hi someone have or know where I can found the solution manual of book Convection Heat Transfer, third edition of author Adrian Bejan, because I need very much in my pos- graduate , thanks.
my e mail is augusto_bassan@yahoo.com.br
augusto_bassan is offline   Reply With Quote

Old   August 20, 2009, 05:48
Default ownerstartaddr....
  #7
New Member
 
Markus
Join Date: Aug 2009
Posts: 3
Rep Power: 7
zaratustra is on a distinguished road
Hi Henrik again,

thanks for your reply.

>>>
losortAddr() for sweeps going from row n to row 0 as well as ownerStartAddr() and losortStartAddr() for individual row/column access.
<<<

I tried, but i couldnt figure out, what you exactly mean by this, but i think/hope thats exactly what i need.
I generated an ownerstartlist for an example matrix by hand using the algorithm in the doxygen docu, but i couldnt interpret the result. Similar the losortAddr / losortStartAddr().

Do you have an idea?

Greetings,
Markus
zaratustra is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
FvMatrix coefficients shrina OpenFOAM Running, Solving & CFD 10 October 3, 2013 14:38
Getting old values of psi internal ffbof OpenFOAM Running, Solving & CFD 4 August 27, 2008 14:46
Disabling and Enabling Solver Summary Outputs within code adona058 OpenFOAM Running, Solving & CFD 3 November 1, 2007 12:00
Sparse matrix hemph OpenFOAM Running, Solving & CFD 5 September 27, 2005 16:57


All times are GMT -4. The time now is 02:47.