|
flow
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| channel_sdf (nx, ny, nz, ylo, yhi) | |
| run (N, Solver, rho=1.0, mu=0.1, dt=50.0, F=0.01, max_steps=400) | |
| main () | |
Verification (flow): plane Poiseuille flow through an SDF-defined channel, driven by a body force, with Robust-Scaled cut-cell IBM no-slip at the (non-grid-aligned) walls. The steady profile is the parabola u(y) = F/(2 mu) (y - ylo)(yhi - y); because it is exactly quadratic and a second-order scheme is exact on quadratics, the cut-cell solution must match it AT EVERY GRID NODE to solver tolerance -- at every resolution and on both the staggered and collocated meshes. We therefore verify POINTWISE: max_node |u - u_analytic|. (The old version of this script compared the discrete u.max() to the continuum peak U_max = F H^2/(8 mu); with half-integer walls the channel centre sits 0.5h from the nearest node, so u.max() is a fixed amount below U_max and dividing by U_max fabricated a "converging" error -- a sampling artifact, not discretization error. The pointwise metric below actually tests method order and would catch a genuine first-order regression.) Uses the canonical `peclet.flow` module (one GPU as plain `python`, or multi-rank under `mpirun -np N`). Physical units: set_rho/set_mu, body force F is a force per unit volume (= -dp/dx). Grid spacing = 1.
| verify_poiseuille_flow.channel_sdf | ( | nx, | |
| ny, | |||
| nz, | |||
| ylo, | |||
| yhi | |||
| ) |
Global SDF as a 3-D array sdf[x,y,z]; negative inside the solid walls.
Definition at line 26 of file verify_poiseuille_flow.py.
Referenced by run().
| verify_poiseuille_flow.run | ( | N, | |
| Solver, | |||
rho = 1.0, |
|||
mu = 0.1, |
|||
dt = 50.0, |
|||
F = 0.01, |
|||
max_steps = 400 |
|||
| ) |
Solve one channel case at wall-to-wall resolution N; return the pointwise node error vs the parabola.
Definition at line 34 of file verify_poiseuille_flow.py.
References channel_sdf().
Referenced by main().
| verify_poiseuille_flow.main | ( | ) |
Run staggered + collocated at a few N, print the pointwise node error, exit non-zero on failure.
Definition at line 75 of file verify_poiseuille_flow.py.
Referenced by main().