OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | List of all members
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 397 of file boundaryPostProcessors3D.hh.

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

References 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 474 of file boundaryPostProcessors3D.hh.

476{
477 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
478}
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 438 of file boundaryPostProcessors3D.hh.

440{
441 int newX0, newX1, newY0, newY1, newZ0, newZ1;
442
443 if ( util::intersect (
444 x0, x1, y0, y1, z0, z1,
445 x0_, x1_, y0_, y1_, z0_, z1_,
446 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
447
448 int iX;
449#ifdef PARALLEL_MODE_OMP
450 #pragma omp parallel for
451#endif
452 for (iX=newX0; iX<=newX1; ++iX) {
453 for (int iY=newY0; iY<=newY1; ++iY) {
454 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
455 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
456 if (reflectionPop[iPop]!=0) {
457 //do reflection
458 blockLattice.get(iX,iY,iZ)[iPop] = tuner*blockLattice.get(iX,iY,iZ)[reflectionPop[iPop]];
459 }
460 }
461 for (int iPop = 1; iPop < DESCRIPTOR::q/2 ; ++iPop) {
462 T provv = blockLattice.get(iX,iY,iZ)[descriptors::opposite<DESCRIPTOR>(iPop)];
463 blockLattice.get(iX,iY,iZ)[descriptors::opposite<DESCRIPTOR>(iPop)] +=
464 (1.-tuner)*blockLattice.get(iX,iY,iZ)[iPop];
465 blockLattice.get(iX,iY,iZ)[iPop] += (1.-tuner)*provv;
466 }
467 }
468 }
469 }
470 }
471}
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:89

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::util::intersect().

+ Here is the call graph for this function:

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