OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle > Class Template Reference

Class for a generic non-local back-coupling model (but this is NOT VIRTUAL!), viz., momentum coupling from particle to fluid, for model more complicated that CubicDeltaBackCouplingModel. More...

#include <backCouplingModels.h>

+ Inheritance diagram for olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >:
+ Collaboration diagram for olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >:

Public Member Functions

 NonLocalBaseBackCouplingModel (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, std::shared_ptr< SmoothingFunctional< T, Lattice > > smoothingFunctional, int overlap)
 Constructor.
 
virtual bool operator() (Particle< T > *p, int globic, int material, int subCycles=1) override
 Class operator to apply the coupling.
 
- Public Member Functions inherited from olb::BaseNonLocalBackCouplingModel< T, Lattice, Particle >
virtual void communicate () override
 Communicates POPULATION and FORCE fields if the model is non-local.
 
 BaseNonLocalBackCouplingModel (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, int overlap)
 Constructor.
 
- Public Member Functions inherited from olb::BaseBackCouplingModel< T, Lattice, Particle >
virtual void resetExternalField (int material) override
 Resets external field.
 

Protected Attributes

std::shared_ptr< SmoothingFunctional< T, Lattice > > _smoothingFunctional
 
- Protected Attributes inherited from olb::BaseBackCouplingModel< T, Lattice, Particle >
UnitConverter< T, Lattice > & _converter
 
SuperGeometry< T, 3 > & _sGeometry
 
SuperLattice< T, Lattice > & _sLattice
 
SuperCommunicator< T, SuperLattice< T, Lattice > > _commPopulation
 

Additional Inherited Members

- Protected Member Functions inherited from olb::BaseBackCouplingModel< T, Lattice, Particle >
 BaseBackCouplingModel (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, int overlap)
 Constructor.
 

Detailed Description

template<typename T, typename Lattice, template< typename V > class Particle>
class olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >

Class for a generic non-local back-coupling model (but this is NOT VIRTUAL!), viz., momentum coupling from particle to fluid, for model more complicated that CubicDeltaBackCouplingModel.

It reproduces the characteristics (viz., smoothing) of an input forward coupling model. Input parameters in attice units.

Definition at line 148 of file backCouplingModels.h.

Constructor & Destructor Documentation

◆ NonLocalBaseBackCouplingModel()

template<typename T , typename Lattice , template< typename V > class Particle>
olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >::NonLocalBaseBackCouplingModel ( UnitConverter< T, Lattice > & converter,
SuperLattice< T, Lattice > & sLattice,
SuperGeometry< T, 3 > & sGeometry,
std::shared_ptr< SmoothingFunctional< T, Lattice > > smoothingFunctional,
int overlap )

Constructor.

Definition at line 230 of file backCouplingModels.hh.

236 : BaseNonLocalBackCouplingModel<T,Lattice,Particle>(converter, sLattice, sGeometry, overlap),
237 _smoothingFunctional(smoothingFunctional)
238{}
std::shared_ptr< SmoothingFunctional< T, Lattice > > _smoothingFunctional

Member Function Documentation

◆ operator()()

template<typename T , typename Lattice , template< typename V > class Particle>
bool olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >::operator() ( Particle< T > * p,
int globic,
int material,
int subCycles = 1 )
overridevirtual

Class operator to apply the coupling.

Implements olb::BackCouplingModel< T, Particle >.

Definition at line 241 of file backCouplingModels.hh.

242{
243 int locIC = this->_sLattice.getLoadBalancer().loc(globic);
244
245 // reading the force from the value stored inside the particle
246 std::vector<T> physForceP = p->getStoreForce(); // physical force acting on the particle
247 T latticeForceP[3] = { physForceP[0] / this->_converter.getConversionFactorForce(),
248 physForceP[1] / this->_converter.getConversionFactorForce(),
249 physForceP[2] / this->_converter.getConversionFactorForce()
250 }; // dimensionless force acting on the particle
251
252 // Updating force through voxels within kernel smoothing length from the bubble's position
253 for (auto&& i : this->_smoothingFunctional->getData()) {
254
255 // Updating iterated voxel
256 if ( this->_sGeometry.getBlockGeometry(locIC).getMaterial(i.latticePos[0], i.latticePos[1], i.latticePos[2]) == material ) {
257
258 // Weighted force acting on the iterated voxel
259 FieldD<T,Lattice,descriptors::FORCE> F{
260 -latticeForceP[0] * i.weight / (T)(subCycles),
261 -latticeForceP[1] * i.weight / (T)(subCycles),
262 -latticeForceP[2] * i.weight / (T)(subCycles)
263 }; // dimensionless smoothed force
264
265 this->_sLattice.getBlock(locIC).get(
266 i.latticePos[0], i.latticePos[1], i.latticePos[2]
267 ).template getFieldPointer<descriptors::FORCE>() += F;
268 }
269 }
270 return true;
271}
UnitConverter< T, Lattice > & _converter
SuperLattice< T, Lattice > & _sLattice
SuperGeometry< T, 3 > & _sGeometry
BlockGeometry< T, D > & getBlockGeometry(int locIC)
Read and write access to a single block geometry.
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
constexpr T getConversionFactorForce() const
access (read-only) to private member variable

References olb::Vector< T, D >::getBlock().

+ Here is the call graph for this function:

Member Data Documentation

◆ _smoothingFunctional

template<typename T , typename Lattice , template< typename V > class Particle>
std::shared_ptr<SmoothingFunctional<T, Lattice> > olb::NonLocalBaseBackCouplingModel< T, Lattice, Particle >::_smoothingFunctional
protected

Definition at line 159 of file backCouplingModels.h.


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