OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation > Class Template Reference

#include <extendedFiniteDifferenceBoundary3D.h>

+ Inheritance diagram for olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >:
+ Collaboration diagram for olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >:

Public Member Functions

 ExtendedFdPlaneBoundaryPostProcessor3D (int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
 
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, int direction, int orientation>
class olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >

Definition at line 34 of file extendedFiniteDifferenceBoundary3D.h.

Constructor & Destructor Documentation

◆ ExtendedFdPlaneBoundaryPostProcessor3D()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >::ExtendedFdPlaneBoundaryPostProcessor3D ( int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )

Definition at line 36 of file extendedFiniteDifferenceBoundary3D.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 this->getName() = "ExtendedFdPlaneBoundaryPostProcessor3D";
42}
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 direction, int orientation>
int olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >::extent ( ) const
inlineoverridevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 37 of file extendedFiniteDifferenceBoundary3D.h.

38 {
39 return 1;
40 }

◆ extent() [2/2]

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

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

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 41 of file extendedFiniteDifferenceBoundary3D.h.

42 {
43 return 1;
44 }

◆ process()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
void olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >::process ( BlockLattice< T, DESCRIPTOR > & blockLattice)
overridevirtual

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 163 of file extendedFiniteDifferenceBoundary3D.hh.

165{
166 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
167}
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 , int direction, int orientation>
void olb::ExtendedFdPlaneBoundaryPostProcessor3D< T, DESCRIPTOR, direction, orientation >::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 45 of file extendedFiniteDifferenceBoundary3D.hh.

