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

Functions

 build (pf, phys)
 fields (s)
 main ()

Variables

 N
 D_CELLS
 STEPS
 RTOL
 AR
 BO
 RHO_RATIO
 MU_RATIO
float G_CELL = 6.0e-5
tuple SIGMA_CELL = (1.0 - RHO_RATIO) * G_CELL * D_CELLS**2 / BO
 MU_CELL = math.sqrt((1.0 - RHO_RATIO) * G_CELL * D_CELLS**3) / AR
 H
 RHO_REF
 T_REF

Detailed Description

Gate: block VoF with CSF gives the same flow in a physical domain as in cell units.

Why this test exists. Two unit bugs were reachable only under `Solver(cells, extent=...)` with the
block container (`enable_vof_blocks` + `enable_vof_block_csf`), and nothing ran that combination:
  1. step() handed its INTERNAL dt to the physical-unit block advector, which converted it again;
     with tRef pinned by the first set_dt the first step threw the Weymouth-Yue cap.
  2. enable_vof_block_csf() copied the internal sigma into the container before the first set_dt
     pinned tRef; the block CSF then ran 1/tRef^2 (~1e9 here) too strong.
In cell units tRef = 1, so both are invisible there (flow ac09b68).

The case: one block-marker bubble (d = 10 h) in a periodic 16^3 box, the case-A groups of the
bubble-swarm validation (Ar 29.9, Bo 2, density and viscosity ratio 0.1), buoyancy with the mixture
weight removed, the volume-mean u_x held at 0. It runs twice: in cell units (dt = 1, rho_l = 1), and
in a physical box (h = 1e-4 m, rho_l = 1000 kg/m^3, dt = 2.5e-5 s) whose every input is the cell-unit
value times its unit scale. After STEPS steps u, v, w, p (converted with `unit_scales`) and C must
match to <= 1e-12 relative to each field's maximum. set_dt comes after enable_vof_block_csf on
purpose: that is the drivers' order (tests/study/case_a) and the one that exposed bug 2.

Run:  OMP_NUM_THREADS=4 OMP_PROC_BIND=false PYTHONPATH=<build> \
          python tests/python/test_vof_blocks_physical_units.py
Exit 0 pass, 1 fail, 77 skipped (no module).

Function Documentation

◆ build()

test_vof_blocks_physical_units.build ( pf,
phys )
The same case; `phys` scales every input from cell units to SI.

Definition at line 39 of file test_vof_blocks_physical_units.py.

Referenced by main().

◆ fields()

test_vof_blocks_physical_units.fields ( s)

Definition at line 73 of file test_vof_blocks_physical_units.py.

Referenced by main().

◆ main()

test_vof_blocks_physical_units.main ( )

Definition at line 80 of file test_vof_blocks_physical_units.py.

References build(), fields(), and main().

Referenced by main().

Variable Documentation

◆ N

test_vof_blocks_physical_units.N

Definition at line 29 of file test_vof_blocks_physical_units.py.

◆ D_CELLS

test_vof_blocks_physical_units.D_CELLS

Definition at line 29 of file test_vof_blocks_physical_units.py.

◆ STEPS

test_vof_blocks_physical_units.STEPS

Definition at line 29 of file test_vof_blocks_physical_units.py.

◆ RTOL

test_vof_blocks_physical_units.RTOL

Definition at line 29 of file test_vof_blocks_physical_units.py.

◆ AR

test_vof_blocks_physical_units.AR

Definition at line 30 of file test_vof_blocks_physical_units.py.

◆ BO

test_vof_blocks_physical_units.BO

Definition at line 30 of file test_vof_blocks_physical_units.py.

◆ RHO_RATIO

test_vof_blocks_physical_units.RHO_RATIO

Definition at line 30 of file test_vof_blocks_physical_units.py.

◆ MU_RATIO

test_vof_blocks_physical_units.MU_RATIO

Definition at line 30 of file test_vof_blocks_physical_units.py.

◆ G_CELL

float test_vof_blocks_physical_units.G_CELL = 6.0e-5

Definition at line 32 of file test_vof_blocks_physical_units.py.

◆ SIGMA_CELL

tuple test_vof_blocks_physical_units.SIGMA_CELL = (1.0 - RHO_RATIO) * G_CELL * D_CELLS**2 / BO

Definition at line 33 of file test_vof_blocks_physical_units.py.

◆ MU_CELL

test_vof_blocks_physical_units.MU_CELL = math.sqrt((1.0 - RHO_RATIO) * G_CELL * D_CELLS**3) / AR

Definition at line 34 of file test_vof_blocks_physical_units.py.

◆ H

test_vof_blocks_physical_units.H

Definition at line 36 of file test_vof_blocks_physical_units.py.

◆ RHO_REF

test_vof_blocks_physical_units.RHO_REF

Definition at line 36 of file test_vof_blocks_physical_units.py.

◆ T_REF

test_vof_blocks_physical_units.T_REF

Definition at line 36 of file test_vof_blocks_physical_units.py.