|
flow 1.4.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Classes | |
| class | Dist |
Functions | |
| parse () | |
| check_backend (want) | |
| sphere_fractions (n, c, r, sub=8) | |
| build (n, mu_g=MU_G, face_mu="arithmetic", stress=None, single=False, vof_mom=False, dist=None, advection=True, rho_g_in=RHO_G, vof_mom_muscl=False) | |
| sample (s, h, x_prev, t_prev, t, dist, with_blocks=True) | |
| main () | |
Variables | |
| AR | |
| BO | |
| RHO_RATIO | |
| MU_RATIO | |
| L_OVER_D | |
| float | D = 1.0e-3 |
| float | RHO_L = 1000.0 |
| float | RHO_G = RHO_RATIO * RHO_L |
| float | G = 9.81 |
| MU_L = math.sqrt(RHO_L * abs(RHO_G - RHO_L) * G * D ** 3) / AR | |
| MU_G = MU_RATIO * MU_L | |
| float | SIGMA = abs(RHO_G - RHO_L) * G * D ** 2 / BO |
| T_REF = math.sqrt(D / G) | |
Case A of the bubble-swarm validation: the Esmaeeli-Tryggvason (1999) ordered bubble array.
One bubble in a triply periodic cube is an infinite simple-cubic array. Parameters as rerun by
Innocenti, Jaccod, Popinet & Chibbaro (2021, JFM 918:A23, arXiv 2002.02209, sec. 3 and Table 3)
and Loisy, Naso & Spelt (2017, JFM 816:94, case E1, fig. 1a):
Ar = sqrt(rho_l |rho_b - rho_l| g d^3) / mu_l = 29.9, Bo = |rho_b - rho_l| g d^2 / sigma = 2,
rho_b/rho_l = mu_b/mu_l = 0.1, L = 1.6 d (Table 3: 16^3 cells at d/h = 10), phi = 12.8 %.
Re = rho_l U d / mu_l with U the DRIFT velocity U = <u>_d - <u> (Loisy 2017 eq. 2.3: the volume
average over the gas minus the volume average over the whole cell). Targets (Table 3): Basilisk
23.05/22.01/21.275/21.0 at d/h 10/20/40/80, Loisy 19.05/20.22/20.58 at 10/20/40, E&T 20.49 at 40.
Set-up: the bubble-column driver's (peclet-examples benchmarks/bubble-column/scripts/run_peclet.py)
multiple-marker VoF with its solver settings, in a PHYSICAL domain (metres, SI properties).
Gravity points along -x, so the bubble rises along +x:
* buoyancy with the mixture weight removed, f_x = -(rho(C) - <rho>) g, <rho> from the discrete
gas volume (the -<rho>g body force of Innocenti sec. 3 / Loisy eq. 3.1);
* set_superficial_velocity(True, 'x', 0): the volume mean <u_x> is held at 0, so the computational
frame is Loisy's zero-mixture-velocity frame and the drift velocity is the gas-averaged u_x.
The lateral means <u_y>, <u_z> are free (zero by symmetry) and are written out as a check.
Usage:
PYTHONPATH=<flow build> OMP_NUM_THREADS=8 OMP_PROC_BIND=false \\
python tests/study/case_a/run_case_a.py --d-over-h 10 --backend host --t-end 20 --out runA10
--d-over-h {10,20,40,80} cells per bubble diameter; box = (1.6 d/h)^3 cells
--backend {host,cuda} checked against the imported module's Kokkos execution space (the
backend is chosen by PYTHONPATH, i.e. by which build is imported)
--t-end T end time in units of sqrt(d/g) (default 20)
--out DIR writes DIR/case_a.csv (one row per sample) and DIR/summary.txt;
a_closure_g = the superficial-velocity closure's acceleration
(last_superficial_velocity_shift / dt) in units of g
--dt-out T sample interval in sqrt(d/g) (default 0.05)
--max-steps N, --wall S stop early (timing / smoke runs)
--dt-safety F fraction of the CFL and capillary limits (default 0.25, the driver's)
--mu-ratio R ablation: mu_b/mu_l (default 0.1, the case); Ar and Bo are unchanged
(both use mu_l and the density difference)
--rho-ratio R ablation: the INERTIAL density ratio rho_b/rho_l (default 0.1, the case).
The buoyancy force keeps the case density, -(rho_case(C) - <rho_case>) g
with rho_b = 0.1 rho_l, so at R = 1 the buoyancy is Boussinesq and Ar,
Bo, mu_l, sigma are unchanged (refused with --vof-momentum)
--face-mu {arithmetic,harmonic} ablation: face-viscosity mean (default arithmetic, the driver's)
--viscous-stress {laplacian,full} the viscous stress form (set_viscous_stress). Absent: no setter
call, the solver's own default (AUTO = full for case A since WO-7;
doc/full_viscous_stress.md)
--no-advection momentum advection off (unsteady Stokes momentum). The default is ON
(set_advection(True), explicit SOU): case A is Navier-Stokes. The
solver's own default is OFF, and every case-A run before 2026-10-23
ran without it (G5 diagnosis, validation/G5_DIAG.md); `--advection`
is accepted and is the default
--single-vof ablation: the structured VoF + CSF without the block container (the
bubble seeded as 8x8x8 sub-sampled sphere fractions)
--vof-momentum ablation: enable_vof_momentum(rho_g, rho_l) (implies --single-vof:
the momentum-consistent transport is refused with the blocks)
--vof-mom-muscl ablation (with --vof-momentum): MinMod-limited donor velocity in the
momentum flux (diagnostics.set_vof_momentum_muscl) instead of the
default first-order donor cell
--mpi distributed run under mpirun (mpi4py; needs a PECLET_FLOW_MPI build):
mpi_block + init_mpi before the geometry; the fields are gathered for
the samples, rank 0 writes. At one rank the single-rank solver runs (no
mpi_block, no init_mpi), so `--mpi` at np 1 equals a run without it.
--dump FILE.npz write the final global u, v, w, p, C (decomposition-invariance checks,
doc/full_viscous_stress.md G4)
Prints one summary line.
| run_case_a.parse | ( | ) |
Definition at line 92 of file run_case_a.py.
Referenced by main().
| run_case_a.check_backend | ( | want | ) |
Definition at line 116 of file run_case_a.py.
Referenced by main().
| run_case_a.sphere_fractions | ( | n, | |
| c, | |||
| r, | |||
| sub = 8 ) |
Cell volume fractions of a sphere (centre c, radius r, both in cells), sub^3 samples.
Definition at line 125 of file run_case_a.py.
References mean().
Referenced by build().
| run_case_a.sample | ( | s, | |
| h, | |||
| x_prev, | |||
| t_prev, | |||
| t, | |||
| dist, | |||
| with_blocks = True ) |
Definition at line 212 of file run_case_a.py.
Referenced by main().
| run_case_a.main | ( | ) |
Definition at line 242 of file run_case_a.py.
References build(), check_backend(), main(), parse(), and sample().
Referenced by main().
| run_case_a.AR |
Definition at line 80 of file run_case_a.py.
| run_case_a.BO |
Definition at line 80 of file run_case_a.py.
| run_case_a.RHO_RATIO |
Definition at line 80 of file run_case_a.py.
| run_case_a.MU_RATIO |
Definition at line 80 of file run_case_a.py.
| run_case_a.L_OVER_D |
Definition at line 80 of file run_case_a.py.
| float run_case_a.D = 1.0e-3 |
Definition at line 82 of file run_case_a.py.
| float run_case_a.RHO_L = 1000.0 |
Definition at line 83 of file run_case_a.py.
Definition at line 84 of file run_case_a.py.
| float run_case_a.G = 9.81 |
Definition at line 85 of file run_case_a.py.
Definition at line 86 of file run_case_a.py.
Definition at line 87 of file run_case_a.py.
Definition at line 88 of file run_case_a.py.
Definition at line 89 of file run_case_a.py.