OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR > Class Template Reference

This class computes a partial slip BC in 3D. More...

#include <boundaryPostProcessors3D.h>

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

Public Member Functions

 PartialSlipBoundaryProcessor3D (T tuner_, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
 
int extent () const override
 Extent of application area (0 for purely local operations)
 
int extent (int whichDirection) const override
 Extent of application area along a direction (0 or 1)
 
void process (BlockLattice< T, DESCRIPTOR > &blockLattice) override
 Execute post-processing step.
 
void processSubDomain (BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor3D< T, DESCRIPTOR >
 PostProcessor3D ()
 
virtual ~PostProcessor3D ()
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
int getPriority () const
 read only access to priority
 

Additional Inherited Members

- Protected Attributes inherited from olb::PostProcessor3D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

This class computes a partial slip BC in 3D.

Definition at line 164 of file boundaryPostProcessors3D.h.

Constructor & Destructor Documentation

◆ PartialSlipBoundaryProcessor3D()

template<typename T , typename DESCRIPTOR >
olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR >::PartialSlipBoundaryProcessor3D ( T tuner_,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
int discreteNormalX_,
int discreteNormalY_,
int discreteNormalZ_ )

Definition at line 403 of file boundaryPostProcessors3D.hh.

405 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_), tuner(tuner_)
406{
407 this->getName() = "PartialSlipBoundaryProcessor3D";
408 OLB_PRECONDITION(x0==x1 || y0==y1 || z0==z1);
409 reflectionPop[0] = 0;
410 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
411 reflectionPop[iPop] = 0;
412 // iPop are the directions which pointing into the fluid, discreteNormal is pointing outwarts
413 if (descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ < 0) {
414 //std::cout << "-----" <<std::endl;
415 int mirrorDirection0;
416 int mirrorDirection1;
417 int mirrorDirection2;
418 int mult = 2 / (discreteNormalX*discreteNormalX + discreteNormalY*discreteNormalY + discreteNormalZ*discreteNormalZ);
419
420 mirrorDirection0 = (descriptors::c<DESCRIPTOR>(iPop,0) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ)*discreteNormalX);
421
422 mirrorDirection1 = (descriptors::c<DESCRIPTOR>(iPop,1) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ)*discreteNormalY);
423 mirrorDirection2 = (descriptors::c<DESCRIPTOR>(iPop,2) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ)*discreteNormalZ);
424
425 // bounce back for the case discreteNormalX = discreteNormalY = discreteNormalZ = 1, that is mult=0
426 if (mult == 0) {
427 mirrorDirection0 = -descriptors::c<DESCRIPTOR>(iPop,0);
428 mirrorDirection1 = -descriptors::c<DESCRIPTOR>(iPop,1);
429 mirrorDirection2 = -descriptors::c<DESCRIPTOR>(iPop,2);
430 }
431
432 // computes mirror jPop
433 for (reflectionPop[iPop] = 1; reflectionPop[iPop] < DESCRIPTOR::q ; reflectionPop[iPop]++) {
434 if (descriptors::c<DESCRIPTOR>(reflectionPop[iPop],0)==mirrorDirection0 && descriptors::c<DESCRIPTOR>(reflectionPop[iPop],1)==mirrorDirection1 && descriptors::c<DESCRIPTOR>(reflectionPop[iPop],2)==mirrorDirection2) {
435 break;
436 }
437 }
438 //std::cout <<iPop << " to "<< jPop <<" for discreteNormal= "<< discreteNormalX << "/"<<discreteNormalY <<std::endl;
439 }
440 }
441}
std::string & getName()
read and write access to name
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References olb::descriptors::c(), olb::PostProcessor3D< T, DESCRIPTOR >::getName(), and OLB_PRECONDITION.

+ Here is the call graph for this function:

Member Function Documentation

◆ extent() [1/2]

template<typename T , typename DESCRIPTOR >
int olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 167 of file boundaryPostProcessors3D.h.

168 {
169 return 0;
170 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR >::extent ( int direction) const
inlineoverridevirtual

Extent of application area along a direction (0 or 1)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 171 of file boundaryPostProcessors3D.h.

172 {
173 return 0;
174 }

◆ process()

template<typename T , typename DESCRIPTOR >
void olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR >::process ( BlockLattice< T, DESCRIPTOR > & blockLattice)
overridevirtual

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 480 of file boundaryPostProcessors3D.hh.

482{
483 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
484}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

template<typename T , typename DESCRIPTOR >
void olb::PartialSlipBoundaryProcessor3D< T, DESCRIPTOR >::processSubDomain ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
overridevirtual

Execute post-processing step on a sublattice.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 444 of file boundaryPostProcessors3D.hh.

446{
447 int newX0, newX1, newY0, newY1, newZ0, newZ1;
448
449 if ( util::intersect (
450 x0, x1, y0, y1, z0, z1,
451 x0_, x1_, y0_, y1_, z0_, z1_,
452 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
453
454 int iX;
455#ifdef PARALLEL_MODE_OMP
456 #pragma omp parallel for
457#endif
458 for (iX=newX0; iX<=newX1; ++iX) {
459 for (int iY=newY0; iY<=newY1; ++iY) {
460 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
461 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
462 if (reflectionPop[iPop]!=0) {
463 //do reflection
464 blockLattice.get(iX,iY,iZ)[iPop] = tuner*blockLattice.get(iX,iY,iZ)[reflectionPop[iPop]];
465 }
466 }
467 for (int iPop = 1; iPop < DESCRIPTOR::q/2 ; ++iPop) {
468 T provv = blockLattice.get(iX,iY,iZ)[descriptors::opposite<DESCRIPTOR>(iPop)];
469 blockLattice.get(iX,iY,iZ)[descriptors::opposite<DESCRIPTOR>(iPop)] +=
470 (1.-tuner)*blockLattice.get(iX,iY,iZ)[iPop];
471 blockLattice.get(iX,iY,iZ)[iPop] += (1.-tuner)*provv;
472 }
473 }
474 }
475 }
476 }
477}
constexpr int opposite(unsigned iPop) any_platform
Definition functions.h:95
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)
Definition util.h:85

References olb::util::intersect(), and olb::descriptors::opposite().

+ Here is the call graph for this function:

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