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

Performance issues with rad.correct() in a loop

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 19, 2016, 07:17
Default Performance issues with rad.correct() in a loop
  #1
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
I'm calling radiation.correct() in a loop a few thousand times and the performance of this function call is gradually getting worse. The other code I have written inside this loop is unaffected. The memory usage doesn't increase. I'm using a self-written radiation model that is a non-grey P1 model. Any idea what the reason might be? Can this be a memory related issue (page fault, needing to move memory on allocation, ...)?
How would one go about finding the reason and fixing it?
chriss85 is offline   Reply With Quote

Old   August 17, 2016, 10:16
Default
  #2
Senior Member
 
Join Date: Oct 2013
Posts: 397
Rep Power: 18
chriss85 will become famous soon enough
As a follow up on the first post, I noticed that the performance gets good again after increasing the time step. I have absolutely no idea why, but I suppose there is some book keeping (possibly related to objectRegistry?) happening that leads to slowdowns when an equation is solved very often in an iteration that gets cleared on the next time step. This is just a guess, no idea if it's the case, but my benchmarks clearly show much better performance if I increase the time step regularly in the iteration. Naturally, I don't want to have this effect outside of the loop, so I backup the original time step and revert to it like this:
Code:
TimeState tSCurrent(runTime);
loop();
runTime.TimeState::operator=(tSCurrent);
As far as I can tell, this completely restores the time state but I would be happy if anyone can confirm this and/or provide an explanation for this effect I'm seeing.
chriss85 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
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field lakeat OpenFOAM Community Contributions 58 December 23, 2021 02:36
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 11:04
[Gmsh] Problem with Gmsh nishant_hull OpenFOAM Meshing & Mesh Conversion 23 August 5, 2015 02:09
[CAD formats] my stl surface is seen as just a line rcastilla OpenFOAM Meshing & Mesh Conversion 2 January 6, 2010 01:30
NACA0012 geometry/design software needed Franny Main CFD Forum 13 July 7, 2007 15:57


All times are GMT -4. The time now is 00:50.