|
flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
|
Functions | |
| hydrostatic (ratio, mu=0.0, steps=100, g=0.1, dt=1.0, N=8, NZ=24) | |
| rayleigh_taylor (N=48, NZ=96, g=0.005, mu=0.002, dt=1.0, steps=240) | |
| rayleigh_taylor_vof (N=48, NZ=96, g=0.005, mu=0.002, steps=240, cfl=0.2, dt0=1.0) | |
| fit (a, t, t0=40.0, t1=160.0) | |
Variables | |
| m | |
| perr | |
| hist = rayleigh_taylor() | |
| growth = hist[-1] / hist[0] | |
| vh | |
| vt | |
| vdrift | |
| vgrowth = vh[-1] / vh[0] | |
| A | |
| k | |
| n_lin = np.sqrt(A * 0.005 * k) | |
| list | td = [40.0 * i for i in range(len(hist))] |
| n_dif | |
| n_vof | |
Variable-density validation (Phase 5): hydrostatic acid tests + Rayleigh-Taylor demonstrator.
1. Hydrostatic balance (the acid test): a stratified two-layer fluid at rest under gravity must
STAY at rest, with the discrete pressure gradient exactly rho_face*g. This detects any
inconsistency between the momentum face density, the body-force face value, and the projection
face coefficient. Inviscid: max steady velocity ~1e-16, P-gradient error ~1e-16 at density
ratios 3 AND 1000. (The C++ ctest `vardensity_projection` runs the same case.)
2. Rayleigh-Taylor: heavy over light (ratio 3, Atwood 0.5) through the FULL two-phase chain — a
TRANSPORTED phase fraction c drives rho via a linear-mixture closure (auto-enabling the
variable-density path), gravity is a closure force_z = -g*rho, momentum + projection carry the
variable density. The interface amplitude grows ~exponentially then nonlinearly; the measured
growth rate is ~0.75x the inviscid sqrt(A g k) (viscous + finite-interface damping).
TWO records, same physics, reported side by side (VoF rung V2a / WO-J):
* DIFFUSE C — the pre-VoF baseline: a tanh profile of width 1.5 advected by the Koren TVD
scalar transport. Amplitude 1.50 -> 19.52 (x13.0), rate 0.75x sqrt(A g k).
* SHARP C — geometric VoF (PLIC + Weymouth-Yue), adaptive dt from the INTERFACE-LOCAL
Courant number. Amplitude 1.50 -> 20.20 (x13.5), rate 0.77x sqrt(A g k), colour volume
drift -6.6e-09. The sharp interface grows marginally FASTER, which is the expected sign:
a two-cell-wide density ramp damps the mode that a sharp jump does not.
Run: PYTHONPATH=<build> python rayleigh_taylor.py
| rayleigh_taylor.hydrostatic | ( | ratio, | |
mu = 0.0, |
|||
steps = 100, |
|||
g = 0.1, |
|||
dt = 1.0, |
|||
N = 8, |
|||
NZ = 24 |
|||
| ) |
Definition at line 30 of file rayleigh_taylor.py.
| rayleigh_taylor.rayleigh_taylor | ( | N = 48, |
|
NZ = 96, |
|||
g = 0.005, |
|||
mu = 0.002, |
|||
dt = 1.0, |
|||
steps = 240 |
|||
| ) |
Definition at line 52 of file rayleigh_taylor.py.
| rayleigh_taylor.rayleigh_taylor_vof | ( | N = 48, |
|
NZ = 96, |
|||
g = 0.005, |
|||
mu = 0.002, |
|||
steps = 240, |
|||
cfl = 0.2, |
|||
dt0 = 1.0 |
|||
| ) |
SHARP-interface Rayleigh-Taylor through the geometric VoF chain (rung V2a, WO-J). Identical physics to `rayleigh_taylor()` above — same grid, same Atwood number (ratio 3), same gravity, same viscosity, same initial interface z_i(x) = NZ/2 + 1.5 cos(2 pi x / N) — with ONE difference: the phase field is a sharp geometric VoF colour field advected by Weymouth-Yue instead of a tanh profile of width 1.5 advected by Koren TVD. Reporting both is the point: the diffuse record is the pre-VoF baseline this rung has to reproduce. Two deliberate departures from the diffuse driver, both forced by the method rather than chosen: * dt is ADAPTIVE. Weymouth-Yue is bounded only for an interface-local Courant number below 1/(2(N-1)) = 0.25 in 3D, and an RT interface accelerates, so a fixed dt = 1 that is safe at t = 0 is not safe at t = 240. dt is therefore chosen from `vof_max_courant()` — the INTERFACE-LOCAL Courant number, which is the quantity the bound applies to (a global max would throttle on the far-field return flow; V1 measured 2x over-throttling on Zalesak, and the WO-J ctest measures 22x on a jet-plus-quiescent-interface scene). Amplitudes are therefore reported against PHYSICAL TIME, sampled at the same t = 40, 80, ... 240 as the diffuse record. * the amplitude comes from the COLUMN SUM of C, not from interpolating a C = 0.5 crossing. For a sharp interface the column sum IS the interface height to machine precision (z_i = NZ - sum_z C, heavy on top), while a 0.5-crossing interpolation of a two-cell-wide profile carries an O(h) bias that the diffuse case cannot avoid and this one need not.
Definition at line 82 of file rayleigh_taylor.py.
| rayleigh_taylor.fit | ( | a, | |
| t, | |||
t0 = 40.0, |
|||
t1 = 160.0 |
|||
| ) |
Definition at line 166 of file rayleigh_taylor.py.
| rayleigh_taylor.m |
Definition at line 144 of file rayleigh_taylor.py.
| rayleigh_taylor.perr |
Definition at line 144 of file rayleigh_taylor.py.
| rayleigh_taylor.hist = rayleigh_taylor() |
Definition at line 147 of file rayleigh_taylor.py.
Definition at line 148 of file rayleigh_taylor.py.
| rayleigh_taylor.vh |
Definition at line 153 of file rayleigh_taylor.py.
| rayleigh_taylor.vt |
Definition at line 153 of file rayleigh_taylor.py.
| rayleigh_taylor.vdrift |
Definition at line 153 of file rayleigh_taylor.py.
Definition at line 154 of file rayleigh_taylor.py.
| rayleigh_taylor.A |
Definition at line 163 of file rayleigh_taylor.py.
| rayleigh_taylor.k |
Definition at line 163 of file rayleigh_taylor.py.
Definition at line 164 of file rayleigh_taylor.py.
| list rayleigh_taylor.td = [40.0 * i for i in range(len(hist))] |
Definition at line 170 of file rayleigh_taylor.py.
| rayleigh_taylor.n_dif |
Definition at line 171 of file rayleigh_taylor.py.
| rayleigh_taylor.n_vof |
Definition at line 171 of file rayleigh_taylor.py.