|
flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| _collocated_mode (s, mode) | |
| bed_sdf (N, npz) | |
Variables | |
| flow = ensure_flow() | |
| BED = os.environ["BED"] | |
| N = int(os.environ.get("N", "192")) | |
| STEPS = int(os.environ.get("STEPS", "20000")) | |
| EVERY = int(os.environ.get("EVERY", "500")) | |
| DT = float(os.environ.get("DT", "60.0")) | |
| KIND = os.environ.get("KIND", "gauge-exact") | |
| ROT = int(os.environ.get("ROT", "1")) | |
| ROTF = int(os.environ.get("ROTF", "0")) | |
| ROTW = float(os.environ.get("ROTW", "1")) | |
| WALLW = float(os.environ.get("WALLW", "0")) | |
| DTSWITCH | |
| MU | |
| F0 | |
| SHIFT = np.array([float(v) for v in os.environ.get("SHIFT", "0,0,0").split(",")]) | |
| sdf | |
| R | |
| str | sv = "stag" else flow.SolverColocated |
| str | s = sv(N, N, N) |
| cutcell_pressure | |
| float | fluid = 0.0 |
| flush | |
| pk = None | |
| Pprev = None | |
| list | U = [np.asarray(s.get_u()), np.asarray(s.get_v()), np.asarray(s.get_w())] |
| int | us = float(np.abs(U[0][fluid]).mean()) + 1e-300 |
| int | kc = float(U[0].mean()) * MU / F0 / R ** 2 |
| float | m1 = 0.0 |
| list | OX = [np.asarray(s.get_ox()), np.asarray(s.get_oy()), np.asarray(s.get_oz())] |
| int | kf = float((OX[0] * U[0]).mean()) * MU / F0 / R ** 2 |
| div = np.zeros_like(U[0]) | |
| list | flx = OX[a] * U[a] |
| axis | |
| int | m2 = float(np.sqrt((div[fluid] ** 2).mean())) / us |
| list | UF = [np.asarray(s.get_uf()), np.asarray(s.get_vf()), np.asarray(s.get_wf())] |
| float | m1sq = 0.0 |
| float | half = 0.5 * (U[a] + np.roll(U[a], 1, axis=a)) |
| list | op = OX[a] > 0 |
| str | dk = "" if pk is None else f"{kc - pk:+.2e}" |
| str | dm = "" if pm is None else f"{m1 - pm:+.2e}" |
| Pf = np.asarray(s.get_p()) | |
| str | dP = "" if Pprev is None else f"{np.abs(Pf - Pprev).max():.3e}" |
| pm | |
Long-march probe of the STALL hypothesis (2026-08-20): the collocated march quasi-freezes on a slow u-P manifold far from the true fixed point (measured: |uf - halfavg(u)| rms 4.5e-2 <u> at the stopping point, while the ONLY true fixed point of the map has phi = 0, uf == halfavg(u), and a dt-free steady system). If that is the plateau mechanism, marching far past the <u> criterion must show k creeping toward the staggered answer as the reconciliation gap decays (however slowly); if k and the gap are EXACTLY stationary, the implemented map has a non-closing loop that differs from the model and the discrepancy must be found in code. Runs the phi=0.60 bed, collocated gauge-exact, for STEPS steps regardless of any criterion, printing every EVERY steps: k (cell + flux estimators), m1 = rms|uf - halfavg(u)|/<|u|>, m2 = rms alpha-div(halfavg(u))/<|u|>, and the drift of each since the last print. PECLET_FLOW_BUILD=build_ge BED=...npz N=192 STEPS=20000 EVERY=500 DT=60 python collocated_longmarch.py
|
protected |
Select a collocated scheme by the integer face-interp mode this script was written with:
0/7/9 are the public strings ('plain' / 'embed' / 'gauge-exact'), 5/6 the diagnostics rungs,
and every other number was deleted at 1.0.0 (the call then raises).
Definition at line 47 of file collocated_longmarch.py.
| collocated_longmarch.bed_sdf | ( | N, | |
| npz | |||
| ) |
Definition at line 57 of file collocated_longmarch.py.
| collocated_longmarch.flow = ensure_flow() |
Definition at line 23 of file collocated_longmarch.py.
| collocated_longmarch.BED = os.environ["BED"] |
Definition at line 25 of file collocated_longmarch.py.
| collocated_longmarch.N = int(os.environ.get("N", "192")) |
Definition at line 26 of file collocated_longmarch.py.
| collocated_longmarch.STEPS = int(os.environ.get("STEPS", "20000")) |
Definition at line 27 of file collocated_longmarch.py.
| collocated_longmarch.EVERY = int(os.environ.get("EVERY", "500")) |
Definition at line 28 of file collocated_longmarch.py.
| collocated_longmarch.DT = float(os.environ.get("DT", "60.0")) |
Definition at line 29 of file collocated_longmarch.py.
| collocated_longmarch.KIND = os.environ.get("KIND", "gauge-exact") |
Definition at line 30 of file collocated_longmarch.py.
| collocated_longmarch.ROT = int(os.environ.get("ROT", "1")) |
Definition at line 31 of file collocated_longmarch.py.
| collocated_longmarch.ROTF = int(os.environ.get("ROTF", "0")) |
Definition at line 32 of file collocated_longmarch.py.
| collocated_longmarch.ROTW = float(os.environ.get("ROTW", "1")) |
Definition at line 33 of file collocated_longmarch.py.
| collocated_longmarch.WALLW = float(os.environ.get("WALLW", "0")) |
Definition at line 34 of file collocated_longmarch.py.
| collocated_longmarch.DTSWITCH |
Definition at line 38 of file collocated_longmarch.py.
| collocated_longmarch.MU |
Definition at line 40 of file collocated_longmarch.py.
| collocated_longmarch.F0 |
Definition at line 40 of file collocated_longmarch.py.
| collocated_longmarch.SHIFT = np.array([float(v) for v in os.environ.get("SHIFT", "0,0,0").split(",")]) |
Definition at line 43 of file collocated_longmarch.py.
| collocated_longmarch.sdf |
Definition at line 80 of file collocated_longmarch.py.
| collocated_longmarch.R |
Definition at line 80 of file collocated_longmarch.py.
| str collocated_longmarch.sv = "stag" else flow.SolverColocated |
Definition at line 81 of file collocated_longmarch.py.
| collocated_longmarch.cutcell_pressure |
Definition at line 115 of file collocated_longmarch.py.
| float collocated_longmarch.fluid = 0.0 |
Definition at line 116 of file collocated_longmarch.py.
| collocated_longmarch.flush |
Definition at line 118 of file collocated_longmarch.py.
| collocated_longmarch.pk = None |
Definition at line 121 of file collocated_longmarch.py.
| collocated_longmarch.Pprev = None |
Definition at line 122 of file collocated_longmarch.py.
| list collocated_longmarch.U = [np.asarray(s.get_u()), np.asarray(s.get_v()), np.asarray(s.get_w())] |
Definition at line 129 of file collocated_longmarch.py.
Definition at line 130 of file collocated_longmarch.py.
Definition at line 131 of file collocated_longmarch.py.
| int collocated_longmarch.m1 = 0.0 |
Definition at line 133 of file collocated_longmarch.py.
| list collocated_longmarch.OX = [np.asarray(s.get_ox()), np.asarray(s.get_oy()), np.asarray(s.get_oz())] |
Definition at line 134 of file collocated_longmarch.py.
Definition at line 135 of file collocated_longmarch.py.
| collocated_longmarch.div = np.zeros_like(U[0]) |
Definition at line 136 of file collocated_longmarch.py.
Definition at line 138 of file collocated_longmarch.py.
| collocated_longmarch.axis |
Definition at line 139 of file collocated_longmarch.py.
Definition at line 140 of file collocated_longmarch.py.
| list collocated_longmarch.UF = [np.asarray(s.get_uf()), np.asarray(s.get_vf()), np.asarray(s.get_wf())] |
Definition at line 142 of file collocated_longmarch.py.
| float collocated_longmarch.m1sq = 0.0 |
Definition at line 145 of file collocated_longmarch.py.
Definition at line 148 of file collocated_longmarch.py.
| list collocated_longmarch.op = OX[a] > 0 |
Definition at line 149 of file collocated_longmarch.py.
Definition at line 155 of file collocated_longmarch.py.
Definition at line 156 of file collocated_longmarch.py.
| collocated_longmarch.Pf = np.asarray(s.get_p()) |
Definition at line 157 of file collocated_longmarch.py.
Definition at line 158 of file collocated_longmarch.py.
| collocated_longmarch.pm |
Definition at line 162 of file collocated_longmarch.py.