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

Functions

 comps (open_faces, active)
 

Variables

 pack
 
 R
 
 pk = np.load(pack)
 
 box = np.asarray(pk["box"], float)
 
 G = np.round(box * R).astype(int)
 
 c = np.asarray(pk["centers"]) * R
 
 r = np.asarray(pk["scales"]) * R
 
 S = np.full(tuple(G), 1e30, np.float32)
 
list ax = [np.arange(G[k]) + 0.5 for k in range(3)]
 
 cs = c + sh * G
 
 keep = np.all((cs + (r + 3)[:, None] > 0) & (cs - (r + 3)[:, None] < G), axis=1)
 
 i0
 
 i1
 
 j0
 
 j1
 
 k0
 
 k1
 
 d
 
 out
 
 n = int(np.prod(G))
 
int fluidC = 0
 
list Fm = [0.5 * (np.roll(S, 1, axis=a) + S) >= 0 for a in range(3)]
 
 nfaces = sum(Fm[a].astype(np.int8) + np.roll(Fm[a], -1, axis=a).astype(np.int8) for a in range(3))
 
int hasface = nfaces > 0
 
list cur_open = [np.roll(fluidC, 1, axis=a) & fluidC for a in range(3)]
 
 nc
 
 tot
 
 orph
 
 nc2
 
 tot2
 
 orph2
 

Detailed Description

How many pressure unknowns does the CURRENT centre-based classification throw away, and what
does it do to fluid connectivity? Compares
  CURRENT : cell has a row iff its CENTRE is fluid; face open iff BOTH centres fluid
  FACE    : cell has a row iff >=1 of its 6 faces has a FLUID velocity point; face open iff that
            face point is fluid   (= the paper's rule: pressure lives wherever a fluid face needs
            a gradient)
Face sdf = mean of the two adjacent centres, exactly as the solver classifies it.

Function Documentation

◆ comps()

gp_pressure_classification.comps (   open_faces,
  active 
)
connected components of the pressure graph over `active` cells.

Definition at line 51 of file gp_pressure_classification.py.

Variable Documentation

◆ pack

gp_pressure_classification.pack

Definition at line 14 of file gp_pressure_classification.py.

◆ R

gp_pressure_classification.R

Definition at line 14 of file gp_pressure_classification.py.

◆ pk

gp_pressure_classification.pk = np.load(pack)

Definition at line 15 of file gp_pressure_classification.py.

◆ box

gp_pressure_classification.box = np.asarray(pk["box"], float)

Definition at line 16 of file gp_pressure_classification.py.

◆ G

gp_pressure_classification.G = np.round(box * R).astype(int)

Definition at line 17 of file gp_pressure_classification.py.

◆ c

gp_pressure_classification.c = np.asarray(pk["centers"]) * R

Definition at line 18 of file gp_pressure_classification.py.

◆ r

gp_pressure_classification.r = np.asarray(pk["scales"]) * R

Definition at line 19 of file gp_pressure_classification.py.

◆ S

gp_pressure_classification.S = np.full(tuple(G), 1e30, np.float32)

Definition at line 20 of file gp_pressure_classification.py.

◆ ax

list gp_pressure_classification.ax = [np.arange(G[k]) + 0.5 for k in range(3)]

Definition at line 21 of file gp_pressure_classification.py.

◆ cs

gp_pressure_classification.cs = c + sh * G

Definition at line 23 of file gp_pressure_classification.py.

◆ keep

gp_pressure_classification.keep = np.all((cs + (r + 3)[:, None] > 0) & (cs - (r + 3)[:, None] < G), axis=1)

Definition at line 24 of file gp_pressure_classification.py.

◆ i0

gp_pressure_classification.i0

Definition at line 26 of file gp_pressure_classification.py.

◆ i1

gp_pressure_classification.i1

Definition at line 26 of file gp_pressure_classification.py.

◆ j0

gp_pressure_classification.j0

Definition at line 27 of file gp_pressure_classification.py.

◆ j1

gp_pressure_classification.j1

Definition at line 27 of file gp_pressure_classification.py.

◆ k0

gp_pressure_classification.k0

Definition at line 28 of file gp_pressure_classification.py.

◆ k1

gp_pressure_classification.k1

Definition at line 28 of file gp_pressure_classification.py.

◆ d

gp_pressure_classification.d
Initial value:
1= np.sqrt((ax[0][i0:i1, None, None] - cx) ** 2 + (ax[1][None, j0:j1, None] - cy) ** 2
2 + (ax[2][None, None, k0:k1] - cz) ** 2) - rr

Definition at line 31 of file gp_pressure_classification.py.

◆ out

gp_pressure_classification.out

Definition at line 33 of file gp_pressure_classification.py.

◆ n

gp_pressure_classification.n = int(np.prod(G))

Definition at line 35 of file gp_pressure_classification.py.

◆ fluidC

int gp_pressure_classification.fluidC = 0

Definition at line 36 of file gp_pressure_classification.py.

◆ Fm

list gp_pressure_classification.Fm = [0.5 * (np.roll(S, 1, axis=a) + S) >= 0 for a in range(3)]

Definition at line 38 of file gp_pressure_classification.py.

◆ nfaces

gp_pressure_classification.nfaces = sum(Fm[a].astype(np.int8) + np.roll(Fm[a], -1, axis=a).astype(np.int8) for a in range(3))

Definition at line 39 of file gp_pressure_classification.py.

◆ hasface

int gp_pressure_classification.hasface = nfaces > 0

Definition at line 41 of file gp_pressure_classification.py.

◆ cur_open

list gp_pressure_classification.cur_open = [np.roll(fluidC, 1, axis=a) & fluidC for a in range(3)]

Definition at line 70 of file gp_pressure_classification.py.

◆ nc

gp_pressure_classification.nc

Definition at line 71 of file gp_pressure_classification.py.

◆ tot

gp_pressure_classification.tot

Definition at line 71 of file gp_pressure_classification.py.

◆ orph

gp_pressure_classification.orph

Definition at line 71 of file gp_pressure_classification.py.

◆ nc2

gp_pressure_classification.nc2

Definition at line 73 of file gp_pressure_classification.py.

◆ tot2

gp_pressure_classification.tot2

Definition at line 73 of file gp_pressure_classification.py.

◆ orph2

gp_pressure_classification.orph2

Definition at line 73 of file gp_pressure_classification.py.