OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque > Class Template Referencefinal

functor to get pointwise momentum exchange on local lattice (block level) More...

#include <latticeMomentumExchangeForce.h>

+ Inheritance diagram for olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque >:
+ Collaboration diagram for olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque >:

Public Member Functions

 BlockLatticeMomentumExchangeForceLocal (BlockLattice< T, DESCRIPTOR > &blockLattice, const BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, particles::ParticleSystem< T, PARTICLETYPE > &particleSystem, const UnitConverter< T, DESCRIPTOR > &converter)
 
bool operator() (T output[], const int input[]) override
 

Detailed Description

template<typename T, typename DESCRIPTOR, typename PARTICLETYPE, bool useTorque = false>
class olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque >

functor to get pointwise momentum exchange on local lattice (block level)

Definition at line 146 of file latticeMomentumExchangeForce.h.

Constructor & Destructor Documentation

◆ BlockLatticeMomentumExchangeForceLocal()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , bool useTorque>
olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque >::BlockLatticeMomentumExchangeForceLocal ( BlockLattice< T, DESCRIPTOR > & blockLattice,
const BlockGeometry< T, DESCRIPTOR::d > & blockGeometry,
particles::ParticleSystem< T, PARTICLETYPE > & particleSystem,
const UnitConverter< T, DESCRIPTOR > & converter )

Definition at line 259 of file latticeMomentumExchangeForce.hh.

264 : BlockLatticePhysF<T,DESCRIPTOR>(blockLattice,converter,
265 useTorque ? utilities::dimensions::convert<DESCRIPTOR::d>::rotation : DESCRIPTOR::d),
266 _blockLattice(blockLattice),
267 _blockGeometry(blockGeometry),
268 _particleSystem(particleSystem)
269{
270 this->getName() = "localMomentumExchange";
271}
constexpr int d() any_platform

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR , typename PARTICLETYPE , bool useTorque>
bool olb::BlockLatticeMomentumExchangeForceLocal< T, DESCRIPTOR, PARTICLETYPE, useTorque >::operator() ( T output[],
const int input[] )
override

Definition at line 274 of file latticeMomentumExchangeForce.hh.

275{
276 using namespace descriptors;
277 const unsigned D = DESCRIPTOR::d;
278 const unsigned Drot = utilities::dimensions::convert<D>::rotation;
279
280 for (unsigned iDim=0; iDim<D; ++iDim) {
281 output[iDim] = 0.;
282 }
283
284 // iterate over all particles in _particleSystem
285 int _iP0 = 0;
286 for (std::size_t iP=_iP0; iP!=_particleSystem.size(); ++iP) {
287 auto particle = _particleSystem.get(iP);
288 auto circumRadius = particle.template getField<SURFACE,SINDICATOR>()->getCircumRadius();
289 auto position = particle.template getField<GENERAL,POSITION>();
290
291 LatticeR<DESCRIPTOR::d> start, end;
292 if ( particles::getBlockParticleIntersection(this->_blockGeometry, T(1.)/this->_converter.getPhysDeltaX(), start, end,
293 position, circumRadius) ){
294
295 Vector<T,D>tmpForce(0.);
296 PhysR<T,D> lever(0.);
298 lever, input, this->_blockGeometry,
299 this->_blockLattice, this->_converter, particle) ){
300
301 //Shift centre of mass (for oblique rotation) if offset provided
302 if constexpr ( PARTICLETYPE::template providesNested<SURFACE,COR_OFFSET>() ){
303 lever -= Vector<T,D> ( particle.template getField<SURFACE,COR_OFFSET>() );
304 }
305
306 //Calculate torque
307 const auto torque = particles::dynamics::torque_from_force<D,T>::calculate( tmpForce, lever );
308
309 //Add force and torque to output
310 if constexpr(!useTorque){
311 for (unsigned iDim=0; iDim<D; ++iDim) {
312 output[iDim] = tmpForce[iDim];
313 }
314 } else {
315 for (unsigned iRot=0; iRot<Drot; ++iRot) {
316 output[iRot] = torque[iRot];
317 }
318 }
319 }
320 }
321 }
322 return true;
323}
bool momentumExchangeAtSurfaceLocation(T momentumExchange[], PhysR< T, DESCRIPTOR::d > &lever, const LatticeR< DESCRIPTOR::d > &latticeRinner, const BlockGeometry< T, DESCRIPTOR::d > &blockGeometry, BlockLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter, Particle< T, PARTICLETYPE > &particle, const int bulkMaterial=1)
bool getBlockParticleIntersection(const BlockGeometry< T, D > &blockGeometry, T invDeltaX, LatticeR< D > &start, LatticeR< D > &end, Vector< T, D > position, T circumRadius)
static constexpr Vector< T, utilities::dimensions::convert< D >::rotation > calculate(Vector< T, D > force, PhysR< T, D > lever)

References olb::particles::dynamics::torque_from_force< D, T >::calculate(), olb::Vector< T, D >::data(), olb::particles::getBlockParticleIntersection(), and olb::particles::resolved::momentumExchangeAtSurfaceLocation().

+ Here is the call graph for this function:

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