|
[Sponsors] |
Performance issues with rad.correct() in a loop |
![]() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
![]() |
![]() |
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 17 ![]() |
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? |
|
![]() |
![]() |
![]() |
![]() |
#2 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 17 ![]() |
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); |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |