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

functor returns pointwise phys force for PSM dynamics More...

#include <latticePSMPhysForce2D.h>

+ Inheritance diagram for olb::BlockLatticePSMPhysForce2DMod< T, DESCRIPTOR >:
+ Collaboration diagram for olb::BlockLatticePSMPhysForce2DMod< T, DESCRIPTOR >:

Public Member Functions

 BlockLatticePSMPhysForce2DMod (BlockLattice< T, DESCRIPTOR > &blockLattice, BlockGeometry< T, 2 > &blockGeometry, const UnitConverter< T, DESCRIPTOR > &converter, IndicatorF2D< T > &shapeIndicator)
 
bool operator() (T output[], const int input[]) override
 has to be implemented for 'every' derived class
 
- Public Member Functions inherited from olb::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & getBlock ()
 Copy Constructor.
 
- Public Member Functions inherited from olb::BlockF2D< T >
virtual BlockStructureD< 2 > & getBlockStructure ()
 virtual destructor for defined behaviour
 
void setBlockStructure (BlockStructureD< 2 > *blockStructure)
 
BlockF2D< T > & operator- (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator+ (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator* (BlockF2D< T > &rhs)
 
BlockF2D< T > & operator/ (BlockF2D< T > &rhs)
 
- Public Member Functions inherited from olb::GenericF< T, int >
virtual ~GenericF ()=default
 
int getSourceDim () const
 read only access to member variable _m
 
int getTargetDim () const
 read only access to member variable _n
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
bool operator() (T output[])
 wrapper that call the pure virtual operator() (T output[], const S input[]) from above
 
bool operator() (T output[], int input0)
 
bool operator() (T output[], int input0, int input1)
 
bool operator() (T output[], int input0, int input1, int input2)
 
bool operator() (T output[], int input0, int input1, int input2, int input3)
 

Additional Inherited Members

- Public Types inherited from olb::GenericF< T, int >
using targetType
 
using sourceType
 
- Public Attributes inherited from olb::GenericF< T, int >
std::shared_ptr< GenericF< T, int > > _ptrCalcC
 memory management, frees resouces (calcClass)
 
- Protected Member Functions inherited from olb::BlockLatticePhysF2D< T, DESCRIPTOR >
 BlockLatticePhysF2D (BlockLattice< T, DESCRIPTOR > &blockLattice, const UnitConverter< T, DESCRIPTOR > &converter, int targetDim)
 
- Protected Member Functions inherited from olb::BlockLatticeF2D< T, DESCRIPTOR >
 BlockLatticeF2D (BlockLattice< T, DESCRIPTOR > &blockLattice, int targetDim)
 
- Protected Member Functions inherited from olb::BlockF2D< T >
 BlockF2D (BlockStructureD< 2 > &blockStructure, int targetDim)
 
 BlockF2D (int targetDim)
 
- Protected Member Functions inherited from olb::GenericF< T, int >
 GenericF (int targetDim, int sourceDim)
 
- Protected Attributes inherited from olb::BlockLatticePhysF2D< T, DESCRIPTOR >
const UnitConverter< T, DESCRIPTOR > & _converter
 
- Protected Attributes inherited from olb::BlockLatticeF2D< T, DESCRIPTOR >
BlockLattice< T, DESCRIPTOR > & _blockLattice
 
- Protected Attributes inherited from olb::BlockF2D< T >
BlockStructureD< 2 > * _blockStructure
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::BlockLatticePSMPhysForce2DMod< T, DESCRIPTOR >

functor returns pointwise phys force for PSM dynamics

Definition at line 62 of file latticePSMPhysForce2D.h.

Constructor & Destructor Documentation

◆ BlockLatticePSMPhysForce2DMod()

template<typename T , typename DESCRIPTOR >
olb::BlockLatticePSMPhysForce2DMod< T, DESCRIPTOR >::BlockLatticePSMPhysForce2DMod ( BlockLattice< T, DESCRIPTOR > & blockLattice,
BlockGeometry< T, 2 > & blockGeometry,
const UnitConverter< T, DESCRIPTOR > & converter,
IndicatorF2D< T > & shapeIndicator )

Definition at line 150 of file latticePSMPhysForce2D.hh.

155 : BlockLatticePhysF2D<T,DESCRIPTOR>(blockLattice, converter, 2), _shapeIndicator(shapeIndicator), _blockGeometry(blockGeometry)
156{
157 this->getName() = "physPSMForce";
158}
std::string & getName()
read and write access to name
Definition genericF.hh:51

References olb::GenericF< T, int >::getName().

+ Here is the call graph for this function:

Member Function Documentation

◆ operator()()

template<typename T , typename DESCRIPTOR >
bool olb::BlockLatticePSMPhysForce2DMod< T, DESCRIPTOR >::operator() ( T output[],
const int input[] )
overridevirtual

has to be implemented for 'every' derived class

Implements olb::GenericF< T, int >.

Definition at line 162 of file latticePSMPhysForce2D.hh.

163{
164 for (int i = 0; i < this->getTargetDim(); ++i) {
165 output[i] = T();
166 }
167
168 T epsilon = 1. - this->_blockLattice.get(input[0], input[1]).template getField<descriptors::POROSITY>();
169 if ((epsilon > 1e-5)) {
170
171 T posBlockGeo[2] = {0.};
172 bool insideShape[1];
173 _blockGeometry.getPhysR( posBlockGeo, {input[0], input[1]});
174 _shapeIndicator( insideShape, posBlockGeo );
175
176 if ( insideShape[0] == true ) {
177
178 T rho, u[DESCRIPTOR::d], u_s[DESCRIPTOR::d];
179
180 for (int i = 0; i < DESCRIPTOR::d; i++) {
181 u_s[i] = this->_blockLattice.get(input[0], input[1]).template getFieldComponent<descriptors::VELOCITY_SOLID>(i);
182 }
183 T paramA = this->_converter.getLatticeRelaxationTime() - 0.5;
184 // speed up paramB
185 T paramB = (epsilon * paramA) / ((1. - epsilon) + paramA);
186
187 T omega_s;
188 T omega = 1. / this->_converter.getLatticeRelaxationTime();
189
190 this->_blockLattice.get(input[0], input[1]).computeRhoU(rho, u);
191
192 const T uSqr_s = util::normSqr<T,DESCRIPTOR::d>(u_s);
193 T uSqr = util::normSqr<T,DESCRIPTOR::d>(u);
194 for (int iPop=0; iPop < DESCRIPTOR::q; ++iPop) {
195 //switch (mode) {
196 // case M2:
197 omega_s = (lbm< DESCRIPTOR>::equilibrium(iPop, rho, u_s, uSqr_s)
198 - this->_blockLattice.get(input[0], input[1])[iPop])
199 + (1 - omega)
200 * (this->_blockLattice.get(input[0], input[1])[iPop]
201 - lbm< DESCRIPTOR>::equilibrium(iPop, rho, u, uSqr));
202 // break;
203 // case M3:
204 // omega_s =
205 // (this->_blockLattice.get(input[0], input[1])[descriptors::opposite<DESCRIPTOR>(iPop)]
206 // - lbm< DESCRIPTOR>::equilibrium(
207 // descriptors::opposite<DESCRIPTOR>(iPop), rho, u_s, uSqr_s))
208 // - (this->_blockLattice.get(input[0], input[1])[iPop]
209 // - lbm< DESCRIPTOR>::equilibrium(iPop, rho, u_s, uSqr_s));
210 //}
211
212 for (int i = 0; i < this->getTargetDim(); ++i) {
213 output[i] -= descriptors::c<DESCRIPTOR>(iPop,i) * omega_s;
214 }
215 }
216
217 for (int i = 0; i < this->getTargetDim(); ++i) {
218 output[i] = this->_converter.getPhysForce(output[i] * paramB);
219 }
220 }
221 return true;
222 }
223}
Vector< T, D > getPhysR(LatticeR< D > latticeR)
BlockLattice< T, DESCRIPTOR > & _blockLattice
const UnitConverter< T, DESCRIPTOR > & _converter
int getTargetDim() const
read only access to member variable _n
Definition genericF.hh:45

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