48{
49 typedef DESCRIPTOR L;
50 using namespace olb::util::tensorIndices3D;
51 typedef lbm<DESCRIPTOR> lbH;
52 enum {x,y,z};
53
54
55 for (int iX=x0; iX<=x1; ++iX) {
56 for (int iY=y0; iY<=y1; ++iY) {
57 for (int iZ=z0; iZ<=z1; ++iZ) {
58 Cell<T,DESCRIPTOR> cell = blockLattice.get(iX,iY,iZ);
59 T rho, u[L::d];
60 cell.computeRhoU(rho,u);
61 T dx_U[DESCRIPTOR::d], dy_U[DESCRIPTOR::d], dz_U[DESCRIPTOR::d];
62 interpolateGradients<0>(blockLattice, dx_U, iX, iY, iZ);
63 interpolateGradients<1>(blockLattice, dy_U, iX, iY, iZ);
64 interpolateGradients<2>(blockLattice, dz_U, iX, iY, iZ);
65
66 T rhoGradU[L::d][L::d];
67 rhoGradU[x][x] = rho *dx_U[x];
68 rhoGradU[x][y] = rho *dx_U[y];
69 rhoGradU[x][z] = rho *dx_U[z];
70 rhoGradU[y][x] = rho *dy_U[x];
71 rhoGradU[y][y] = rho *dy_U[y];
72 rhoGradU[y][z] = rho *dy_U[z];
73 rhoGradU[z][x] = rho *dz_U[x];
74 rhoGradU[z][y] = rho *dz_U[y];
75 rhoGradU[z][z] = rho *dz_U[z];
76
77 T omega = blockLattice.getDynamics(iX, iY, iZ) -> getOmega();
78 T sToPi = - (T)1 / descriptors::invCs2<T,DESCRIPTOR>() / omega;
80
81 pi[xx] = (T)2 * rhoGradU[x][x] * sToPi;
82 pi[yy] = (T)2 * rhoGradU[y][y] * sToPi;
83 pi[zz] = (T)2 * rhoGradU[z][z] * sToPi;
84 pi[xy] = (rhoGradU[x][y] + rhoGradU[y][x]) * sToPi;
85 pi[xz] = (rhoGradU[x][z] + rhoGradU[z][x]) * sToPi;
86 pi[yz] = (rhoGradU[y][z] + rhoGradU[z][y]) * sToPi;
87
88 // here ends the "regular" fdBoudaryCondition
89 // implemented in OpenLB
90
92
93 // first we compute the term
94 // (c_{i\alpha} \nabla_\beta)(rho*u_\alpha*u_\beta)
95 T dx_rho, dy_rho, dz_rho;
96 interpolateGradients<0>(blockLattice, dx_rho, iX, iY, iZ);
97 interpolateGradients<1>(blockLattice, dy_rho, iX, iY, iZ);
98 interpolateGradients<2>(blockLattice, dz_rho, iX, iY, iZ);
99 for (int iPop = 0; iPop < L::q; ++iPop) {
100 T cGradRhoUU = T();
101 for (int iAlpha=0; iAlpha < L::d; ++iAlpha) {
102 cGradRhoUU += descriptors::c<L>(iPop,iAlpha) * (
103 dx_rho*u[iAlpha]*u[x] +
104 dx_U[iAlpha]*rho*u[x] +
105 dx_U[x]*rho*u[iAlpha] + //end of dx derivative
106 dy_rho*u[iAlpha]*u[y] +
107 dy_U[iAlpha]*rho*u[y] +
108 dy_U[y]*rho*u[iAlpha] +//end of dy derivative
109 dz_rho*u[iAlpha]*u[z] +
110 dz_U[iAlpha]*rho*u[z] +
111 dz_U[z]*rho*u[iAlpha]);
112 }
113
114 // then we compute the term
115 // c_{i\gamma}\nabla_{\gamma}(\rho*u_\alpha * u_\beta)
116 T cDivRhoUU[L::d][L::d]; //first step towards QcdivRhoUU
117 for (int iAlpha = 0; iAlpha < L::d; ++iAlpha) {
118 for (int iBeta = 0; iBeta < L::d; ++iBeta) {
119 cDivRhoUU[iAlpha][iBeta] = descriptors::c<L>(iPop,x)*
120 (dx_rho*u[iAlpha]*u[iBeta] +
121 dx_U[iAlpha]*rho*u[iBeta] +
122 dx_U[iBeta]*rho*u[iAlpha])
123 +descriptors::c<L>(iPop,y)*
124 (dy_rho*u[iAlpha]*u[iBeta] +
125 dy_U[iAlpha]*rho*u[iBeta] +
126 dy_U[iBeta]*rho*u[iAlpha])
127 +descriptors::c<L>(iPop,z)*
128 (dz_rho*u[iAlpha]*u[iBeta] +
129 dz_U[iAlpha]*rho*u[iBeta] +
130 dz_U[iBeta]*rho*u[iAlpha]);
131 }
132 }
133
134 //Finally we can compute
135 // Q_{i\alpha\beta}c_{i\gamma}\nabla_{\gamma}(\rho*u_\alpha * u_\beta)
136 // and Q_{i\alpha\beta}\rho\nabla_{\alpha}u_\beta
137 T qCdivRhoUU = T();
138 T qRhoGradU = T();
139 for (int iAlpha = 0; iAlpha < L::d; ++iAlpha) {
140 for (int iBeta = 0; iBeta < L::d; ++iBeta) {
141 int ci_ci = descriptors::c<L>(iPop,iAlpha)*descriptors::c<L>(iPop,iBeta);
142 qCdivRhoUU += ci_ci * cDivRhoUU[iAlpha][iBeta];
143 qRhoGradU += ci_ci * rhoGradU[iAlpha][iBeta];
144 if (iAlpha == iBeta) {
145 qCdivRhoUU -= cDivRhoUU[iAlpha][iBeta]/descriptors::invCs2<T,L>();
146 qRhoGradU -= rhoGradU[iAlpha][iBeta]/descriptors::invCs2<T,L>();
147 }
148 }
149 }
150
151 // we then can reconstruct the value of the populations
152 // according to the complete C-E expansion term
153 cell[iPop] = lbH::equilibrium(iPop,rho,u,uSqr)
155 * (qRhoGradU - cGradRhoUU + 0.5*descriptors::invCs2<T,L>()*qCdivRhoUU);
156 }
157 }
158 }
159 }
160}
constexpr T invCs2() any_platform
Definition functions.h:107
constexpr T t(unsigned iPop, tag::CUM) any_platform
Definition cum.h:108
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83
auto normSqr(const ARRAY_LIKE &u) any_platform
Compute norm square of a d-dimensional vector.
Definition util.h:145
Collection of common computations for LBM.
Definition lbm.h:264
Compute number of elements of a symmetric d-dimensional tensor.
Definition util.h:216

References olb::descriptors::c(), olb::descriptors::invCs2(), olb::util::normSqr(), and olb::descriptors::t().

+ Here is the call graph for this function:

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