flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
uf_outlet_hash200.py
Go to the documentation of this file.
1#!/usr/bin/env python
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."""
4import hashlib
5import sys
6
7import numpy as np
8
9sys.argv += []
10import peclet.flow as pf
11
12NX, NY, NZ = 48, 16, 4
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)
23 for _ in range(200):
24 s.step()
25 h = hashlib.sha256()
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}")