Skip to content

Reply To: Regarding Particle Checkpoints

#8466
jan
Participant

Dear Rookie,

1.
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
  sLattice.save( “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:


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

2.
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,
Jan

  • This reply was modified 1 month ago by jan.