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

Big data handling, List vs Matrix

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 29, 2020, 03:40
Default Big data handling, List vs Matrix
  #1
Member
 
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 6
sippanspojk is on a distinguished road
Hi foamers,

I have developed a functionObject that reads and works on the face pressure values from some selected patches. At the moment I am working with lists and lists of lists to store my values and to perform my calculations. I have however experienced performance issues (lack of RAM) when my mesh grows. It is working fine on ~100k cells but above that it crashes. I have therefore started to look into the matrix class in OpenFOAM. However, before I start to adapt my code I would like to hear your opinion on this - will my code be more lightweight using the matrix class instead of my current lists of lists definition?

Thanks,
David

EDIT ----------------------------------------------------

To further specify my problem - I need to store 5-8 list of lists throughout the complete simulation that all have the size nCells x nCells. This is eating up the RAM when the number of cells increase and I therefore need to find a more economic way of storing this data.

Thanks again,
David
sippanspojk is offline   Reply With Quote

Old   May 29, 2020, 18:09
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Hi,

Can't you just write them out (if you really really need temporal-accurate data instead of statistics) instead of keeping them in the memory throughout the simulation? Using List or Matrix would not help if the data keep accumulating as ~ t N^2 (t = time, N = cells).
HPE is offline   Reply With Quote

Old   May 29, 2020, 18:37
Default
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
You cannot afford to store the list of nCells x nCells. This is a massive size.

Please think what you need this list for. Are there alternative stogare arrangements that would work? Do you REALLY need a list of that size?

fvMatrix is stored in a sparse matrix format, excluding all the entries that you know will be zero. The lookup is slower, but it is feasible. Even on a massive supercomputer, there is not enough memory for nCells x nCells.

Also, please consider carefully what you are trying to do. When running in parallel, does it parallelise, ie do you have one huge global matrix or a smaller matrix on each processor? Read up on parallel communication and sparse matrix formats - otherwise you will always be stuck around 100k cells. By the way, 100k x 100k is 10 BILLION NUMBERS: this is why you run out of memory
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   May 30, 2020, 12:31
Default
  #4
Member
 
alexander thierfelder
Join Date: Dec 2019
Posts: 71
Rep Power: 6
superkelle is on a distinguished road
Quote:
Originally Posted by sippanspojk View Post
Hi foamers,

I have developed a functionObject that reads and works on the face pressure values from some selected patches.

So only for understanding, you are only storing some hundred to some thousand values of (boundary) patches for meshes of a bigger size?
superkelle is offline   Reply With Quote

Old   June 2, 2020, 03:00
Default
  #5
Member
 
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 6
sippanspojk is on a distinguished road
Quote:
Originally Posted by hjasak View Post
fvMatrix is stored in a sparse matrix format, excluding all the entries that you know will be zero. The lookup is slower, but it is feasible. Even on a massive supercomputer, there is not enough memory for nCells x nCells.

Also, please consider carefully what you are trying to do. When running in parallel, does it parallelise, ie do you have one huge global matrix or a smaller matrix on each processor? Read up on parallel communication and sparse matrix formats - otherwise you will always be stuck around 100k cells. By the way, 100k x 100k is 10 BILLION NUMBERS: this is why you run out of memory
Is fvMatrix taking care of excluding the zero values on its own or do I need to provide more information more than just defining my matrix using the class?

When I run it in parallel at the moment I gather the pressure values onto the master node, perform my matrix multiplications and then scatter it back. Which means that it is the memory on the master node that is doing the job.

Cheers,
David
sippanspojk is offline   Reply With Quote

Old   June 2, 2020, 03:04
Default
  #6
Member
 
David Andersson
Join Date: Oct 2019
Posts: 46
Rep Power: 6
sippanspojk is on a distinguished road
Quote:
Originally Posted by superkelle View Post
So only for understanding, you are only storing some hundred to some thousand values of (boundary) patches for meshes of a bigger size?
I select the patches I am interested in (e.g. building, but not inlet, oulet, ground, etc.) and perform my computations on the faces on those patches. And I want to be able to do that on ~1M faces.

Cheers,
David
sippanspojk is offline   Reply With Quote

Reply

Tags
efficiency, function object, matrix, ram

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM] How to get the coordinates of velocity data at all cells and at all times vidyadhar ParaView 9 May 20, 2020 20:06
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08


All times are GMT -4. The time now is 11:16.