76 step, t, blocks, vel, pres, series = rp.load_ckpt(CKPT)
78 for c, a
in enumerate(vel):
80 s.set_field(
"p", pres)
81 s.diagnostics.set_vof_step_parity(step)
82 s.set_pressure_pcg(
True, 800, rtol)
83 v0 = np.array([b[
"volume"]
for b
in s.diagnostics.vof_block_stats()])
84 rec = {k: []
for k
in (
"t",
"dt",
"p_iters",
"mom_residual",
"mom_time",
"step_time",
85 "div_proj",
"vol",
"ux")}
86 samples = [rp.sample(s, t)]
88 L = s.vof_step_limits()
89 dt = min(0.25 * L[
"cfl_dt"], 0.25 * L[
"capillary_dt"])
94 tm = d.last_step_timers()
95 st = d.vof_block_stats()
98 rec[
"p_iters"].append(d.last_pressure_iterations())
99 rec[
"mom_residual"].append(d.last_momentum_residual())
100 rec[
"mom_time"].append(tm[
"momentum"])
101 rec[
"step_time"].append(tm[
"step"])
102 rec[
"div_proj"].append(s.max_open_divergence_projected())
103 rec[
"vol"].append([b[
"volume"]
for b
in st])
104 rec[
"ux"].append([b[
"velocity"][0] / rp.S
for b
in st])
105 if (i + 1) % 50 == 0:
106 samples.append(rp.sample(s, t))
107 print(f
" column rtol {rtol:g}: step {i+1}/{NCOL} p_iters {rec['p_iters'][-1]} "
108 f
"div {rec['div_proj'][-1]:.2e}", flush=
True)
109 vol = np.array(rec[
"vol"])
110 ux = np.array(rec[
"ux"])
114 "bubble_vol_drift_max": float(np.max(np.abs(vol / v0 - 1.0))),
115 "total_vol_drift_max": float(np.max(np.abs(vol.sum(axis=1) / v0.sum() - 1.0))),
116 "rise_mean_last_half": float(-np.mean(ux[half:])),
117 "drift_mean_last_half": float(np.mean([q[
"drift"]
for q
in samples[len(samples) // 2:]])),