|
| | 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 |
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.