|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
flow — VoF rung V2b (WO-K): momentum-consistent transport of rho^c u_c on the half-shifted (MAC) momentum control volumes, driven by the SAME geometric fluxes as the colour advection of the same step. More...
#include <Kokkos_Core.hpp>#include <stdexcept>#include "policy.hpp"#include "vof/advect_wy.hpp"#include "vof/cutcell.hpp"Go to the source code of this file.
Classes | |
| struct | peclet::flow::vof::VofMomCount |
| The two face counters of the capped flux kernels, one reduction (never a second fence). More... | |
| struct | Kokkos::reduction_identity< peclet::flow::vof::VofMomCount > |
| class | peclet::flow::vof::MomentumConsistentAdvector |
| Momentum-consistent companion to WyAdvector. More... | |
| struct | peclet::flow::vof::MomentumConsistentAdvector::Diagnostics |
Namespaces | |
| namespace | peclet |
| namespace | peclet::flow |
| namespace | peclet::flow::vof |
| namespace | Kokkos |
Enumerations | |
| enum class | peclet::flow::vof::MomentumScheme : int { peclet::flow::vof::Upwind , peclet::flow::vof::MusclMixed , peclet::flow::vof::MusclMixedCapped , peclet::flow::vof::MusclPhase } |
| The transported face velocity of the momentum flux (doc/vof_momentum_second_order.md; the file header, "The transported velocity in the flux"). More... | |
Functions | |
| double | peclet::flow::vof::vofPhaseRho (double rhoG, double rhoL, double c) |
| Two-phase density from a fraction, written so that C = 1 returns rho_l and C = 0 returns rho_g EXACTLY (a plain rho_g + (rho_l - rho_g) C does not). | |
| double | peclet::flow::vof::vofMinmod (double a, double b) |
| double | peclet::flow::vof::vofPhaseSlope (double dm, double dp, bool hq, bool hm, bool hp) |
| The interface-biased, MC-bounded slope of one phase (note §4.2). | |
| double | peclet::flow::vof::vofMomentumCap (double rg, double rl, double s, double aGeo, double atP, double atO, double fAbs, double epsQ, double cQ, bool kQ, double dm, double dp, double sigL, double sigG) |
| The mass-aware cap theta in (0, 1] of note §4.3, for face p of donor q. | |
| double | peclet::flow::vof::vofCellBox (const SField &c, const SField &mx, const SField &my, const SField &mz, const SField &al, long q, const double lo[3], const double hi[3], double eps=0.0) |
| Liquid volume of the PLIC polyhedron of cell q inside a box given as per-axis intervals, as a fraction of a whole cell. | |
flow — VoF rung V2b (WO-K): momentum-consistent transport of rho^c u_c on the half-shifted (MAC) momentum control volumes, driven by the SAME geometric fluxes as the colour advection of the same step.
With mass and momentum advected by different fluxes, a mixed cell multiplies the gas acceleration by the liquid density — a spurious interfacial momentum source of order d(rho). Rudman (1998) and Arrufat et al. (Computers & Fluids 215:104785, 2021) show the naive scheme breaks down around ratio 1000 unless the resolution is absurd; with consistency a raindrop at ratio 831.8 is accurate within 15 % at 15 cells/diameter instead of ~200.
The momentum control volume of component e is the pressure cell shifted half a cell in e. Everything here is indexed in flow's own low-face convention: CV_e(i) is the control volume centred on the -e face of cell i, spanning [x_{i-1}, x_i] (the +e half of cell i-1 plus the -e half of cell i), which is exactly where the solver's velocity unknown u_e(i) lives. Three things follow and all three are load-bearing:
Per sweep, with Psi = rho_g a + (rho_l - rho_g) F the mass flux and rho^ the frozen-flag density, the conservative pair is
C^e_i += dC = (F_- - F_+) + flag_i (a_+ - a_-) M_i += (Psi_- u^_- - Psi_+ u^_+) + rho^_i u_i (a_+ - a_-)
with rho^e = rho_g (1 - C^e) + rho_l C^e, so d(rho^e) = drho dC — the SAME dC. If u_e == U everywhere then every u^ and every u_i is U and the two updates differ by exactly the factor U: dM = U d(rho^e), so M = U rho^e is preserved and u = M/rho^e = U at ANY density ratio, with no tuning knob. An inconsistent scheme is wrong at O(d rho).
The identity holds whatever the fluxes are, provided the two updates use the same ones. That is the whole point of driving both from one set of planes, and it is why the flux clamp of point 3 is free: it changes F, not the fact that there is one F. momentumUpdate evolves the algebraically identical u_new = u_old + dev/rho_new form so that the identity survives in FLOATING POINT too, not only in exact arithmetic — the note there explains why that matters.
momentumScheme selects the face velocity u^ (design: doc/vof_momentum_second_order.md):
With an immersed solid the half-shifted control volume gets a fluid volume and open face areas of its own, by the same half-cell averaging that defines it:
The consistency identity survives all of it verbatim, and that is the point: every term of dev is a DIFFERENCE OF VELOCITIES, so a uniform field gives dev = 0 bit for bit whatever eps^e and the openness are, and u_new = u_old exactly — in cut cells too, not only away from them. Measured on a sphere packing at ratio 1e3: 0.0.
u^ is the CURRENT transported velocity of the donor CV (plain donor-cell upwind by default; the slope schemes of momentumScheme reconstruct it to the flux slab's centroid, see "The transported velocity in the flux" above). With a uniform field u^ = U bit for bit either way, so the gate above is untouched. The velocity is exchanged between sweeps alongside C^e — fluxing the FROZEN u^n instead would be one exchange cheaper but leaves a term with gain rho_l/rho_g on any control volume a sweep empties (see the derivation in momentumUpdate), which is not something to carry into a high-ratio rung to save a halo exchange.
Definition in file momentum_advect.hpp.