OpenLB 1.7
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | List of all members
olb::StraightConvectionBoundaryProcessor3D< DESCRIPTOR, direction, orientation > Class Template Reference

#include <boundaryPostProcessors3D.h>

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

Classes

struct  PREV_CELL
 

Public Member Functions

int getPriority () const
 
template<CONCEPT(Cell) CELL>
void initialize (CELL &cell) any_platform
 
template<CONCEPT(Cell) CELL>
void apply (CELL &cell) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

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

Definition at line 61 of file boundaryPostProcessors3D.h.

Member Function Documentation

◆ apply()

template<typename DESCRIPTOR , int direction, int orientation>
template<CONCEPT(Cell) CELL>
void olb::StraightConvectionBoundaryProcessor3D< DESCRIPTOR, direction, orientation >::apply ( CELL & cell)

Definition at line 105 of file boundaryPostProcessors3D.hh.

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

References olb::util::populationsContributingToVelocity().

+ Here is the call graph for this function:

◆ getPriority()

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

Definition at line 69 of file boundaryPostProcessors3D.h.

69 {
70 return 0;
71 }

◆ initialize()

template<typename DESCRIPTOR , int direction, int orientation>
template<CONCEPT(Cell) CELL>
void olb::StraightConvectionBoundaryProcessor3D< DESCRIPTOR, direction, orientation >::initialize ( CELL & cell)

Definition at line 94 of file boundaryPostProcessors3D.hh.

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

References olb::util::populationsContributingToVelocity().

+ Here is the call graph for this function:

Member Data Documentation

◆ scope

template<typename DESCRIPTOR , int direction, int orientation>
constexpr OperatorScope olb::StraightConvectionBoundaryProcessor3D< 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: