flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
run_channel_18 Namespace Reference

Functions

 arg (name, default, cast=float)
 
 tbf_read (path, shape)
 
 interp_component (src, src_pos, dst_pos)
 
 load_tbf_ic ()
 
 laminar_ic ()
 
 sphere_frac (shape, R, c, sub=16)
 
 new_acc ()
 
 sample (acc, s, t)
 
 profiles (acc)
 
 save_ckpt (path, s, step, t, acc, blocks, alpha0)
 
 load_ckpt (path)
 
 block_state (s)
 
 main ()
 

Variables

 TBF = str(arg("--tbf", "/home/frankp/Codes/TBFsolver/channel_18/0", str))
 
 NY = int(arg("--ny", 80, int))
 
 NSTEP = int(arg("--steps", 20000, int))
 
 CKPT = str(arg("--ckpt", "channel_18_ckpt.npz", str))
 
 OUT = str(arg("--out", "channel_18_stats.npz", str))
 
 LOGJ = str(arg("--chunklog", "channel_18_chunks.jsonl", str))
 
 WALL = float(arg("--wall", 1e18))
 
 TARGET = float(arg("--turnovers", 20.0))
 
 STATS_START = float(arg("--stats-start", 4.0))
 
 SAMPLE = int(arg("--sample", 10, int))
 
 CKEVERY = int(arg("--ckpt-every", 2000, int))
 
 DTEVERY = int(arg("--dt-every", 1, int))
 
 DTSAFE = float(arg("--dt-safety", 0.25))
 
 PRINTEVERY = int(arg("--print-every", 200, int))
 
str QUICK = "--quick" in sys.argv
 
 LX
 
 LY
 
 LZ
 
 RHO_L
 
 RHO_G
 
float MU = 3.33333333333333e-4
 
float SIGMA = 5.0e-3
 
float GCH = 0.1
 
float RET = 127.3
 
float RE = 1.0 / MU
 
tuple TAUW = (RET / RE) ** 2
 
float UTAU = RET * MU
 
float RBUB = 0.125
 
 NBX
 
 NBY
 
 NBZ
 
 S = NY / LY
 
int NX = int(round(LX * S / 16)) * 16
 
int NZ = int(round(LZ * S / 16)) * 16
 
 LXC
 
 LZC
 
tuple KEYS
 

Detailed Description

VoF Part III rung W3 (WO-W3) — TBFsolver's `channel_18` to a statistically steady state.

WO-W12 gate 4 transcribed the case and ran it for 0.84 eddy turnovers on one shared workstation
GPU (`tests/study/vof_channel_18.py`).  W3 is the same case run to ~20 eddy turnovers on Snellius
H100s, which no single job's wall clock can hold, so this driver differs from that one in exactly
three ways and in nothing else:

  1. **it checkpoints and restarts** — velocity + every marker's OWN colour (`vof_block_color` /
     `enable_vof_blocks_from_colors`, added for this rung: re-seeding from the union field is
     NOT exact once two markers touch, WO-W12 open item 5),
  2. **it accumulates the statistics across chunks** (running sums live in the checkpoint), with an
     explicit transient window that is discarded, and
  3. **it stops on a wall-clock budget** as well as on a step/turnover target, so a chunk always
     ends with a checkpoint on disk.

The physical case is WO-W12's transcription verbatim — see `tests/study/vof_channel_18.py` for the
derivation of every number from the Fortran that consumes `channel_18/specs`:

    geometry   Lx = pi (streamwise, periodic), Ly = 2 (wall-normal, WALLS), Lz = pi/2 (spanwise,
               periodic), h = 1;  mapped onto an ISOTROPIC ny=80 grid -> 128 x 80 x 64.
    fluids     rho_l = 1, rho_g = 0.1;  mu_l = mu_g = 3.3333e-4;  sigma = 5e-3.
    driving    x-momentum source  tau_w + (rho - <rho>) gCH,  tau_w = (Re_tau/Re)^2 = 1.800588e-3,
               gCH = 0.1 a STREAMWISE GRAVITY (buoyancy only) -> u_tau = 0.0424333 by construction.
               The bubbles are driven against the mean flow: a DOWNFLOW channel.
    bubbles    18 spheres of R = 0.125 h on the centreline, 6 x 3 in (x, z); void fraction 1.49 %.
    IC         `channel_18/0/{ux,uy,uz}`, TBFsolver's own converged single-phase snapshot,
               trilinearly resampled onto our grid (U_b = 0.6113).

