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

Functions

 stefan_lambda (st)
 
 planar_colour (nx, ny, nz, xg, liquid_low=True)
 
 gate_p0a (nx=64, ny=4, nz=4, x0=32.25, mdot=0.02, dt=1.0, nsteps=1000)
 
 gate_p0b (nx=64, ny=4, nz=4, rg=1.0, rl=100.0, mdot=0.01, x0=32.25, nsteps=20)
 
 stefan_run (n, st=1.0, alpha=1.0, x0p=0.10, xep=0.25, fo=0.5, ny=4, nz=4)
 
 gate_p1 (ns=(64, 128, 256))
 

Variables

 want = sys.argv[1:] or ["p0a", "p0b", "p1"]
 
bool ok = True
 

Detailed Description

WO-P01 (Part II, rungs P0/P1) — phase change in planar form: the gate battery, in Python.

Every gate prints its numbers; nothing is summarised into an adjective.

  p0a  REGRESSION ONLY (rho_g = rho_l = 1, no divergence source). A planar interface under a
       uniform prescribed mdot, 1000 kinematic steps. The interface position must follow
       x(t) = x0 - mdot t / rho_l EXACTLY (it is a plane shift by a constant volume per step,
       so the only error is round-off), the colour must stay in [0, 1], and the run must cross
       twenty cell boundaries — which is what exercises the clip-and-redistribute.

  p0b  THE DIVERGENCE SOURCE at density ratio 100. A CLOSED column (walls on +-x, periodic in
       y/z) with the net vapour production balanced by a prescribed sink plane, so the Poisson
       problem is compatible without an outflow face. WHY CLOSED AND NOT AN OUTFLOW: the
       variable-density outflow OPERATOR is inconsistent by the density ratio until WO-R2 lands
       (`flow/CLAUDE.md`, rung V-BC), so an outflow at ratio 100 would measure that defect, not
       this one. WHY WALLS AND NOT A PERIODIC BOX: in a periodic box nothing anchors the frame,
       the constraint is zero net momentum, and the liquid recoils at
       -u_g rho_g L_g / (rho_l L_l + rho_g L_g) -- a real effect, but it turns the "gas velocity"
       gate into a statement about a near-cancellation. With walls the liquid is at rest and the
       1-D solution is u = 0 up to the deposit cell, u = mdot(1/rho_g - 1/rho_l) beyond it, and
       0 again past the sink.

  p1   THE STEFAN PROBLEM, and the convergence ladder 64/128/256. A vapour layer growing from a
       superheated wall into saturated liquid; mdot from the one-sided pure-cell gradients of a
       transported temperature, interfacial cells pinned at T_sat by the per-cell Dirichlet mask.
       x(t) = 2 lambda sqrt(alpha_g t) with lambda e^{lambda^2} erf(lambda) = St/sqrt(pi).
       The ladder holds the PHYSICAL problem fixed (domain length 1, alpha = 1, St = 1, the layer
       growing from 0.10 to 0.25 of the domain) and refines h = 1/N with the diffusive number
       Fo = alpha dt/h^2 fixed, so dt ~ h^2 and the backward-Euler time error is O(h^2) --
       it cannot contaminate a first- or second-order spatial statement.
       At N = 256 the vapour layer is 64 cells thick at the gate time, which is the WO's rung.
       Run with rho_g = rho_l: the classical Stefan similarity solution has the vapour at rest
       against the wall and the LIQUID moving at mdot(1/rho_g - 1/rho_l), i.e. a ratio /= 1 needs
       an outlet at the liquid end -- the same WO-R2 dependence as p0b, and the thermal/regression
       kernels this rung exists to measure are identical either way.

Usage:
    PYTHONPATH=$PWD/build_cuda python tests/study/vof_stefan.py [p0a p0b p1 ...]

Function Documentation

◆ stefan_lambda()

vof_stefan.stefan_lambda (   st)
lambda e^{lambda^2} erf(lambda) = St / sqrt(pi)  (bisection; no scipy dependency).

Definition at line 49 of file vof_stefan.py.

Referenced by stefan_run().

◆ planar_colour()

vof_stefan.planar_colour (   nx,
  ny,
  nz,
  xg,
  liquid_low = True 
)

Definition at line 62 of file vof_stefan.py.

Referenced by gate_p0a(), gate_p0b(), and stefan_run().

◆ gate_p0a()

vof_stefan.gate_p0a (   nx = 64,
  ny = 4,
  nz = 4,
  x0 = 32.25,
  mdot = 0.02,
  dt = 1.0,
  nsteps = 1000 
)

Definition at line 70 of file vof_stefan.py.

References planar_colour().

◆ gate_p0b()

vof_stefan.gate_p0b (   nx = 64,
  ny = 4,
  nz = 4,
  rg = 1.0,
  rl = 100.0,
  mdot = 0.01,
  x0 = 32.25,
  nsteps = 20 
)

Definition at line 96 of file vof_stefan.py.

References planar_colour().

◆ stefan_run()

vof_stefan.stefan_run (   n,
  st = 1.0,
  alpha = 1.0,
  x0p = 0.10,
  xep = 0.25,
  fo = 0.5,
  ny = 4,
  nz = 4 
)

Definition at line 140 of file vof_stefan.py.

References planar_colour(), and stefan_lambda().

Referenced by gate_p1().

◆ gate_p1()

vof_stefan.gate_p1 (   ns = (64, 128, 256))

Definition at line 174 of file vof_stefan.py.

References stefan_run().

Variable Documentation

◆ want

vof_stefan.want = sys.argv[1:] or ["p0a", "p0b", "p1"]

Definition at line 195 of file vof_stefan.py.

◆ ok

bool vof_stefan.ok = True

Definition at line 196 of file vof_stefan.py.