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

#include <boundaryPostProcessors3D.h>

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

Classes

struct  PREV_CELL
 

Public Member Functions

int getPriority () const
 
template<concepts::DynamicCell CELL>
void initialize (CELL &cell) any_platform
 
template<concepts::DynamicCell CELL>
void apply (CELL &cell) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

template<typename T, typename DESCRIPTOR, int direction, int orientation>
class olb::StraightConvectionBoundaryProcessor3D< T, DESCRIPTOR, direction, orientation >

Definition at line 61 of file boundaryPostProcessors3D.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
template<concepts::DynamicCell CELL>
void olb::StraightConvectionBoundaryProcessor3D< T, DESCRIPTOR, direction, orientation >::apply ( CELL & cell)

Definition at line 107 of file boundaryPostProcessors3D.hh.

108{
109 using V = typename CELL::value_t;
110 constexpr auto missing = util::populationsContributingToVelocity<DESCRIPTOR,direction,-orientation>();
111
112 auto prevCell = cell.template getField<PREV_CELL>();
113
114 for (unsigned i=0; i < missing.size(); ++i) {
115 cell[missing[i]] = prevCell[i];
116 }
117
118 V rho0, u0[3];
119 V rho1, u1[3];
120 V rho2, u2[3];
121
122 cell.computeRhoU(rho0, u0);
123
124 static_assert(direction == 0 || direction == 1 || direction ==2,
125 "Direction must be one of 0, 1 or 2");
126 if constexpr (direction == 0) {
127 cell.neighbor({-orientation ,0,0}).computeRhoU(rho1, u1);
128 cell.neighbor({-orientation*2,0,0}).computeRhoU(rho2, u2);
129 }
130 else if constexpr (direction == 1) {
131 cell.neighbor({0,-orientation ,0}).computeRhoU(rho1, u1);
132 cell.neighbor({0,-orientation*2,0}).computeRhoU(rho2, u2);
133 }
134 else if constexpr (direction == 2) {
135 cell.neighbor({0,0,-orientation }).computeRhoU(rho1, u1);
136 cell.neighbor({0,0,-orientation*2}).computeRhoU(rho2, u2);
137 }
138
139 V uDelta[3];
140 V uAverage = rho0*u0[direction];
141 //if (uAv!=nullptr) {
142 // rho0 = V{1};
143 // rho1 = V{1};
144 // rho2 = V{1};
145 // uAverage = *uAv * rho0;
146 //}
147
148 uDelta[0] = -uAverage*0.5*(3*rho0*u0[0]-4*rho1*u1[0]+rho2*u2[0]);
149 uDelta[1] = -uAverage*0.5*(3*rho0*u0[1]-4*rho1*u1[1]+rho2*u2[1]);
150 uDelta[2] = -uAverage*0.5*(3*rho0*u0[2]-4*rho1*u1[2]+rho2*u2[2]);
151
152 for (unsigned i=0; i < missing.size(); ++i) {
153 auto iPop = missing[i];
154 prevCell[i] = cell[iPop]
156 * ( uDelta[0]*descriptors::c<DESCRIPTOR>(iPop,0)
157 + uDelta[1]*descriptors::c<DESCRIPTOR>(iPop,1)
158 + uDelta[2]*descriptors::c<DESCRIPTOR>(iPop,2));
159 }
160
161 cell.template setField<PREV_CELL>(prevCell);
162}
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
constexpr auto populationsContributingToVelocity() any_platform
Return array of population indices where c[iVel] == value.
Definition util.h:222

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

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
int olb::StraightConvectionBoundaryProcessor3D< T, DESCRIPTOR, direction, orientation >::getPriority ( ) const
inline

Definition at line 69 of file boundaryPostProcessors3D.h.

69 {
70 return 0;
71 }

◆ initialize()

template<typename T , typename DESCRIPTOR , int direction, int orientation>
template<concepts::DynamicCell CELL>
void olb::StraightConvectionBoundaryProcessor3D< T, DESCRIPTOR, direction, orientation >::initialize ( CELL & cell)

Definition at line 96 of file boundaryPostProcessors3D.hh.

97{
98 constexpr auto missing = util::populationsContributingToVelocity<DESCRIPTOR,direction,-orientation>();
99 auto prevCell = cell.template getFieldPointer<PREV_CELL>();
100 for (unsigned i=0; i < missing.size(); ++i) {
101 prevCell[i] = cell[missing[i]];
102 }
103}

References olb::util::populationsContributingToVelocity().

+ Here is the call graph for this function:

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR , int direction, int orientation>
OperatorScope olb::StraightConvectionBoundaryProcessor3D< T, DESCRIPTOR, direction, orientation >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 63 of file boundaryPostProcessors3D.h.


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