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

Functions

 zh_ref (phi)
 
 sphere_radius (phi, N)
 
 sc_sdf_xyz (N, phi)
 
 drag_K (umean, R, N, f, mu)
 
 _upsample2 (a)
 
 run_sdflow (N, phi, mu=0.1, f=1e-3, dt=None, max_steps=600, tol=1e-6, coarse="rediscretized", seed=None)
 
 main ()
 

Variables

list ZH_PHI = [0.000125, 0.001, 0.008, 0.027, 0.064, 0.125, 0.216, 0.343, 0.45, 0.5236]
 
list ZH_K = [1.096, 1.212, 1.525, 2.008, 2.810, 4.292, 7.442, 15.4, 28.1, 42.1]
 

Detailed Description

GROUND TRUTH: simple-cubic (SC) array of spheres, Stokes drag factor K vs Zick & Homsy (1982).

A single sphere centred in a periodic cube is the classic SC lattice. Z&H give the semi-analytic Stokes
drag factor K(c) (c = sphere solid fraction) to high accuracy -- the external reference for the sdflow
cut-cell IBM. (Historically this also re-ran the retired pnm_backend reference solver; sdflow was validated
bit-identical to it before its retirement, so only the external Z&H comparison remains.)

  K = F_total / (6*pi*mu*R*U_sup),   F_total = f * V_cell,   U_sup = mean(u) over the whole cell.

K is dimensionless and unit-invariant.

Usage:  python scripts/validate_zick_homsy_sdflow.py [N1,N2,...] [phi1,phi2,...]

Function Documentation

◆ zh_ref()

validate_zick_homsy_sdflow.zh_ref (   phi)

Definition at line 30 of file validate_zick_homsy_sdflow.py.

◆ sphere_radius()

validate_zick_homsy_sdflow.sphere_radius (   phi,
  N 
)
Sphere radius (grid units) for solid fraction phi in an N^3 cube.

Definition at line 34 of file validate_zick_homsy_sdflow.py.

Referenced by sc_sdf_xyz().

◆ sc_sdf_xyz()

validate_zick_homsy_sdflow.sc_sdf_xyz (   N,
  phi 
)
SC single sphere, SDF as 3-D array sdf[x,y,z] in grid units (dx=1); negative inside the sphere.

Definition at line 39 of file validate_zick_homsy_sdflow.py.

References sphere_radius().

Referenced by run_sdflow().

◆ drag_K()

validate_zick_homsy_sdflow.drag_K (   umean,
  R,
  N,
  f,
  mu 
)
K = F_total/(6 pi mu R U_sup), F_total = f*N^3 (grid units), U_sup = mean(u).

Definition at line 48 of file validate_zick_homsy_sdflow.py.

Referenced by run_sdflow().

◆ _upsample2()

validate_zick_homsy_sdflow._upsample2 (   a)
protected
2x nearest upsample x4 (self-similar packing: u_2N(2x) ~ 4*u_N(x)) -> near-steady seed.

Definition at line 53 of file validate_zick_homsy_sdflow.py.

Referenced by run_sdflow().

◆ run_sdflow()

validate_zick_homsy_sdflow.run_sdflow (   N,
  phi,
  mu = 0.1,
  f = 1e-3,
  dt = None,
  max_steps = 600,
  tol = 1e-6,
  coarse = "rediscretized",
  seed = None 
)
Multilevel MG-PCG pressure solve; `coarse` selects the coarse-operator mode
('rediscretized' = the geometric per-level cut-cell operator, the recommended default;
'galerkin' = the inconsistent aggregation path; 'const' = geometry-blind coarse).
`seed` = (u,v,w) from the next-coarser N, upsampled here, to start the march near steady.

Definition at line 58 of file validate_zick_homsy_sdflow.py.

References _upsample2(), drag_K(), and sc_sdf_xyz().

Referenced by main().

◆ main()

validate_zick_homsy_sdflow.main ( )

Definition at line 91 of file validate_zick_homsy_sdflow.py.

References main(), and run_sdflow().

Referenced by main().

Variable Documentation

◆ ZH_PHI

list validate_zick_homsy_sdflow.ZH_PHI = [0.000125, 0.001, 0.008, 0.027, 0.064, 0.125, 0.216, 0.343, 0.45, 0.5236]

Definition at line 26 of file validate_zick_homsy_sdflow.py.

◆ ZH_K

list validate_zick_homsy_sdflow.ZH_K = [1.096, 1.212, 1.525, 2.008, 2.810, 4.292, 7.442, 15.4, 28.1, 42.1]

Definition at line 27 of file validate_zick_homsy_sdflow.py.