Mallard 0.8.0
Unstructured, GPU accelerated, high-order finite volume CFD solver
Mallard website
Loading...
Searching...
No Matches
mixture_viscous_flux.h
Go to the documentation of this file.
1
14#ifndef MIXTURE_VISCOUS_FLUX_H
15#define MIXTURE_VISCOUS_FLUX_H
16
17#include <Kokkos_Core.hpp>
18
19#include "common.h"
20#include "boundary.h"
21#include "gradient.h"
22#include "mixture.h"
24#include "viscous_flux.h"
25
27enum MixtureCoefficient : uint8_t { MU = 0, LAMBDA = 1, NU_EFF = 2 };
28
31 const rtype * Y;
32 KOKKOS_INLINE_FUNCTION double operator()(const uint32_t k) const { return static_cast<double>(Y[k]); }
33};
34
48 Kokkos::View<rtype *[N_CONSERVATIVE]> W;
50 Kokkos::View<rtype *[3]> coefficients;
51 Kokkos::View<double **, Kokkos::LayoutRight> diffusion;
52 Kokkos::View<rtype **, Kokkos::LayoutRight> values;
53
55 void operator()(const uint32_t c) const {
56 const ScalarMassFractions y{&scalars(c, 0)};
57 const double rho = static_cast<double>(W(c, 0)), p = static_cast<double>(W(c, N_DIM + 1));
58 const double R = gas.thermo.gas_constant(y);
59 const double T = p / (rho * R);
60 const double cp = gas.thermo.cp_mass(T, y);
61 double mu, lambda;
62 double * D = &diffusion(c, 0);
63 double * DT = gas.transport.thermal_diffusion ? &diffusion(c, gas.n_species) : nullptr;
64 gas.transport.properties(T, p, rho, cp, y, mu, lambda, D, DT);
65 const double W_mean = chemistry::GAS_CONSTANT / R;
66 double nu = Kokkos::fmax(4.0 / 3.0 * mu / rho, lambda / (rho * (cp - R)));
67 for (uint32_t k = 0; k < gas.n_species; k++) {
68 nu = Kokkos::fmax(nu, D[k]);
69 D[k] *= rho * gas.transport.W(k) / W_mean;
70 }
71 coefficients(c, MU) = static_cast<rtype>(mu);
72 coefficients(c, LAMBDA) = static_cast<rtype>(lambda);
73 coefficients(c, NU_EFF) = static_cast<rtype>(nu);
74 FOR_I_DIM values(c, i) = W(c, 1 + i);
75 values(c, N_DIM) = static_cast<rtype>(T);
76 for (uint32_t k = 0; k < gas.n_species; k++) {
77 values(c, N_DIM + 1 + k) = static_cast<rtype>(y(k) / gas.transport.W(k) * W_mean);
78 }
79 }
80};
81
91 Kokkos::View<rtype **, Kokkos::LayoutRight> values;
92 Kokkos::View<rtype ***, Kokkos::LayoutRight> gradients; // (cell, variable, dimension)
93 Kokkos::View<rtype **, Kokkos::LayoutRight> bc_values; // (condition, [T, X_1 .. X_Ns]) of UPT
95
96 static constexpr uint32_t CHUNK = 16; // variables per pass over the stencil
97
99 void operator()(const uint32_t c) const {
100 const LSQGradientFunctor & f = stencil.faces;
101 const uint32_t n_vars = N_DIM + 1 + n_species;
102 for (uint32_t v0 = 0; v0 < n_vars; v0 += CHUNK) {
103 const uint32_t n = n_vars - v0 < CHUNK ? n_vars - v0 : CHUNK;
104 rtype q_c[CHUNK], g[CHUNK][N_DIM] = {};
105 for (uint32_t v = 0; v < CHUNK; v++) {
106 if (v < n) q_c[v] = values(c, v0 + v);
107 }
109 const uint32_t j = stencil.cells_of_cell(k);
110 rtype w[N_DIM];
111 FOR_I_DIM w[i] = stencil.weights.cells(k, i);
112 for (uint32_t v = 0; v < CHUNK; v++) {
113 if (v >= n) continue;
114 const rtype dq = values(j, v0 + v) - q_c[v];
115 FOR_I_DIM g[v][i] += w[i] * dq;
116 }
117 }
118 for (uint32_t v = 0; v < CHUNK; v++) {
119 if (v < n) FOR_I_DIM gradients(c, v0 + v, i) = g[v][i];
120 }
121 }
123 FOR_I_CONSERVATIVE W_i[i] = f.W(c, i);
124 for (uint32_t k = f.offsets_faces_of_cell(c); k < f.offsets_faces_of_cell(c + 1); k++) {
125 const uint32_t i_face = f.faces_of_cell(k);
126 if (f.cells_of_face(i_face, 1) >= 0) continue;
128 f.neighbor(c, i_face, W_i, dx, W_g);
129 for (uint8_t v = 0; v < N_DIM; v++) {
130 const rtype dq = W_g[1 + v] - W_i[1 + v];
131 FOR_I_DIM gradients(c, v, i) += stencil.weights.faces(k, i) * dq;
132 }
133 const int32_t i_bc = f.boundaries.face_bc(i_face);
134 if (f.boundaries.bcs(i_bc).type != BoundaryType::UPT) continue;
135 for (uint32_t v = N_DIM; v < n_vars; v++) {
136 const rtype dq = bc_values(i_bc, v - N_DIM) - values(c, v);
137 FOR_I_DIM gradients(c, v, i) += stencil.weights.faces(k, i) * dq;
138 }
139 }
140 }
141};
142
165 Kokkos::View<rtype *[N_DIM]> normals;
166 Kokkos::View<rtype *> face_area;
167 Kokkos::View<rtype *[N_DIM]> face_coords;
168 Kokkos::View<rtype *[N_DIM]> cell_coords;
169 Kokkos::View<int32_t *[2]> cells_of_face;
170 Kokkos::View<rtype *[N_DIM]> shifts;
171 Kokkos::View<uint8_t *> face_shift;
175 Kokkos::View<rtype **, Kokkos::LayoutRight> values;
176 Kokkos::View<rtype ***, Kokkos::LayoutRight> gradients;
177 Kokkos::View<rtype *[3]> coefficients;
178 Kokkos::View<double **, Kokkos::LayoutRight> diffusion;
179 Kokkos::View<rtype *[N_CONSERVATIVE]> face_flux;
180 Kokkos::View<rtype ***, Kokkos::LayoutRight> slots;
181 bool axisymmetric = false; // face_area is then the revolved area
182 Kokkos::View<rtype *[3]> covariance; // axisymmetric: Mesh::cell_covariance
183 Kokkos::View<rtype *[3]> sgs; // LES: (cell, [mu_t, lambda_t, mu_t / (Sc_t W)]), else empty
184 bool sgs_only = false; // LES budget: the SGS fluxes alone
185
186 static constexpr uint8_t NQ = N_DIM + 1; // [u, T]
187
189
191 struct Geometry {
194 rtype t; // axisymmetric: fraction along d of the face center's projection (see ViscousFluxFunctor)
195 rtype dvar; // axisymmetric: ViscousFluxFunctor::variance_jump
196 };
197
199 Geometry geometry(const uint32_t f) const {
200 Geometry g;
201 g.c0 = cells_of_face(f, 0);
202 g.c1 = cells_of_face(f, 1);
204 FOR_I_DIM n_vec[i] = normals(f, i);
205 unit<N_DIM>(n_vec, g.n);
206 const uint8_t s = face_shift(f);
207 FOR_I_DIM g.d[i] = (cell_coords(g.c1, i) + shifts(s, i)) - cell_coords(g.c0, i);
208 g.d_n = dot<N_DIM>(g.d, g.n);
209 g.t = 0.5_r;
210 g.dvar = 0.0_r;
211 if (axisymmetric) {
212 g.t = face_fraction(face_coords, cell_coords, f, g.c0, g.d);
213 g.dvar = variance_jump(covariance, g.c0, g.c1, g.d);
214 }
215 return g;
216 }
217
220 rtype interior(const Geometry & G, const uint32_t v, rtype * g) const {
221 const rtype q0 = values(G.c0, v), q1 = values(G.c1, v);
222 FOR_I_DIM g[i] = 0.5_r * (gradients(G.c0, v, i) + gradients(G.c1, v, i));
223 rtype dq = q1 - q0;
224 if (axisymmetric) {
225 rtype g0[N_DIM], g1[N_DIM];
226 FOR_I_DIM {
227 g0[i] = gradients(G.c0, v, i);
228 g1[i] = gradients(G.c1, v, i);
229 }
230 dq -= mean_offset(g0, g1, G.d, G.dvar);
231 }
232 const rtype correction = (dq - dot<N_DIM>(g, G.d)) / G.d_n;
233 if (axisymmetric) {
234 FOR_I_DIM g[i] = gradients(G.c0, v, i) + G.t * (gradients(G.c1, v, i) - gradients(G.c0, v, i));
235 FOR_I_DIM g[i] += correction * G.n[i];
236 return q0 + G.t * (q1 - q0);
237 }
238 FOR_I_DIM g[i] += correction * G.n[i];
239 return 0.5_r * (q0 + q1);
240 }
241
243 void operator()(const uint32_t i_face) const {
244 const int32_t c0 = cells_of_face(i_face, 0);
245 rtype n[N_DIM], n_vec[N_DIM];
247 unit<N_DIM>(n_vec, n);
248
249 // The face whose cells provide the values (an image face for transmissive boundaries)
252 bool wall = false, symmetry = false;
253 const BoundaryCondition * bc = nullptr;
254 if (cells_of_face(i_face, 1) < 0) {
256 if (bc->is_wall()) {
257 wall = true;
259 } else if (bc->type == BoundaryType::SYMMETRY) {
260 symmetry = true;
262 } else if (boundaries.face_image_face(i_face) >= 0) {
264 } else if (bc->type == BoundaryType::UPT) {
266 } else {
268 }
269 }
270 const bool two_cells = mode == Mode::INTERIOR;
271 Geometry G;
272 if (two_cells) {
273 G = geometry(f_src);
274 } else {
275 G.c0 = G.c1 = c0;
276 }
277
278 // Velocity and temperature with their gradients
279 rtype q_f[NQ], g_f[NQ][N_DIM];
280 for (uint8_t v = 0; v < NQ; v++) {
281 if (two_cells) {
282 q_f[v] = interior(G, v, g_f[v]);
283 } else {
284 q_f[v] = values(c0, v);
285 FOR_I_DIM g_f[v][i] = gradients(c0, v, i);
286 }
287 if (mode == Mode::ZERO_NORMAL) {
288 const rtype g_n = dot<N_DIM>(g_f[v], n);
289 FOR_I_DIM g_f[v][i] -= g_n * n[i];
290 }
291 }
292 if (wall) {
293 rtype dn = 0.0;
294 FOR_I_DIM dn += (face_coords(i_face, i) - cell_coords(c0, i)) * n[i];
295 for (uint8_t k = 0; k < N_DIM; k++) {
296 q_f[k] = bc->data[1 + k];
297 const rtype correction = (q_f[k] - values(c0, k)) / dn - dot<N_DIM>(g_f[k], n);
298 FOR_I_DIM g_f[k][i] += correction * n[i];
299 }
300 }
301 auto coefficient = [&](const uint8_t m) {
302 return two_cells ? 0.5_r * (coefficients(G.c0, m) + coefficients(G.c1, m)) : coefficients(c0, m);
303 };
304 // SGS coefficients: zero on walls, whose fluxes are molecular
305 const bool les = sgs.extent(0) > 0;
306 auto sgs_coefficient = [&](const uint8_t m) {
307 if (!les || wall) return 0.0_r;
308 return two_cells ? 0.5_r * (sgs(G.c0, m) + sgs(G.c1, m)) : sgs(c0, m);
309 };
310 const rtype molecular = sgs_only ? 0.0_r : 1.0_r;
311 const rtype mu = les ? molecular * coefficient(MU) + sgs_coefficient(0) : coefficient(MU);
314 if (symmetry) {
315 const rtype tau_nn = dot<N_DIM>(tau_n, n);
316 FOR_I_DIM tau_n[i] = tau_nn * n[i];
317 const rtype u_n = dot<N_DIM>(q_f, n);
318 FOR_I_DIM q_f[i] -= u_n * n[i];
319 }
320 const rtype A = face_area(i_face);
321 FOR_I_DIM face_flux(i_face, 1 + i) += A * tau_n[i];
322 rtype energy = dot<N_DIM>(q_f, tau_n);
323
324 if (mode != Mode::NONE) {
326 energy += lambda * dot<N_DIM>(g_f[N_DIM], n);
327 // Species: j_k . n = -c_k dX_k/dn + Y_k sum_j c_j dX_j/dn with c_k = rho D_k W_k / W
328 const uint32_t ns = gas.n_species;
329 auto dX_dn = [&](const uint32_t k) {
330 const uint32_t v = NQ + k;
331 rtype g[N_DIM];
332 if (two_cells) {
333 interior(G, v, g);
334 } else {
335 if (mode == Mode::ZERO_NORMAL) return 0.0;
336 FOR_I_DIM g[i] = gradients(c0, v, i);
337 }
338 return static_cast<double>(dot<N_DIM>(g, n));
339 };
340 const double rho_D_t = static_cast<double>(sgs_coefficient(2));
341 auto c_k = [&](const uint32_t k) {
342 const double c = two_cells ? 0.5 * (diffusion(G.c0, k) + diffusion(G.c1, k)) : diffusion(c0, k);
343 return les ? static_cast<double>(molecular) * c + rho_D_t * gas.transport.W(k) : c;
344 };
345 auto Y_k = [&](const uint32_t k) {
346 return two_cells ? 0.5 * (static_cast<double>(scalars(G.c0, k)) + static_cast<double>(scalars(G.c1, k)))
347 : static_cast<double>(scalars(c0, k));
348 };
349 // c_k and dX_k/dn of the first species, for the fluxes
350 constexpr uint32_t KEPT = 16;
351 double kept_c[KEPT] = {}, kept_dX[KEPT] = {};
352 double correction = 0.0, sum_Y = 0.0;
353 for (uint32_t k = 0; k < ns; k++) {
354 const double c = c_k(k), dX = dX_dn(k);
355 if (k < KEPT) {
356 kept_c[k] = c;
357 kept_dX[k] = dX;
358 }
359 correction += c * dX;
360 sum_Y += Y_k(k);
361 }
362 correction /= sum_Y;
363 const auto p = chemistry::ThermoTable<>::powers(static_cast<double>(q_f[N_DIM]));
364 const double RT = chemistry::GAS_CONSTANT * p.T;
365 // Soret: -D^T_k (dT/dn) / T, molecular
367 const double dlnT_dn =
368 soret ? static_cast<double>(molecular) * static_cast<double>(dot<N_DIM>(g_f[N_DIM], n)) / p.T : 0.0;
369 auto DT_k = [&](const uint32_t k) {
370 return two_cells ? 0.5 * (diffusion(G.c0, ns + k) + diffusion(G.c1, ns + k)) : diffusion(c0, ns + k);
371 };
372 double enthalpy = 0.0;
373 for (uint32_t k = 0; k < ns; k++) {
374 const double c = k < KEPT ? kept_c[k] : c_k(k), dX = k < KEPT ? kept_dX[k] : dX_dn(k);
375 double j = -c * dX + Y_k(k) * correction;
376 if (soret) j -= DT_k(k) * dlnT_dn;
377 enthalpy += gas.thermo.h_RT(k, p) * RT * gas.thermo.inv_W(k) * j;
378 slots(i_face, 0, k) += static_cast<rtype>(static_cast<double>(A) * j);
379 }
380 energy -= static_cast<rtype>(enthalpy);
381 }
382 face_flux(i_face, N_DIM + 1) += A * energy;
383 }
384};
385
386#endif // MIXTURE_VISCOUS_FLUX_H
Boundary conditions.
Common header file.
KOKKOS_INLINE_FUNCTION rtype dot(const rtype *a, const rtype *b)
Compute the dot product of two arrays.
Definition common_math.h:32
float rtype
Definition common_typedef.h:39
#define N_DIM
Definition common_typedef.h:28
#define FOR_I_CONSERVATIVE
Definition common_typedef.h:33
#define N_CONSERVATIVE
Definition common_typedef.h:29
#define FOR_I_DIM
Definition common_typedef.h:32
Cell gradient reconstruction.
Thermally perfect gas mixture: the gas model of runs with a mechanism.
MixtureCoefficient
Columns of the per-cell transport coefficients.
Definition mixture_viscous_flux.h:27
@ NU_EFF
Definition mixture_viscous_flux.h:27
@ LAMBDA
Definition mixture_viscous_flux.h:27
@ MU
Definition mixture_viscous_flux.h:27
constexpr double GAS_CONSTANT
Definition mechanism.h:26
Reconstruction of a gas mixture's cell scalars to faces.
Kokkos::View< rtype **, Kokkos::LayoutRight > ScalarView
Cell scalars of a mixture: (cell, j) = Y_1 .. Y_Ns, gamma, e0.
Definition scalar_reconstruction.h:26
Device-copyable boundary condition.
Definition boundary.h:97
Device-side lookup from faces to boundary conditions.
Definition boundary.h:229
Kokkos::View< int32_t * > face_bc
Definition boundary.h:230
Kokkos::View< BoundaryCondition * > bcs
Definition boundary.h:249
Kokkos::View< int32_t * > face_image_face
Definition boundary.h:232
Weighted least-squares gradient of W = [rho, u, p] over face neighbors, with boundary ghost states pl...
Definition gradient.h:85
KOKKOS_INLINE_FUNCTION void neighbor(const uint32_t i_cell, const uint32_t i_face, const rtype *W_i, rtype *dx, rtype *W_j) const
Offset to and state of the neighbor across face i_face.
Definition gradient.h:114
Kokkos::View< uint32_t * > offsets_faces_of_cell
Definition gradient.h:86
Kokkos::View< uint32_t * > faces_of_cell
Definition gradient.h:87
BoundaryData boundaries
Definition gradient.h:94
Kokkos::View< int32_t *[2]> cells_of_face
Definition gradient.h:88
Kokkos::View< rtype *[N_CONSERVATIVE]> W
Definition gradient.h:95
Gradient over all vertex neighbors plus the boundary ghost states of the cell's own boundary faces,...
Definition gradient.h:233
Kokkos::View< uint32_t * > offsets_cells_of_cell
Definition gradient.h:235
Kokkos::View< uint32_t * > cells_of_cell
Definition gradient.h:236
LSQGradientFunctor faces
Definition gradient.h:234
VertexGradientWeights weights
Definition gradient.h:238
Gradients of [u, T, X_1 .. X_Ns] with the weights and stencil of the viscous gradient (LSQVertexGradi...
Definition mixture_viscous_flux.h:89
Kokkos::View< rtype ***, Kokkos::LayoutRight > gradients
Definition mixture_viscous_flux.h:92
static constexpr uint32_t CHUNK
Definition mixture_viscous_flux.h:96
KOKKOS_INLINE_FUNCTION void operator()(const uint32_t c) const
Definition mixture_viscous_flux.h:99
Kokkos::View< rtype **, Kokkos::LayoutRight > bc_values
Definition mixture_viscous_flux.h:93
uint32_t n_species
Definition mixture_viscous_flux.h:94
LSQVertexGradientFunctor stencil
Definition mixture_viscous_flux.h:90
Kokkos::View< rtype **, Kokkos::LayoutRight > values
Definition mixture_viscous_flux.h:91
Per cell: viscosity, conductivity and the time step's effective diffusivity max(4/3 mu / rho,...
Definition mixture_viscous_flux.h:46
Kokkos::View< rtype *[N_CONSERVATIVE]> W
Definition mixture_viscous_flux.h:48
Kokkos::View< double **, Kokkos::LayoutRight > diffusion
Definition mixture_viscous_flux.h:51
Kokkos::View< rtype **, Kokkos::LayoutRight > values
Definition mixture_viscous_flux.h:52
ScalarView scalars
Definition mixture_viscous_flux.h:49
Mixture gas
Definition mixture_viscous_flux.h:47
Kokkos::View< rtype *[3]> coefficients
Definition mixture_viscous_flux.h:50
KOKKOS_INLINE_FUNCTION void operator()(const uint32_t c) const
Definition mixture_viscous_flux.h:55
Geometry of an interior face: unit normal, centroid offset and its normal component.
Definition mixture_viscous_flux.h:191
int32_t c0
Definition mixture_viscous_flux.h:192
int32_t c1
Definition mixture_viscous_flux.h:192
rtype dvar
Definition mixture_viscous_flux.h:195
rtype d[N_DIM]
Definition mixture_viscous_flux.h:193
rtype d_n
Definition mixture_viscous_flux.h:193
rtype n[N_DIM]
Definition mixture_viscous_flux.h:193
rtype t
Definition mixture_viscous_flux.h:194
Diffusive fluxes of a gas mixture on every face (one-point rule), added to face_flux (momentum and en...
Definition mixture_viscous_flux.h:164
Kokkos::View< rtype *[3]> coefficients
Definition mixture_viscous_flux.h:177
ScalarView scalars
Definition mixture_viscous_flux.h:174
Kokkos::View< rtype *[3]> covariance
Definition mixture_viscous_flux.h:182
Kokkos::View< rtype *[3]> sgs
Definition mixture_viscous_flux.h:183
static constexpr uint8_t NQ
Definition mixture_viscous_flux.h:186
KOKKOS_INLINE_FUNCTION Geometry geometry(const uint32_t f) const
Definition mixture_viscous_flux.h:199
Mixture gas
Definition mixture_viscous_flux.h:173
Kokkos::View< rtype *[N_DIM]> shifts
Definition mixture_viscous_flux.h:170
Kokkos::View< rtype *[N_DIM]> cell_coords
Definition mixture_viscous_flux.h:168
bool axisymmetric
Definition mixture_viscous_flux.h:181
Kokkos::View< rtype ***, Kokkos::LayoutRight > slots
Definition mixture_viscous_flux.h:180
Kokkos::View< rtype *[N_DIM]> normals
Definition mixture_viscous_flux.h:165
BoundaryData boundaries
Definition mixture_viscous_flux.h:172
Mode
Definition mixture_viscous_flux.h:188
Kokkos::View< rtype *[N_DIM]> face_coords
Definition mixture_viscous_flux.h:167
Kokkos::View< int32_t *[2]> cells_of_face
Definition mixture_viscous_flux.h:169
Kokkos::View< rtype *[N_CONSERVATIVE]> face_flux
Definition mixture_viscous_flux.h:179
Kokkos::View< rtype **, Kokkos::LayoutRight > values
Definition mixture_viscous_flux.h:175
Kokkos::View< uint8_t * > face_shift
Definition mixture_viscous_flux.h:171
Kokkos::View< rtype * > face_area
Definition mixture_viscous_flux.h:166
bool sgs_only
Definition mixture_viscous_flux.h:184
Kokkos::View< double **, Kokkos::LayoutRight > diffusion
Definition mixture_viscous_flux.h:178
KOKKOS_INLINE_FUNCTION rtype interior(const Geometry &G, const uint32_t v, rtype *g) const
Value and gradient of variable v on an interior face.
Definition mixture_viscous_flux.h:220
Kokkos::View< rtype ***, Kokkos::LayoutRight > gradients
Definition mixture_viscous_flux.h:176
KOKKOS_INLINE_FUNCTION void operator()(const uint32_t i_face) const
Definition mixture_viscous_flux.h:243
Device side of the mixture gas model, captured by value in kernels.
Definition mixture.h:45
uint32_t n_species
Definition mixture.h:48
chemistry::ThermoTable thermo
Definition mixture.h:46
chemistry::TransportTable transport
Definition mixture.h:47
Mass fractions of a cell from its scalars, in double.
Definition mixture_viscous_flux.h:30
KOKKOS_INLINE_FUNCTION double operator()(const uint32_t k) const
Definition mixture_viscous_flux.h:32
const rtype * Y
Definition mixture_viscous_flux.h:31
Kokkos::View< rtype *[N_DIM]> cells
Definition gradient.h:218
Kokkos::View< rtype *[N_DIM]> faces
Definition gradient.h:219
KOKKOS_INLINE_FUNCTION double gas_constant(const F_Y &y) const
Mixture gas constant R_u sum_k Y_k / W_k [J/(kg K)].
Definition thermo.h:117
KOKKOS_INLINE_FUNCTION double cp_mass(const double T, const F_Y &y) const
Mixture cp [J/(kg K)].
Definition thermo.h:125
KOKKOS_INLINE_FUNCTION double h_RT(const uint32_t k, const Powers &p) const
h_k / (R T), molar enthalpy including the formation enthalpy.
Definition thermo.h:96
Kokkos::View< double *, MemorySpace > inv_W
Definition thermo.h:45
static KOKKOS_INLINE_FUNCTION Powers powers(const double T)
Definition thermo.h:59
Kokkos::View< double *, MemorySpace > W
Definition transport.h:90
KOKKOS_INLINE_FUNCTION void properties(const double T, const double p, const double rho, const double cp, const F_Y &y, double &mu, double &lambda, double *D, double *DT=nullptr) const
Mixture viscosity mu [Pa s], conductivity lambda [W/(m K)] and species diffusion coefficients D [m^2/...
Definition transport.h:139
bool thermal_diffusion
Definition transport.h:97
CellSetup< ExecSpace > c
Definition teno_setup.cpp:1810
Geometry< Space > g
Definition teno_setup.cpp:678
uint16_t ns
Definition teno_setup.cpp:688
SlotArray< double, Space > A
Definition teno_setup.cpp:478
@ DT
Definition time_integrator.h:55
Viscous (diffusive) flux functor for the Navier-Stokes equations.
KOKKOS_INLINE_FUNCTION rtype mean_offset(const rtype *g0, const rtype *g1, const rtype *d, const rtype dvar)
Part of the jump of two cell averages that comes from the cells' different spreads (variance jump dva...
Definition viscous_flux.h:82
KOKKOS_INLINE_FUNCTION rtype variance_jump(const Kokkos::View< rtype *[3]> &covariance, const int32_t c0, const int32_t c1, const rtype *d)
Axisymmetric meshes: jump from cell c0 to c1 of the cells' r-weighted variance along d (Mesh::cell_co...
Definition viscous_flux.h:58
KOKKOS_INLINE_FUNCTION void viscous_traction(const rtype mu, const rtype g[][N_DIM], const rtype *n, rtype *tau_n, const rtype hoop_divergence=0.0_r)
Viscous traction tau . n of a Newtonian fluid under Stokes' hypothesis, tau = mu (grad u + grad u^T -...
Definition viscous_flux.h:27
KOKKOS_INLINE_FUNCTION rtype hoop_divergence(const rtype r, const rtype *u, const rtype g[][N_DIM])
u_r / r at radius r for velocity u and gradient g (g[k][i] = d u_k / d x_i), with r = y: its limit d ...
Definition viscous_flux.h:49
KOKKOS_INLINE_FUNCTION rtype face_fraction(const Kokkos::View< rtype *[N_DIM]> &face_coords, const Kokkos::View< rtype *[N_DIM]> &cell_coords, const uint32_t f, const int32_t c0, const rtype *d)
Fraction along d (from the center of cell c0 to that of its neighbor) of the projection of face f's c...
Definition viscous_flux.h:93