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

Functions

 bed_sdf (N, npz)
 
 solve (N, kind, mu=0.1, F=1e-3, dt=80.0, warm_tol=1e-7, tail=40, max_steps=4000)
 

Variables

float PHI0 = 0.125
 
 BED = os.environ.get("BED", "")
 
list Ns = [int(x) for x in (sys.argv[1:] or [32, 64, 128])]
 
 prev = None
 
 fs
 
 ox
 
 sdf
 
 R
 
 fc
 
 _
 
float sf = 0.5 * (sdf + np.roll(sdf, 1, axis=0))
 
 d = ox * (fc - fs)
 
 tot = float(d.mean())
 
float band = 2.0
 
int share = float(d[band].sum() / d.sum()) if abs(d.sum()) > 0 else float("nan")
 
 mx = float(np.abs(d[band]).max())
 
 rms = float(np.sqrt((d[band] ** 2).mean()))
 
dict o = {}
 
 lr = np.log(N / prev[0])
 
 flush
 

Detailed Description

WHERE does the collocated-vs-staggered difference live, and does its amplitude grow?

The permeability gap does not vanish under refinement, and the constraint operator was exonerated
a-priori (net flux defect ~1e-5). If the surviving difference is localised in a wall band, the
arithmetic is forced: the band's VOLUME fraction shrinks as O(h), so for its contribution to the
volume-averaged velocity to stay constant the AMPLITUDE in the band must grow as O(1/h).

So: run both solvers on identical geometry, compare the alpha-weighted FACE fluxes (the conserved
quantity, and a like-for-like basis -- staggered get_u IS the face field, collocated get_uf is its
projected one), and split the difference by distance to the wall in CELL units.

  amplitude ~ 1/h  => mechanism found: a gauge/scaling error in the near-wall reconstruction
  amplitude ~ O(1) => the band contributes O(h) and the gap must come from somewhere else

    SDFLOW_BUILD=build_ge python tests/study/zh_wallband_diff.py [N ...]

Function Documentation

◆ bed_sdf()

zh_wallband_diff.bed_sdf (   N,
  npz 
)
Periodic union-of-spheres SDF from a packing, sampled on an N^3 grid (cubic box only).

Definition at line 31 of file zh_wallband_diff.py.

Referenced by solve().

◆ solve()

zh_wallband_diff.solve (   N,
  kind,
  mu = 0.1,
  F = 1e-3,
  dt = 80.0,
  warm_tol = 1e-7,
  tail = 40,
  max_steps = 4000 
)

Definition at line 56 of file zh_wallband_diff.py.

References bed_sdf(), and d.

Variable Documentation

◆ PHI0

float zh_wallband_diff.PHI0 = 0.125

Definition at line 27 of file zh_wallband_diff.py.

◆ BED

zh_wallband_diff.BED = os.environ.get("BED", "")

Definition at line 28 of file zh_wallband_diff.py.

◆ Ns

list zh_wallband_diff.Ns = [int(x) for x in (sys.argv[1:] or [32, 64, 128])]

Definition at line 95 of file zh_wallband_diff.py.

◆ prev

tuple zh_wallband_diff.prev = None

Definition at line 100 of file zh_wallband_diff.py.

◆ fs

zh_wallband_diff.fs

Definition at line 102 of file zh_wallband_diff.py.

◆ ox

zh_wallband_diff.ox

Definition at line 102 of file zh_wallband_diff.py.

◆ sdf

zh_wallband_diff.sdf

Definition at line 102 of file zh_wallband_diff.py.

◆ R

zh_wallband_diff.R

Definition at line 102 of file zh_wallband_diff.py.

◆ fc

zh_wallband_diff.fc

Definition at line 103 of file zh_wallband_diff.py.

◆ _

zh_wallband_diff._
protected

Definition at line 103 of file zh_wallband_diff.py.

◆ sf

float zh_wallband_diff.sf = 0.5 * (sdf + np.roll(sdf, 1, axis=0))

Definition at line 105 of file zh_wallband_diff.py.

◆ d

zh_wallband_diff.d = ox * (fc - fs)

Definition at line 106 of file zh_wallband_diff.py.

Referenced by solve().

◆ tot

zh_wallband_diff.tot = float(d.mean())

Definition at line 107 of file zh_wallband_diff.py.

◆ band

float zh_wallband_diff.band = 2.0

Definition at line 108 of file zh_wallband_diff.py.

◆ share

int zh_wallband_diff.share = float(d[band].sum() / d.sum()) if abs(d.sum()) > 0 else float("nan")

Definition at line 109 of file zh_wallband_diff.py.

◆ mx

zh_wallband_diff.mx = float(np.abs(d[band]).max())

Definition at line 110 of file zh_wallband_diff.py.

◆ rms

zh_wallband_diff.rms = float(np.sqrt((d[band] ** 2).mean()))

Definition at line 111 of file zh_wallband_diff.py.

◆ o

dict zh_wallband_diff.o = {}

Definition at line 112 of file zh_wallband_diff.py.

◆ lr

zh_wallband_diff.lr = np.log(N / prev[0])

Definition at line 114 of file zh_wallband_diff.py.

◆ flush

zh_wallband_diff.flush

Definition at line 121 of file zh_wallband_diff.py.