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

Functions

 zh_ref (phi)
 
 sphere_radius (phi, N)
 
 sc_sdf (N, phi)
 
 drag_K (umean, R, N, f, mu)
 
 run_sdflow (SolverCls, N, phi, mu=0.1, f=1e-3, dt=60.0, max_steps=600, tol=1e-6)
 
 run_amr (N, phi, mu=0.1, f=1e-3, dt=60.0, steps=100, mom=120, pres=6, psw=2)
 
 main ()
 

Variables

 _here = os.path.dirname(__file__)
 
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

Grid-convergence of Stokes permeability through an SC sphere array (Zick & Homsy ground truth),
comparing how the SUPERFICIAL VELOCITY U_sup = <u_x> is computed across discretizations:

  * staggered      — sdflow.Solver: u lives on faces (divergence-free), <u_x> over the face field.
  * collocated/cell — sdflow.SolverColocated: <u_x> over the CELL-centered velocity (the default).
  * collocated/face — sdflow.SolverColocated: <u_x> over the projected, divergence-free MAC FACE field
                      (get_uf). Same solve as collocated/cell — only the averaging location differs.
  * amr/uniform     — transport-core tpx_amr.Flow (collocated cut-cell) on a UNIFORM octree (lmax=0).

Motivation: the staggered solver is ~1% more accurate per grid than collocated on permeability. The cell
average is biased by the openness-aware central-difference pressure correction (projectCorrectCenter) at cut
cells, which has a non-zero mean there; the face field's correction is a plain gradient (zero periodic mean),
so its mean is the clean momentum-balance superficial velocity. This script measures whether averaging the
divergence-free face field recovers the staggered accuracy.

K = f N^3 / (6 pi mu R U_sup) (Z&H drag); err% vs the Z&H table. Run from sdflow/ with the OpenMP build:
  SDFLOW_BUILD=build_omp PYTHONPATH=build_omp:../transport-core/python/build python scripts/study_avg_velocity_spheres.py

Function Documentation

◆ zh_ref()

study_avg_velocity_spheres.zh_ref (   phi)

Definition at line 36 of file study_avg_velocity_spheres.py.

◆ sphere_radius()

study_avg_velocity_spheres.sphere_radius (   phi,
  N 
)

Definition at line 40 of file study_avg_velocity_spheres.py.

Referenced by main(), and sc_sdf().

◆ sc_sdf()

study_avg_velocity_spheres.sc_sdf (   N,
  phi 
)
Single SC sphere centered in the N^3 cube; suite sign (<0 solid).

Definition at line 44 of file study_avg_velocity_spheres.py.

References sphere_radius().

Referenced by run_amr(), and run_sdflow().

◆ drag_K()

study_avg_velocity_spheres.drag_K (   umean,
  R,
  N,
  f,
  mu 
)

Definition at line 54 of file study_avg_velocity_spheres.py.

Referenced by main().

◆ run_sdflow()

study_avg_velocity_spheres.run_sdflow (   SolverCls,
  N,
  phi,
  mu = 0.1,
  f = 1e-3,
  dt = 60.0,
  max_steps = 600,
  tol = 1e-6 
)
Returns (U_cell, U_face): the cell-mean and the divergence-free face-mean of u_x at steady state.

Definition at line 58 of file study_avg_velocity_spheres.py.

References sc_sdf().

Referenced by main().

◆ run_amr()

study_avg_velocity_spheres.run_amr (   N,
  phi,
  mu = 0.1,
  f = 1e-3,
  dt = 60.0,
  steps = 100,
  mom = 120,
  pres = 6,
  psw = 2 
)

Definition at line 85 of file study_avg_velocity_spheres.py.

References sc_sdf().

Referenced by main().

◆ main()

study_avg_velocity_spheres.main ( )

Definition at line 97 of file study_avg_velocity_spheres.py.

References drag_K(), main(), run_amr(), run_sdflow(), and sphere_radius().

Referenced by main().

Variable Documentation

◆ _here

study_avg_velocity_spheres._here = os.path.dirname(__file__)
protected

Definition at line 26 of file study_avg_velocity_spheres.py.

◆ ZH_PHI

list study_avg_velocity_spheres.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 32 of file study_avg_velocity_spheres.py.

◆ ZH_K

list study_avg_velocity_spheres.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 33 of file study_avg_velocity_spheres.py.