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

Redistribution of cells on processors during simulation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 13, 2019, 08:09
Default Redistribution of cells on processors during simulation
  #1
Member
 
Join Date: May 2016
Posts: 39
Rep Power: 9
dzordz is on a distinguished road
Dear foamers,

I am dealing with a transient problem which needs adaptive meshing to manage the calculation. The issue is that the number of cells grows enormously from the start of the simulation till the end. Therefore the decomposition I make via decomposePar and scotch pre-run (time 0) is not gonna be an optimal after some elapsed time in fact the calculation time needed from one writing to the other will grow due to the fact that particular core will receive more cells and the others will have to wait for it to finish. Ultimately this problem grows with time.

My question is the following. Does there exist an utility that would redistribute cells during the run of the simulation and where one can specify at what intervals redistribution should happen? I can't seem to find such capability anywhere.

At the moment I have a bash code that stops simulation multiple times at specific intervals, redistributes the cells and reruns the sim. But the times have to be put in manually and since they are different for different simulations this becomes unmanageable.

My idea would be to somehow put it in controlDict as sort of a codded function that would basically do the following (it would literally call the utilities at specific times):

1) every n-th writeInterval do:
2) reconstructParMest --> saves your mesh for each time step
3) reconstructPar --> saves the fields for each time step
4) decompose -force --> decomposes mesh & fields for latest time step
5) continue with simulation with more optimal distribution

I have seen libraries and codes being called in controlDict but not utilities. Is this possible?

Thanks!
dzordz is offline   Reply With Quote

Old   February 13, 2019, 08:45
Default
  #2
Senior Member
 
Andrew Somorjai
Join Date: May 2013
Posts: 175
Rep Power: 13
massive_turbulence is on a distinguished road
Quote:
Originally Posted by dzordz View Post
Dear foamers,

I am dealing with a transient problem which needs adaptive meshing to manage the calculation. The issue is that the number of cells grows enormously from the start of the simulation till the end. Therefore the decomposition I make via decomposePar and scotch pre-run (time 0) is not gonna be an optimal after some elapsed time in fact the calculation time needed from one writing to the other will grow due to the fact that particular core will receive more cells and the others will have to wait for it to finish. Ultimately this problem grows with time.

My question is the following. Does there exist an utility that would redistribute cells during the run of the simulation and where one can specify at what intervals redistribution should happen? I can't seem to find such capability anywhere.

At the moment I have a bash code that stops simulation multiple times at specific intervals, redistributes the cells and reruns the sim. But the times have to be put in manually and since they are different for different simulations this becomes unmanageable.

My idea would be to somehow put it in controlDict as sort of a codded function that would basically do the following (it would literally call the utilities at specific times):

1) every n-th writeInterval do:
2) reconstructParMest --> saves your mesh for each time step
3) reconstructPar --> saves the fields for each time step
4) decompose -force --> decomposes mesh & fields for latest time step
5) continue with simulation with more optimal distribution

I have seen libraries and codes being called in controlDict but not utilities. Is this possible?

Thanks!
Sounds like load balancing? See if this thread helps Run-Time Parallel Load Balancing

I only know of the term, never used more than Scotch myself.
massive_turbulence is offline   Reply With Quote

Old   February 14, 2019, 06:39
Default
  #3
Member
 
Join Date: May 2016
Posts: 39
Rep Power: 9
dzordz is on a distinguished road
If anyone is interested I solved the load balancing problem and incorporated it in ofv1812 with an easy added function in controlDict. This functionality does not compare the loads and decide when to re-balance based on criteria given (would need a more complex coding, but I do not need this at the moment). It just re-balances it on user specified bases every n-th write time.

Code:
functions
{
redistribution
{
    libs        ("libutilityFunctionObjects.so");

    type coded;
    writeControl    writeTime;
    writeInterval     2;
    name redistribution;
    codeWrite
    #{
    system ("reconstructParMesh");
    system ("reconstructPar");    
    system ("decomposePar -force");
    #};
}
}
Hopefully something like this will be useful to someone.


UPDATE: This seems to NOT work at large number of processors. The re-composition and decomposition are also made many times (basically equals to number of processors set). All this results in some time steps missing fields files. This would be workable if somehow system ("reconstructParMesh"); could be forced to be performed on 1 processors, while others do nothing. Is such a thing possible?

Cheers

Last edited by dzordz; February 14, 2019 at 08:05.
dzordz 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
LES simulation - Not able to bring down M value of every cell below 0.1 shettysds STAR-CCM+ 1 February 7, 2018 19:39
How much can the sizes of cells vary within one simulation domain? wildfire230 OpenFOAM Running, Solving & CFD 3 December 29, 2017 02:59
RAM for large number of cells in CFD Simulation saketh Main CFD Forum 3 September 17, 2017 13:26
Different results between 3 processors simulation and 7 processors simulation mfmohdyasin OpenFOAM Programming & Development 1 August 27, 2012 04:07
physical boundary error!! kris Siemens 2 August 3, 2005 00:32


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