flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
full_stress.hpp File Reference

flow — the transpose half of the full deviatoric viscous stress on the staggered grid. More...

#include <cstdint>
#include <Kokkos_Core.hpp>
#include "mac_cutcell.hpp"

Go to the source code of this file.

Namespaces

namespace  peclet
namespace  peclet::flow

Typedefs

using peclet::flow::RegMask = Kokkos::View<std::uint8_t*, CCMem>
 Per-component regular-node mask (§5.4): 1 = a velocity node with neither a solid nor a cut row.
using peclet::flow::RegConst = Kokkos::View<const std::uint8_t*, CCMem>

Functions

template<class FaceProps, bool kSolid>
void peclet::flow::addFullStressRhs (int c, CCField bb, CCConst rs, const CCConst(&v)[3], FaceProps fp, C3 e, int g, double wc, bool skipLoC, const RegConst(&reg)[3]={RegConst(), RegConst(), RegConst()})
 Add rs_c · T_c(uⁿ) to the momentum RHS bb of component c over the inner cells [g, e−g)³.
void peclet::flow::muRangeInner (CCConst mu, C3 e, int g, double &lo, double &hi)
 The local min and max of mu over [g−1, e−g+1)³ — the inner cells plus the one ghost ring the transpose term reads (§4.3 step 2).

Detailed Description

flow — the transpose half of the full deviatoric viscous stress on the staggered grid.

Design: doc/full_viscous_stress.md (§4–§5). The Laplacian band kernel (ibmBuildDiffusionVar) discretizes ∇·(μ∇u); with variable μ the momentum equation needs ∇·(μ(∇u + ∇uᵀ)) = ∇·(2μD). This header adds the missing term

T_c = Σ_a ∂_a(μ ∂_c u_a)

as the divergence of conservative MAC stress elements, EXPLICIT on the time base uⁿ:

normal element at cell k: N_c(k) = β_c(k, k+s_c) · (v_c(k+s_c) − v_c(k)) shear element, edge (+a): S_c(i,+a) = β_c(i, i+s_a) · (v_a(i+s_a) − v_a(i+s_a−s_c)) shear element, edge (−a): S_c(i,−a) = β_c(i, i−s_a) · (v_a(i) − v_a(i−s_c)) T_c(i) = w_c · (((N_c(i) − N_c(i−s_c)) + (S_c(i,+a1) − S_c(i,−a1))) + (S_c(i,+a2) − S_c(i,−a2))) bb_c(i) += rs_c(i) · T_c(i)

with a1 < a2 the two other axes (this association order is fixed), β_c the SAME face viscosity the Laplacian bands use (VarFaceProps::beta of component c, before the ×w multiplication), and w_c the metric weight of the COMPONENT axis (§3). Because β is bitwise symmetric under (i, j) swap, S_c(i,+a) ≡ S_c(i+s_a,−a) and the sum telescopes exactly. Never the product form (∇μ)·(∇u)ᵀ, never on the Picard iterate: register, flow "Variable viscosity uses the full deviatoric stress".

Definition in file full_stress.hpp.