|
flow 0.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| bed_sdf (N, npz) | |
| solve (N, kind, mu=0.1, F=1e-3, dt=80.0, warm_tol=1e-7, tail=40, max_steps=4000) | |
Variables | |
| float | PHI0 = 0.125 |
| BED = os.environ.get("BED", "") | |
| list | Ns = [int(x) for x in (sys.argv[1:] or [32, 64, 128])] |
| prev = None | |
| fs | |
| ox | |
| sdf | |
| R | |
| fc | |
| _ | |
| float | sf = 0.5 * (sdf + np.roll(sdf, 1, axis=0)) |
| d = ox * (fc - fs) | |
| tot = float(d.mean()) | |
| float | band = 2.0 |
| int | share = float(d[band].sum() / d.sum()) if abs(d.sum()) > 0 else float("nan") |
| mx = float(np.abs(d[band]).max()) | |
| rms = float(np.sqrt((d[band] ** 2).mean())) | |
| dict | o = {} |
| lr = np.log(N / prev[0]) | |
| flush | |
WHERE does the collocated-vs-staggered difference live, and does its amplitude grow?
The permeability gap does not vanish under refinement, and the constraint operator was exonerated
a-priori (net flux defect ~1e-5). If the surviving difference is localised in a wall band, the
arithmetic is forced: the band's VOLUME fraction shrinks as O(h), so for its contribution to the
volume-averaged velocity to stay constant the AMPLITUDE in the band must grow as O(1/h).
So: run both solvers on identical geometry, compare the alpha-weighted FACE fluxes (the conserved
quantity, and a like-for-like basis -- staggered get_u IS the face field, collocated get_uf is its
projected one), and split the difference by distance to the wall in CELL units.
amplitude ~ 1/h => mechanism found: a gauge/scaling error in the near-wall reconstruction
amplitude ~ O(1) => the band contributes O(h) and the gap must come from somewhere else
SDFLOW_BUILD=build_ge python tests/study/zh_wallband_diff.py [N ...]
| zh_wallband_diff.bed_sdf | ( | N, | |
| npz | |||
| ) |
Periodic union-of-spheres SDF from a packing, sampled on an N^3 grid (cubic box only).
Definition at line 31 of file zh_wallband_diff.py.
Referenced by solve().
| zh_wallband_diff.solve | ( | N, | |
| kind, | |||
mu = 0.1, |
|||
F = 1e-3, |
|||
dt = 80.0, |
|||
warm_tol = 1e-7, |
|||
tail = 40, |
|||
max_steps = 4000 |
|||
| ) |
Definition at line 56 of file zh_wallband_diff.py.
| float zh_wallband_diff.PHI0 = 0.125 |
Definition at line 27 of file zh_wallband_diff.py.
| zh_wallband_diff.BED = os.environ.get("BED", "") |
Definition at line 28 of file zh_wallband_diff.py.
| list zh_wallband_diff.Ns = [int(x) for x in (sys.argv[1:] or [32, 64, 128])] |
Definition at line 95 of file zh_wallband_diff.py.
| tuple zh_wallband_diff.prev = None |
Definition at line 100 of file zh_wallband_diff.py.
| zh_wallband_diff.fs |
Definition at line 102 of file zh_wallband_diff.py.
| zh_wallband_diff.ox |
Definition at line 102 of file zh_wallband_diff.py.
| zh_wallband_diff.sdf |
Definition at line 102 of file zh_wallband_diff.py.
| zh_wallband_diff.R |
Definition at line 102 of file zh_wallband_diff.py.
| zh_wallband_diff.fc |
Definition at line 103 of file zh_wallband_diff.py.
|
protected |
Definition at line 103 of file zh_wallband_diff.py.
Definition at line 105 of file zh_wallband_diff.py.
Definition at line 106 of file zh_wallband_diff.py.
Referenced by solve().
| zh_wallband_diff.tot = float(d.mean()) |
Definition at line 107 of file zh_wallband_diff.py.
| float zh_wallband_diff.band = 2.0 |
Definition at line 108 of file zh_wallband_diff.py.
Definition at line 109 of file zh_wallband_diff.py.
Definition at line 110 of file zh_wallband_diff.py.
Definition at line 111 of file zh_wallband_diff.py.
| dict zh_wallband_diff.o = {} |
Definition at line 112 of file zh_wallband_diff.py.
Definition at line 114 of file zh_wallband_diff.py.
| zh_wallband_diff.flush |
Definition at line 121 of file zh_wallband_diff.py.