1"""G-SV9 (a) (doc/vof_sharp_viscous_stress.md §11, amended §6.1 / WO-5b): the 2-D harness
2amplification factor rho(G), G = P (M+K)^-1 (M+K-A), of the PRODUCTION split Kb (2 mu(C) m_cc
3implicit on interfacial cells, mu(C) m_cc implicit + mu(C) m_cc explicit elsewhere, face-fraction
4edges; built by gsv9_split.harness_case), A = the sharp operator with the §5.7 interfacial-mean tau
5rule, over the six planar geometries of stab5.py, the four mu/rho ratio pairs, D_hi = 0.1, 1, 10,
6100, 1e4, at N = 16 and 32. PASS: rho(G) <= 1 + 1e-12 everywhere for Kb. Control: K1 (mu(C) split
7evenly on every cell, the pre-WO-5b code) is printed and must exceed 1 at D_hi = 1e4 for every
8N x ratio pair, proving the harness models what it claims.
10 nice -n 10 python gsv9a.py (12 worker processes; one line per N x ratio, one verdict line)
13from multiprocessing
import Pool
17from gsv9_split
import harness_case
19GEOMS = ((0.0, 0.6), (0.0, 0.2), (22.5, 0.0), (22.5, 0.3), (45.0, 0.3), (67.5, 0.5))
20PAIRS = ((1e-3, 1e-4), (1e-2, 1e-3), (1e2, 1e3), (1e3, 1e4))
21DS = (0.1, 1.0, 10.0, 100.0, 1e4)
25 N, muA, rA, ang, off = args
26 out = harness_case(N, ang, off, muA, rA, DS,
"sharp")
27 return args, {nm: np.array([out[(nm, d)]
for d
in DS])
for nm
in (
"Kb",
"K1")}
31 jobs = [(N, mu, r, a, o)
for N
in (16, 32)
for (mu, r)
in PAIRS
for (a, o)
in GEOMS]
33 res = p.map(one, jobs)
36 for nm
in (
"Kb",
"K1"):
38 worst[k] = np.maximum(worst.get(k, np.zeros(len(DS))), o[nm])
40 for k, v
in sorted(worst.items()):
42 top = max(top, float(np.max(v)))
44 ctl = ctl
and v[-1] > 1.0
45 print(
"GSV9a N=%d muA/muB=%g rhoA/rhoB=%g %s worst rho(G) at D_hi=%s: %s"
46 % (k[0], k[1], k[2], k[3],
",".join(
"%g" % d
for d
in DS),
" ".join(
"%.4f" % x
for x
in v)))
47 ok = top <= 1.0 + 1e-12
48 print(
"GSV9a %s worst Kb rho(G)=%.6f over %d geometries x %d ratio pairs x %d D_hi x N=16,32; "
49 "control K1 > 1 at D_hi=1e4 for every N x pair: %s"
50 % (
"PASS" if ok
else "MISS", top, len(GEOMS), len(PAIRS), len(DS),
"YES" if ctl
else "NO"))
51 return 0
if (ok
and ctl)
else 1
54if __name__ ==
"__main__":