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

FluctuatingMRT: configure lattice model after resetting it

parent f5d2e900
Branches
Tags
No related merge requests found
......@@ -74,8 +74,9 @@ int main( int argc, char ** argv )
BlockDataID pdfFieldId = lbm::addPdfFieldToStorage( blocks, "pdf field", latticeModel, initialVelocity, real_t(1) );
BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >( blocks, "flag field" );
// create and initialize boundary handling
// create and initialize flag field
const FlagUID fluidFlagUID( "Fluid" );
geometry::setNonBoundaryCellsToDomain<FlagField_T>(*blocks, flagFieldId, fluidFlagUID);
// create time loop
SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps );
......@@ -86,7 +87,12 @@ int main( int argc, char ** argv )
// 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" )
<< Sweep( [&]( IBlock * block ){ block->getData< PdfField_T >( pdfFieldId )->resetLatticeModel( latticeModel ); }, "set RNG counter" );
<< Sweep( [&]( IBlock * block ){
auto field = block->getData< PdfField_T >( pdfFieldId );
field->resetLatticeModel( latticeModel );
field->latticeModel().configure( *block, *blocks );
WALBERLA_ASSERT_EQUAL( field->latticeModel().time_step_, latticeModel.time_step_ );
}, "set RNG counter" );
// add LBM sweep and communication to time loop
timeloop.add() << BeforeFunction( communication, "communication" )
<< Sweep( LatticeModel_T::Sweep( pdfFieldId ), "LB stream & collide" );
......
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