Process reference: local_mhd_criteria

Generated from the docstrings of vaft.process.local_mhd_criteria: 7 public functions. Each entry is what vaft.process.describe("local_mhd_criteria.<name>") prints. All process categories

Overview

Mercier’s ideal-interchange index D_I and the Glasser-Greene-Johnson resistive-interchange index D_R with its geodesic coefficient H, from flux-surface averages of the equilibrium itself – no stability code. They are the quantities DCON and RDCON report as di, dr and h, and the formulas are DCON’s (dcon/mercier.f, mercier_scan) rewritten free of its coordinate normalisation, so the two can be compared surface by surface.

psi(R, Z), F, p, q ─ trace each level ─▶ <1/|grad chi|^2>, <B^2/|grad chi|^2>,
                                         <1/B^2>, <1/(B^2 |grad chi|^2)>, <B^2>, V'
                   ─ GGJ / Mercier ─────▶ D_I, H, D_R = D_I + (H - 1/2)^2
SymbolMeaningUnit
chitotal poloidal flux, 2 pi psi with psi per radian, oriented to
'd/d chi1/Wb
Vvolume enclosed by a surface; V' = closed_integral(R dl / |grad psi|) [m^3/Wb]
F|R B_phi|T m
pmu0 times the pressureT^2
<X>volume-weighted flux-surface average, closed_integral(X R dl / |grad psi|) / V'
D_IMercier index; > 0 is ideal-interchange unstable-
D_RGGJ resistive-interchange index; > 0 is resistive-interchange unstable [-]
HGGJ geodesic coefficient-

DCON’s sign convention. D_I < 0 is Mercier stable, the opposite sign to vaft.formula.stability.mercier_criterion_circular and the same as vaft.formula.stability.ggj_ideal_interchange_index. With T = 2 pi F p' V' <1/|grad chi|^2> / q'::

D_I = -1/4 + T (1 - T) + p' (V'/q')^2 <B^2/|grad chi|^2>
      * [ p' (<1/B^2> + (2 pi F)^2 <1/(B^2 |grad chi|^2)>) - V''/V' ]
H   = 2 pi F p' V' / q' * ( <1/|grad chi|^2> - <B^2/|grad chi|^2> / <B^2> )
D_R = D_I + (H - 1/2)^2

Orientation. The indices are invariant under the COCOS sign choices, so they are evaluated in DCON’s orientation: chi increases outward, F and q are taken by magnitude, and p' is then negative for a pressure that falls outward.

E and F are not separated. Only E + F enters both indices (D_I = E + F + H - 1/4, D_R = E + F + H^2), so it is reported as one number, E_plus_F.

Functions

curvature_mapkappa_n, kappa_g and local shear on the (R, Z) grid inside the plasma. Convention
flux_surface_curvatureNormal and geodesic field-line curvature and local shear along flux surfaces. Convention
interchange_comparisonEquilibrium-native D_I, D_R against a stability code’s di, dr. Convention
mercier_ggj_from_odsMercier / GGJ indices of one ODS equilibrium slice. Convention
mercier_ggj_profileMercier D_I, GGJ H and D_R on flux surfaces of a flux map. Convention
s_alpha_from_odsPer-surface s-alpha coordinates of one ODS equilibrium slice. Convention
s_alpha_profilePer-surface s and alpha of local ballooning theory and the s-alpha first-stability boundary. Convention

curvature_map

Machine-independentConvention-sensitive source
curvature_map(psi_grid, R, Z, psi_axis, psi_boundary, *, profile_psi_n, f, pressure, axis_rz, psi_n_max=0.98, psi_n_min=0.02)

kappa_n, kappa_g and local shear on the (R, Z) grid inside the plasma.

NameTypeUnitDescription
psi_gridarray_likeWb/rad

Poloidal flux, indexed (R, Z), per radian.

Rarray_likem

Major-radius grid axis.

Zarray_likem

Height grid axis.

psi_axisfloatWb/rad

Flux on the axis.

