flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
peclet::flow::sco Namespace Reference

Classes

struct  MaterialTable
 The per-body material of a conjugate scalar, internal units (§4.2): conj 1 on a conjugate body; lam = Lam_s' = C_s D_s K diffToInt, ck = C_s K, kp = K, rc = R_c resistToInt. More...
 
struct  MeanGradPosition
 G.x at the centre of extended-block cell j (physical; cellCentres' formula, unwrapped). More...
 
struct  WallTable
 Device copy of the per-body wall table, resolved (instance override or default) and converted to internal units: type, k', g, q'. More...
 

Functions

double lowAp (const CCConst &sax, const CCConst &say, const CCConst &saz, int a, long i)
 Face aperture of axis a at the low face of cell i (sa_a(i)).
 
void zeroNonUnknown (CCField c, CCConst unk, C3 e, int g)
 Zero c on every inner cell that is not a fluid unknown (§1.3: re-zeroed at the start of every advance or steady solve, since a user set_field may have written them).
 
void buildBands (CCField AC, CCField AW, CCField AE, CCField AS, CCField AN, CCField AB, CCField AT, CCConst kappa, CCConst unk, CCConst sax, CCConst say, CCConst saz, double lam, double idt, const double w[3], C3 e, int g)
 The 7 bands (§4.1): AC = kappa idt + sum of the six face terms Lam w_a a (guarded toward a cell that is not an unknown), off-diagonals -Lam w_a a; identity rows elsewhere.
 
void buildRhs (CCField b, CCConst cOld, CCConst kappa, CCConst unk, double idt, double srcConst, CCConst src, bool useField, double srcFactor, C3 e, int g)
 Base right-hand side: b = kappa (idt c^n + S'), identity rows 0.
 
void faceTangents (int a, int &t1, int &t2)
 The tangential axes of face axis a, in x, y, z order (t1 < t2): the layout of a domain-face profile (§8.1 set_scalar_bc), t1 fastest.
 
void dirichletFaceFold (CCField AC, CCField b, CCConst unk, CCConst saA, Kokkos::View< const double *, CCMem > gv, double lamW, int a, int side, C3 e, int g)
 Dirichlet domain face (§1.4 B_i): for the inner boundary cell i of face (a, side), if it is an unknown, AC += 2 Lam w_a a_bf and b += 2 Lam w_a a_bf g_bf, a_bf = the boundary face's snapped aperture (the low face of the first cell, or the high face at ext - G — both in the record).
 
double dirichletFaceInflux (CCConst c, CCConst unk, CCConst saA, Kokkos::View< const double *, CCMem > gv, double lamW, double vol, int a, int side, C3 e, int g)
 Sum over one Dirichlet domain face of V t (g_bf - c_i): the flux INTO the domain through it, per internal time (budget boundary_in).
 
void residualFluxForm (CCField r, CCConst c, CCConst b, CCConst kappa, CCConst unk, CCConst sax, CCConst say, CCConst saz, double lam, double idt, const double w[3], C3 e, int g)
 The budget's residual r = b - A c in FLUX form (§9): r = b - kappa idt c - sum_faces t (c_i - c_nb) with the same guarded face terms t as buildBands; the caller then subtracts the overlay (overlayApply(..., subtract)) and the Dirichlet-domain folds (dirichletFaceResidual).
 
void dirichletFaceResidual (CCField r, CCConst c, CCConst unk, CCConst saA, double lamW, int a, int side, C3 e, int g)
 r(i) -= 2 Lam w_a a_bf c_i on the inner boundary cells of a Dirichlet domain face (the LHS part of dirichletFaceFold, for the flux-form residual).
 
void facetCoefficients (Kokkos::View< double *, CCMem > cw, Kokkos::View< double *, CCMem > rw, const scg::ScalarFacetOverlay &fo, CCConst unk, const WallTable &wt, double lam)
 Per-facet overlay coefficients (§4.1): cw = alpha G, rw = alpha G g (Dirichlet/Robin) or cw = 0, rw = alpha q (Neumann); both 0 on a facet whose cell is not an unknown.
 
void overlayApply (CCField y, CCConst x, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, bool subtract=false)
 y(i) += sum over the facets of cut cell i of cw * (probe interpolation of x): the overlay pass of the matvec (§4.1 step 3).
 
void overlayRhs (CCField b, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > rw)
 b(i) += sum over the facets of cut cell i of rw (the wall part of the right-hand side).
 
void surrogateDiagonal (CCField SAC, CCConst AC, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw)
 The level-0 surrogate diagonal (§4.3): SAC = AC + sum of the cut cell's cw (the probe weights lumped, sum w_k = 1).
 
void facetFlux (Kokkos::View< double *, CCMem > up, Kokkos::View< double *, CCMem > qin, CCConst x, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, Kokkos::View< const double *, CCMem > rw)
 Per facet: the probe value u_p of x and the wall flux INTO the fluid per unit cell volume per internal time, rw - cw u_p (§1.4: the row carries + cw u_p - rw = alpha Q, the flux out).
 
template<class R >
void dotReduce (CCConst a, CCConst b, C3 e, int g, R &&result)
 sum over inner cells of a(i) b(i), into result.
 
double dotLocal (CCConst a, CCConst b, C3 e, int g)
 
template<class R1 , class R2 >
void dot2Reduce (CCConst a, CCConst b, CCConst c, C3 e, int g, R1 &&r1, R2 &&r2)
 (sum a b, sum c c) over inner cells in one pass, into (r1, r2).
 
void dot2Local (CCConst a, CCConst b, CCConst c, C3 e, int g, double &ab, double &cc)
 
template<class Red >
void maxabsReduce (CCConst a, C3 e, int g, Red red)
 max over inner cells of |a|, through the Max reducer red (Kokkos::Max over a host double or a device slot).
 
double maxabsLocal (CCConst a, C3 e, int g)
 
void sumUnknownLocal (CCConst a, CCConst unk, C3 e, int g, double &sum, double &sumAbs)
 (sum a, sum |a|) over the inner cells that are unknowns.
 
void addOnUnknown (CCField a, CCConst unk, double d, C3 e, int g)
 a(i) += d on the inner cells that are unknowns.
 
void kappaMomentsLocal (CCConst c, CCConst kappa, CCConst unk, C3 e, int g, double &kc, double &k)
 (sum kappa c, sum kappa) over the unknowns (times V by the caller).
 
double sourceSumLocal (CCConst kappa, CCConst unk, double srcConst, CCConst src, bool useField, double srcFactor, C3 e, int g)
 sum over unknowns of kappa S' (the source part of the right-hand side, per unit V).
 
void faceFluxes (CCField phi, CCConst vel, CCConst open, CCConst unk, int a, C3 e)
 phi = open * vel on every face whose two cells are inside the block (0 on the block's lowest layer), and 0 where either cell is not a fluid unknown: the advective analogue of the band guard of ruling D-WO3-4 (a non-unknown row is an identity row and cannot take its half of the flux; at a non-periodic global face the cleared ghost flag zeroes the wall/slip face, where u.n = 0).
 
void faceFluxCountsLocal (CCConst phi, CCConst vel, CCConst open, int a, C3 e, int g, long &nFlux, long &nGuarded)
 (faces carrying flux, faces whose nonzero open * vel the guard zeroed) over the low faces of the inner cells (each interior face exactly once over all ranks; a non-periodic high domain face is not counted).
 
double maxAbsFluxLocal (CCConst phx, CCConst phy, CCConst phz, C3 e, int g)
 max |phi| over the low faces of the inner cells (0: no advection this step).
 
double maxCellPecletLocal (CCConst phx, CCConst phy, CCConst phz, CCConst unk, double lam, const double w[3], C3 e, int g)
 A2 census max_cell_peclet on this rank: the max over the interior flux faces (the low faces of the inner cells whose two cells are fluid unknowns) and the axes of |phi_a| / (lam w_a), the aperture-weighted face Peclet number |u_a| a h_a / D (lam = 0 with flux: +inf).
 
void clampNonNegative (CCField omega, C3 e, int g)
 omega = max(omega, 0) on the inner cells (A2: implicit backflow never enters the coarse mass).
 
double cellOutflow (const CCConst &phx, const CCConst &phy, const CCConst &phz, long i, long sy, long sz)
 Out_i = sum over the six faces of max(F_out, 0), per unit V (§6.3), in a fixed order.
 
double bulkCourantLocal (CCConst phx, CCConst phy, CCConst phz, CCConst kappa, CCConst unk, CCConst sax, CCConst say, CCConst saz, double dt, C3 e, int g)
 C_bulk of §6.3 on this rank: max over the inner FULL cells (an unknown with kappa = 1 and all six snapped apertures 1) of dt Out_i.
 
void smallCells (CCField small, CCConst phx, CCConst phy, CCConst phz, CCConst kappa, CCConst unk, double dt, double thr, C3 e, int g)
 The small-cell flags of §6.3 over the inner cells: small(i) = 1 iff i is an unknown, kappa_i < 1 and dt Out_i > thr kappa_i, thr = max(1/2, C_bulk); 0 elsewhere on the block.
 
long countSmallLocal (CCConst small, C3 e, int g)
 Count of small inner cells (census num_small_cells).
 
long countImplicitLocal (CCConst phi, CCConst small, CCConst unk, int a, bool steady, C3 e, int g)
 Faces carrying flux that are implicit, over the low faces of the inner cells (census num_implicit_faces): steady, or either adjacent cell small.
 
void advectionBands (CCField AC, CCField AW, CCField AE, CCField AS, CCField AN, CCField AB, CCField AT, CCField outflow, CCConst phx, CCConst phy, CCConst phz, CCConst small, CCConst unk, bool steady, C3 e, int g)
 The implicit FOU part of the operator (§1.4, §6.3; all faces when steady, §6.7): on every unknown inner cell, for each face that is implicit (steady, or either cell small), AC += max(F_out, 0) and the band toward the neighbour += min(F_out, 0); outflow = the sum of the max(F_out, 0) added (the surrogate's lumped outflow, §4.3), 0 on every other inner cell.
 
void explicitFaceFluxes (CCField Phi, CCConst phi, CCConst c, CCConst unk, CCConst small, int a, int scheme, bool steady, C3 e, int g)
 The explicit face fluxes of §6.2 on the low a-faces of the cells g .
 
void explicitAdvectionRhs (CCField b, CCConst Px, CCConst Py, CCConst Pz, CCConst unk, C3 e, int g)
 b(i) -= the net explicit outflow sum_a (Phi_a(i + s_a) - Phi_a(i)) on the unknown inner cells.
 
void advectionResidual (CCField r, CCConst c, CCConst phx, CCConst phy, CCConst phz, CCConst small, CCConst unk, bool steady, C3 e, int g)
 r(i) -= the implicit faces' net outflow sum F_out c_up at c (the budget's flux-form residual, §9): per face exactly the advectionBands terms, so a face's two contributions are exact negatives (an open domain face's: openFaceResidual).
 
void openFaceFluxes (CCField phi, Kokkos::View< const double *, CCMem > plane, CCConst unk, int a, int side, C3 e, int g)
 phi(bf) = plane value on the boundary face of (a, side), over the full transverse extent, where the inner-side cell is an unknown; 0 elsewhere on that plane.
 
void openFaceAdvection (CCField AC, CCField b, CCField outflow, CCConst cOld, CCConst phi, CCConst small, CCConst unk, Kokkos::View< const double *, CCMem > gv, bool inflow, int a, int side, bool steady, C3 e, int g, CCField omega=CCField(), bool wOmega=false)
 The open face's row terms on the unknown inner boundary cells of (a, side) (table above): inflow b += F_in g (gv over the inner tangential range, j1 + j2 n1, as dirichletFaceFold); outflow implicit (steady or small) AC += F_out and outflow += F_out (the surrogate's lumped outflow, as advectionBands), explicit b -= F_out c^n.
 
void openFaceResidual (CCField r, CCConst c, CCConst phi, CCConst small, CCConst unk, bool inflow, int a, int side, bool steady, C3 e, int g)
 r(i) -= F_out c_i on the implicit outflow faces of (a, side) (the budget's flux-form residual; the inflow and explicit terms sit in b).
 
double openFaceInflux (CCConst c, CCConst cOld, CCConst phi, CCConst small, CCConst unk, Kokkos::View< const double *, CCMem > gv, bool inflow, double vol, int a, int side, bool steady, C3 e, int g)
 Sum over one open face of V times the advective flux INTO the domain through it, per internal time (budget boundary_in): inflow F_in g; outflow -F_out c_i at c (implicit) or c^n (explicit).
 
void openFaceCountsLocal (CCConst phi, CCConst small, CCConst unk, bool inflow, int a, int side, bool steady, C3 e, int g, long &nFlux, long &nImpl, long &nBack)
 The census counts of one open face over this rank's inner boundary cells: (faces carrying flux on the HIGH side — faceFluxCountsLocal already counts the low side's —, the implicit ones of either side: outflow with steady or a small inner cell, the BACKFLOW rows of an outflow face: F_out < 0, flow entering through it, whose inflow takes the zero-gradient value c_i; review finding 2, census num_backflow_faces).
 
double maxFacetLocal (Kokkos::View< const double *, CCMem > cw)
 max over facets of cw (0 when there is no Dirichlet/Robin facet: the steady singular test).
 
void meanGradientFaceRhs (CCField b, CCConst unk, CCConst sax, CCConst say, CCConst saz, const double gf[3], C3 e, int g)
 Faces (§1.5): b(i) += sum_a gf_a (a_a^+ - a_a^-) over the coupled faces (the bands' guard), gf_a = Lam w_a h'_a G'_a — the G.x part of the face terms Lam w_a a (c_i - c_nb) moved to the right-hand side.
 
void meanGradientProbeShift (Kokkos::View< double *, CCMem > rw, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, const MeanGradPosition &pos)
 Dirichlet/Robin probes (§1.5): rw(f) -= cw(f) sum_k w_k G.x_k, so that rw = alpha G_phi (g - sum_k w_k G.x_k); x_k the global centres of the stencil cells.
 
void cellVelocity (const CCConst &phx, const CCConst &phy, const CCConst &phz, long i, long sy, long sz, const double hh[3], double u[3])
 U'_a/V of cell i (§1.5): the volume-integrated cell velocity sum_f F_out (x_f - x_i) per unit full-cell volume, = (h'_a/2) (phi_a(i + s_a) + phi_a(i)) (internal length per internal time).
 
void cellVelocitySumLocal (CCConst phx, CCConst phy, CCConst phz, CCConst unk, const double hh[3], C3 e, int g, double s[3])
 (sum U'_x/V, sum U'_y/V, sum U'_z/V) over the unknown inner cells (the moving frame's numerator; its denominator is sum kappa, kappaMomentsLocal).
 
void meanGradientAdvectionRhs (CCField b, CCConst phx, CCConst phy, CCConst phz, CCConst kappa, CCConst unk, const double gi[3], const double hh[3], const double ub[3], C3 e, int g)
 Advection (§1.5): b(i) -= G'.
 
void meanFluxLocal (CCConst th, CCConst kappa, CCConst unk, CCConst sax, CCConst say, CCConst saz, CCConst phx, CCConst phy, CCConst phz, bool advecting, double lam, const double gi[3], const double hp[3], const double ub[3], C3 e, int g, double diff[3], double adv[3])
 scalar_mean_flux (§8.1), this rank's sums (internal; the caller divides by the global cell count): diffusive, over the low faces of the inner cells whose two cells are unknowns, sum -Lam a (theta_i - theta_{i - s_a} + G'_a h'_a) / h'_a; advective, over the unknown inner cells, sum (U'_i/V - kappa_i U'bar) theta_i (zero when the operator carried no advection).
 
int bodyIndex (double m, int nb)
 A body id clamped into the table (out of range -> 0, as facetCoefficients does).
 
double solidFaceLam (const Kokkos::View< double *, CCMem > &lam, int ma, int mb)
 Lam_face of a solid face between materials ma and mb (§1.4): Lam_s of the material when equal, the harmonic mean when they differ.
 
void buildSolidMaterial (CCField mat, CCField sunk, CCConst kappa, CCConst sax, CCConst say, CCConst saz, const scg::ScalarFacetOverlay &fo, Kokkos::View< const int *, CCMem > owner, bool hasOwner, const MaterialTable &mt, C3 e, int g, double vol[2])
 The material per cell and the solid-unknown flags on the inner cells (§1.3, §2.7).
 
void buildSolidProbes (Kokkos::View< double *, CCMem > sS, Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem > offS, Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem > wS, Kokkos::View< std::uint8_t *, CCMem > rungS, Kokkos::View< const std::uint8_t *, CCMem > conjF, const scg::ScalarFacetOverlay &fo, CCConst sdf, CCConst sunk, C3 e, const double hp[3])
 The solid probe ladder (§3.4): per facet of a conjugate body (conjF), the ladder of §3.3 with -n, the solid-unknown flags and -phi.
 
void solidFaceProducts (CCField spx, CCField spy, CCField spz, CCConst sunk, CCConst mat, CCConst sax, CCConst say, CCConst saz, const MaterialTable &mt, C3 e)
 The level-0 solid face products P_a(i) = Lam_face a_s on the LOW a-face of cell i when cells i - s_a and i are both solid unknowns, else 0 (0 on the block's lowest layer).
 
void solidMass (CCField ms, CCConst kappa, CCConst sunk, CCConst mat, const MaterialTable &mt, double idt, C3 e, int g)
 The solid mass m_s = C_s K kappa_s idt on the solid unknowns, 0 elsewhere (inner cells).
 
void solidBands (CCField AC, CCField AW, CCField AE, CCField AS, CCField AN, CCField AB, CCField AT, CCConst ms, CCConst sunk, CCConst spx, CCConst spy, CCConst spz, const double w[3], C3 e, int g)
 The solid phase's 7 bands (§4.1): AC = m_s + the six face terms w_a P, off-diagonals -w_a P; identity rows on the cells that are not solid unknowns.
 
void solidRhs (CCField bs, CCConst ms, CCConst sOld, C3 e, int g)
 The solid right-hand side b_s = m_s psi_s^n (no solid source in v1, §13 Q17); 0 elsewhere.
 
void conjugateCoefficients (Kokkos::View< double *, CCMem > cc, const scg::ScalarFacetOverlay &fo, Kokkos::View< const std::uint8_t *, CCMem > conjF, Kokkos::View< const double *, CCMem > sS, CCConst unk, CCConst sunk, const MaterialTable &mt, double lamF)
 Per facet (§1.4, §4.1): cc = alpha G_c, G_c = 1/(s_f/Lam_f + R_c + s_s/Lam_s), on a facet of a conjugate body whose cell is both a fluid and a solid unknown (the material of the facet's body); 0 elsewhere (a facet that cannot enter both rows carries no coupling: conservation).
 
void conjOverlayApply (CCField yf, CCField ys, CCConst xf, CCConst xs, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, Kokkos::View< const double *, CCMem > cc, Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem > offS, Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem > wS, bool subtract=false)
 The two-field overlay (§4.1 step 3), one thread per cut cell, facets in CSR order: y_f(i) += sum cw u_pf + sum cc (u_pf - u_ps), y_s(i) += sum cc (u_ps - u_pf).
 
void conjSurrogate (CCField SACf, CCField SACs, CCField W0, CCConst ACf, CCConst ACs, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, Kokkos::View< const double *, CCMem > cc)
 The two-field level-0 surrogate (§4.3): SAC_f = AC_f + sum (cw + cc), SAC_s = AC_s + sum cc, W0 = sum cc (the same-cell coupling, S_{i_f, i_s} = -W0) on the cut cells; W0 = 0 elsewhere.
 
void conjMeanGradientShift (CCField bf, CCField bs, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cc, Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem > offS, Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem > wS, const MeanGradPosition &pos)
 Mean-gradient mode, conjugate facets (§1.5): the fluid row carries + cc (u_pf - u_ps) with u = theta + G.x, so its G.x part, cc (GxF - GxS), moves to the right-hand side — b_f += cc (GxS - GxF) and b_s -= cc (GxS - GxF), GxF = sum_k wF_k G.x_k, GxS = sum_k wS_k G.x_k.
 
void solidMeanGradientFaceRhs (CCField bs, CCConst sunk, CCConst spx, CCConst spy, CCConst spz, const double gs[3], C3 e, int g)
 Mean-gradient mode, solid faces (§1.5): b_s(i) += sum_a gs_a (P_a(i + s_a) - P_a(i)), gs_a = w_a h'_a G'_a, over the solid-coupled faces (P is guarded) — the G.x part of w_a P (psi_i - psi_nb).
 
void solidResidualFluxForm (CCField r, CCConst x, CCConst b, CCConst ms, CCConst sunk, CCConst spx, CCConst spy, CCConst spz, const double w[3], C3 e, int g)
 The solid residual in FLUX form (the budget, §9): r = b - m_s psi - sum_faces t (psi_i - psi_nb); the caller subtracts the overlay.
 
void solidMomentsLocal (CCConst xs, CCConst kappa, CCConst sunk, CCConst mat, const MaterialTable &mt, C3 e, int g, double &m, double &w)
 (sum C_s K kappa_s psi_s, sum C_s K kappa_s) over the solid unknowns (times V by the caller): the solid mass and the gauge weight.
 
void conjFacetFlux (Kokkos::View< double *, CCMem > up, Kokkos::View< double *, CCMem > us, Kokkos::View< double *, CCMem > qin, CCConst xf, CCConst xs, const scg::ScalarFacetOverlay &fo, Kokkos::View< const double *, CCMem > cw, Kokkos::View< const double *, CCMem > rw, Kokkos::View< const double *, CCMem > cc, Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem > offS, Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem > wS, const MeanGradPosition &pos, bool mgOn)
 Per facet: the probe values and the flux INTO the fluid per unit cell volume per internal time, rw - cw u_pf on a wall facet, cc (u_ps - u_pf) on a conjugate one (scalar_wall_flux, scalar_facets).
 
template<class R >
void dotTwoReduce (CCConst af, CCConst bf, CCConst as, CCConst bs, C3 e, int g, R &&result)
 sum over inner cells of af bf + as bs (the two-field dot).
 
double dotTwoLocal (CCConst af, CCConst bf, CCConst as, CCConst bs, C3 e, int g)
 
template<class R1 , class R2 >
void dot2TwoReduce (CCConst af, CCConst bf, CCConst cf, CCConst as, CCConst bs, CCConst cs, C3 e, int g, R1 &&r1, R2 &&r2)
 (sum a b, sum c c) over inner cells, both fields, in one pass, into (r1, r2).
 
void dot2TwoLocal (CCConst af, CCConst bf, CCConst cf, CCConst as, CCConst bs, CCConst cs, C3 e, int g, double &ab, double &cc)
 
void solidMeanFluxLocal (CCConst th, CCConst sunk, CCConst spx, CCConst spy, CCConst spz, const double gi[3], const double hp[3], C3 e, int g, double diff[3])
 The solid part of scalar_mean_flux's diffusive sum (§8.1): over the low faces of the inner cells whose two cells are solid unknowns, sum -P (theta_i - theta_{i - s_a} + G'_a h'_a)/h'_a.
 

Function Documentation

◆ lowAp()

double peclet::flow::sco::lowAp ( const CCConst &  sax,
const CCConst &  say,
const CCConst &  saz,
int  a,
long  i 
)

Face aperture of axis a at the low face of cell i (sa_a(i)).

Definition at line 167 of file scalar_cutcell_operator.hpp.

◆ zeroNonUnknown()

void peclet::flow::sco::zeroNonUnknown ( CCField  c,
CCConst  unk,
C3  e,
int  g 
)
inline

Zero c on every inner cell that is not a fluid unknown (§1.3: re-zeroed at the start of every advance or steady solve, since a user set_field may have written them).

Definition at line 174 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ buildBands()

void peclet::flow::sco::buildBands ( CCField  AC,
CCField  AW,
CCField  AE,
CCField  AS,
CCField  AN,
CCField  AB,
CCField  AT,
CCConst  kappa,
CCConst  unk,
CCConst  sax,
CCConst  say,
CCConst  saz,
double  lam,
double  idt,
const double  w[3],
C3  e,
int  g 
)
inline

The 7 bands (§4.1): AC = kappa idt + sum of the six face terms Lam w_a a (guarded toward a cell that is not an unknown), off-diagonals -Lam w_a a; identity rows elsewhere.

Definition at line 186 of file scalar_cutcell_operator.hpp.

References AC, and peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ buildRhs()

void peclet::flow::sco::buildRhs ( CCField  b,
CCConst  cOld,
CCConst  kappa,
CCConst  unk,
double  idt,
double  srcConst,
CCConst  src,
bool  useField,
double  srcFactor,
C3  e,
int  g 
)
inline

Base right-hand side: b = kappa (idt c^n + S'), identity rows 0.

src is the per-cell source (physical) when useField, else the constant srcConst; both times srcFactor (= tRef).

Definition at line 218 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ faceTangents()

void peclet::flow::sco::faceTangents ( int  a,
int &  t1,
int &  t2 
)

◆ dirichletFaceFold()

void peclet::flow::sco::dirichletFaceFold ( CCField  AC,
CCField  b,
CCConst  unk,
CCConst  saA,
Kokkos::View< const double *, CCMem >  gv,
double  lamW,
int  a,
int  side,
C3  e,
int  g 
)
inline

Dirichlet domain face (§1.4 B_i): for the inner boundary cell i of face (a, side), if it is an unknown, AC += 2 Lam w_a a_bf and b += 2 Lam w_a a_bf g_bf, a_bf = the boundary face's snapped aperture (the low face of the first cell, or the high face at ext - G — both in the record).

Definition at line 243 of file scalar_cutcell_operator.hpp.

References AC, and faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ dirichletFaceInflux()

double peclet::flow::sco::dirichletFaceInflux ( CCConst  c,
CCConst  unk,
CCConst  saA,
Kokkos::View< const double *, CCMem >  gv,
double  lamW,
double  vol,
int  a,
int  side,
C3  e,
int  g 
)
inline

Sum over one Dirichlet domain face of V t (g_bf - c_i): the flux INTO the domain through it, per internal time (budget boundary_in).

Summed in a fixed (j1, j2) order on the host.

Definition at line 270 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ residualFluxForm()

void peclet::flow::sco::residualFluxForm ( CCField  r,
CCConst  c,
CCConst  b,
CCConst  kappa,
CCConst  unk,
CCConst  sax,
CCConst  say,
CCConst  saz,
double  lam,
double  idt,
const double  w[3],
C3  e,
int  g 
)
inline

The budget's residual r = b - A c in FLUX form (§9): r = b - kappa idt c - sum_faces t (c_i - c_nb) with the same guarded face terms t as buildBands; the caller then subtracts the overlay (overlayApply(..., subtract)) and the Dirichlet-domain folds (dirichletFaceResidual).

Equal to the band form b - A c in exact arithmetic; its round-off is eps |t (c_i - c_nb)| instead of eps t |c|, and a face's two contributions are exact negatives, so the identity of §1.6.1 closes to the round-off of the fluxes themselves even at large dt D / h^2. Identity rows give r = 0. The solve itself never uses this form.

Definition at line 309 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ dirichletFaceResidual()

void peclet::flow::sco::dirichletFaceResidual ( CCField  r,
CCConst  c,
CCConst  unk,
CCConst  saA,
double  lamW,
int  a,
int  side,
C3  e,
int  g 
)
inline

r(i) -= 2 Lam w_a a_bf c_i on the inner boundary cells of a Dirichlet domain face (the LHS part of dirichletFaceFold, for the flux-form residual).

Definition at line 338 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ facetCoefficients()

void peclet::flow::sco::facetCoefficients ( Kokkos::View< double *, CCMem >  cw,
Kokkos::View< double *, CCMem >  rw,
const scg::ScalarFacetOverlay &  fo,
CCConst  unk,
const WallTable &  wt,
double  lam 
)
inline

Per-facet overlay coefficients (§4.1): cw = alpha G, rw = alpha G g (Dirichlet/Robin) or cw = 0, rw = alpha q (Neumann); both 0 on a facet whose cell is not an unknown.

Definition at line 370 of file scalar_cutcell_operator.hpp.

References G.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ overlayApply()

void peclet::flow::sco::overlayApply ( CCField  y,
CCConst  x,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
bool  subtract = false 
)
inline

y(i) += sum over the facets of cut cell i of cw * (probe interpolation of x): the overlay pass of the matvec (§4.1 step 3).

One thread per cut cell, facets in CSR order: deterministic, no atomics. subtract = true gives y(i) -= that sum instead (the budget's flux-form residual). No fence: the next kernel on the execution space is ordered after it (WO-9b).

Definition at line 419 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), and peclet::flow::Solver< Grid >::scalarCutMatvec().

◆ overlayRhs()

void peclet::flow::sco::overlayRhs ( CCField  b,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  rw 
)
inline

b(i) += sum over the facets of cut cell i of rw (the wall part of the right-hand side).

Definition at line 445 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ surrogateDiagonal()

void peclet::flow::sco::surrogateDiagonal ( CCField  SAC,
CCConst  AC,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw 
)
inline

The level-0 surrogate diagonal (§4.3): SAC = AC + sum of the cut cell's cw (the probe weights lumped, sum w_k = 1).

Off-diagonals are the bands themselves.

Definition at line 463 of file scalar_cutcell_operator.hpp.

References AC.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ facetFlux()

void peclet::flow::sco::facetFlux ( Kokkos::View< double *, CCMem >  up,
Kokkos::View< double *, CCMem >  qin,
CCConst  x,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
Kokkos::View< const double *, CCMem >  rw 
)
inline

Per facet: the probe value u_p of x and the wall flux INTO the fluid per unit cell volume per internal time, rw - cw u_p (§1.4: the row carries + cw u_p - rw = alpha Q, the flux out).

Definition at line 482 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), peclet::flow::Solver< Grid >::scalarFacets(), and peclet::flow::Solver< Grid >::scalarWallFlux().

◆ dotReduce()

template<class R >
void peclet::flow::sco::dotReduce ( CCConst  a,
CCConst  b,
C3  e,
int  g,
R &&  result 
)
inline

sum over inner cells of a(i) b(i), into result.

Definition at line 510 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by dotLocal(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ dotLocal()

double peclet::flow::sco::dotLocal ( CCConst  a,
CCConst  b,
C3  e,
int  g 
)
inline

◆ dot2Reduce()

template<class R1 , class R2 >
void peclet::flow::sco::dot2Reduce ( CCConst  a,
CCConst  b,
CCConst  c,
C3  e,
int  g,
R1 &&  r1,
R2 &&  r2 
)
inline

(sum a b, sum c c) over inner cells in one pass, into (r1, r2).

Definition at line 527 of file scalar_cutcell_operator.hpp.

Referenced by dot2Local(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ dot2Local()

void peclet::flow::sco::dot2Local ( CCConst  a,
CCConst  b,
CCConst  c,
C3  e,
int  g,
double &  ab,
double &  cc 
)
inline

◆ maxabsReduce()

template<class Red >
void peclet::flow::sco::maxabsReduce ( CCConst  a,
C3  e,
int  g,
Red  red 
)
inline

max over inner cells of |a|, through the Max reducer red (Kokkos::Max over a host double or a device slot).

Definition at line 548 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by maxabsLocal(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ maxabsLocal()

double peclet::flow::sco::maxabsLocal ( CCConst  a,
C3  e,
int  g 
)
inline

◆ sumUnknownLocal()

void peclet::flow::sco::sumUnknownLocal ( CCConst  a,
CCConst  unk,
C3  e,
int  g,
double &  sum,
double &  sumAbs 
)
inline

(sum a, sum |a|) over the inner cells that are unknowns.

Definition at line 566 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ addOnUnknown()

void peclet::flow::sco::addOnUnknown ( CCField  a,
CCConst  unk,
double  d,
C3  e,
int  g 
)
inline

a(i) += d on the inner cells that are unknowns.

Definition at line 585 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ kappaMomentsLocal()

void peclet::flow::sco::kappaMomentsLocal ( CCConst  c,
CCConst  kappa,
CCConst  unk,
C3  e,
int  g,
double &  kc,
double &  k 
)
inline

(sum kappa c, sum kappa) over the unknowns (times V by the caller).

Definition at line 596 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ sourceSumLocal()

double peclet::flow::sco::sourceSumLocal ( CCConst  kappa,
CCConst  unk,
double  srcConst,
CCConst  src,
bool  useField,
double  srcFactor,
C3  e,
int  g 
)
inline

sum over unknowns of kappa S' (the source part of the right-hand side, per unit V).

Definition at line 616 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ faceFluxes()

void peclet::flow::sco::faceFluxes ( CCField  phi,
CCConst  vel,
CCConst  open,
CCConst  unk,
int  a,
C3  e 
)
inline

phi = open * vel on every face whose two cells are inside the block (0 on the block's lowest layer), and 0 where either cell is not a fluid unknown: the advective analogue of the band guard of ruling D-WO3-4 (a non-unknown row is an identity row and cannot take its half of the flux; at a non-periodic global face the cleared ghost flag zeroes the wall/slip face, where u.n = 0).

Definition at line 642 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ faceFluxCountsLocal()

void peclet::flow::sco::faceFluxCountsLocal ( CCConst  phi,
CCConst  vel,
CCConst  open,
int  a,
C3  e,
int  g,
long &  nFlux,
long &  nGuarded 
)
inline

(faces carrying flux, faces whose nonzero open * vel the guard zeroed) over the low faces of the inner cells (each interior face exactly once over all ranks; a non-periodic high domain face is not counted).

Definition at line 660 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ maxAbsFluxLocal()

double peclet::flow::sco::maxAbsFluxLocal ( CCConst  phx,
CCConst  phy,
CCConst  phz,
C3  e,
int  g 
)
inline

max |phi| over the low faces of the inner cells (0: no advection this step).

Definition at line 681 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ maxCellPecletLocal()

double peclet::flow::sco::maxCellPecletLocal ( CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  unk,
double  lam,
const double  w[3],
C3  e,
int  g 
)
inline

A2 census max_cell_peclet on this rank: the max over the interior flux faces (the low faces of the inner cells whose two cells are fluid unknowns) and the axes of |phi_a| / (lam w_a), the aperture-weighted face Peclet number |u_a| a h_a / D (lam = 0 with flux: +inf).

Definition at line 699 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ clampNonNegative()

void peclet::flow::sco::clampNonNegative ( CCField  omega,
C3  e,
int  g 
)
inline

omega = max(omega, 0) on the inner cells (A2: implicit backflow never enters the coarse mass).

Definition at line 722 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ cellOutflow()

double peclet::flow::sco::cellOutflow ( const CCConst &  phx,
const CCConst &  phy,
const CCConst &  phz,
long  i,
long  sy,
long  sz 
)

Out_i = sum over the six faces of max(F_out, 0), per unit V (§6.3), in a fixed order.

Definition at line 733 of file scalar_cutcell_operator.hpp.

Referenced by bulkCourantLocal(), and smallCells().

◆ bulkCourantLocal()

double peclet::flow::sco::bulkCourantLocal ( CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  kappa,
CCConst  unk,
CCConst  sax,
CCConst  say,
CCConst  saz,
double  dt,
C3  e,
int  g 
)
inline

C_bulk of §6.3 on this rank: max over the inner FULL cells (an unknown with kappa = 1 and all six snapped apertures 1) of dt Out_i.

Definition at line 742 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3(), and cellOutflow().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ smallCells()

void peclet::flow::sco::smallCells ( CCField  small,
CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  kappa,
CCConst  unk,
double  dt,
double  thr,
C3  e,
int  g 
)
inline

The small-cell flags of §6.3 over the inner cells: small(i) = 1 iff i is an unknown, kappa_i < 1 and dt Out_i > thr kappa_i, thr = max(1/2, C_bulk); 0 elsewhere on the block.

The ghost layers are the caller's one exchange (review finding 6: the owner's flag, however its ghost fluxes were formed), followed by zeroNonUnknown over the whole block.

Definition at line 765 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3(), and cellOutflow().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ countSmallLocal()

long peclet::flow::sco::countSmallLocal ( CCConst  small,
C3  e,
int  g 
)
inline

Count of small inner cells (census num_small_cells).

Definition at line 781 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ countImplicitLocal()

long peclet::flow::sco::countImplicitLocal ( CCConst  phi,
CCConst  small,
CCConst  unk,
int  a,
bool  steady,
C3  e,
int  g 
)
inline

Faces carrying flux that are implicit, over the low faces of the inner cells (census num_implicit_faces): steady, or either adjacent cell small.

A face toward a non-unknown (an open domain face, WO-5b) is counted by openFaceCountsLocal instead.

Definition at line 797 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ advectionBands()

void peclet::flow::sco::advectionBands ( CCField  AC,
CCField  AW,
CCField  AE,
CCField  AS,
CCField  AN,
CCField  AB,
CCField  AT,
CCField  outflow,
CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  small,
CCConst  unk,
bool  steady,
C3  e,
int  g 
)
inline

The implicit FOU part of the operator (§1.4, §6.3; all faces when steady, §6.7): on every unknown inner cell, for each face that is implicit (steady, or either cell small), AC += max(F_out, 0) and the band toward the neighbour += min(F_out, 0); outflow = the sum of the max(F_out, 0) added (the surrogate's lumped outflow, §4.3), 0 on every other inner cell.

A face flux is one number read by both cells, so the face's two contributions are exact negatives (conservation). A face toward a non-unknown is skipped: its flux is 0 by the guard of faceFluxes except on an open domain face, whose row is openFaceAdvection's (WO-5b).

Definition at line 821 of file scalar_cutcell_operator.hpp.

References AC, peclet::flow::ccFor3(), and F.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ explicitFaceFluxes()

void peclet::flow::sco::explicitFaceFluxes ( CCField  Phi,
CCConst  phi,
CCConst  c,
CCConst  unk,
CCConst  small,
int  a,
int  scheme,
bool  steady,
C3  e,
int  g 
)
inline

The explicit face fluxes of §6.2 on the low a-faces of the cells g .

. ext_a - g (the high face of the last inner cell included), transverse inner: 0 on an implicit face (steady, or either cell small); else Phi = phi c*(c^n) with the legacy reconstruction (sadv: 0 fou, 1 koren, 2 sou), first-order upwind when any cell of the stencil (two upwind, one downwind) is not a fluid unknown — the ghosts beyond a non-periodic global face included (their flags are cleared). A face toward a non-unknown is skipped (0 by the guard of faceFluxes, or an open domain face, whose flux openFaceAdvection carries; WO-5b).

Definition at line 862 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3(), sadv::fou_flux(), sadv::sou(), and sadv::tvd().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ explicitAdvectionRhs()

void peclet::flow::sco::explicitAdvectionRhs ( CCField  b,
CCConst  Px,
CCConst  Py,
CCConst  Pz,
CCConst  unk,
C3  e,
int  g 
)
inline

b(i) -= the net explicit outflow sum_a (Phi_a(i + s_a) - Phi_a(i)) on the unknown inner cells.

Definition at line 888 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ advectionResidual()

void peclet::flow::sco::advectionResidual ( CCField  r,
CCConst  c,
CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  small,
CCConst  unk,
bool  steady,
C3  e,
int  g 
)
inline

r(i) -= the implicit faces' net outflow sum F_out c_up at c (the budget's flux-form residual, §9): per face exactly the advectionBands terms, so a face's two contributions are exact negatives (an open domain face's: openFaceResidual).

Definition at line 904 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3(), and F.

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ openFaceFluxes()

void peclet::flow::sco::openFaceFluxes ( CCField  phi,
Kokkos::View< const double *, CCMem >  plane,
CCConst  unk,
int  a,
int  side,
C3  e,
int  g 
)
inline

phi(bf) = plane value on the boundary face of (a, side), over the full transverse extent, where the inner-side cell is an unknown; 0 elsewhere on that plane.

Definition at line 943 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ openFaceAdvection()

void peclet::flow::sco::openFaceAdvection ( CCField  AC,
CCField  b,
CCField  outflow,
CCConst  cOld,
CCConst  phi,
CCConst  small,
CCConst  unk,
Kokkos::View< const double *, CCMem >  gv,
bool  inflow,
int  a,
int  side,
bool  steady,
C3  e,
int  g,
CCField  omega = CCField(),
bool  wOmega = false 
)
inline

The open face's row terms on the unknown inner boundary cells of (a, side) (table above): inflow b += F_in g (gv over the inner tangential range, j1 + j2 n1, as dirichletFaceFold); outflow implicit (steady or small) AC += F_out and outflow += F_out (the surrogate's lumped outflow, as advectionBands), explicit b -= F_out c^n.

Runs after advectionBands. A2: omega (when wOmega) += F_out on the implicit outflow rows as well (omega_open).

Definition at line 968 of file scalar_cutcell_operator.hpp.

References AC, and faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ openFaceResidual()

void peclet::flow::sco::openFaceResidual ( CCField  r,
CCConst  c,
CCConst  phi,
CCConst  small,
CCConst  unk,
bool  inflow,
int  a,
int  side,
bool  steady,
C3  e,
int  g 
)
inline

r(i) -= F_out c_i on the implicit outflow faces of (a, side) (the budget's flux-form residual; the inflow and explicit terms sit in b).

Definition at line 1003 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ openFaceInflux()

double peclet::flow::sco::openFaceInflux ( CCConst  c,
CCConst  cOld,
CCConst  phi,
CCConst  small,
CCConst  unk,
Kokkos::View< const double *, CCMem >  gv,
bool  inflow,
double  vol,
int  a,
int  side,
bool  steady,
C3  e,
int  g 
)
inline

Sum over one open face of V times the advective flux INTO the domain through it, per internal time (budget boundary_in): inflow F_in g; outflow -F_out c_i at c (implicit) or c^n (explicit).

Summed in a fixed (j1, j2) order on the host.

Definition at line 1030 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ openFaceCountsLocal()

void peclet::flow::sco::openFaceCountsLocal ( CCConst  phi,
CCConst  small,
CCConst  unk,
bool  inflow,
int  a,
int  side,
bool  steady,
C3  e,
int  g,
long &  nFlux,
long &  nImpl,
long &  nBack 
)
inline

The census counts of one open face over this rank's inner boundary cells: (faces carrying flux on the HIGH side — faceFluxCountsLocal already counts the low side's —, the implicit ones of either side: outflow with steady or a small inner cell, the BACKFLOW rows of an outflow face: F_out < 0, flow entering through it, whose inflow takes the zero-gradient value c_i; review finding 2, census num_backflow_faces).

Definition at line 1068 of file scalar_cutcell_operator.hpp.

References faceTangents().

Referenced by peclet::flow::Solver< Grid >::scalarCutAdvection().

◆ maxFacetLocal()

double peclet::flow::sco::maxFacetLocal ( Kokkos::View< const double *, CCMem >  cw)
inline

max over facets of cw (0 when there is no Dirichlet/Robin facet: the steady singular test).

Definition at line 1101 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ meanGradientFaceRhs()

void peclet::flow::sco::meanGradientFaceRhs ( CCField  b,
CCConst  unk,
CCConst  sax,
CCConst  say,
CCConst  saz,
const double  gf[3],
C3  e,
int  g 
)
inline

Faces (§1.5): b(i) += sum_a gf_a (a_a^+ - a_a^-) over the coupled faces (the bands' guard), gf_a = Lam w_a h'_a G'_a — the G.x part of the face terms Lam w_a a (c_i - c_nb) moved to the right-hand side.

Unknown inner cells only.

Definition at line 1140 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ meanGradientProbeShift()

void peclet::flow::sco::meanGradientProbeShift ( Kokkos::View< double *, CCMem >  rw,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
const MeanGradPosition &  pos 
)
inline

Dirichlet/Robin probes (§1.5): rw(f) -= cw(f) sum_k w_k G.x_k, so that rw = alpha G_phi (g - sum_k w_k G.x_k); x_k the global centres of the stencil cells.

Neumann facets (cw = 0) and facets of non-unknown cells (cw = rw = 0) are unchanged.

Definition at line 1163 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ cellVelocity()

void peclet::flow::sco::cellVelocity ( const CCConst &  phx,
const CCConst &  phy,
const CCConst &  phz,
long  i,
long  sy,
long  sz,
const double  hh[3],
double  u[3] 
)

U'_a/V of cell i (§1.5): the volume-integrated cell velocity sum_f F_out (x_f - x_i) per unit full-cell volume, = (h'_a/2) (phi_a(i + s_a) + phi_a(i)) (internal length per internal time).

Definition at line 1187 of file scalar_cutcell_operator.hpp.

Referenced by cellVelocitySumLocal(), meanFluxLocal(), and meanGradientAdvectionRhs().

◆ cellVelocitySumLocal()

void peclet::flow::sco::cellVelocitySumLocal ( CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  unk,
const double  hh[3],
C3  e,
int  g,
double  s[3] 
)
inline

(sum U'_x/V, sum U'_y/V, sum U'_z/V) over the unknown inner cells (the moving frame's numerator; its denominator is sum kappa, kappaMomentsLocal).

hh = h'/2.

Definition at line 1197 of file scalar_cutcell_operator.hpp.

References cellVelocity().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ meanGradientAdvectionRhs()

void peclet::flow::sco::meanGradientAdvectionRhs ( CCField  b,
CCConst  phx,
CCConst  phy,
CCConst  phz,
CCConst  kappa,
CCConst  unk,
const double  gi[3],
const double  hh[3],
const double  ub[3],
C3  e,
int  g 
)
inline

Advection (§1.5): b(i) -= G'.

(U'_i/V - kappa_i U'bar), the exact linear part of the advective term in the frame moving with U'bar. Sums to zero over the unknowns (exactly, in exact arithmetic), which keeps steady problems compatible.

Definition at line 1226 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3(), and cellVelocity().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ meanFluxLocal()

void peclet::flow::sco::meanFluxLocal ( CCConst  th,
CCConst  kappa,
CCConst  unk,
CCConst  sax,
CCConst  say,
CCConst  saz,
CCConst  phx,
CCConst  phy,
CCConst  phz,
bool  advecting,
double  lam,
const double  gi[3],
const double  hp[3],
const double  ub[3],
C3  e,
int  g,
double  diff[3],
double  adv[3] 
)
inline

scalar_mean_flux (§8.1), this rank's sums (internal; the caller divides by the global cell count): diffusive, over the low faces of the inner cells whose two cells are unknowns, sum -Lam a (theta_i - theta_{i - s_a} + G'_a h'_a) / h'_a; advective, over the unknown inner cells, sum (U'_i/V - kappa_i U'bar) theta_i (zero when the operator carried no advection).

Definition at line 1250 of file scalar_cutcell_operator.hpp.

References cellVelocity().

Referenced by peclet::flow::Solver< Grid >::scalarMeanFlux().

◆ bodyIndex()

int peclet::flow::sco::bodyIndex ( double  m,
int  nb 
)

A body id clamped into the table (out of range -> 0, as facetCoefficients does).

Definition at line 1323 of file scalar_cutcell_operator.hpp.

Referenced by buildSolidMaterial(), conjugateCoefficients(), peclet::flow::Solver< Grid >::ensureScalarSolidRecord(), solidFaceProducts(), solidMass(), and solidMomentsLocal().

◆ solidFaceLam()

double peclet::flow::sco::solidFaceLam ( const Kokkos::View< double *, CCMem > &  lam,
int  ma,
int  mb 
)

Lam_face of a solid face between materials ma and mb (§1.4): Lam_s of the material when equal, the harmonic mean when they differ.

Definition at line 1330 of file scalar_cutcell_operator.hpp.

Referenced by solidFaceProducts().

◆ buildSolidMaterial()

void peclet::flow::sco::buildSolidMaterial ( CCField  mat,
CCField  sunk,
CCConst  kappa,
CCConst  sax,
CCConst  say,
CCConst  saz,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const int *, CCMem >  owner,
bool  hasOwner,
const MaterialTable &  mt,
C3  e,
int  g,
double  vol[2] 
)
inline

The material per cell and the solid-unknown flags on the inner cells (§1.3, §2.7).

A cell with a facet takes the body of its conjugate facet (the larger-area one if both are conjugate), or the larger facet's body when neither is; a cell without a facet takes the scene owner owner (compact inner index; absent: 0). A cell is a solid unknown iff kappa_s = 1 - kappa > 0, its material is conjugate, and it has an open solid face (sum a_s > 0, a_s = 1 - a^snap) or a conjugate facet (ruling D-WO7-1: the solid mirror of the fluid's sealed rule). Returns, on this rank's inner cells, the conjugate solid volume sum kappa_s and the part of it that is sealed (kappa_s > 0, conjugate, neither condition) in vol[0], vol[1] (times V by the caller). The caller exchanges both fields and clears the flags beyond a non-periodic global face.

Definition at line 1348 of file scalar_cutcell_operator.hpp.

References bodyIndex(), and peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::ensureScalarSolidRecord().

◆ buildSolidProbes()

void peclet::flow::sco::buildSolidProbes ( Kokkos::View< double *, CCMem >  sS,
Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem >  offS,
Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem >  wS,
Kokkos::View< std::uint8_t *, CCMem >  rungS,
Kokkos::View< const std::uint8_t *, CCMem >  conjF,
const scg::ScalarFacetOverlay &  fo,
CCConst  sdf,
CCConst  sunk,
C3  e,
const double  hp[3] 
)
inline

The solid probe ladder (§3.4): per facet of a conjugate body (conjF), the ladder of §3.3 with -n, the solid-unknown flags and -phi.

Other facets get s = 0, no stencil, rung 0.

Definition at line 1416 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::ensureScalarSolidRecord().

◆ solidFaceProducts()

void peclet::flow::sco::solidFaceProducts ( CCField  spx,
CCField  spy,
CCField  spz,
CCConst  sunk,
CCConst  mat,
CCConst  sax,
CCConst  say,
CCConst  saz,
const MaterialTable &  mt,
C3  e 
)
inline

The level-0 solid face products P_a(i) = Lam_face a_s on the LOW a-face of cell i when cells i - s_a and i are both solid unknowns, else 0 (0 on the block's lowest layer).

The solid bands carry w_a P_a; ScalarMG coarsens P (§5.2: the plain average of the product Lam a).

Definition at line 1461 of file scalar_cutcell_operator.hpp.

References bodyIndex(), peclet::flow::ccFor3(), and solidFaceLam().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ solidMass()

void peclet::flow::sco::solidMass ( CCField  ms,
CCConst  kappa,
CCConst  sunk,
CCConst  mat,
const MaterialTable &  mt,
double  idt,
C3  e,
int  g 
)
inline

The solid mass m_s = C_s K kappa_s idt on the solid unknowns, 0 elsewhere (inner cells).

Definition at line 1489 of file scalar_cutcell_operator.hpp.

References bodyIndex(), and peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ solidBands()

void peclet::flow::sco::solidBands ( CCField  AC,
CCField  AW,
CCField  AE,
CCField  AS,
CCField  AN,
CCField  AB,
CCField  AT,
CCConst  ms,
CCConst  sunk,
CCConst  spx,
CCConst  spy,
CCConst  spz,
const double  w[3],
C3  e,
int  g 
)
inline

The solid phase's 7 bands (§4.1): AC = m_s + the six face terms w_a P, off-diagonals -w_a P; identity rows on the cells that are not solid unknowns.

Definition at line 1505 of file scalar_cutcell_operator.hpp.

References AC, and peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ solidRhs()

void peclet::flow::sco::solidRhs ( CCField  bs,
CCConst  ms,
CCConst  sOld,
C3  e,
int  g 
)
inline

The solid right-hand side b_s = m_s psi_s^n (no solid source in v1, §13 Q17); 0 elsewhere.

Definition at line 1533 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ conjugateCoefficients()

void peclet::flow::sco::conjugateCoefficients ( Kokkos::View< double *, CCMem >  cc,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const std::uint8_t *, CCMem >  conjF,
Kokkos::View< const double *, CCMem >  sS,
CCConst  unk,
CCConst  sunk,
const MaterialTable &  mt,
double  lamF 
)
inline

Per facet (§1.4, §4.1): cc = alpha G_c, G_c = 1/(s_f/Lam_f + R_c + s_s/Lam_s), on a facet of a conjugate body whose cell is both a fluid and a solid unknown (the material of the facet's body); 0 elsewhere (a facet that cannot enter both rows carries no coupling: conservation).

Definition at line 1545 of file scalar_cutcell_operator.hpp.

References bodyIndex().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ conjOverlayApply()

void peclet::flow::sco::conjOverlayApply ( CCField  yf,
CCField  ys,
CCConst  xf,
CCConst  xs,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
Kokkos::View< const double *, CCMem >  cc,
Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem >  offS,
Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem >  wS,
bool  subtract = false 
)
inline

The two-field overlay (§4.1 step 3), one thread per cut cell, facets in CSR order: y_f(i) += sum cw u_pf + sum cc (u_pf - u_ps), y_s(i) += sum cc (u_ps - u_pf).

subtract gives the negatives (the budget's flux-form residual).

Definition at line 1576 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), and peclet::flow::Solver< Grid >::scalarCutMatvecTwo().

◆ conjSurrogate()

void peclet::flow::sco::conjSurrogate ( CCField  SACf,
CCField  SACs,
CCField  W0,
CCConst  ACf,
CCConst  ACs,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
Kokkos::View< const double *, CCMem >  cc 
)
inline

The two-field level-0 surrogate (§4.3): SAC_f = AC_f + sum (cw + cc), SAC_s = AC_s + sum cc, W0 = sum cc (the same-cell coupling, S_{i_f, i_s} = -W0) on the cut cells; W0 = 0 elsewhere.

Definition at line 1619 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ conjMeanGradientShift()

void peclet::flow::sco::conjMeanGradientShift ( CCField  bf,
CCField  bs,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cc,
Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem >  offS,
Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem >  wS,
const MeanGradPosition &  pos 
)
inline

Mean-gradient mode, conjugate facets (§1.5): the fluid row carries + cc (u_pf - u_ps) with u = theta + G.x, so its G.x part, cc (GxF - GxS), moves to the right-hand side — b_f += cc (GxS - GxF) and b_s -= cc (GxS - GxF), GxF = sum_k wF_k G.x_k, GxS = sum_k wS_k G.x_k.

Definition at line 1647 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ solidMeanGradientFaceRhs()

void peclet::flow::sco::solidMeanGradientFaceRhs ( CCField  bs,
CCConst  sunk,
CCConst  spx,
CCConst  spy,
CCConst  spz,
const double  gs[3],
C3  e,
int  g 
)
inline

Mean-gradient mode, solid faces (§1.5): b_s(i) += sum_a gs_a (P_a(i + s_a) - P_a(i)), gs_a = w_a h'_a G'_a, over the solid-coupled faces (P is guarded) — the G.x part of w_a P (psi_i - psi_nb).

Solid unknowns only.

Definition at line 1681 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ solidResidualFluxForm()

void peclet::flow::sco::solidResidualFluxForm ( CCField  r,
CCConst  x,
CCConst  b,
CCConst  ms,
CCConst  sunk,
CCConst  spx,
CCConst  spy,
CCConst  spz,
const double  w[3],
C3  e,
int  g 
)
inline

The solid residual in FLUX form (the budget, §9): r = b - m_s psi - sum_faces t (psi_i - psi_nb); the caller subtracts the overlay.

Identity rows: r = 0.

Definition at line 1698 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccFor3().

Referenced by peclet::flow::Solver< Grid >::scalarBudget().

◆ solidMomentsLocal()

void peclet::flow::sco::solidMomentsLocal ( CCConst  xs,
CCConst  kappa,
CCConst  sunk,
CCConst  mat,
const MaterialTable &  mt,
C3  e,
int  g,
double &  m,
double &  w 
)
inline

(sum C_s K kappa_s psi_s, sum C_s K kappa_s) over the solid unknowns (times V by the caller): the solid mass and the gauge weight.

Definition at line 1722 of file scalar_cutcell_operator.hpp.

References bodyIndex().

Referenced by peclet::flow::Solver< Grid >::scalarBudget(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ conjFacetFlux()

void peclet::flow::sco::conjFacetFlux ( Kokkos::View< double *, CCMem >  up,
Kokkos::View< double *, CCMem >  us,
Kokkos::View< double *, CCMem >  qin,
CCConst  xf,
CCConst  xs,
const scg::ScalarFacetOverlay &  fo,
Kokkos::View< const double *, CCMem >  cw,
Kokkos::View< const double *, CCMem >  rw,
Kokkos::View< const double *, CCMem >  cc,
Kokkos::View< int *[8], Kokkos::LayoutLeft, CCMem >  offS,
Kokkos::View< double *[8], Kokkos::LayoutLeft, CCMem >  wS,
const MeanGradPosition &  pos,
bool  mgOn 
)
inline

Per facet: the probe values and the flux INTO the fluid per unit cell volume per internal time, rw - cw u_pf on a wall facet, cc (u_ps - u_pf) on a conjugate one (scalar_wall_flux, scalar_facets).

up = u_pf, us = u_ps (0 on a wall facet).

Definition at line 1747 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarFacets(), and peclet::flow::Solver< Grid >::scalarWallFlux().

◆ dotTwoReduce()

template<class R >
void peclet::flow::sco::dotTwoReduce ( CCConst  af,
CCConst  bf,
CCConst  as,
CCConst  bs,
C3  e,
int  g,
R &&  result 
)
inline

sum over inner cells of af bf + as bs (the two-field dot).

Definition at line 1791 of file scalar_cutcell_operator.hpp.

References peclet::flow::ccReduce3().

Referenced by dotTwoLocal(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ dotTwoLocal()

double peclet::flow::sco::dotTwoLocal ( CCConst  af,
CCConst  bf,
CCConst  as,
CCConst  bs,
C3  e,
int  g 
)
inline

◆ dot2TwoReduce()

template<class R1 , class R2 >
void peclet::flow::sco::dot2TwoReduce ( CCConst  af,
CCConst  bf,
CCConst  cf,
CCConst  as,
CCConst  bs,
CCConst  cs,
C3  e,
int  g,
R1 &&  r1,
R2 &&  r2 
)
inline

(sum a b, sum c c) over inner cells, both fields, in one pass, into (r1, r2).

Definition at line 1808 of file scalar_cutcell_operator.hpp.

Referenced by dot2TwoLocal(), and peclet::flow::Solver< Grid >::scalarCutAssembleSolve().

◆ dot2TwoLocal()

void peclet::flow::sco::dot2TwoLocal ( CCConst  af,
CCConst  bf,
CCConst  cf,
CCConst  as,
CCConst  bs,
CCConst  cs,
C3  e,
int  g,
double &  ab,
double &  cc 
)
inline

◆ solidMeanFluxLocal()

void peclet::flow::sco::solidMeanFluxLocal ( CCConst  th,
CCConst  sunk,
CCConst  spx,
CCConst  spy,
CCConst  spz,
const double  gi[3],
const double  hp[3],
C3  e,
int  g,
double  diff[3] 
)
inline

The solid part of scalar_mean_flux's diffusive sum (§8.1): over the low faces of the inner cells whose two cells are solid unknowns, sum -P (theta_i - theta_{i - s_a} + G'_a h'_a)/h'_a.

Definition at line 1830 of file scalar_cutcell_operator.hpp.

Referenced by peclet::flow::Solver< Grid >::scalarMeanFlux().