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

This class interpolates missing f_i from values near the boundary to get a more stable outflow condition for the density. More...

#include <advectionDiffusionBoundaryPostProcessor3D.h>

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

Public Member Functions

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

This class interpolates missing f_i from values near the boundary to get a more stable outflow condition for the density.

It is assumed that the next two cells in direction of this f_i have viable values.

Definition at line 43 of file advectionDiffusionBoundaryPostProcessor3D.h.

Constructor & Destructor Documentation

◆ ConvectionBoundaryProcessor3D()

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

Definition at line 35 of file advectionDiffusionBoundaryPostProcessor3D.hh.

38 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_)
39{
40 OLB_PRECONDITION(x0==x1 || y0==y1 || z0==z1);
41
42 this->getName() = "ConvectionBoundaryProcessor3D";
43
44 interpolationPop[0] = 0;
45 for (int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
46 interpolationPop[iPop] = 0;
47 // find incoming iPop from material 0
48 if (descriptors::c<DESCRIPTOR>(iPop,0)*discreteNormalX + descriptors::c<DESCRIPTOR>(iPop,1)*discreteNormalY + descriptors::c<DESCRIPTOR>(iPop,2)*discreteNormalZ > 0) {
49 // check for material number of neighbours has to be one level higher
50 interpolationPop[iPop] = 1;
51 }
52 }
53}
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::ConvectionBoundaryProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 48 of file advectionDiffusionBoundaryPostProcessor3D.h.

49 {
50 return 0;
51 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
int olb::ConvectionBoundaryProcessor3D< 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 52 of file advectionDiffusionBoundaryPostProcessor3D.h.

53 {
54 return 0;
55 }

◆ process()

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

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 92 of file advectionDiffusionBoundaryPostProcessor3D.hh.

94{
95 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
96}
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::ConvectionBoundaryProcessor3D< 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 56 of file advectionDiffusionBoundaryPostProcessor3D.hh.

59{
60 int newX0, newX1, newY0, newY1, newZ0, newZ1;
61 if ( util::intersect (
62 x0, x1, y0, y1, z0, z1,
63 x0_, x1_, y0_, y1_, z0_, z1_,
64 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
65
66 auto& pop = blockLattice.template getField<descriptors::POPULATION>();
67
68#ifdef PARALLEL_MODE_OMP
69 #pragma omp parallel for
70#endif
71 for (int iPop = 1; iPop < DESCRIPTOR::q; ++iPop) {
72 if (interpolationPop[iPop] != 0) {
73 for (int iX=newX0; iX<=newX1; ++iX) {
74 for (int iY=newY0; iY<=newY1; ++iY) {
75 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
76 const auto c = descriptors::c<DESCRIPTOR>(iPop);
77 if (blockLattice.isInside(iX+c[0],iY+c[0],iZ+c[0]) && blockLattice.isInside(iX+2*c[0],iY+2*c[0],iZ+2*c[0])) {
78 //do reflection
79 T v = 0.5 * ( pop[iPop][blockLattice.getCellId(iX+ c[0],iY+ c[1],iZ+ c[2])]
80 + pop[iPop][blockLattice.getCellId(iX+2*c[0],iY+2*c[1],iZ+2*c[2])]);
81 pop[iPop][blockLattice.getCellId(iX,iY,iZ)] = v;
82 }
83 }
84 }
85 }
86 }
87 }
88 }
89}
platform_constant int c[Q][D]
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::BlockStructureD< D >::getCellId(), olb::util::intersect(), and olb::BlockStructureD< D >::isInside().

+ Here is the call graph for this function:

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