One eddy turnover is h/u_tau; the driver reports `t u_tau / h` everywhere.

STATISTICS (plane averages over x and z, per wall-normal row; sampled every `--sample` steps and
accumulated only after `t u_tau/h >= --stats-start`):

    <C>(y)                     the void fraction (C is the GAS indicator in this transcription:
                               rho = rho_l + (rho_g - rho_l) C)
    <u>(y), <v>(y), <w>(y)     cell-centred velocity means
    <u'u'>, <v'v'>, <w'w'>     rms components (from the accumulated squares)
    <u'v'>                     the Reynolds shear stress
    the same six conditioned on the LIQUID with the weight (1 - C)  ->  <u>_l etc.

    u_tau is reported three ways: the imposed 0.0424333, the wall gradient of <u>_l at the first
    cell, and the wall gradient at both walls separately (their spread is the convergence measure).

Usage (one chunk):
  PYTHONPATH=<build> python run_channel_18.py --ckpt ck.npz --steps 20000 --wall 39000 \
      --turnovers 20 --stats-start 4 --out results.npz
Re-running the same command resumes from `ck.npz` and stops when the turnover target is reached.

Function Documentation

◆ arg()

run_channel_18.arg (   name,
  default,
  cast = float 
)

Definition at line 61 of file run_channel_18.py.

◆ tbf_read()

run_channel_18.tbf_read (   path,
  shape 
)

Definition at line 112 of file run_channel_18.py.

Referenced by load_tbf_ic().

◆ interp_component()

run_channel_18.interp_component (   src,
  src_pos,
  dst_pos 
)

Definition at line 121 of file run_channel_18.py.

References slice().

Referenced by load_tbf_ic().

◆ load_tbf_ic()

run_channel_18.load_tbf_ic ( )

Definition at line 144 of file run_channel_18.py.

References interp_component(), and tbf_read().

Referenced by main().

◆ laminar_ic()

run_channel_18.laminar_ic ( )

Definition at line 167 of file run_channel_18.py.

Referenced by main().

◆ sphere_frac()

run_channel_18.sphere_frac (   shape,
  R,
  c,
  sub = 16 
)

Definition at line 181 of file run_channel_18.py.

References mean().

Referenced by main().

◆ new_acc()

run_channel_18.new_acc ( )

Definition at line 200 of file run_channel_18.py.

Referenced by load_ckpt(), and main().

◆ sample()

run_channel_18.sample (   acc,
  s,
  t 
)
One plane-averaged sample. Velocities are interpolated to CELL CENTRES first.

flow's `u` is the LOW-x face of each cell and x is periodic, `v` the low-y face (the +y face of
the last row is the wall, v = 0), `w` the low-z face with z periodic — so the centred value is
the mean of the cell's two faces on each axis.

Definition at line 208 of file run_channel_18.py.

References mean().

Referenced by main().

◆ profiles()

run_channel_18.profiles (   acc)
Turn the running sums into the reported profiles (dimensional, then in wall units).

Definition at line 251 of file run_channel_18.py.

Referenced by main().

◆ save_ckpt()

run_channel_18.save_ckpt (   path,
  s,
  step,
  t,
  acc,
  blocks,
  alpha0 
)

Definition at line 292 of file run_channel_18.py.

Referenced by main().

◆ load_ckpt()

run_channel_18.load_ckpt (   path)

Definition at line 316 of file run_channel_18.py.

References new_acc().

Referenced by main().

◆ block_state()

run_channel_18.block_state (   s)
{box, own colour} per marker — the complete state of the block container.

Definition at line 335 of file run_channel_18.py.

Referenced by main().

◆ main()

run_channel_18.main ( )

Variable Documentation

◆ TBF

run_channel_18.TBF = str(arg("--tbf", "/home/frankp/Codes/TBFsolver/channel_18/0", str))

Definition at line 67 of file run_channel_18.py.

◆ NY

run_channel_18.NY = int(arg("--ny", 80, int))

Definition at line 68 of file run_channel_18.py.

◆ NSTEP

run_channel_18.NSTEP = int(arg("--steps", 20000, int))

Definition at line 69 of file run_channel_18.py.

◆ CKPT

run_channel_18.CKPT = str(arg("--ckpt", "channel_18_ckpt.npz", str))

