|
flow 0.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
flow — directional ghost-cell IBM projection overlay (experimental second staggered IBM). More...
#include <Kokkos_Core.hpp>#include <cstdint>#include "cut_cell_ibm.hpp"#include "mac_cutcell.hpp"#include "peclet/core/scheme/ghost_closure.hpp"#include "gauge_exact_gradient.hpp"Go to the source code of this file.
Classes | |
| struct | peclet::flow::GpOverlayT< Space > |
| Per-overlay-row SoA. More... | |
Namespaces | |
| namespace | peclet |
| namespace | peclet::flow |
Typedefs | |
| using | peclet::flow::GpOverlay = GpOverlayT< CCMem > |
Functions | |
| GpOverlay | peclet::flow::gpMakeOverlay (long n) |
| int | peclet::flow::gpWrap (int v, int n) |
| int | peclet::flow::buildGpOverlay (CCConst sdf, C3 ext, int g, C3 nn, const GpOverlay &ov, Kokkos::View< int *, CCMem > idMap, Kokkos::View< int, CCMem > counter, int matrixOrder=2, int rhsOrder=2, CCConst tx=CCConst(), CCConst ty=CCConst(), CCConst tz=CCConst(), bool useGhost=false) |
| Build the overlay over the inner grid nn from the cell-centered sdf on the extended block (ext, ghost width g). | |
| void | peclet::flow::gpBinaryOpenness (CCField ox, CCField oy, CCField oz, CCConst sdf, C3 ext) |
| Binary openness for the symmetric MG surrogate, on the extended-block layout of buildOpenness: o(face) = 1 iff the face point is fluid AND both adjacent cell centers are fluid, else 0. | |
| void | peclet::flow::gpApplyDelta (CCField y, CCConst x, const GpOverlay &ov, int nOv, C3 nn, C3 extY, int gbY, C3 extX, int gbX, bool useGhost=false) |
| Overlay matvec correction: y(r) = rho_r * (y(r) + closure-face phi terms), where y currently holds the binary-openness (COUPLED-part) matvec. | |
| void | peclet::flow::gpDivergDelta (CCField d, CCConst u, CCConst v, CCConst w, const GpOverlay &ov, int nOv, C3 nn, C3 extb, int gb, bool useGhost=false) |
| Overlay divergence correction: d(r) = rho_r * (d(r) + closure/BC/explicit face values), where d currently holds the binary-openness divergence (divergOpen on the binary fields: COUPLED faces only). | |
flow — directional ghost-cell IBM projection overlay (experimental second staggered IBM).
Point-based finite-difference projection near the immersed boundary, NO openness factors: the divergence of a fluid-centered pressure cell uses plain face differences; a face whose staggered velocity point is solid is closed by the momentum IBM's 1-D wall-anchored quadratic along the face's own axis (poly_D/poly_Nc/poly_N_nb of cut_cell_ibm.hpp, reused verbatim):
poly_D(th) * u_ghost = 2*u_bc + poly_Nc(th)*u_near + poly_N_nb(th)*u_far th = sdf_near/(sdf_near - sdf_ghost), clamped [GP_THETA_MIN, 1]
Substituting the corrected velocity u = u* - grad(phi) makes the closure implicit in phi: the Poisson row gains couplings to phi(+/-1), phi(+/-2) along the axis (up to 13-point, nonsymmetric). The symmetric part is realised as the BINARY-openness 7-point operator (gpBinaryOpenness -> buildCutcellOp -> the whole CutcellMG hierarchy unchanged, as the preconditioner); the nonsymmetric remainder is a compact per-row overlay applied by gpApplyDelta (matvec) and gpDivergDelta (RHS + diagnostic), both scaled by the per-row conditioning rescale rho = min(1, min_f D_f) — the D_rescale analog.
Face-state cascade per (cell, axis, side), sdf >= 0 fluid, classification from CELL-CENTERED sdf with face values = mean of the two adjacent centers (identical to the trilinear ccSampleExt at the +/-0.5 staggered offsets, so it agrees with the momentum solid masks): COUPLED face point fluid AND neighbor center fluid -> standard +/- (phi_i - phi_nb) (sandwich) both own face points solid, center fluid -> BC_ONLY both sides (no fluid unknown lives between the walls: the wall BCs alone determine the axis) QUAD face point solid, near+far sources usable -> quadratic closure, th in (0,1] LIN face point solid, only near source -> th*u_g = u_bc + (th-1)*u_near (sliver) face point fluid but neighbor center solid -> same QUAD/LIN with EXTENDED th = 1 + sdf_g/(sdf_g - sdf_beyond) in (1,2) (interpolation, D > 2) BC_ONLY no usable fluid source -> u_face = u_bc, no phi coupling EXPLICIT sliver with no crossing on the u-line -> face flux = u* (no phi coupling) Rows with no phi coupling at all are decoupled (phi = 0, RHS zeroed).
v1 scope: periodic + IBM only, stationary walls (u_bc = 0 at runtime; the w_bc weights are stored for the parity tests / future moving walls). Neighbor access has two modes: single-rank uses explicit periodic wrap over the INNER grid (so the +/-2 reach never depends on the ghost-layer depth); distributed (useGhost) reads straight offsets into the exchanged halo — the +/-2 reach then requires a g=2 block with current ghosts (the solver's velocity block). Row ownership under MPI is by inner-block cell: each rank builds/applies only the rows of its own inner cells, and every coupling is a read into the halo. Reference implementation + gates: tests/study/ghost_projection_apriori.py.
Definition in file ghost_projection.hpp.