23#ifndef ADVECTION_DIFFUSION_BOUNDARY_POST_PROCESSOR_3D_HH
24#define ADVECTION_DIFFUSION_BOUNDARY_POST_PROCESSOR_3D_HH
34template<
typename T,
typename DESCRIPTOR>
37 int discreteNormalX,
int discreteNormalY,
int discreteNormalZ)
38 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_)
42 this->
getName() =
"ConvectionBoundaryProcessor3D";
44 interpolationPop[0] = 0;
45 for (
int iPop = 1; iPop < DESCRIPTOR::q; iPop++) {
46 interpolationPop[iPop] = 0;
50 interpolationPop[iPop] = 1;
55template<
typename T,
typename DESCRIPTOR>
58 int y1_,
int z0_,
int z1_)
60 int newX0, newX1, newY0, newY1, newZ0, newZ1;
62 x0, x1, y0, y1, z0, z1,
63 x0_, x1_, y0_, y1_, z0_, z1_,
64 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
66 auto& pop = blockLattice.template getField<descriptors::POPULATION>();
68#ifdef PARALLEL_MODE_OMP
69 #pragma omp parallel for
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) {
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])) {
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;
91template<
typename T,
typename DESCRIPTOR>
95 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
100template<
typename T,
typename DESCRIPTOR>
103 int z1_,
int discreteNormalX_,
int discreteNormalY_,
int discreteNormalZ_)
105 discreteNormalX(discreteNormalX_), discreteNormalY(discreteNormalY_),
106 discreteNormalZ(discreteNormalZ_)
109template<
typename T,
typename DESCRIPTOR>
114 this->y1, this->z0, this->z1,
120template<
typename T,
typename DESCRIPTOR>
125 this->y0, this->y1, this->z0, this->z1,
126 discreteNormalX, discreteNormalY, discreteNormalZ);
This class interpolates missing f_i from values near the boundary to get a more stable outflow condit...
ConvectionBoundaryProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
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.
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
ConvectionBoundaryProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
PostProcessor3D< T, DESCRIPTOR > * generate() const override
std::string & getName()
read and write access to name
constexpr int c(unsigned iPop, unsigned iDim) any_platform
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)
Top level namespace for all of OpenLB.
#define OLB_PRECONDITION(COND)
Set of functions commonly used in LB computations – header file.