psi_boundaryfloatWb/rad

Flux on the boundary.

profile_psi_nsequence of float-

Normalized flux grid of f and pressure.

fsequence of floatT m

F = R B_phi, either sign.

pressuresequence of floatPa

Plasma pressure.

axis_rztuple of floatm

Magnetic-axis position; selects the confined region.

psi_n_maxfloat, optional-

Outermost normalized flux kept; a display choice, short of the boundary where psi_n stops labelling closed surfaces.

psi_n_minfloat, optional-

Innermost kept; a display choice, outside the axis where n is ill-defined.

Returns
mapsdict-

R, Z (2-D, indexed (R, Z)) [m], psi_n [-], kappa_n, kappa_g [1/m], local_shear [1/m^3] and B [T]; NaN outside the confined band [psi_n_min, psi_n_max].

Convention

As flux_surface_curvature.

Raises

  • ValueError psi_grid is not indexed (R, Z), the band is not inside (0, 1), or no closed psi_n_max contour encloses the axis.
Processing steps · Applicability · Provenance

Processing steps

  1. Orient and spline as flux_surface_curvature.
  2. Evaluate the same pointwise quantities at every grid node.
  3. Keep nodes in the normalized-flux band and inside the closed psi_n_max contour that encloses the axis, so vacuum or private-flux regions whose flux happens to fall in the band are excluded.

Applicability

Machine-independent.

Provenance

  1. Issue #1902, R-Z maps of curvature and local shear.

flux_surface_curvature

Machine-independentConvention-sensitive source
flux_surface_curvature(psi_grid, R, Z, psi_axis, psi_boundary, levels_norm, *, profile_psi_n, f, pressure, q, axis_rz, min_points=40, oversample=2)

Normal and geodesic field-line curvature and local shear along flux surfaces.

NameTypeUnitDescription
psi_gridarray_likeWb/rad

Poloidal flux on the grid, indexed (R, Z), per radian.

Rarray_likem

Major-radius grid axis.

Zarray_likem

Height grid axis.

psi_axisfloatWb/rad

Flux on the magnetic axis.

psi_boundaryfloatWb/rad

Flux on the boundary.

levels_normsequence of float-

Normalized flux of the surfaces to trace, inside (0, 1); sorted and de-duplicated here.

profile_psi_nsequence of float-

Normalized flux grid of f, pressure and q, increasing.

fsequence of floatT m

F = R B_phi, either sign.

pressuresequence of floatPa

Plasma pressure.

qsequence of float-

Safety factor, either sign; only for the shear-identity check.

axis_rztuple of floatm

Magnetic-axis position.

min_pointsint, optional-

Fewest contour vertices for a resolved surface; a numerical-resolution control.

oversampleint, optional-

Contours traced on the flux map refined this many times by its quintic spline; a numerical-resolution control.

Returns
curvatureSurfaceCurvature-

Per surface the contour, kappa_n, kappa_g [1/m], local_shear [1/m^3], B [T], and the identity residuals in checks.

Convention

n points outward (psi increasing outward), so kappa_n < 0 – the curvature vector pointing inward, as on the outboard side – is the unfavourable sign for a pressure falling outward. kappa_g is along b x n and local_shear is h . curl h in the canonical orientation (B_phi > 0, psi increasing outward); in it closed(local_shear R dl/|grad psi|) = 2 pi d|q|/dpsi, the local shear whose surface average is the global shear.

Raises

  • ValueError Shapes disagree or a level is outside (0, 1).
Processing steps · Applicability · Limitations · Provenance

