flow 0.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
collocated_longmarch Namespace Reference

Functions

 bed_sdf (N, npz)
 

Variables

 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
 
 True
 
 pressure_coarse
 
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
 

Detailed Description

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.

  SDFLOW_BUILD=build_ge BED=...npz N=192 STEPS=20000 EVERY=500 DT=60 python collocated_longmarch.py

Function Documentation

◆ bed_sdf()

collocated_longmarch.bed_sdf (   N,
  npz 
)

Definition at line 46 of file collocated_longmarch.py.

Variable Documentation

◆ BED

collocated_longmarch.BED = os.environ["BED"]

Definition at line 25 of file collocated_longmarch.py.

◆ N

collocated_longmarch.N = int(os.environ.get("N", "192"))

Definition at line 26 of file collocated_longmarch.py.

◆ STEPS

collocated_longmarch.STEPS = int(os.environ.get("STEPS", "20000"))

Definition at line 27 of file collocated_longmarch.py.

◆ EVERY

collocated_longmarch.EVERY = int(os.environ.get("EVERY", "500"))

Definition at line 28 of file collocated_longmarch.py.

◆ DT

collocated_longmarch.DT = float(os.environ.get("DT", "60.0"))

Definition at line 29 of file collocated_longmarch.py.

◆ KIND

collocated_longmarch.KIND = os.environ.get("KIND", "gauge-exact")

Definition at line 30 of file collocated_longmarch.py.

◆ ROT

collocated_longmarch.ROT = int(os.environ.get("ROT", "1"))

Definition at line 31 of file collocated_longmarch.py.

◆ ROTF

collocated_longmarch.ROTF = int(os.environ.get("ROTF", "0"))

Definition at line 32 of file collocated_longmarch.py.

◆ ROTW

collocated_longmarch.ROTW = float(os.environ.get("ROTW", "1"))

Definition at line 33 of file collocated_longmarch.py.

◆ WALLW

collocated_longmarch.WALLW = float(os.environ.get("WALLW", "0"))

Definition at line 34 of file collocated_longmarch.py.

◆ DTSWITCH

collocated_longmarch.DTSWITCH
Initial value:
1= dict((int(a), float(b)) for a, b in
2 (kv.split(":") for kv in os.environ.get("DTSWITCH", "").split(",") if kv))

Definition at line 38 of file collocated_longmarch.py.

◆ MU

collocated_longmarch.MU

Definition at line 40 of file collocated_longmarch.py.

◆ F0

collocated_longmarch.F0

Definition at line 40 of file collocated_longmarch.py.

◆ SHIFT

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.

◆ sdf

collocated_longmarch.sdf

Definition at line 69 of file collocated_longmarch.py.

◆ R

collocated_longmarch.R

Definition at line 69 of file collocated_longmarch.py.

◆ sv

str collocated_longmarch.sv = "stag" else flow.SolverColocated

Definition at line 70 of file collocated_longmarch.py.

◆ s

str collocated_longmarch.s = sv(N, N, N)

Definition at line 71 of file collocated_longmarch.py.

◆ cutcell_pressure

collocated_longmarch.cutcell_pressure

Definition at line 104 of file collocated_longmarch.py.

◆ True

collocated_longmarch.True

Definition at line 104 of file collocated_longmarch.py.

◆ pressure_coarse

collocated_longmarch.pressure_coarse

Definition at line 104 of file collocated_longmarch.py.

◆ fluid

float collocated_longmarch.fluid = 0.0

Definition at line 105 of file collocated_longmarch.py.

◆ flush

collocated_longmarch.flush

Definition at line 107 of file collocated_longmarch.py.

◆ pk

collocated_longmarch.pk = None

Definition at line 110 of file collocated_longmarch.py.

◆ Pprev

collocated_longmarch.Pprev = None

Definition at line 111 of file collocated_longmarch.py.

◆ U

list collocated_longmarch.U = [np.asarray(s.get_u()), np.asarray(s.get_v()), np.asarray(s.get_w())]

Definition at line 118 of file collocated_longmarch.py.

◆ us

int collocated_longmarch.us = float(np.abs(U[0][fluid]).mean()) + 1e-300

Definition at line 119 of file collocated_longmarch.py.

◆ kc

int collocated_longmarch.kc = float(U[0].mean()) * MU / F0 / R ** 2

Definition at line 120 of file collocated_longmarch.py.

◆ m1

int collocated_longmarch.m1 = 0.0

Definition at line 122 of file collocated_longmarch.py.

◆ OX

list collocated_longmarch.OX = [np.asarray(s.get_ox()), np.asarray(s.get_oy()), np.asarray(s.get_oz())]

Definition at line 123 of file collocated_longmarch.py.

◆ kf

int collocated_longmarch.kf = float((OX[0] * U[0]).mean()) * MU / F0 / R ** 2

Definition at line 124 of file collocated_longmarch.py.

◆ div

collocated_longmarch.div = np.zeros_like(U[0])

Definition at line 125 of file collocated_longmarch.py.

◆ flx

list collocated_longmarch.flx = OX[a] * U[a]

Definition at line 127 of file collocated_longmarch.py.

◆ axis

collocated_longmarch.axis

Definition at line 128 of file collocated_longmarch.py.

◆ m2

int collocated_longmarch.m2 = float(np.sqrt((div[fluid] ** 2).mean())) / us

Definition at line 129 of file collocated_longmarch.py.

◆ UF

list collocated_longmarch.UF = [np.asarray(s.get_uf()), np.asarray(s.get_vf()), np.asarray(s.get_wf())]

Definition at line 131 of file collocated_longmarch.py.

◆ m1sq

float collocated_longmarch.m1sq = 0.0

Definition at line 134 of file collocated_longmarch.py.

◆ half

float collocated_longmarch.half = 0.5 * (U[a] + np.roll(U[a], 1, axis=a))

Definition at line 137 of file collocated_longmarch.py.

◆ op

list collocated_longmarch.op = OX[a] > 0

Definition at line 138 of file collocated_longmarch.py.

◆ dk

str collocated_longmarch.dk = "" if pk is None else f"{kc - pk:+.2e}"

Definition at line 144 of file collocated_longmarch.py.

◆ dm

str collocated_longmarch.dm = "" if pm is None else f"{m1 - pm:+.2e}"

Definition at line 145 of file collocated_longmarch.py.

◆ Pf

collocated_longmarch.Pf = np.asarray(s.get_p())

Definition at line 146 of file collocated_longmarch.py.

◆ dP

str collocated_longmarch.dP = "" if Pprev is None else f"{np.abs(Pf - Pprev).max():.3e}"

Definition at line 147 of file collocated_longmarch.py.

◆ pm

collocated_longmarch.pm

Definition at line 151 of file collocated_longmarch.py.