restart CFDEM

mbaldini's picture
Submitted by mbaldini on Thu, 10/20/2016 - 13:55

Hi all! I have a question regarding on how to restart a CFDEM simulation.

I want to set up a case that check if the simulation was run before and continue the simulation from the last time step.
I can read a restart file with the last configuration, but how do I check if all the particles were inserted during the first run of the simulation and if I need to insert the rest to achieve the specified number of particles?

PD: I am using the ErgunTestMPI_restart case as a template
Cheers,
Mauro

j-kerbl's picture

j-kerbl | Tue, 10/25/2016 - 16:49

Hi Mauro,

if you read the restart section of
http://www.cfdem.com/media/DEM/docu/fix_insert_pack.html
you'll see that during insertion, the fix should remember how much is already inserted.

However, you can use variable in LIGGGHTS to access the number of particles (or mass) in the domain, group or region.
http://www.cfdem.com/media/DEM/docu/variable.html
e.g.
variable nAtoms equal atoms
Then you could calculate the number of missing particles and insert these.

Cheers
Josef

kalei | Wed, 07/26/2017 - 07:39

Hallo,

I want to restart a cfdem calculation from the latest timestep. To do so I changed modified the controlDict to "startFrom latestTime". However, if perform Allrun the calculation starts from the beginning. What files do I need to modify to restart a cfdem calculation and what is the procedure to follow?

Best
kalei

alice's picture

alice | Wed, 07/26/2017 - 16:20

Hello kalei,
as mentioned by mauro, there is a test case (cfdemSolverPiso/ErgunTestMPI_restart) which does exactly what you're looking for. Please have a look at that case.
Apart from changing the starting time of the CFD calculation to the latest time step you'll also have to change the end time (which you probably did anyways). You'll then also have to create a new liggghts input file (which reads the old liggghts restart file and perhaps stops to insert further particles), and make sure that it is used (change the liggghts input file in the couplingProperties file). The also change the name of the liggghts restart file which will be written in the new calculation (in the liggghtsCommands file), otherwise the existing is overwritten, and you'll have to start over from the beginnning in case something goes wrong with the second calculation.
I think that's pretty much it, but as mentioned, please have a look at the restart case.
Cheers,
Alice

kalei | Thu, 08/17/2017 - 11:20

Dear Alice,

I tried to modify my case according to your description and the ErgungTestMPI_restart case. However I get the following error:
ERROR on proc 0: Cannot open restart file ../DEM/post/restart/liggghts.restart
Actually this file does not exist.

I also tried to run the ErgunTestMPI_restart case, however I get the following error:
--> FOAM FATAL ERROR: No times selected From function reconstructPar
I am using Liggghts 3.0.6 and CFDEM 2.9.0
Actually in this case I do not understand why an initialization is required?

Coming back to my problem I have two questions:
How can I make Liggghts to write a restart file?
Do I require a kind of initialization step, if I want to continue a calculation?

Best
Karl-Heinz

alice's picture

alice | Tue, 08/22/2017 - 15:28

Hello Karl-Heinz,
first of all I'd recommend to change to the latest CFDEMcoupling and LIGGGHTS versions (3.7.0). Just as a side-remark: if you decide to upgrade, please make sure that the versions of CFDEMcoupling and LIGGGHTS match since only versions with matching numbers are tested for compatibility.
Secondly: running LIGGGHTS-only initializations usually makes sense for cases, where you are not really interested in the very details of the first (necessary) step of a process. In ErgunTestMPI this would for example be the filling of the cylinder (necessary as a packed bed is required, not really interesting since the focus lies on the pressure drop within the bed). Pure LIGGGHTS calculations are faster which saves you computational time.

Generally one can differ between two scenarios in which restart files are written:
1) restart file from a pure LIGGGHTS calculation: an example for this is in the in.liggghts_init of ErgunTestMPI/DEM. Here only LIGGGHTS runs (for a defined number of time steps) and the restart file is written at the end.
2) restart file from a coupled calculation: an example for this is ErgunTestMPI_restart (in cfdemSolverPiso as well). In this case the creation of the restart files has to be triggered by CFDEMcoupling, as the liggghts input script is only executed once at the beginning of the calculation. Usually the restart file is updated at the end of each CFD writing interval, such that the created liggghts restart file and the latest CFD time data are in accordance (The command for writing the liggghts restart file can be found in the liggghtsCommands scripts in the consant folder of the CFD calculation).

I would suggest to use the Allrun scripts of the delivered case and then have a close look at the results.
Cheers,
Alice

kalei | Thu, 08/24/2017 - 07:21

Hello Alice,
thanks a lot, I think I got it solved. After introducing a Liggghts initialization run and generating an initial /restart/liggghts.restart file in my CFDEM case restart finally works.
Best
Karl-Heinz

mbaldini's picture

mbaldini | Tue, 10/17/2017 - 16:39

Hi all,

I succeed restarting simulations but now I came across with a problem. When the simulation restarts I get the following error message:

----------------------------------------------------------------------------------------------------------------------------------------------
ERROR: Fix insert/stream (id ins): 'start' step can not be before current step (../fix_insert.cpp:515)
-----------------------------------------------------------------------------------------------------------------------------------------------

And this is how my insert fix looks like:
fix ins all insert/stream seed 54325 distributiontemplate pdd verbose yes nparticles ${np1} particlerate ${p1rate} insert_every 75 overlapcheck yes all_in no vel constant ${vx0} 0.0 0.0 insertion_face inface

As you can see I am not using the "start" flag so particles should be inserted in the following timestep (default value of insert/stream). I don't know why it doesn't work because when the restart file is read the the "current" timestep is loaded and the insertion should continue. Thanks for your help.

Regards,
Mauro

alice's picture

alice | Wed, 10/18/2017 - 14:46

Hi Mauro,
is this the complete error message or warning?
Yo could try to put a
run 0
command before the insertion command, maybe this helps...
Cheers,
Alice