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

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

#include <boundaryPostProcessors2D.h>

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

Public Member Functions

 PartialSlipBoundaryProcessor2D (T tuner_, int x0_, int x1_, int y0_, int y1_, int discreteNormalX_, int discreteNormalY_)
 
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_) override
 Execute post-processing step on a sublattice.
 
- Public Member Functions inherited from olb::PostProcessor2D< T, DESCRIPTOR >
 PostProcessor2D ()
 
virtual ~PostProcessor2D ()
 
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::PostProcessor2D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

This class computes a partial slip BC in 2D.

Definition at line 212 of file boundaryPostProcessors2D.h.

Constructor & Destructor Documentation

◆ PartialSlipBoundaryProcessor2D()

template<typename T , typename DESCRIPTOR >
olb::PartialSlipBoundaryProcessor2D< T, DESCRIPTOR >::PartialSlipBoundaryProcessor2D ( T tuner_,
int x0_,
int x1_,
int y0_,
int y1_,
int discreteNormalX_,
int discreteNormalY_ )

Definition at line 310 of file boundaryPostProcessors2D.hh.

312 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), tuner(tuner_)
313{
314 this->getName() = "PartialSlipBoundaryProcessor2D";
315 OLB_PRECONDITION(x0==x1 || y0==y1);
316 reflectionPop[0] = 0;
317 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
318 reflectionPop[iPop] = 0;
319 // iPop are the directions which ointing into the fluid, discreteNormal is pointing outwarts
320 if (descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY < 0) {
321 //std::cout << "-----" <<std::endl;
322 int mirrorDirection0;
323 int mirrorDirection1;
324 int mult = 1;
325 if (discreteNormalX*discreteNormalY==0) {
326 mult = 2;
327 }
328 mirrorDirection0 = (descriptors::c<DESCRIPTOR>(iPop,0) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY )*discreteNormalX);
329 mirrorDirection1 = (descriptors::c<DESCRIPTOR>(iPop,1) - mult*(descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY )*discreteNormalY);
330
331 // computes mirror jPop
332 for (reflectionPop[iPop] = 1; reflectionPop[iPop] < DESCRIPTOR::q ; reflectionPop[iPop]++) {
333 if (descriptors::c<DESCRIPTOR>(reflectionPop[iPop],0)==mirrorDirection0 && descriptors::c<DESCRIPTOR>(reflectionPop[iPop],1)==mirrorDirection1 ) {
334 break;
335 }
336 }
337 //std::cout <<iPop << " to "<< jPop <<" for discreteNormal= "<< discreteNormalX << "/"<<discreteNormalY <<std::endl;
338 }
339 }
340}
std::string & getName()
read and write access to name
#define OLB_PRECONDITION(COND)
Definition olbDebug.h:46

References olb::PostProcessor2D< 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::PartialSlipBoundaryProcessor2D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 215 of file boundaryPostProcessors2D.h.

216 {
217 return 0;
218 }

◆ extent() [2/2]

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

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

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 219 of file boundaryPostProcessors2D.h.

220 {
221 return 0;
222 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 376 of file boundaryPostProcessors2D.hh.

378{
379 processSubDomain(blockLattice, x0, x1, y0, y1);
380}
void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_) override
Execute post-processing step on a sublattice.

◆ processSubDomain()

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

Execute post-processing step on a sublattice.

Implements olb::PostProcessor2D< T, DESCRIPTOR >.

Definition at line 343 of file boundaryPostProcessors2D.hh.

345{
346 int newX0, newX1, newY0, newY1;
347 if ( util::intersect (
348 x0, x1, y0, y1,
349 x0_, x1_, y0_, y1_,
350 newX0, newX1, newY0, newY1 ) ) {
351
352 int iX;
353#ifdef PARALLEL_MODE_OMP
354 #pragma omp parallel for
355#endif
356 for (iX=newX0; iX<=newX1; ++iX) {
357 for (int iY=newY0; iY<=newY1; ++iY) {
358 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
359 if (reflectionPop[iPop]!=0) {
360 //do reflection
361 blockLattice.get(iX,iY)[iPop] = tuner*blockLattice.get(iX,iY)[reflectionPop[iPop]];
362 }
363 }
364 for (int iPop = 1; iPop < DESCRIPTOR::q/2 ; ++iPop) {
365 T provv = blockLattice.get(iX,iY)[descriptors::opposite<DESCRIPTOR>(iPop)];
366 blockLattice.get(iX,iY)[descriptors::opposite<DESCRIPTOR>(iPop)] +=
367 (1.-tuner)*blockLattice.get(iX,iY)[iPop];
368 blockLattice.get(iX,iY)[iPop] += (1.-tuner)*provv;
369 }
370 }
371 }
372 }
373}
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: