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

Naive way. More...

#include <twoWayHelperFunctionals.h>

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

Public Member Functions

 NaiveMomentumExchange (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice, std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > interpLatticeDensity)
 Constructor.
 
virtual bool operator() (T gF[], T latticeVelF[], T latticeVelP[], T physPosP[], int latticeRoundedP[], int globic) override
 Computes the momentum transfer from fluid to particle.
 
- Public Member Functions inherited from olb::TwoWayHelperFunctional< T, Lattice >
virtual ~TwoWayHelperFunctional ()
 

Additional Inherited Members

- Protected Member Functions inherited from olb::TwoWayHelperFunctional< T, Lattice >
 TwoWayHelperFunctional (UnitConverter< T, Lattice > &converter, SuperLattice< T, Lattice > &sLattice)
 Constructor.
 
- Protected Attributes inherited from olb::TwoWayHelperFunctional< T, Lattice >
UnitConverter< T, Lattice > & _converter
 
SuperLattice< T, Lattice > & _sLattice
 
std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > _interpLatticeDensity
 
std::shared_ptr< SuperLatticeInterpPhysVelocity3D< T, Lattice > > _interpLatticeVelocity
 

Detailed Description

template<typename T, typename Lattice>
class olb::NaiveMomentumExchange< T, Lattice >

Naive way.

Definition at line 61 of file twoWayHelperFunctionals.h.

Constructor & Destructor Documentation

◆ NaiveMomentumExchange()

template<typename T , typename Lattice >
olb::NaiveMomentumExchange< T, Lattice >::NaiveMomentumExchange ( UnitConverter< T, Lattice > & converter,
SuperLattice< T, Lattice > & sLattice,
std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > interpLatticeDensity )

Constructor.

Definition at line 54 of file twoWayHelperFunctionals.hh.

58 : TwoWayHelperFunctional<T, Lattice>(converter, sLattice)
59{
60 this->_interpLatticeDensity = interpLatticeDensity;
61}
std::shared_ptr< SuperLatticeInterpDensity3Degree3D< T, Lattice > > _interpLatticeDensity

References olb::TwoWayHelperFunctional< T, Lattice >::_interpLatticeDensity.

Member Function Documentation

◆ operator()()

template<typename T , typename Lattice >
bool olb::NaiveMomentumExchange< T, Lattice >::operator() ( T gF[],
T latticeVelF[],
T latticeVelP[],
T physPosP[],
int latticeRoundedP[],
int globic )
overridevirtual

Computes the momentum transfer from fluid to particle.

Implements olb::TwoWayHelperFunctional< T, Lattice >.

Definition at line 64 of file twoWayHelperFunctionals.hh.

67{
68 T magU = util::sqrt( util::pow(latticeVelF[0] - latticeVelP[0],2) +
69 util::pow(latticeVelF[1] - latticeVelP[1],2) +
70 util::pow(latticeVelF[2] - latticeVelP[2],2) );
71
72 int locIC = this->_sLattice.getLoadBalancer().loc(globic);
73 T rhoL = this->_sLattice.getBlock(locIC).get(
74 latticeRoundedP[0],
75 latticeRoundedP[1],
76 latticeRoundedP[2]).computeRho();
77
78 gF[0] = rhoL * magU;
79 gF[1] = rhoL * magU;
80 gF[2] = rhoL * magU;
81
82 return true;
83}
BlockLattice< T, DESCRIPTOR > & getBlock(int locC)
Return BlockLattice with local index locC.
LoadBalancer< T > & getLoadBalancer()
Read and write access to the load balancer.
SuperLattice< T, Lattice > & _sLattice
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

References olb::util::pow(), and olb::util::sqrt().

+ Here is the call graph for this function:

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