|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| k_hr (kappa) | |
| k_per (kappa) | |
| colour (N) | |
| run_case (key) | |
| _run (key) | |
| line (r) | |
| load (path) | |
| cmd_run (a) | |
| fit (hs, Ks) | |
| cmd_accept (a) | |
| cmd_table (a) | |
| main () | |
Variables | |
| HERE = os.path.dirname(os.path.abspath(__file__)) | |
| float | L = 1.0 |
| float | R = L / 8.0 |
| tuple | DOH = (8, 12, 16, 24, 32) |
| tuple | KAPPAS = (1e-2, 1.0, 1e2) |
| int | SUB = 32 |
| float | PHI = math.pi / 384.0 |
G-SV2 -- Hadamard-Rybczynski drag of a buoyant drop in a periodic box (doc/vof_sharp_viscous_stress.md
§6.7, fourth pass, which binds; §11 G-SV2; WO-G2).
Box [0, L]^3, L = 8R (here L = 1, R = 1/8), triply periodic, isotropic h; d = 2R, d/h in
{8, 12, 16, 24, 32}, N = 4 d/h. Phase A (C = 1) is the sphere |x - x_c| < R, x_c = (L/2, L/2, L/2), a
cell vertex at every N. C_i is the exact z-chord average over 32 x 32 midpoint sub-columns of cell i;
cells with all 8 corners inside (outside) the closed (open) ball are exactly 1 (0) -- with the centre
on a vertex and R/h an integer this is exact integer arithmetic. The colour is frozen. sigma = 0;
rho = 1 in both phases; mu = LinearMix(C), mu_out = mu_B = 1, mu_A = kappa, kappa in {1e-2, 1, 1e2}
(kappa = 1 is the uniform-mu control of the forcing and the base scheme: 'sharp' is bitwise skipped
there, so it is run once). Force (Boussinesq, Hasimoto): the cell field f_z = drg (C_i - phi_h),
phi_h = mean C_i, written with set_field("force_z") in internal units; F = drg V_h, V_h = h^3 sum C_i.
drg = 1e-3 (h/dt) 9 mu_out K_HR / (2 R^2) (colour CFL ~1e-3 at the unbounded HR speed).
Steady Stokes (advection off) by gsv1.py's WO-6s GMRES(60) under the §6.6 rule (converged momentum on
every step, RB-GS update stop 1e-15 = gsv1.MOM_UTOL, coordinator decision 2026-11-01; rows taken at a
looser stop are void and rerun), from u = 0, p = 0; D_hi = mu_hi dt / (rho h^2) = 100, mu_hi = max(kappa, 1) mu_out;
certificate 1e-12 max|u|; cap 3000 matvecs (at the cap: NOT CONVERGED, not judged).
U_d = sum_i C_i wbar_i / sum_i C_i - <w>, wbar_i the mean of w on the -z and +z faces of cell i, <w> the
mean over all z-faces. K = F / (6 pi mu_out U_d R_h), R_h = (3 V_h / 4 pi)^(1/3).
PASS ('sharp', kappa = 1e-2 and 1e2): the unweighted nonlinear LS fit K(h) = K_inf + C h^p over the
five levels, p in [0.5, 4], gives p >= 1.8 and |K_inf - K_per| / K_per <= 3 %,
K_per = K_HR / (1 - 1.7601 K_HR phi^(1/3)), K_HR = (2 + 3 kappa) / (3 (1 + kappa)), phi = pi/384.
kappa = 1 must pass the same criteria, else G-SV2 is NOT JUDGED (instrument or base scheme).
Reported: K per level, the four-finest fit (12-32), 'averaged''s p and K_inf, matvecs per case.
Acceptance before the gate (WO-G2): kappa = 1, d/h 8 and 12: sum force = 0 to 1e-14 relative,
momentum invariant <= 1e-13, CFL <= 1.1e-3.
nice -n 10 python gsv2.py run --doh 8,12,16 [--kappa 1e-2,1,1e2] [--modes sharp,averaged] --procs 3 --out F.jsonl
python gsv2.py accept --out F.jsonl
python gsv2.py table --out F.jsonl
| gsv2.k_hr | ( | kappa | ) |
Definition at line 54 of file gsv2.py.
Referenced by k_per(), and run_case().
| gsv2.k_per | ( | kappa | ) |
| gsv2.colour | ( | N | ) |
Exact z-chord average over SUB x SUB midpoint sub-columns; exact 0/1 by the corner test.
Definition at line 63 of file gsv2.py.
References mean().
Referenced by run_case().
| gsv2.run_case | ( | key | ) |
Definition at line 94 of file gsv2.py.
References colour(), gsv1.converge_momentum(), gsv1.default_step_increment(), gsv1.gmres_steady(), and k_hr().
Referenced by _run().
|
protected |
Definition at line 154 of file gsv2.py.
References run_case().
| gsv2.load | ( | path | ) |
Definition at line 173 of file gsv2.py.
Referenced by cmd_accept(), cmd_run(), and cmd_table().
| gsv2.fit | ( | hs, | |
| Ks ) |
Definition at line 209 of file gsv2.py.
Referenced by cmd_table().