|
flow 0.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| channel (N, s) | |
| exact_profile (exp, y, w_lo, w_hi) | |
| exact_discharge (exp, w_lo, w_hi) | |
| make_solver (kind, N, s) | |
| set_forces (sol, exp, ny, w_lo, w_hi) | |
| march (sol) | |
| run (kind, exp, N, s) | |
Variables | |
| MU | |
| F0 | |
| int | NX = 8 |
| int | SLAB = 8 |
| TOL = float(os.environ.get("MARCH_TOL", "1e-9")) | |
| CAP = int(os.environ.get("MARCH_MAX", "8000")) | |
| DT = float(os.environ.get("DT", "60.0")) | |
| ap = argparse.ArgumentParser() | |
| default | |
| a = ap.parse_args() | |
| list | Ns = [int(x) for x in a.N.split(",")] |
| list | Ss = [float(x) for x in a.s.split(",")] |
| exps = a.exp.split(",") | |
| kinds = a.solvers.split(",") | |
| str | hdr = f"{'N':>4} {'s':>5} {'solver':>12} {'steps':>6} {'e_flux':>11} {'e_cell':>11} {'L2prof':>10}" |
| flush | |
| dict | base = {} |
| r = run(kind, exp, N, s) | |
| tuple | row |
| dict | r1 = base.get(kind) |
| du = float(np.abs(r['U'] - r1['U']).max()) / r['uscale'] | |
| dv = float(np.abs(r['V']).max()) / r['uscale'] | |
Flat-wall displacement sweep (Frank's isolation ladder, 2026-08-20): the collocated ceiling
hunted in the simplest IBM geometry -- a plane channel whose walls sit at a FRACTIONAL grid offset
s, so every cut cell has the same theta and the closure error is a coherent function of one
parameter instead of an average over random incidences.
Steady-state structure (doc/collocated_accuracy_ceiling.md + the joint-fixed-point argument): the
collocated steady state satisfies nu*L_ibm(u) + F = G_gp(P) with D_alpha(avg_half(u)) = 0.
In a wall-aligned channel these decouple, giving three isolating experiments:
E1 uniform Fx -> parabola. u = u(y) x-only => div == 0 discretely, P == 0: the
pressure machinery NEVER ENGAGES. Any error is the momentum IBM
closure L_ibm alone (suspect S4). (Caveat: 2nd-order closures can
be exact on parabolas -- a null here does not clear curved walls.)
E1b Fx(y)=F0 cos(k(y-yc)), k=pi/W -> u = F0/(mu k^2) cos(k(y-yc)), zero at both walls,
non-polynomial: the order of L_ibm is readable.
E2 E1's Fx PLUS Fy(y)=A sin(2pi(y-w_lo)/W) in the fluid -> exact answer: u IDENTICAL to E1,
v == 0, p = integral(Fy). The y-force must be absorbed ENTIRELY by
the discrete pressure. Any (u - u_E1, v != 0) response is a defect
of the (G_gp vs masked-half-average constraint) pair -- the
non-adjointness channel, with L_ibm differenced out.
Sweep s in [0,1) x N (channel width in cells) x solver in {stag, gauge-exact (mode 9), plain
(mode 0)}. Errors are reported on the conserved face flux (primary; mean(alpha_x*uf)) and the
cell mean, both relative to the exact discharge.
SDFLOW_BUILD=build_omp3 python tests/study/flatwall_displacement.py # default sweep
... flatwall_displacement.py --N 8,16,32,64 --s 0.1,0.3,0.5,0.7,0.9 --exp E1,E1b,E2
| flatwall_displacement.channel | ( | N, | |
| s | |||
| ) |
SDF (F-order (nx,ny,nz)) + wall positions for a width-N channel displaced by s cells.
Definition at line 48 of file flatwall_displacement.py.
Referenced by make_solver().
| flatwall_displacement.exact_profile | ( | exp, | |
| y, | |||
| w_lo, | |||
| w_hi | |||
| ) |
Definition at line 59 of file flatwall_displacement.py.
Referenced by run().
| flatwall_displacement.exact_discharge | ( | exp, | |
| w_lo, | |||
| w_hi | |||
| ) |
Definition at line 70 of file flatwall_displacement.py.
Referenced by run().
| flatwall_displacement.make_solver | ( | kind, | |
| N, | |||
| s | |||
| ) |
| flatwall_displacement.set_forces | ( | sol, | |
| exp, | |||
| ny, | |||
| w_lo, | |||
| w_hi | |||
| ) |
Definition at line 96 of file flatwall_displacement.py.
Referenced by run().
| flatwall_displacement.march | ( | sol | ) |
Definition at line 120 of file flatwall_displacement.py.
Referenced by run().
| flatwall_displacement.run | ( | kind, | |
| exp, | |||
| N, | |||
| s | |||
| ) |
Definition at line 132 of file flatwall_displacement.py.
References exact_discharge(), exact_profile(), make_solver(), march(), and set_forces().
| flatwall_displacement.MU |
Definition at line 40 of file flatwall_displacement.py.
| flatwall_displacement.F0 |
Definition at line 40 of file flatwall_displacement.py.
| int flatwall_displacement.NX = 8 |
Definition at line 41 of file flatwall_displacement.py.
| int flatwall_displacement.SLAB = 8 |
Definition at line 42 of file flatwall_displacement.py.
| flatwall_displacement.TOL = float(os.environ.get("MARCH_TOL", "1e-9")) |
Definition at line 43 of file flatwall_displacement.py.
| flatwall_displacement.CAP = int(os.environ.get("MARCH_MAX", "8000")) |
Definition at line 44 of file flatwall_displacement.py.
| flatwall_displacement.DT = float(os.environ.get("DT", "60.0")) |
Definition at line 45 of file flatwall_displacement.py.
| flatwall_displacement.ap = argparse.ArgumentParser() |
Definition at line 155 of file flatwall_displacement.py.
| flatwall_displacement.default |
Definition at line 156 of file flatwall_displacement.py.
| flatwall_displacement.a = ap.parse_args() |
Definition at line 160 of file flatwall_displacement.py.
| list flatwall_displacement.Ns = [int(x) for x in a.N.split(",")] |
Definition at line 161 of file flatwall_displacement.py.
| list flatwall_displacement.Ss = [float(x) for x in a.s.split(",")] |
Definition at line 162 of file flatwall_displacement.py.
| flatwall_displacement.exps = a.exp.split(",") |
Definition at line 163 of file flatwall_displacement.py.
| flatwall_displacement.kinds = a.solvers.split(",") |
Definition at line 164 of file flatwall_displacement.py.
| flatwall_displacement.hdr = f"{'N':>4} {'s':>5} {'solver':>12} {'steps':>6} {'e_flux':>11} {'e_cell':>11} {'L2prof':>10}" |
Definition at line 167 of file flatwall_displacement.py.
| flatwall_displacement.flush |
Definition at line 170 of file flatwall_displacement.py.
| dict flatwall_displacement.base = {} |
Definition at line 173 of file flatwall_displacement.py.
Definition at line 175 of file flatwall_displacement.py.
| flatwall_displacement.row |
Definition at line 176 of file flatwall_displacement.py.
| flatwall_displacement.r1 = base.get(kind) |
Definition at line 180 of file flatwall_displacement.py.
Definition at line 183 of file flatwall_displacement.py.
Definition at line 184 of file flatwall_displacement.py.