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

Back-coupling is performed on the cell containing the particle and its neighbours within a cube of one lattice spacing, as per in Maier et al. More...

#include <backCouplingModels.h>

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

Public Member Functions

 CubicDeltaBackCouplingModel (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::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

int _range = 1
 
_delta [4][4][4] = { T() }
 
std::shared_ptr< SuperLatticeSmoothDiracDelta3D< T, Lattice > > _cubicDeltaFunctional
 
- 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::CubicDeltaBackCouplingModel< T, Lattice, Particle >

Back-coupling is performed on the cell containing the particle and its neighbours within a cube of one lattice spacing, as per in Maier et al.

(2017). Input parameters in attice units.

Definition at line 127 of file backCouplingModels.h.

Constructor & Destructor Documentation

◆ CubicDeltaBackCouplingModel()

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

Constructor.

Definition at line 162 of file backCouplingModels.hh.

167 : BaseNonLocalBackCouplingModel<T,Lattice,Particle>(converter, sLattice, sGeometry, overlap)
168{
169 _cubicDeltaFunctional = std::make_shared<SuperLatticeSmoothDiracDelta3D<T, Lattice> > (
170 this->_sLattice, this->_converter, this->_sGeometry );
171}
UnitConverter< T, Lattice > & _converter
SuperLattice< T, Lattice > & _sLattice
SuperGeometry< T, 3 > & _sGeometry
std::shared_ptr< SuperLatticeSmoothDiracDelta3D< T, Lattice > > _cubicDeltaFunctional

References olb::BaseBackCouplingModel< T, Lattice, Particle >::_converter, olb::CubicDeltaBackCouplingModel< T, Lattice, Particle >::_cubicDeltaFunctional, olb::BaseBackCouplingModel< T, Lattice, Particle >::_sGeometry, and olb::BaseBackCouplingModel< T, Lattice, Particle >::_sLattice.

Member Function Documentation

◆ operator()()

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

175{
176 int locIC = this->_sLattice.getLoadBalancer().loc(globic);
177
178 // reading the force from the value stored inside the particle
179 std::vector<T> physForceP = p->getStoreForce(); // physical force acting on the particle
180
181 T latticeForceP[3] = { physForceP[0] / this->_converter.getConversionFactorForce(),
182 physForceP[1] / this->_converter.getConversionFactorForce(),
183 physForceP[2] / this->_converter.getConversionFactorForce()
184 }; // dimensionless force acting on the particle
185
186 T physPosP[3] = { p->getPos()[0],
187 p->getPos()[1],
188 p->getPos()[2]
189 }; // particle's physical position
190
191 // particle's dimensionless position, rounded at neighbouring voxel
192 int latticeRoundedPosP[3] = {0, 0, 0};
193 this->_sLattice.getCuboidGeometry().get(globic).getLatticeR( latticeRoundedPosP, physPosP );
194
195 // smooth Dirac delta
196 this->_cubicDeltaFunctional->operator() (_delta, physPosP, globic);
197
198 T tempDelta = T();
199 FieldD<T,Lattice,descriptors::FORCE> F; // dimensionless smoothed force
200
201 for (int i = -_range; i <= _range; ++i) {
202 for (int j = -_range; j <= _range; ++j) {
203 for (int k = -_range; k <= _range; ++k) {
204 if (this->_sGeometry.getBlockGeometry(locIC).getMaterial(
205 latticeRoundedPosP[0] + i, latticeRoundedPosP[1] + j,
206 latticeRoundedPosP[2] + k) == material) {
207
208 tempDelta = _delta[i + _range][j + _range][k + _range];
209
210 F[0] = -latticeForceP[0] * tempDelta / (T)(subCycles);
211 F[1] = -latticeForceP[1] * tempDelta / (T)(subCycles);
212 F[2] = -latticeForceP[2] * tempDelta / (T)(subCycles);
213
214 this->_sLattice.getBlock(locIC).get(
215 latticeRoundedPosP[0] + i,
216 latticeRoundedPosP[1] + j,
217 latticeRoundedPosP[2] + k
218 ).template getFieldPointer<descriptors::FORCE>() += F;
219 }
220 }
221 }
222 }
223 return true;
224}
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:

Member Data Documentation

◆ _cubicDeltaFunctional

template<typename T , typename Lattice , template< typename V > class Particle>
std::shared_ptr<SuperLatticeSmoothDiracDelta3D<T, Lattice> > olb::CubicDeltaBackCouplingModel< T, Lattice, Particle >::_cubicDeltaFunctional
protected

Definition at line 139 of file backCouplingModels.h.

◆ _delta

template<typename T , typename Lattice , template< typename V > class Particle>
T olb::CubicDeltaBackCouplingModel< T, Lattice, Particle >::_delta[4][4][4] = { T() }
protected

Definition at line 138 of file backCouplingModels.h.

138{ T() };

◆ _range

template<typename T , typename Lattice , template< typename V > class Particle>
int olb::CubicDeltaBackCouplingModel< T, Lattice, Particle >::_range = 1
protected

Definition at line 137 of file backCouplingModels.h.


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