walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers > Class Template Reference

Detailed Description

template<typename LatticeModel_T, typename BoundaryHandling_T, typename Reconstructer_T, bool conserveMomentum = false, bool includeGhostLayers = false>
class walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >

Class to manage the reconstruction of PDFs that is needed when cells are becoming uncovered by moving obstacles.

Due to the explicit mapping of bodies into the fluid domain via flags, the PDFs of cells that turned from obstacle to fluid are missing and must be reconstructed in order to continue with the simulation. This class is to be used as a sweep in a LBM simulation with moving obstacles and calls for each cell that is tagged as 'formerObstacle' the specified reconstructor (see Reconstructor.h for the available variants). After the successful reconstruction of all PDFs, the flags are updated to 'fluid'. For small obstacle fractions, an optimized variant is available that only looks for 'formerObstacle' cells in the vicinity of available bodies. It is activated via the 'optimizeForSmallObstacleFraction' argument in the constructor.

The 'movingBodySelectorFct' can be used to decide which bodies should be check for reconstruction (only used when 'optimizeForSmallObstacleFraction' is chosen).

#include <PDFReconstruction.h>

Public Types

using PdfField_T = lbm::PdfField< LatticeModel_T >
 
using FlagField_T = typename BoundaryHandling_T::FlagField
 
using flag_t = typename BoundaryHandling_T::flag_t
 
using BodyField_T = Field< pe::BodyID, 1 >
 

Public Member Functions

 PDFReconstruction (const shared_ptr< StructuredBlockStorage > &blockStorage, const BlockDataID &pdfFieldID, const BlockDataID &boundaryHandlingID, const BlockDataID &bodyStorageID, const shared_ptr< pe::BodyStorage > &globalBodyStorage, const BlockDataID &bodyFieldID, const Reconstructer_T &reconstructor, const FlagUID &formerObstacle, const FlagUID &fluid, const std::function< bool(pe::BodyID)> &movingBodySelectorFct=selectRegularBodies, const bool optimizeForSmallObstacleFraction=false)
 
void operator() (IBlock *const block)
 

Private Member Functions

void reconstructPDFsInCells (const CellInterval &cells, IBlock *const block, PdfField_T *pdfField, FlagField_T *flagField, BodyField_T *bodyField, const flag_t &formerObstacle)
 
void updateFlags (const CellInterval &cells, BoundaryHandling_T *boundaryHandling, FlagField_T *flagField, BodyField_T *bodyField, const flag_t &formerObstacle, const flag_t &fluid)
 

Private Attributes

shared_ptr< StructuredBlockStorageblockStorage_
 
const BlockDataID pdfFieldID_
 
const BlockDataID boundaryHandlingID_
 
const BlockDataID bodyStorageID_
 
shared_ptr< pe::BodyStorageglobalBodyStorage_
 
const BlockDataID bodyFieldID_
 
Reconstructer_T reconstructor_
 
const FlagUID formerObstacle_
 
const FlagUID fluid_
 
std::function< bool(pe::BodyID)> movingBodySelectorFct_
 
const bool optimizeForSmallObstacleFraction_
 

Member Typedef Documentation

◆ BodyField_T

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
using walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::BodyField_T = Field<pe::BodyID, 1>

◆ flag_t

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
using walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::flag_t = typename BoundaryHandling_T::flag_t

◆ FlagField_T

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
using walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::FlagField_T = typename BoundaryHandling_T::FlagField

◆ PdfField_T

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
using walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::PdfField_T = lbm::PdfField<LatticeModel_T>

Constructor & Destructor Documentation

◆ PDFReconstruction()

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::PDFReconstruction ( const shared_ptr< StructuredBlockStorage > &  blockStorage,
const BlockDataID pdfFieldID,
const BlockDataID boundaryHandlingID,
const BlockDataID bodyStorageID,
const shared_ptr< pe::BodyStorage > &  globalBodyStorage,
const BlockDataID bodyFieldID,
const Reconstructer_T &  reconstructor,
const FlagUID &  formerObstacle,
const FlagUID &  fluid,
const std::function< bool(pe::BodyID)> &  movingBodySelectorFct = selectRegularBodies,
const bool  optimizeForSmallObstacleFraction = false 
)
inline

Member Function Documentation

◆ operator()()

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum, bool includeGhostLayers>
void walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::operator() ( IBlock *const  block)

◆ reconstructPDFsInCells()

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
void walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::reconstructPDFsInCells ( const CellInterval cells,
IBlock *const  block,
PdfField_T pdfField,
FlagField_T flagField,
BodyField_T bodyField,
const flag_t formerObstacle 
)
inlineprivate

◆ updateFlags()

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
void walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::updateFlags ( const CellInterval cells,
BoundaryHandling_T boundaryHandling,
FlagField_T flagField,
BodyField_T bodyField,
const flag_t formerObstacle,
const flag_t fluid 
)
inlineprivate

Member Data Documentation

◆ blockStorage_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
shared_ptr<StructuredBlockStorage> walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::blockStorage_
private

◆ bodyFieldID_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const BlockDataID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::bodyFieldID_
private

◆ bodyStorageID_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const BlockDataID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::bodyStorageID_
private

◆ boundaryHandlingID_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const BlockDataID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::boundaryHandlingID_
private

◆ fluid_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const FlagUID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::fluid_
private

◆ formerObstacle_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const FlagUID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::formerObstacle_
private

◆ globalBodyStorage_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
shared_ptr<pe::BodyStorage> walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::globalBodyStorage_
private

◆ movingBodySelectorFct_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
std::function<bool(pe::BodyID)> walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::movingBodySelectorFct_
private

◆ optimizeForSmallObstacleFraction_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const bool walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::optimizeForSmallObstacleFraction_
private

◆ pdfFieldID_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
const BlockDataID walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::pdfFieldID_
private

◆ reconstructor_

template<typename LatticeModel_T , typename BoundaryHandling_T , typename Reconstructer_T , bool conserveMomentum = false, bool includeGhostLayers = false>
Reconstructer_T walberla::pe_coupling::PDFReconstruction< LatticeModel_T, BoundaryHandling_T, Reconstructer_T, conserveMomentum, includeGhostLayers >::reconstructor_
private

The documentation for this class was generated from the following file: