You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The structure-function half and the J₁ Bessel method are implemented.
Advective structure functions are cross-channel second-order moments, so they needed no new kernel mathematics — only the channel generalisation from #34:
𝓐 is an input, supplied as a channel. Derivatives are not computed inside a pair kernel — that is a grid operation, and the pair loop is deliberately agnostic about how the field was produced.
uniformly for every advected quantity — kinetic energy, enstrophy, SQG buoyancy variance and QG potential enstrophy are the same relation with a different channel (eqs. 14/17/20/21). Bessels.jl is a zero-dependency weakdep, and only the 2-D kernel and the flux kernels need it, since the 1-D and 3-D isotropic kernels are cos and sin(x)/x.
The prefactor is verified against a closed form rather than fitted. Since ∫₀^R J₁(Kr) dr = (1 − J₀(KR))/K, a constant advective structure function c must give Π_K = −(c/2)(1 − J₀(KR)) exactly — matched at every K to ~6 decimals, settling on −c/2.
Two things deliberately left out:
The third-order companions (eqs. 15/16/18/19, J₂/J₃). bessel_kernel supplies the orders, but these carry different prefactors (−K²/4, −K³/12), an extra factor of r in one, and ξ boundary terms the paper notes do not generally vanish. An order keyword was briefly exposed and then removed, because it applied the −K/2 prefactor at every order — it would have returned a plausible wrong flux.
A tight physics gate against the transfer function. Verified in sign and magnitude where the comparison is well-posed (ratio +1.055 at K = 5 on a triad field), but a few-mode field's true flux is a staircase jumping at each mode shell, while the J₁ estimator has width ~1/r_max and necessarily smooths it. A clean comparison needs broadband turbulence, i.e. a simulation. The shipped tests therefore assert the quadrature, the sign and the refusals — not the published relation itself.
Also gated: a flux needs two distinct channels. The diagonal is a variance and carries no flux, and VectorDotSFType(1,1)isS2SF, so that case is refused by name.
Activity
jbphyswx commentedon Sep 6, 2026
The structure-function half and the
J₁Bessel method are implemented.Advective structure functions are cross-channel second-order moments, so they needed no new kernel mathematics — only the channel generalisation from #34:
𝓐is an input, supplied as a channel. Derivatives are not computed inside a pair kernel — that is a grid operation, and the pair loop is deliberately agnostic about how the field was produced.Spectral flux.
spectral_flux(result, wavenumbers)implementsuniformly for every advected quantity — kinetic energy, enstrophy, SQG buoyancy variance and QG potential enstrophy are the same relation with a different channel (eqs. 14/17/20/21).
Bessels.jlis a zero-dependency weakdep, and only the 2-D kernel and the flux kernels need it, since the 1-D and 3-D isotropic kernels arecosandsin(x)/x.The prefactor is verified against a closed form rather than fitted. Since
∫₀^R J₁(Kr) dr = (1 − J₀(KR))/K, a constant advective structure functioncmust giveΠ_K = −(c/2)(1 − J₀(KR))exactly — matched at everyKto ~6 decimals, settling on−c/2.Two things deliberately left out:
J₂/J₃).bessel_kernelsupplies the orders, but these carry different prefactors (−K²/4,−K³/12), an extra factor ofrin one, andξboundary terms the paper notes do not generally vanish. Anorderkeyword was briefly exposed and then removed, because it applied the−K/2prefactor at every order — it would have returned a plausible wrong flux.K = 5on a triad field), but a few-mode field's true flux is a staircase jumping at each mode shell, while theJ₁estimator has width~1/r_maxand necessarily smooths it. A clean comparison needs broadband turbulence, i.e. a simulation. The shipped tests therefore assert the quadrature, the sign and the refusals — not the published relation itself.Also gated: a flux needs two distinct channels. The diagonal is a variance and carries no flux, and
VectorDotSFType(1,1)isS2SF, so that case is refused by name.