30#ifndef PECLET_CORE_SCHEME_PROBE_FLUX_HPP
31#define PECLET_CORE_SCHEME_PROBE_FLUX_HPP
76 const double ax = n[0] < 0.0 ? -n[0] : n[0];
77 const double ay = n[1] < 0.0 ? -n[1] : n[1];
78 const double az = n[2] < 0.0 ? -n[2] : n[2];
79 return 0.5 * (
ax * h[0] +
ay * h[1] +
az * h[2]);
85#ifdef KOKKOS_INLINE_FUNCTION
86 return Kokkos::floor(x);
99 for (
int a = 0; a < 3; ++a) {
101 base[a] =
static_cast<int>(b);
104 for (
int k = 0;
k < 8; ++
k) {
105 const double wx = (
k & 1) ?
f[0] : 1.0 -
f[0];
106 const double wy = ((
k >> 1) & 1) ?
f[1] : 1.0 -
f[1];
107 const double wz = ((
k >> 2) & 1) ?
f[2] : 1.0 -
f[2];
116 double s,
double xi[3],
int base[3],
double w[8]) {
117 for (
int a = 0; a < 3; ++a)
118 xi[a] = (
xw[a] + s * n[a]) / h[a];
120 for (
int a = 0; a < 3; ++a)
127template <
class Lookup>
129 for (
int k = 0;
k < 8; ++
k)
131 !
L.unknown(
base[0] + (
k & 1),
base[1] + ((
k >> 1) & 1),
base[2] + ((
k >> 2) & 1)))
141 for (
int k = 0;
k < 8; ++
k) {
157template <
class Lookup>
190 const double s1 = 0.5 *
gap;
194 for (
int k = 0;
k < 8; ++
k) {
206 for (
int k = 0;
k <
m; ++
k)
221 r.
off[0][0] = r.
off[0][1] = r.
off[0][2] = 0;
230 constexpr double kDoubleMax = 1.7976931348623157e308;
235 return 1.0 / (s /
L + 1.0 /
k);
core — the shared cut-cell IBM boundary-distance closure polynomials (flow <-> amr).
#define PECLET_CORE_CC_HD
PECLET_CORE_CC_HD void probeFillAll(ProbeResult &r, int rung, double s, const int base[3], const double w[8])
PECLET_CORE_CC_HD bool probeAllUnknown(const int base[3], const double w[8], const Lookup &L)
PECLET_CORE_CC_HD bool probeCandidate(const double xw[3], const double n[3], const double h[3], double s, double xi[3], int base[3], double w[8])
PECLET_CORE_CC_HD double probeFloor(double x)
constexpr int kProbeReach
V3: every stencil cell within ±kProbeReach cells on each axis (the G = 2 halo).
constexpr double kProbeSigma
Probe distance factors on S(n) (§3.1, §3.3): R0 = 1.1, R1a = 1.5, R2 = 0.5.
PECLET_CORE_CC_HD double interfaceConductance(double sf, double Lf, double Rc, double ss, double Ls)
Conjugate interface conductance (§1.4): the series resistance of the fluid probe leg,...
constexpr double kProbeSigmaLong
constexpr double kProbeMinKeptWeight
... and accepted only when the kept weights sum to at least kProbeMinKeptWeight.
@ gap
two facets, fluid between two walls
PECLET_CORE_CC_HD double wallConductance(double s, double L, double k)
Wall conductance of a Robin facet (§1.4): G = 1 / (s/L + 1/k), the flux out of the fluid per area bei...
constexpr double kProbeWeightEps
V1 ignores stencil cells whose weight is at most this.
constexpr double kProbeSigmaLast
constexpr int kProbeR0
Ladder rungs, in ProbeResult::rung (flow stores them as uint8).
PECLET_CORE_CC_HD double probeSupport(const double n[3], const double h[3])
S(n) = ½ Σ_a |n_a| h_a: the support half-width of a cell of size h along the unit normal n (§3....
constexpr double kProbeGapMin
R1b is attempted only when the estimated gap w exceeds kProbeGapMin · S(n) ...
PECLET_CORE_CC_HD ProbeResult buildProbe(const double xw[3], const double n[3], const double h[3], const Lookup &L)
Build the probe of one facet by the ladder of §3.3.
PECLET_CORE_CC_HD void trilinearStencil(const double xi[3], int base[3], double w[8])
Trilinear stencil of the index-space point ξ (cell centres at integer ξ, relative to the facet's cell...
constexpr double kProbeClearance
V2: φ_phase(p) ≥ kProbeClearance · s.
Kokkos::View< T *, MemSpace > View
1D device array.
One facet's probe: the rung, the probe distance s, and n stencil cells (lattice offsets relative to t...