Restart file write time bug?

Submitted by Jiri on Sun, 11/04/2018 - 00:42

I have problems with controling write interval of restart file during the simulation, I set a writeLiggghtsProps to write a restart file every cfd write step. The first restart file is created at writeIterval, however, after that there is created another restart file every single CFD time step.

I set writeInterval in controlDict to 1e-2s, CFD time step is 5e-5s. First file is correctly created: liggghts.restartCFDEM_0.01, however than a huge number of files is generated, liggghts.restartCFDEM_0.0100500, liggghts.restartCFDEM_0.010100 .. and so on, at next every CFD time step.

Do you have any idea what could cause that strange behaviour? Is it a bug in the CFD-DEM coupling? I use OF5 and current release of CFDEM and Liggghts.

Any answer would be helpful, thx.

Best regards,

Setting of my writeLiggghtsProps:
writeLast off;
//path "../DEM"; // optional setting
writeName "post/restart/liggghts.restartCFDEM";
overwrite off; //on;

Fei Xiao | Thu, 03/21/2019 - 03:03

Hi, Jiri.
Have you solved this problem? I met the same situation. I only want to save the restarDEM files as the same write time step as the CFD. While the DEM write the restar files as the every step of CFD. Large amounts of useless files are accumulated in DEM. Is there any setting or method to solve this problem?
Best regard
Fei Xiao

Rachel | Thu, 11/21/2019 - 18:39

Hi, I run into the same problem, have you solved this problem? Could you please give me any clues? Thanks so much!

JensM | Tue, 03/10/2020 - 13:54

Hi all,

I also encountered the problem of having produced too many restart files when working with CFDEM 3.8 and OpenFoam 5.0. The problem occurs after the simulation surpasses the first writeInterval. Afterwards, restart files are written every CFD-timestep. This issue persists even if one substitutes the writeLiggghts command in the the liggghtsCommands-File with an analogous execute command.

Since this error did not occur in an older version of CFDEM (3.6), I compared the source code and could find a solution to the problem:
In the newer version of CFDEM the accordance of the simulation time with the writeInterval in the controlDict is done by a writeTimePassed_ variable, that is set in the cfdemCloud.C file. in line 709.

if(!writeTimePassed_ && mesh_.time().outputTime()) writeTimePassed_=true;

However, this Boolean is not reset to its ground state (false) in progress of the simulation. Thus, the condition to execute a command is always true.
Substituting this line with the expression

If(!writeTimePassed_ && mesh_.time().outputTime())
{ writeTimePassed_=false;}

and recompiling the software resolves the problem. Perhaps this should be fixed in the CFDEM source code as well.