Definition at line 70 of file run_channel_18.py.

◆ OUT

run_channel_18.OUT = str(arg("--out", "channel_18_stats.npz", str))

Definition at line 71 of file run_channel_18.py.

◆ LOGJ

run_channel_18.LOGJ = str(arg("--chunklog", "channel_18_chunks.jsonl", str))

Definition at line 72 of file run_channel_18.py.

◆ WALL

run_channel_18.WALL = float(arg("--wall", 1e18))

Definition at line 73 of file run_channel_18.py.

◆ TARGET

run_channel_18.TARGET = float(arg("--turnovers", 20.0))

Definition at line 74 of file run_channel_18.py.

◆ STATS_START

run_channel_18.STATS_START = float(arg("--stats-start", 4.0))

Definition at line 75 of file run_channel_18.py.

◆ SAMPLE

run_channel_18.SAMPLE = int(arg("--sample", 10, int))

Definition at line 76 of file run_channel_18.py.

◆ CKEVERY

run_channel_18.CKEVERY = int(arg("--ckpt-every", 2000, int))

Definition at line 77 of file run_channel_18.py.

◆ DTEVERY

run_channel_18.DTEVERY = int(arg("--dt-every", 1, int))

Definition at line 78 of file run_channel_18.py.

◆ DTSAFE

run_channel_18.DTSAFE = float(arg("--dt-safety", 0.25))

Definition at line 79 of file run_channel_18.py.

◆ PRINTEVERY

run_channel_18.PRINTEVERY = int(arg("--print-every", 200, int))

Definition at line 80 of file run_channel_18.py.

◆ QUICK

str run_channel_18.QUICK = "--quick" in sys.argv

Definition at line 81 of file run_channel_18.py.

◆ LX

run_channel_18.LX

Definition at line 92 of file run_channel_18.py.

◆ LY

run_channel_18.LY

Definition at line 92 of file run_channel_18.py.

◆ LZ

run_channel_18.LZ

Definition at line 92 of file run_channel_18.py.

◆ RHO_L

run_channel_18.RHO_L

Definition at line 93 of file run_channel_18.py.

◆ RHO_G

run_channel_18.RHO_G

Definition at line 93 of file run_channel_18.py.

◆ MU

float run_channel_18.MU = 3.33333333333333e-4

Definition at line 94 of file run_channel_18.py.

◆ SIGMA

float run_channel_18.SIGMA = 5.0e-3

Definition at line 95 of file run_channel_18.py.

◆ GCH

float run_channel_18.GCH = 0.1

Definition at line 96 of file run_channel_18.py.

◆ RET

float run_channel_18.RET = 127.3

Definition at line 97 of file run_channel_18.py.

◆ RE

float run_channel_18.RE = 1.0 / MU

Definition at line 98 of file run_channel_18.py.

◆ TAUW

tuple run_channel_18.TAUW = (RET / RE) ** 2

Definition at line 99 of file run_channel_18.py.

◆ UTAU

float run_channel_18.UTAU = RET * MU

Definition at line 100 of file run_channel_18.py.

◆ RBUB

float run_channel_18.RBUB = 0.125

Definition at line 101 of file run_channel_18.py.

◆ NBX

run_channel_18.NBX

Definition at line 102 of file run_channel_18.py.

◆ NBY

run_channel_18.NBY

Definition at line 102 of file run_channel_18.py.

◆ NBZ

run_channel_18.NBZ

Definition at line 102 of file run_channel_18.py.

◆ S

run_channel_18.S = NY / LY

Definition at line 105 of file run_channel_18.py.

◆ NX

int run_channel_18.NX = int(round(LX * S / 16)) * 16

Definition at line 106 of file run_channel_18.py.

◆ NZ

int run_channel_18.NZ = int(round(LZ * S / 16)) * 16

Definition at line 107 of file run_channel_18.py.

◆ LXC

run_channel_18.LXC

Definition at line 108 of file run_channel_18.py.

◆ LZC

run_channel_18.LZC

Definition at line 108 of file run_channel_18.py.

◆ KEYS

tuple run_channel_18.KEYS
Initial value:
1= ("C", "u", "v", "w", "uu", "vv", "ww", "uv",
2 "L", "Lu", "Lv", "Lw", "Luu", "Lvv", "Lww", "Luv")

Definition at line 196 of file run_channel_18.py.