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

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

#include <boundaryPostProcessors3D.h>

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

Public Member Functions

 SlipBoundaryProcessor3D (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::SlipBoundaryProcessor3D< T, DESCRIPTOR >

This class computes a slip BC in 3D.

Definition at line 127 of file boundaryPostProcessors3D.h.

Constructor & Destructor Documentation

◆ SlipBoundaryProcessor3D()

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

Definition at line 293 of file boundaryPostProcessors3D.hh.

295 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_)
296{
297 this->getName() = "SlipBoundaryProcessor3D";
298 OLB_PRECONDITION(x0==x1 || y0==y1 || z0==z1);
299 int mirrorDirection0;
300 int mirrorDirection1;
301 int mirrorDirection2;
302 int mult = 2 / (discreteNormalX*discreteNormalX + discreteNormalY*discreteNormalY + discreteNormalZ*discreteNormalZ);
303 reflectionPop[0] = 0;
304 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
305 reflectionPop[iPop] = 0;
306 // iPop are the directions which pointing into the fluid, discreteNormal is pointing outwarts
307 int scalarProduct = descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ;
308 if ( scalarProduct < 0) {
309 // bounce back for the case discreteNormalX = discreteNormalY = discreteNormalZ = 1, that is mult=0
310 if (mult == 0) {
311 mirrorDirection0 = -descriptors::c<DESCRIPTOR>(iPop,0);
312 mirrorDirection1 = -descriptors::c<DESCRIPTOR>(iPop,1);
313 mirrorDirection2 = -descriptors::c<DESCRIPTOR>(iPop,2);
314 }
315 else {
316 mirrorDirection0 = descriptors::c<DESCRIPTOR>(iPop,0) - mult*scalarProduct*discreteNormalX;
317 mirrorDirection1 = descriptors::c<DESCRIPTOR>(iPop,1) - mult*scalarProduct*discreteNormalY;
318 mirrorDirection2 = descriptors::c<DESCRIPTOR>(iPop,2) - mult*scalarProduct*discreteNormalZ;
319 }
320
321 // run through all lattice directions and look for match of direction
322 for (int i = 1; i < DESCRIPTOR::q; i++) {
323 if (descriptors::c<DESCRIPTOR>(i,0)==mirrorDirection0
324 && descriptors::c<DESCRIPTOR>(i,1)==mirrorDirection1
325 && descriptors::c<DESCRIPTOR>(i,2)==mirrorDirection2) {
326 reflectionPop[iPop] = i;
327 break;
328 }
329 }
330 }
331 }
332}
std::string & getName()
read and write access to name
T scalarProduct(const T u1[d], const T u2[d])
Definition util.h:187
#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::SlipBoundaryProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 130 of file boundaryPostProcessors3D.h.

131 {
132 return 0;
133 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::SlipBoundaryProcessor3D< 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 134 of file boundaryPostProcessors3D.h.

135 {
136 return 0;
137 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 364 of file boundaryPostProcessors3D.hh.

366{
367 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
368}
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::SlipBoundaryProcessor3D< 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 335 of file boundaryPostProcessors3D.hh.

337{
338 int newX0, newX1, newY0, newY1, newZ0, newZ1;
339 if ( util::intersect (
340 x0, x1, y0, y1, z0, z1,
341 x0_, x1_, y0_, y1_, z0_, z1_,
342 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
343
344 int iX;
345#ifdef PARALLEL_MODE_OMP
346 #pragma omp parallel for
347#endif
348 for (iX=x0; iX<=x1; ++iX) {
349 for (int iY=y0; iY<=y1; ++iY) {
350 for (int iZ=z0; iZ<=z1; ++iZ) {
351 for (int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
352 if (reflectionPop[iPop]!=0) {
353 //do reflection
354 blockLattice.get(iX,iY,iZ)[iPop] = blockLattice.get(iX,iY,iZ)[reflectionPop[iPop]];
355 }
356 }
357 }
358 }
359 }
360 }
361}
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: