walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T > Class Template Reference

Detailed Description

template<typename PdfField_T, typename BoundaryHandling_T, typename ParticleAccessor_T, typename Reconstructor_T>
class walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >

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

Due to the explicit mapping of particles 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 particles. It is activated via the 'optimizeForSmallObstacleFraction' argument in the constructor.

Note: A potential problem arises when the cell that is to be reconstructed, i.e. filled with fluid, is surrounded (given by the LBM stencil) by only boundary cells. Consequently, the successive calls to LBM will simulate a local system containing a single fluid cell surrounded by boundary cells with different velocity boundary conditions. This system is not divergence free (as required by the mass conservation equation) and will thus lead to mass loss/gain depending on the boundary conditions. This is a very rare case but if it happens, it will almost always lead to malicious oscillations in the density. Note that this can also happen if several cells are locally "trapped" by surrounding boundary cells. Such a case can not be detected easily and also not be curred easily. It has to be inspected whether the behavior arising from this issue leads to problems in real simulations.

#include <PdfReconstructionManager.h>

Public Types

using FlagField_T = typename BoundaryHandling_T::FlagField
 
using flag_t = typename BoundaryHandling_T::flag_t
 

Public Member Functions

 PdfReconstructionManager (const shared_ptr< StructuredBlockStorage > &blockStorage, const BlockDataID &pdfFieldID, const BlockDataID &boundaryHandlingID, const BlockDataID &particleFieldID, const shared_ptr< ParticleAccessor_T > &ac, const FlagUID &formerObstacle, const FlagUID &fluid, const shared_ptr< Reconstructor_T > &reconstructor, bool conserveMomentumWhenRestoring, const bool optimizeForSmallObstacleFraction=false)
 
void operator() (IBlock *const block)
 

Private Attributes

shared_ptr< StructuredBlockStorageblockStorage_
 
const BlockDataID pdfFieldID_
 
const BlockDataID boundaryHandlingID_
 
const BlockDataID particleFieldID_
 
shared_ptr< ParticleAccessor_T > ac_
 
shared_ptr< Reconstructor_T > reconstructor_
 
const FlagUID formerObstacle_
 
const FlagUID fluid_
 
bool conserveMomentumWhenRestoring_
 
const bool optimizeForSmallObstacleFraction_
 

Member Typedef Documentation

◆ flag_t

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
using walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::flag_t = typename BoundaryHandling_T::flag_t

◆ FlagField_T

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
using walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::FlagField_T = typename BoundaryHandling_T::FlagField

Constructor & Destructor Documentation

◆ PdfReconstructionManager()

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::PdfReconstructionManager ( const shared_ptr< StructuredBlockStorage > &  blockStorage,
const BlockDataID pdfFieldID,
const BlockDataID boundaryHandlingID,
const BlockDataID particleFieldID,
const shared_ptr< ParticleAccessor_T > &  ac,
const FlagUID &  formerObstacle,
const FlagUID &  fluid,
const shared_ptr< Reconstructor_T > &  reconstructor,
bool  conserveMomentumWhenRestoring,
const bool  optimizeForSmallObstacleFraction = false 
)
inline

Member Function Documentation

◆ operator()()

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
void walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::operator() ( IBlock *const  block)
inline

Member Data Documentation

◆ ac_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
shared_ptr<ParticleAccessor_T> walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::ac_
private

◆ blockStorage_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
shared_ptr<StructuredBlockStorage> walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::blockStorage_
private

◆ boundaryHandlingID_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const BlockDataID walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::boundaryHandlingID_
private

◆ conserveMomentumWhenRestoring_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
bool walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::conserveMomentumWhenRestoring_
private

◆ fluid_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const FlagUID walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::fluid_
private

◆ formerObstacle_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const FlagUID walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::formerObstacle_
private

◆ optimizeForSmallObstacleFraction_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const bool walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::optimizeForSmallObstacleFraction_
private

◆ particleFieldID_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const BlockDataID walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::particleFieldID_
private

◆ pdfFieldID_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
const BlockDataID walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::pdfFieldID_
private

◆ reconstructor_

template<typename PdfField_T , typename BoundaryHandling_T , typename ParticleAccessor_T , typename Reconstructor_T >
shared_ptr<Reconstructor_T> walberla::lbm_mesapd_coupling::PdfReconstructionManager< PdfField_T, BoundaryHandling_T, ParticleAccessor_T, Reconstructor_T >::reconstructor_
private

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