35#ifndef SET_TEMPERATURE_JUMP_POST_PROCESSOR_3D_H
36#define SET_TEMPERATURE_JUMP_POST_PROCESSOR_3D_H
40namespace descriptors {
43 template <
typename T,
typename DESCRIPTOR>
52 template <
typename T,
typename DESCRIPTOR>
62template <
typename CELL,
typename V =
typename CELL::value_t>
65 using DESCRIPTOR =
typename CELL::descriptor_t;
66 const auto q = x_b.template getFieldPointer<descriptors::BOUZIDI_DISTANCE>();
68 x_b.template getFieldPointer<descriptors::BOUZIDI_JUMP_TEMP>();
73 for (
int iPop = 1; iPop < descriptors::q<DESCRIPTOR>(); ++iPop) {
75 if (q[iPop] > V {0}) {
78 auto x_s = x_b.neighbor(c);
88 * (V {-2} * q[iPop] * (x_s[iPop] + t_i) +
89 (V {2} * q[iPop] - V {1}) * (x_b[iPop] + t_i) + source_d) +
91 * (V {-1} / (V {2} * q[iPop]) * (x_s[iPop] + t_i) +
92 (V {1} - V {1} / (V {2} * q[iPop])) *
93 (x_f[iPop_opposite] + t_iopp) +
94 (V {1} / (V {2} * q[iPop])) * source_d) -
98 else if (q[iPop] == V {0}) {
100 auto source_d = phi_d[iPop] * f;
103 x_b[iPop_opposite] = -(x_b[iPop] + t_i) + source_d - t_iopp;
119 template <
typename CELL,
typename V =
typename CELL::value_t>
122 static_assert(CELL::descriptor_t::d == 3);
127 surroundingPoints[1][0] += 1;
128 surroundingPoints[2][1] += 1;
129 surroundingPoints[3][2] += 1;
130 surroundingPoints[4][0] += 1;
131 surroundingPoints[4][1] += 1;
132 surroundingPoints[5][0] += 1;
133 surroundingPoints[5][2] += 1;
134 surroundingPoints[6][1] += 1;
135 surroundingPoints[6][2] += 1;
136 surroundingPoints[7][0] += 1;
137 surroundingPoints[7][1] += 1;
138 surroundingPoints[7][2] += 1;
140 for (
int nP = 0; nP < 8; nP++) {
141 auto dist = distance - surroundingPoints[nP];
145 rho += volume * cell.neighbor(surroundingPoints[nP]).computeRho();
156 template <
typename CELL,
typename PARAMETERS,
157 typename V =
typename CELL::value_t>
162 using DESCRIPTOR =
typename CELL::descriptor_t;
164 const V lambda =
parameters.template get<descriptors::LAMBDA>();
165 const V conversionFactorLength =
166 parameters.template get<descriptors::CONVERSION_FACTOR_LENGTH>();
167 const V charLength =
parameters.template get<descriptors::CHAR_LENGTH>();
168 const V scalar =
parameters.template get<descriptors::SCALAR>();
170 cell.template getFieldPointer<descriptors::BOUZIDI_WALL_TEMP>();
172 cell.template getFieldPointer<descriptors::BOUZIDI_JUMP_TEMP>();
175 normal = cell.template getField<descriptors::NORMAL>();
179 if (normal_norm != V {0.}) {
180 normal = normal / normal_norm;
182 for (
int iPop = 1; iPop < DESCRIPTOR::q; ++iPop) {
185 const auto opp_bouzidi_dist =
186 cell.template getFieldComponent<descriptors::BOUZIDI_DISTANCE>(
189 if ((opp_bouzidi_dist >= 0) && (normal_norm != 0)) {
194 if (
norm(distance) != V {0.}) {
198 V lambda_eff = lambda;
200 V Dx = delta * conversionFactorLength;
202 V T_f = (scalar * lambda * (4 * T_1 - T_2) +
203 2 * Dx * phi_d[iPop_opposite]) /
204 (2 * Dx + 3 * scalar * lambda);
206 bouzidiTemp[iPop_opposite] = T_f;
static V interpolateDensityOnPoint(CELL &cell, Vector< V, 3 > distance) any_platform
void apply(CELL &cell, PARAMETERS ¶meters) any_platform
static constexpr OperatorScope scope
constexpr int q() any_platform
constexpr T t(unsigned iPop, tag::CUM) any_platform
constexpr int c(unsigned iPop, unsigned iDim) any_platform
constexpr int opposite(unsigned iPop) any_platform
ADf< T, DIM > abs(const ADf< T, DIM > &a)
ADf< T, DIM > floor(const ADf< T, DIM > &a)
T norm(const std::vector< T > &a)
l2 norm of a vector of arbitrary length
Top level namespace for all of OpenLB.
void applyBouzidiTemp(CELL &x_b) any_platform
OperatorScope
Block-wide operator application scopes.
@ PerCellWithParameters
Per-cell application with parameters, i.e. OPERATOR::apply is passed a CELL concept implementation an...
constexpr T norm(const ScalarVector< T, D, IMPL > &a) any_platform
Euclidean vector norm.
static constexpr auto getInitialValue()
static constexpr auto getInitialValue()
Base of a field whose size is defined by [C_0,C_1,C_2]^T * [1,D,Q].
static constexpr std::size_t size()