Skip to content

Reply To: Regarding Particle Checkpoints


Dear Rookie,

The mentioned code should save and then immediately load the saved fluid data. However, that seems unnecessary, because you could just keep using the data that is already stored in the SuperLattice. Instead, you could load the solutions if they exist and then skip the fluid calculations:

if ( !( superLattice.load(  “bstep3d.checkpoint”  ) ) ) {
  // Calculate fluid solution

  // And save afterwards “bstep3d.checkpoint” );
else {
  // Do something with the saved fluid data

The if condition is important here because it ensures that the fluid calculations are only performed if the checkpoint data doesn’t exist.
In your case, if you’d like to always load the fluid solution and then do the same calculations again from that point, for example to divide long simulations into shorter segments, this should work:

// Calculate fluid solution (main loop)
// And save afterwards “bstep3d.checkpoint” );
// Terminate program and restart

Of course, you can also do the fluid calculation at the same time. To do this you just have to call superLattice.collideAndStream(); again (and maybe also setBoundaryValues( superLattice, converter, iT, fluidMaxPhysT, superGeometry ); if necessary). Note, however, that without back-coupling the fluid velocity doesn’t really change anymore, so it seems unnecessary to keep calculating it. Only if you add some dynamic boundary conditions it might be necessary.

Best regards,

  • This reply was modified 1 month ago by jan.