Skip to content
Snippets Groups Projects
Commit f5d2e900 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Fluctuating MRT: propagate the RNG counter to all copies of the lattice model

parent cf2af49a
No related merge requests found
......@@ -84,9 +84,11 @@ int main( int argc, char ** argv )
blockforest::communication::UniformBufferedScheme< CommunicationStencil_T > communication( blocks );
communication.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldId ) );
// add LBM sweep and communication to time loop
// set the RNG counter to match the time step and propagate it to the fields' copies of the lattice model
timeloop.add() << BeforeFunction( [&](){ latticeModel.time_step_ = uint32_c(timeloop.getCurrentTimeStep()); }, "set RNG counter" )
<< BeforeFunction( communication, "communication" )
<< Sweep( [&]( IBlock * block ){ block->getData< PdfField_T >( pdfFieldId )->resetLatticeModel( latticeModel ); }, "set RNG counter" );
// add LBM sweep and communication to time loop
timeloop.add() << BeforeFunction( communication, "communication" )
<< Sweep( LatticeModel_T::Sweep( pdfFieldId ), "LB stream & collide" );
// LBM stability check
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment