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

Back-coupling is performed only on the cell containing the particle. More...

#include <backCouplingModels.h>

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

Public Member Functions

 LocalBackCouplingModel (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, SuperGeometry< T, 3 > &sGeometry, 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::BaseLocalBackCouplingModel< T, Lattice, Particle >
virtual void communicate () override
 Communicates POPULATION and FORCE fields if the model is non-local.
 
 BaseLocalBackCouplingModel (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.
 

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.
 
- 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
 

Detailed Description

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

Back-coupling is performed only on the cell containing the particle.

Input parameters in attice units.

Definition at line 111 of file backCouplingModels.h.

Constructor & Destructor Documentation

◆ LocalBackCouplingModel()

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

Constructor.

Definition at line 111 of file backCouplingModels.hh.

116 : BaseLocalBackCouplingModel<T,Lattice,Particle>(converter, sLattice, sGeometry, overlap)
117{}

Member Function Documentation

◆ operator()()

template<typename T , typename Lattice , template< typename V > class Particle>
bool olb::LocalBackCouplingModel< 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 120 of file backCouplingModels.hh.

121{
122 int locIC = this->_sLattice.getLoadBalancer().loc(globic);
123
124 // reading the force from the value stored inside the particle
125 std::vector<T> physForceP = p->getStoreForce(); // physical force acting on the particle
126
127 T latticeForceP[3] = { physForceP[0] / this->_converter.getConversionFactorForce(),
128 physForceP[1] / this->_converter.getConversionFactorForce(),
129 physForceP[2] / this->_converter.getConversionFactorForce()
130 }; // dimensionless force acting on the particle
131
132 T physPosP[3] = { (p->getPos()[0]),
133 (p->getPos()[1]),
134 (p->getPos()[2])
135 }; // particle's physical position
136
137 // particle's dimensionless position, rounded at neighbouring voxel
138 int latticeRoundedPosP[3] = {0, 0, 0};
139 this->_sLattice.getCuboidGeometry().get(globic).getLatticeR( latticeRoundedPosP, physPosP );
140
141 if (this->_sGeometry.getBlockGeometry(locIC).getMaterial( latticeRoundedPosP[0], latticeRoundedPosP[1], latticeRoundedPosP[2] ) == material) {
142 FieldD<T,Lattice,descriptors::FORCE> F{
143 -latticeForceP[0] / (T)(subCycles),
144 -latticeForceP[1] / (T)(subCycles),
145 -latticeForceP[2] / (T)(subCycles)
146 }; // dimensionless smoothed force
147
148 this->_sLattice.getBlock(locIC).get(
149 latticeRoundedPosP[0],
150 latticeRoundedPosP[1],
151 latticeRoundedPosP[2]
152 ).template getFieldPointer<descriptors::FORCE>() += F;
153 }
154
155 return true;
156}
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.
CuboidGeometry< T, D > & getCuboidGeometry()
Read and write access to cuboid geometry.
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:

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