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

Functions

 wmean (y, hi, lo)

Variables

 d = sys.argv[1]
int L = float(sys.argv[2]) if len(sys.argv) > 2 else 1.6
 hdr = open(f"{d}/err.log").readline()
 mu_l = float(re.search(r"mu2 (\S+)", hdr).group(1))
 N = int(re.search(r"# N (\d+)", hdr).group(1))
 H = np.loadtxt(f"{d}/log.dat")
 t
 ub
 um
 uz
 xc
 cum = np.concatenate(([0.0], np.cumsum(0.5 * (um[1:] + um[:-1]) * np.diff(t))))
 xr = xc - cum
dict cols = {"drift": (ub - um) / mu_l, "zm": (ub - uz) / mu_l, "abs": ub / mu_l, "umix": um / mu_l}
 xe = xr[-1]
dict A = {k: wmean(v, xe, xe - 2 * L) for k, v in cols.items()}
 B = wmean(cols["drift"], xe - 2 * L, xe - 4 * L)
int m = xr > xe - 2 * L
 ta = t[m][0]
tuple rc = (xe - xr[m][0]) / (t[-1] - ta) / mu_l

Detailed Description

Post-process a Basilisk case-A run (array.c) with run_case_a.py's definitions.

usage: python post.py RUN_DIR [L=1.6]
log.dat columns: t ub umix uzm xcent vg step (units d = g = rho_l = 1; mu_l from err.log).
Re_drift = (ub - umix)/mu_l (Loisy eq. 2.3; run_case_a holds umix = 0, Basilisk does not),
Re_zm = (ub - uzm)/mu_l, Re_abs = ub/mu_l (computational frame). Windows as run_case_a.py: A = the
last two box crossings of the gas centroid measured in the <u> = 0 frame (x_rel = xcent - int umix dt),
B = the two before; trapezoidal time means. Re_cent = x_rel displacement over window A / time.
Prints one summary line.

Function Documentation

◆ wmean()

post.wmean ( y,
hi,
lo )

Definition at line 27 of file post.py.

Variable Documentation

◆ d

post.d = sys.argv[1]

Definition at line 15 of file post.py.

◆ L

int post.L = float(sys.argv[2]) if len(sys.argv) > 2 else 1.6

Definition at line 16 of file post.py.

◆ hdr

post.hdr = open(f"{d}/err.log").readline()

Definition at line 17 of file post.py.

◆ mu_l

post.mu_l = float(re.search(r"mu2 (\S+)", hdr).group(1))

Definition at line 18 of file post.py.

◆ N

post.N = int(re.search(r"# N (\d+)", hdr).group(1))

Definition at line 19 of file post.py.

◆ H

post.H = np.loadtxt(f"{d}/log.dat")

Definition at line 20 of file post.py.

◆ t

post.t

Definition at line 21 of file post.py.

◆ ub

post.ub

Definition at line 21 of file post.py.

◆ um

post.um

Definition at line 21 of file post.py.

◆ uz

post.uz

Definition at line 21 of file post.py.

◆ xc

post.xc

Definition at line 21 of file post.py.

◆ cum

post.cum = np.concatenate(([0.0], np.cumsum(0.5 * (um[1:] + um[:-1]) * np.diff(t))))

Definition at line 22 of file post.py.

◆ xr

post.xr = xc - cum

Definition at line 23 of file post.py.

◆ cols

dict post.cols = {"drift": (ub - um) / mu_l, "zm": (ub - uz) / mu_l, "abs": ub / mu_l, "umix": um / mu_l}

Definition at line 24 of file post.py.

◆ xe

post.xe = xr[-1]

Definition at line 32 of file post.py.

◆ A

dict post.A = {k: wmean(v, xe, xe - 2 * L) for k, v in cols.items()}

Definition at line 33 of file post.py.

◆ B

post.B = wmean(cols["drift"], xe - 2 * L, xe - 4 * L)

Definition at line 34 of file post.py.

◆ m

int post.m = xr > xe - 2 * L

Definition at line 35 of file post.py.

◆ ta

post.ta = t[m][0]

Definition at line 36 of file post.py.

◆ rc

tuple post.rc = (xe - xr[m][0]) / (t[-1] - ta) / mu_l

Definition at line 37 of file post.py.