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

Classes

class  Geo
 

Functions

 graetz_ref (Pe)
 
 assemble_fv (G, ap_x, ap_y, cells, wall_coef=None)
 
 assemble_ghost (G, kind, theta_min=1e-3)
 
 smallest_eig (K, Mdiag, k=2)
 
 graetz (K, Mdiag, udiag, Pe)
 
 run (ND, off, Pes=(10.0, 1000.0))
 

Variables

float R = 1.0
 
int J01SQ = jn_zeros(0, 1)[0] ** 2
 
int JP11SQ = jnp_zeros(1, 1)[0] ** 2
 
 rng = np.random.default_rng(1)
 
 offs = rng.random((int(sys.argv[1]) if len(sys.argv) > 1 else 3, 2))
 
list NDs = [int(a) for a in sys.argv[2:]] or [16, 32, 64, 128]
 
dict ref
 
dict res = {}
 
 keys = sorted({k for (k, _) in res})
 
str line = f"{q:8s} {tag:12s}"
 
 prev = None
 
dict e = np.array(res[((q, tag), ND)]) / ref[q] - 1
 
 em = np.sqrt((e**2).mean())
 

Detailed Description

2-D prototype: immersed-surface scalar BCs on a pipe cross-section (disc of radius R=1 in a
square Cartesian box, fluid INSIDE the disc).  Every gate has an exact answer:

  Neumann  : first non-zero eigenvalue of -lap on the disc      j'_11^2 = 3.389957
             Taylor-Aris closure  -<u'b> = 1/48 (D=U=R=1)       (D_ax/alpha = 1 + Pe^2/48)
  Dirichlet: decay eigenvalue                                    j_01^2  = 5.783186
             Graetz total-flux Nu_F = Pe*lambda*R at Pe = 10, 1000 (1F1 root, Peters eq. 43-44)

Discretizations compared (sparse assembly here; every one is a <=5-point row, i.e. 7-point in 3-D):
  Neumann:
    FV-ap/kappa : aperture two-point fluxes, storage/source weighted by fluid fraction kappa
    FV-ap/1     : same fluxes, unit storage/source (what flow's scalar path does today)
    stair       : binary apertures, centre-in-fluid cells only (pure staircase baseline)
  Dirichlet:
    mask-ap     : flow's per-cell Dirichlet mask (centre-in-solid cells pinned to 0) + apertures
    ghost-lin   : Gibou 2002 linear ghost, symmetric (diagonal += 1/theta)
    ghost-quad  : Robust-Scaled scheme-0 quadratic ghost (flow cut_cell_closure.hpp), non-symmetric
    FV-wall     : cut-cell FV, all kappa>0 cells, wall flux D*A_w*(c_G - c_P)/d(centroid), mass kappa

Function Documentation

◆ graetz_ref()

disc_bc.graetz_ref (   Pe)

Definition at line 31 of file disc_bc.py.

◆ assemble_fv()

disc_bc.assemble_fv (   G,
  ap_x,
  ap_y,
  cells,
  wall_coef = None 
)
-sum_f a_f (cQ-cP)/h^2 on the index set `cells`; optional extra diagonal (wall flux).

Definition at line 90 of file disc_bc.py.

◆ assemble_ghost()

disc_bc.assemble_ghost (   G,
  kind,
  theta_min = 1e-3 
)
Cell-centred 5-point -lap on centre-in-fluid cells, Dirichlet 0 at the SDF crossing.

Definition at line 115 of file disc_bc.py.

Referenced by run().

◆ smallest_eig()

disc_bc.smallest_eig (   K,
  Mdiag,
  k = 2 
)
Smallest eigenvalues of K v = mu M v (M diagonal > 0).

Definition at line 143 of file disc_bc.py.

◆ graetz()

disc_bc.graetz (   K,
  Mdiag,
  udiag,
  Pe 
)
Smallest lambda>0 with  K v = (lambda^2 M + lambda Pe M u) v  (D=1, U=Pe, R=1).

Definition at line 155 of file disc_bc.py.

Referenced by run().

◆ run()

disc_bc.run (   ND,
  off,
  Pes = (10.0, 1000.0) 
)

Definition at line 167 of file disc_bc.py.

References assemble_ghost(), graetz(), and mean().

Variable Documentation

◆ R

float disc_bc.R = 1.0

Definition at line 26 of file disc_bc.py.

◆ J01SQ

int disc_bc.J01SQ = jn_zeros(0, 1)[0] ** 2

Definition at line 27 of file disc_bc.py.

◆ JP11SQ

int disc_bc.JP11SQ = jnp_zeros(1, 1)[0] ** 2

Definition at line 28 of file disc_bc.py.

◆ rng

disc_bc.rng = np.random.default_rng(1)

Definition at line 224 of file disc_bc.py.

◆ offs

disc_bc.offs = rng.random((int(sys.argv[1]) if len(sys.argv) > 1 else 3, 2))

Definition at line 225 of file disc_bc.py.

◆ NDs

list disc_bc.NDs = [int(a) for a in sys.argv[2:]] or [16, 32, 64, 128]

Definition at line 226 of file disc_bc.py.

◆ ref

dict disc_bc.ref
Initial value:
1= {"N-eig": JP11SQ, "TA": 1 / 48, "D-eig": J01SQ,
2 "NuF10": graetz_ref(10.0), "NuF1000": graetz_ref(1000.0)}

Definition at line 227 of file disc_bc.py.

◆ res

dict disc_bc.res = {}

Definition at line 230 of file disc_bc.py.

◆ keys

disc_bc.keys = sorted({k for (k, _) in res})

Definition at line 235 of file disc_bc.py.

◆ line

str disc_bc.line = f"{q:8s} {tag:12s}"

Definition at line 237 of file disc_bc.py.

◆ prev

disc_bc.prev = None

Definition at line 238 of file disc_bc.py.

◆ e

dict disc_bc.e = np.array(res[((q, tag), ND)]) / ref[q] - 1

Definition at line 240 of file disc_bc.py.

◆ em

disc_bc.em = np.sqrt((e**2).mean())

Definition at line 241 of file disc_bc.py.