Processing steps

  1. Orient: psi increasing outward, F by magnitude.
  2. Trace each level (axis-enclosing closed contour) on the refined map.
  3. At the segment midpoints: b, n = grad psi/|grad psi|, kappa = b . grad b (cylindrical, axisymmetric), kappa_n = kappa . n, kappa_g = kappa . (b x n), local_shear = h . curl h with h = B x grad psi / |grad psi|^2; derivatives by central differences of the spline-evaluated fields.
  4. Checks: max |kappa . b|; kappa_n and kappa_g against force balance, (n . grad(B^2/2) + mu0 p' |grad psi|) / B^2 and (b x n) . grad(B^2/2) / B^2; and closed(local_shear R dl/|grad psi|) against 2 pi dq/dpsi from the map.

Applicability

Machine-independent.

Limitations

Only the kappa_n check tests the equilibrium (it assumes ideal static force balance); kappa . b, the kappa_g check and the shear identity hold for any flux map with F = F(psi) and test the numerics. Near the axis the flux gradient vanishes and n is ill-defined; trace from psi_N of about 0.05 on a VEST-sized map.

Provenance

  1. J. M. Greene and J. L. Johnson, Plasma Phys. 10, 729 (1968): local shear h . curl h with h = B x grad psi/|grad psi|^2.
  2. Issue #1902, normal/geodesic curvature and local shear maps.

interchange_comparison

Machine-independentConvention-sensitive source
interchange_comparison(profile, psi_n, di, dr, *, label)
Show source vaft/process/local_mhd_criteria.py, lines 429–491
def interchange_comparison(profile: InterchangeProfile, psi_n: Sequence[float], di: Sequence[float],
                           dr: Sequence[float], *, label: str) -> dict[str, np.ndarray]:
    """Equilibrium-native ``D_I``, ``D_R`` against a stability code's ``di``, ``dr``.

    Parameters
    ----------
    profile : InterchangeProfile
        From :func:`mercier_ggj_profile` [-].
    psi_n : sequence of float
        The code's normalized flux grid [-].
    di : sequence of float
        The code's Mercier index on that grid, DCON's sign [-].
    dr : sequence of float
        The code's resistive-interchange index [-].
    label : str
        Which code and run the comparison is against, kept on the result [-].

    Returns
    -------
    comparison : dict
        On the profile's levels: ``psi_n``, ``D_I``, ``di``, ``D_R``, ``dr``,
        the absolute differences ``dD_I``, ``dD_R``, the code's implied
        ``H`` (``0.5 - sqrt(dr - di)``, the root nearer the equilibrium's), and
        ``label`` [-].

    Raises
    ------
    ValueError
        The code's grid is not increasing or the arrays disagree in length.

    Processing steps
    ----------------
    1. Interpolate the code's ``di``, ``dr`` linearly onto the profile's levels
       inside its own range; NaN outside it.
    2. Differences and the code's implied ``H``, choosing the root of
       ``(H - 1/2)^2 = dr - di`` nearer the equilibrium's ``H``.

    Convention
    ----------
    Both in DCON's sign convention; no QA cut, no verdict.

    Applicability
    -------------
    Machine-independent.

    Provenance
    ----------
    .. [1902] Issue #1902, comparison with DCON/RDCON on a reference slice.
    """
    x = np.asarray(psi_n, dtype=float)
    di, dr = np.asarray(di, dtype=float), np.asarray(dr, dtype=float)
    if di.shape != x.shape or dr.shape != x.shape or np.any(np.diff(x) <= 0):
        raise ValueError("psi_n must be increasing and di, dr on it")
    lv = profile.psi_n
    inside = (lv >= x[0]) & (lv <= x[-1])
    # anti-alias: spatial interpolation over normalized flux, not time -- no sample rate to reduce
    di_i = np.where(inside, np.interp(lv, x, di), np.nan)
    dr_i = np.where(inside, np.interp(lv, x, dr), np.nan)
    root = np.sqrt(np.clip(dr_i - di_i, 0.0, None))
    h_code = np.where(np.abs(0.5 - root - profile.H) <= np.abs(0.5 + root - profile.H), 0.5 - root, 0.5 + root)
    return {"psi_n": lv, "D_I": profile.D_I, "di": di_i, "D_R": profile.D_R, "dr": dr_i,
            "dD_I": profile.D_I - di_i, "dD_R": profile.D_R - dr_i, "H": profile.H, "H_code": h_code,
            "label": label}

Equilibrium-native D_I, D_R against a stability code’s di, dr.

NameTypeUnitDescription
profileInterchangeProfile-

From mercier_ggj_profile.

psi_nsequence of float-

The code’s normalized flux grid.

disequence of float-

The code’s Mercier index on that grid, DCON’s sign.

drsequence of float-

The code’s resistive-interchange index.

labelstr-

Which code and run the comparison is against, kept on the result.

Returns
comparisondict-

On the profile’s levels: psi_n, D_I, di, D_R, dr, the absolute differences dD_I, dD_R, the code’s implied H (0.5 - sqrt(dr - di), the root nearer the equilibrium’s), and label.

Convention

Both in DCON’s sign convention; no QA cut, no verdict.

Raises

  • ValueError The code’s grid is not increasing or the arrays disagree in length.
Processing steps · Applicability · Provenance

Processing steps

  1. Interpolate the code’s di, dr linearly onto the profile’s levels inside its own range; NaN outside it.
  2. Differences and the code’s implied H, choosing the root of (H - 1/2)^2 = dr - di nearer the equilibrium’s H.

Applicability

Machine-independent.

Provenance

  1. Issue #1902, comparison with DCON/RDCON on a reference slice.

mercier_ggj_from_ods

Machine-independentConvention-sensitive source
mercier_ggj_from_ods(ods, time_slice=0, *, levels_norm=None, min_points=40, oversample=2)
Show source vaft/process/local_mhd_criteria.py, lines 355–419
def mercier_ggj_from_ods(ods: Any, time_slice: int = 0, *, levels_norm: Sequence[float] | None = None,
                         min_points: int = 40, oversample: int = 2) -> InterchangeProfile:
    """Mercier / GGJ indices of one ODS equilibrium slice.

    Parameters
    ----------
    ods : ODS
        Holding ``equilibrium.time_slice[time_slice]`` with ``profiles_2d[0]``
        ``psi`` on a rectangular grid, ``profiles_1d`` ``psi``, ``f``,
        ``pressure``, ``q``, and the axis and boundary flux and axis position [-].
    time_slice : int, optional
        The slice to read [-].
    levels_norm : sequence of float, optional
        Surfaces to evaluate; by default 0.05 to 0.98 in steps of 0.01, the
        range the reference comparison covers [-].
    min_points : int, optional
        Passed to :func:`mercier_ggj_profile`; a numerical-resolution control [-].
    oversample : int, optional
        Passed to :func:`mercier_ggj_profile`; a numerical-resolution control [-].

    Returns
    -------
    profile : InterchangeProfile
        As :func:`mercier_ggj_profile`, with the slice index and time in its
        provenance [-].

    Raises
    ------
    KeyError
        A required path is missing.

    Processing steps
    ----------------
    1. Read the slice's flux map, profiles and axis, refusing a missing path.
    2. Convert the flux to per radian and the profile grid to normalized flux.
    3. Evaluate with :func:`mercier_ggj_profile` and record the slice and time.

    Input semantics
    ---------------
    The ODS flux is converted to per radian with
    :func:`vaft.data.eqdsk.ods_psi_to_wb_per_radian_factor`, which reads the
    record's own convention.

    Output semantics
    ----------------
    Raw equilibrium-derived indices with no QA cut; comparing with a
    stability code is :func:`interchange_comparison`'s job.

    Convention
    ----------
    As :func:`mercier_ggj_profile`: DCON's sign and orientation.

    Applicability
    -------------
    Machine-independent.

    Provenance
    ----------
    .. [1902] Issue #1902, evaluation from one reconstructed equilibrium ODS.
    """
    inputs = _ods_slice_inputs(ods, time_slice)
    levels = np.arange(0.05, 0.985, 0.01) if levels_norm is None else np.asarray(levels_norm, dtype=float)
    profile = mercier_ggj_profile(levels_norm=levels, min_points=min_points, oversample=oversample, **inputs)
    return InterchangeProfile(**{**profile.__dict__, "provenance": {**profile.provenance, "time_slice": int(time_slice),
                                                                     "time": _slice_time(ods, time_slice)}})

Mercier / GGJ indices of one ODS equilibrium slice.

NameTypeUnitDescription
odsODS-

Holding equilibrium.time_slice[time_slice] with profiles_2d[0] psi on a rectangular grid, profiles_1d psi, f, pressure, q, and the axis and boundary flux and axis position.

time_sliceint, optional-

The slice to read.

levels_normsequence of float, optional-

Surfaces to evaluate; by default 0.05 to 0.98 in steps of 0.01, the range the reference comparison covers.

min_pointsint, optional-

Passed to mercier_ggj_profile; a numerical-resolution control.

oversampleint, optional-

Passed to mercier_ggj_profile; a numerical-resolution control.

Returns
profileInterchangeProfile-

As mercier_ggj_profile, with the slice index and time in its provenance.

Convention

As mercier_ggj_profile: DCON’s sign and orientation.

Raises

  • KeyError A required path is missing.
Processing steps · Input semantics · Output semantics · Applicability · Provenance

Processing steps

  1. Read the slice’s flux map, profiles and axis, refusing a missing path.
  2. Convert the flux to per radian and the profile grid to normalized flux.
  3. Evaluate with mercier_ggj_profile and record the slice and time.

Input semantics

The ODS flux is converted to per radian with vaft.data.eqdsk.ods_psi_to_wb_per_radian_factor, which reads the record’s own convention.

Output semantics

Raw equilibrium-derived indices with no QA cut; comparing with a stability code is interchange_comparison’s job.

Applicability

Machine-independent.

Provenance

  1. Issue #1902, evaluation from one reconstructed equilibrium ODS.

mercier_ggj_profile

Machine-independentConvention-sensitive source
mercier_ggj_profile(psi_grid, R, Z, psi_axis, psi_boundary, levels_norm, *, profile_psi_n, f, pressure, q, axis_rz, min_points=40, oversample=2, q_from_map=True)

Mercier D_I, GGJ H and D_R on flux surfaces of a flux map.

NameTypeUnitDescription
psi_gridarray_likeWb/rad

Poloidal flux on the grid, indexed (R, Z), per radian.

Rarray_likem

Major-radius grid axis.

Zarray_likem

Height grid axis.

psi_axisfloatWb/rad

Flux on the magnetic axis.

psi_boundaryfloatWb/rad

Flux on the boundary.

levels_normsequence of float-

Normalized flux of the surfaces to evaluate, strictly inside (0, 1) and increasing; at least five.

profile_psi_nsequence of float-

Normalized flux grid of f, pressure and q, increasing.

fsequence of floatT m

F = R B_phi on profile_psi_n, either sign.

pressuresequence of floatPa

Plasma pressure on profile_psi_n.

qsequence of float-

Safety factor on profile_psi_n, either sign; used for q' only when q_from_map is false, and otherwise compared with the map’s q as a consistency check.

axis_rztuple of floatm

Magnetic-axis position, which picks the confined contour.

min_pointsint, optional-

Fewest contour vertices for a surface to count as resolved; a numerical-resolution control.

oversampleint, optional-

Contours are traced on the flux map refined this many times by its own quintic spline; a numerical-resolution control.

q_from_mapbool, optional-

Take q and q' from the flux map on each surface, as DCON does, instead of differentiating the given profile. A choice of method: the given profile’s derivative near a flat-q core is noise-dominated (Limitations).

Returns
profileInterchangeProfile-

The indices, E + F, dV/dchi and the five averages per level; an unresolved level is NaN.

Convention

DCON’s: D_I < 0 and D_R < 0 are stable; chi increases outward and F, q enter by magnitude, which leaves the indices unchanged under COCOS sign choices. pressure is in pascal and multiplied by mu0 here.

Raises

  • ValueError Shapes disagree, the levels are not inside (0, 1) and increasing, fewer than five are given, psi_axis equals psi_boundary, or oversample is not positive.
Processing steps · Applicability · Limitations · Provenance

Processing steps

  1. Trace each level and keep the closed contour enclosing the axis.
  2. On it, |grad psi| from a quintic spline of the flux map and B^2 = (|grad psi|^2 + F^2) / R^2; volume-weighted averages.
  3. p' from a cubic spline of the pressure; V'' and (by default) q' on each surface itself, via d/dpsi closed(g dl/|grad psi|) = closed(div(g grad psi / |grad psi|^2) dl/|grad psi|) with g = R and 1/R and second derivatives of the spline, so no difference is taken across levels; all per unit chi.
  4. D_I, H, D_R as in the module notation.

Applicability

Machine-independent.

Limitations

Measured against DCON (mpsi 512, mtheta 1024) with the defaults, D_I on a 0.01 grid of levels: the packaged VEST 39915@319 g-file (129 x 129) within 3.3 % for psi_N 0.05-0.1, 0.5 % for 0.1-0.3 and 0.1 % beyond; the upstream DIII-D-like example (257 x 257) within 0.2 % to psi_N 0.9 and 3.4 % in its steep pedestal (0.95-0.96). With q_from_map=False the VEST core error rises to 19 % (0.05-0.1) and 5 % (0.1-0.3). Near the axis the flux gradient vanishes and every average loses accuracy. DCON clamps p >= 0; this uses the pressure as given. Ideal, static, isotropic pressure; no flow.

Provenance

  1. GPEC dcon/mercier.f mercier_scan.
  2. Glasser, Greene and Johnson, Phys. Fluids 18, 875 (1975).

s_alpha_from_ods

Machine-independentConvention-sensitive source
s_alpha_from_ods(ods, time_slice=0, *, levels_norm=None, R0=None)
Show source vaft/process/local_mhd_criteria.py, lines 1006–1061
def s_alpha_from_ods(ods: Any, time_slice: int = 0, *, levels_norm: Sequence[float] | None = None,
                     R0: float | None = None) -> SAlphaProfile:
    """Per-surface s-alpha coordinates of one ODS equilibrium slice.

    Parameters
    ----------
    ods : ODS
        As :func:`mercier_ggj_from_ods` [-].
    time_slice : int, optional
        The slice to read [-].
    levels_norm : sequence of float, optional
        Surfaces; by default 0.05 to 0.98 in steps of 0.01 [-].
    R0 : float, optional
        Reference major radius; the magnetic axis by default (a convention) [m].

    Returns
    -------
    profile : SAlphaProfile
        As :func:`s_alpha_profile`, with the slice and time in provenance [-].

    Raises
    ------
    KeyError
        A required path is missing.

    Processing steps
    ----------------
    1. Read the slice (per-radian flux) as :func:`mercier_ggj_from_ods`.
    2. Evaluate with :func:`s_alpha_profile` and record the slice and time.

    Input semantics
    ---------------
    One reconstructed equilibrium slice; nothing else of the ODS is read.

    Output semantics
    ----------------
    Raw ``s``, ``alpha`` and the model's boundaries; no verdict beyond the
    model's own criterion.

    Convention
    ----------
    As :func:`s_alpha_profile`.

    Applicability
    -------------
    Machine-independent.

    Provenance
    ----------
    .. [1902] Issue #1902, ODS-facing per-surface s-alpha evaluation.
    """
    inputs = _ods_slice_inputs(ods, time_slice)
    levels = np.arange(0.05, 0.985, 0.01) if levels_norm is None else np.asarray(levels_norm, dtype=float)
    profile = s_alpha_profile(levels_norm=levels, R0=R0, **inputs)
    return SAlphaProfile(**{**profile.__dict__, "provenance": {**profile.provenance, "time_slice": int(time_slice),
                                                               "time": _slice_time(ods, time_slice)}})

Per-surface s-alpha coordinates of one ODS equilibrium slice.

NameTypeUnitDescription
odsODS-

As mercier_ggj_from_ods.

time_sliceint, optional-

The slice to read.

levels_normsequence of float, optional-

Surfaces; by default 0.05 to 0.98 in steps of 0.01.

R0float, optionalm

Reference major radius; the magnetic axis by default (a convention).

Returns
profileSAlphaProfile-

As s_alpha_profile, with the slice and time in provenance.

Convention

As s_alpha_profile.

Raises

  • KeyError A required path is missing.
Processing steps · Input semantics · Output semantics · Applicability · Provenance

Processing steps

  1. Read the slice (per-radian flux) as mercier_ggj_from_ods.
  2. Evaluate with s_alpha_profile and record the slice and time.

Input semantics

One reconstructed equilibrium slice; nothing else of the ODS is read.

Output semantics

Raw s, alpha and the model’s boundaries; no verdict beyond the model’s own criterion.

Applicability

Machine-independent.

Provenance

  1. Issue #1902, ODS-facing per-surface s-alpha evaluation.

s_alpha_profile

Machine-independentConvention-sensitive source
s_alpha_profile(psi_grid, R, Z, psi_axis, psi_boundary, levels_norm, *, profile_psi_n, f, pressure, q, axis_rz, R0=None, min_points=40, oversample=2)

Per-surface s and alpha of local ballooning theory and the s-alpha first-stability boundary.

NameTypeUnitDescription
psi_gridarray_likeWb/rad

Poloidal flux, indexed (R, Z), per radian.

Rarray_likem

Major-radius grid axis.

Zarray_likem

Height grid axis.

psi_axisfloatWb/rad

Flux on the axis.

psi_boundaryfloatWb/rad

Flux on the boundary.

levels_normsequence of float-

Surfaces, at least five, increasing inside (0, 1).

profile_psi_nsequence of float-

Normalized flux grid of the profiles.

fsequence of floatT m

F = R B_phi, either sign.

pressuresequence of floatPa

Plasma pressure.

qsequence of float-

Safety factor, either sign; compared with the map’s.

axis_rztuple of floatm

Magnetic-axis position.

R0float, optionalm

Reference major radius naming the volume radius; by default the magnetic axis, as GPEC.jl’s local ballooning uses (a convention).

min_pointsint, optional-

Contour resolution control, as mercier_ggj_profile.

oversampleint, optional-

Flux-map refinement for tracing, as mercier_ggj_profile.

Returns
profileSAlphaProfile-

s, alpha, the model’s alpha_first/alpha_second and the enclosed volume per surface.

Convention

alpha > 0 where the pressure falls outward. s_alpha_unstable applies only the circular s-alpha model’s criterion: for a shaped, low-aspect-ratio plasma it is an indicator of proximity to the ballooning boundary, not a stability verdict (a ballooning code is that).

Raises

  • ValueError As mercier_ggj_profile, or R0 is not positive.
Processing steps · Applicability · Limitations · Provenance

Processing steps

  1. V', |q| and d|q|/dchi on each surface from the map (mercier_ggj_profile); the enclosed volume from the traced contour by Pappus’ theorem.
  2. s = shear_from_volume and alpha = ballooning_alpha_from_volume (#1720 normalisation) with per-radian flux oriented outward.
  3. The first and second stability boundaries at each s from vaft.formula.stability.s_alpha_marginal_alpha.

Applicability

Machine-independent.

Limitations

The s-alpha model is circular and large-aspect-ratio; on VEST’s aspect ratio alpha_first can be off by a large factor from the true boundary. Inherits the near-axis accuracy of mercier_ggj_profile.

Provenance

  1. J. W. Connor, R. J. Hastie and J. B. Taylor, Phys. Rev. Lett. 40, 396 (1978).
  2. Issue #1720, the volume-radius normalisation of s and alpha.
  3. Issue #1902, per-surface s-alpha from one equilibrium.

results matching ""

    No results matching ""