27#ifndef BOUNDARY_POST_PROCESSORS_3D_H
28#define BOUNDARY_POST_PROCESSORS_3D_H
41template<
typename T,
typename DESCRIPTOR,
int direction,
int orientation>
50 template <concepts::DynamicCell CELL>
54 template <
int deriveDirection,
typename CELL,
typename V=CELL::value_t>
55 void interpolateGradients(CELL& cell, V velDeriv[DESCRIPTOR::d])
const any_platform;
60template <
typename T,
typename DESCRIPTOR,
int direction,
int orientation>
66 util::populationsContributingToVelocity<DESCRIPTOR,direction,-orientation>().size()
73 template <concepts::DynamicCell CELL>
76 template <concepts::DynamicCell CELL>
87template <
typename T,
typename DESCRIPTOR,
int plane,
int normal1,
int normal2>
96 template <concepts::DynamicCell CELL>
100 template <
typename CELL,
typename V=CELL::value_t>
101 V getNeighborRho(CELL& cell,
int step1,
int step2)
any_platform;
103 template <
int deriveDirection,
int orientation,
typename CELL,
typename V=CELL::value_t>
104 void interpolateGradients(CELL& cell, V velDeriv[DESCRIPTOR::d])
const any_platform;
109template<
typename T,
typename DESCRIPTOR,
110 int xNormal,
int yNormal,
int zNormal>
118 template <concepts::DynamicCell CELL>
126template<
typename T,
typename DESCRIPTOR>
129 SlipBoundaryProcessor3D(
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
int discreteNormalX_,
int discreteNormalY_,
int discreteNormalZ_);
134 int extent(
int whichDirection)
const override
140 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
override;
142 int reflectionPop[DESCRIPTOR::q];
143 int x0, x1, y0, y1, z0, z1;
147template<
typename T,
typename DESCRIPTOR>
163template<
typename T,
typename DESCRIPTOR>
166 PartialSlipBoundaryProcessor3D(T tuner_,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_,
int discreteNormalX_,
int discreteNormalY_,
int discreteNormalZ_);
171 int extent(
int whichDirection)
const override
177 int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
override;
179 int reflectionPop[DESCRIPTOR::q];
180 int x0, x1, y0, y1, z0, z1;
185template<
typename T,
typename DESCRIPTOR>
207template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
216 template <concepts::DynamicCell CELL>
219 cell.template setField<descriptors::CHEM_POTENTIAL>(
220 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
222 T rhoBoundary = cell.computeRho();
223 T rhoBulk = cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).computeRho();
225 cell.template setField<descriptors::CHEM_POTENTIAL>(
232template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
241 template <concepts::DynamicCell CELL>
244 cell.template setField<descriptors::CHEM_POTENTIAL>(
245 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
251template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
260 template <concepts::DynamicCell CELL>
263 T rhoBoundaryNew, rhoBoundaryOld, rhoBulk, u[3];
265 rhoBoundaryOld = cell.computeRho();
267 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).computeRhoU(rhoBulk, u);
273 if (normalVec[2] == 0) {
274 if (normalVec[1] == 0) {
275 if (normalVec[0] < 0) {
280 }
else if (normalVec[0] == 0) {
281 if (normalVec[1] < 0) {
287 uPerp =
util::sqrt(u[0] * u[0] + u[1] * u[1]);
289 }
else if (normalVec[1] == 0) {
290 if (normalVec[0] == 0) {
291 if (normalVec[2] < 0) {
297 uPerp =
util::sqrt(u[0] * u[0] + u[2] * u[2]);
299 }
else if (normalVec[0] == 0) {
300 uPerp =
util::sqrt(u[1] * u[1] + u[2] * u[2]);
302 uPerp =
util::sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]);
305 rhoBoundaryNew = (rhoBoundaryOld + uPerp * rhoBulk) / (1. + uPerp);
306 cell.defineRho(rhoBoundaryNew);
308 cell.template setField<descriptors::CHEM_POTENTIAL>(
309 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
311 cell.template setField<descriptors::CHEM_POTENTIAL>(
318template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
327 template <concepts::DynamicCell CELL>
330 T rhoBoundaryNew, rhoBoundaryOld, rhoBulk, u[3];
332 rhoBoundaryOld = cell.computeRho();
334 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).computeRhoU(rhoBulk, u);
340 if (normalVec[2] == 0) {
341 if (normalVec[1] == 0) {
342 if (normalVec[0] < 0) {
347 }
else if (normalVec[0] == 0) {
348 if (normalVec[1] < 0) {
354 uPerp =
util::sqrt(u[0] * u[0] + u[1] * u[1]);
356 }
else if (normalVec[1] == 0) {
357 if (normalVec[0] == 0) {
358 if (normalVec[2] < 0) {
364 uPerp =
util::sqrt(u[0] * u[0] + u[2] * u[2]);
366 }
else if (normalVec[0] == 0) {
367 uPerp =
util::sqrt(u[1] * u[1] + u[2] * u[2]);
369 uPerp =
util::sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]);
372 rhoBoundaryNew = (rhoBoundaryOld + uPerp * rhoBulk) / (1. + uPerp);
373 cell.defineRho(rhoBoundaryNew);
375 cell.template setField<descriptors::CHEM_POTENTIAL>(
376 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
382template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
391 template <concepts::DynamicCell CELL>
396template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
405 template <concepts::DynamicCell CELL>
415template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
426 template <concepts::DynamicCell CELL,
typename PARAMETERS>
431template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
441 template <concepts::DynamicCell CELL,
typename PARAMETERS>
444 auto addend =
parameters.template get<descriptors::ADDEND>();
446 T rhoBulk = cell.neighbor({-NORMAL_X, -NORMAL_Y, -NORMAL_Z}).computeRho();
449 for (
int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
450 rhoTmp += cell[iPop];
453 T rhoBoundary = rhoBulk + addend;
454 rhoBoundary -= rhoTmp;
456 cell[0] = rhoBoundary - 1.;
458 cell.template setField<descriptors::CHEM_POTENTIAL>(
459 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
461 cell.template setField<descriptors::CHEM_POTENTIAL>(
468template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
478 template <concepts::DynamicCell CELL,
typename PARAMETERS>
481 auto addend =
parameters.template get<descriptors::ADDEND>();
483 T rhoBulk = cell.neighbor({-NORMAL_X, -NORMAL_Y, -NORMAL_Z}).computeRho();
486 for (
int iPop = 1; iPop < DESCRIPTOR::q ; ++iPop) {
487 rhoTmp += cell[iPop];
490 T rhoBoundary = rhoBulk + addend;
491 rhoBoundary -= rhoTmp;
493 cell[0] = rhoBoundary - 1.;
495 cell.template setField<descriptors::CHEM_POTENTIAL>(
496 cell.neighbor({-NORMAL_X,-NORMAL_Y,-NORMAL_Z}).template getField<descriptors::CHEM_POTENTIAL>());
505template<
typename T,
typename DESCRIPTOR,
int NORMAL_X,
int NORMAL_Y,
int NORMAL_Z>
514 template <concepts::DynamicCell CELL>
void apply(CELL &cell) any_platform
static constexpr OperatorScope scope
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
PostProcessor for the density / velocity outflow boundaries in the free energy model.
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
static constexpr OperatorScope scope
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
static constexpr OperatorScope scope
PostProcessor for the wetting boundary condition in the free energy model.
meta::list< olb::descriptors::ADDEND > parameters
static constexpr OperatorScope scope
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
This class computes the skordos BC on a convex edge wall in 3D but with a limited number of terms add...
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
This class computes a partial slip BC in 3D.
int extent() const override
Extent of application area (0 for purely local operations)
PartialSlipBoundaryProcessor3D(T tuner_, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
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.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
PartialSlipBoundaryProcessorGenerator3D(T tuner_, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
PostProcessor3D< T, DESCRIPTOR > * generate() const override
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
This class computes the skordos BC on a plane wall in 3D but with a limited number of terms added to ...
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
This class computes a slip BC in 3D.
int extent(int whichDirection) const override
Extent of application area along a direction (0 or 1)
int extent() const override
Extent of application area (0 for purely local operations)
SlipBoundaryProcessor3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
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.
void process(BlockLattice< T, DESCRIPTOR > &blockLattice) override
Execute post-processing step.
PostProcessorGenerator3D< T, DESCRIPTOR > * clone() const override
SlipBoundaryProcessorGenerator3D(int x0_, int x1_, int y0_, int y1_, int z0_, int z1_, int discreteNormalX_, int discreteNormalY_, int discreteNormalZ_)
PostProcessor3D< T, DESCRIPTOR > * generate() const override
static constexpr OperatorScope scope
void initialize(CELL &cell) any_platform
void apply(CELL &cell) any_platform
constexpr T invCs2() any_platform
Top level namespace for all of OpenLB.
OperatorScope
Block-wide operator application scopes.
@ PerCell
Per-cell application, i.e. OPERATOR::apply is passed a CELL concept implementation.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
Interface for post-processing steps – header file.
PostProcessors for the chemical potential boundary condition in the free energy model.
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
void apply(CELL &cell) any_platform
static constexpr OperatorScope scope
static constexpr OperatorScope scope
void apply(CELL &cell) any_platform
void apply(CELL &cell) any_platform
static constexpr OperatorScope scope
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].