Skip to content

Support Pearson Advective Structure Functions #36

Open

Activity

  1. jbphyswx commented on Sep 6, 2026

    @jbphyswx
    OwnerAuthor

    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:

    Fields(vectors = (u, 𝓐u))   → VectorDotSFType(1, 2)   # ⟨δu · δ𝓐ᵤ⟩
    Fields(scalars = (ω, 𝓐ω))   → ScalarDotSFType(1, 2)   # ⟨δω δ𝓐_ω⟩

    𝓐 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) implements

    Π^φ_K = −(K/2) ∫₀^∞ S̃F_{Aφ}(r) J₁(Kr) dr
    

    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:

    1. 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.
    2. 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) is S2SF, so that case is refused by name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions