2"""Diagnosis probe 3: SHA-256 of u/v/w/p after 200 steps of the forward collocated channel (no
3scalar) -- to show whether the outlet face plane of uf_ reaches momentum. Run at one thread."""
13for scheme
in (
"gauge-exact",
"embed"):
14 s = pf.SolverColocated(NX, NY, NZ)
15 s.set_rho(1.0); s.set_mu(0.1); s.set_dt(0.5)
16 s.set_advection(
True); s.set_advection_scheme(
"koren")
17 s.set_collocated_scheme(scheme)
18 s.set_domain_bc(
"-x",
"inflow", (1.0, 0.0, 0.0))
19 s.set_domain_bc(
"+x",
"outflow")
20 s.set_domain_bc(
"-y",
"wall"); s.set_domain_bc(
"+y",
"wall")
21 s.set_pressure_geometry(np.asfortranarray(np.full((NX, NY, NZ), 10.0)))
22 s.set_pressure_pcg(
True, 400, 1e-11)
26 for f
in (s.get_u(), s.get_v(), s.get_w(), s.get_p()):
27 h.update(np.ascontiguousarray(np.asarray(f), dtype=np.float64).tobytes())
28 ob = s.diagnostics.outflow_backflow()
29 print(f
"{scheme:12s} uvwp sha256 {h.hexdigest()[:24]} u_out_max {np.asarray(s.get_u())[-1].max():.15f}")