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

Functions

 F (a)
 
 build (grid, bfp)
 
 vel (s)
 
 check (label, u, ref, absolute)
 
 run (grid)
 
 main ()
 
 test_balanced_force_restart ()
 

Variables

 N
 
 NZ
 
 G
 
int TOL = 1e-12
 
 RHO = np.where(np.arange(NZ) < NZ // 2, 1000.0, 1.0)[None, None, :] * np.ones((N, N, NZ))
 

Detailed Description

Gate: the balanced-force projection's pressure split P = P_dyn + P_b never counts the balanced
pressure twice (doc/collocated_varrho_forces.md ยง4.6.2, the re-split rule).

The option keeps P the total pressure and P_b ("p_balanced") its balanced part; a continuing step
does P += X - P_b, P_b = X. When P_b is NOT the split of the current P -- steps with the option off
moved P, or a restart restored "p" but not "p_balanced" -- that update adds the balanced pressure a
second time (measured before the fix on this column: a restart gave max|u| 1.25e-2 against 7.8e-14
continued; OFF 400 steps then ON gave 1.27e-2). The rule: such a step RE-SPLITS (P_b = X, P
unchanged), and restoring "p_balanced" together with "p" keeps the split.

Configuration: a walled ratio-1000 column (8 x 8 x 24, heavy lower half, walls at -z/+z, mu 0.1,
dt 1, g 0.1, Stokes, Chebyshev rtol 1e-12), on SolverColocated (V8: the option is its default) and
on Solver (option explicitly on). Scenarios, each against its twin:
  continued        30 steps, then one more               (the reference level)
  restart          u, v, w, p restored into a fresh solver, one step (re-split)
  restart + P_b    u, v, w, p and p_balanced restored, one step (keeps the split)
  OFF -> ON        400 steps OFF, then ON for 1 and 6 steps, against the OFF run continued
Gates: every scenario's velocity differs from its twin by < 1e-12 (max over u, v, w), and the two
restarts stay below 1e-12 absolute. On a static force a re-split step IS the OFF step, so the
OFF -> ON run tracks the OFF run to round-off; its absolute level is the OFF transient's (1.8e-4
cell velocity on V8 at step 400, exact on the staggered 1-D column), not the continued ON run's.

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

Function Documentation

◆ F()

test_balanced_force_restart.F (   a)

Definition at line 41 of file test_balanced_force_restart.py.

◆ build()

test_balanced_force_restart.build (   grid,
  bfp 
)

Definition at line 48 of file test_balanced_force_restart.py.

References F.

◆ vel()

test_balanced_force_restart.vel (   s)

Definition at line 73 of file test_balanced_force_restart.py.

Referenced by run().

◆ check()

test_balanced_force_restart.check (   label,
  u,
  ref,
  absolute 
)

Definition at line 77 of file test_balanced_force_restart.py.

Referenced by run().

◆ run()

test_balanced_force_restart.run (   grid)

Definition at line 85 of file test_balanced_force_restart.py.

References check(), F, and vel().

Referenced by main().

◆ main()

test_balanced_force_restart.main ( )

Definition at line 125 of file test_balanced_force_restart.py.

References run().

Referenced by test_balanced_force_restart().

◆ test_balanced_force_restart()

test_balanced_force_restart.test_balanced_force_restart ( )

Definition at line 131 of file test_balanced_force_restart.py.

References main().

Variable Documentation

◆ N

test_balanced_force_restart.N

Definition at line 37 of file test_balanced_force_restart.py.

◆ NZ

test_balanced_force_restart.NZ

Definition at line 37 of file test_balanced_force_restart.py.

◆ G

test_balanced_force_restart.G

Definition at line 37 of file test_balanced_force_restart.py.

◆ TOL

int test_balanced_force_restart.TOL = 1e-12

Definition at line 38 of file test_balanced_force_restart.py.

◆ RHO

test_balanced_force_restart.RHO = np.where(np.arange(NZ) < NZ // 2, 1000.0, 1.0)[None, None, :] * np.ones((N, N, NZ))

Definition at line 45 of file test_balanced_force_restart.py.