Process reference: particle

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

Overview

Numerics are machine-independent and use SI units. No ODS, solver installation, plotting backend, collisions or transport model is required. Native integration times are preserved; interpolation is only an explicitly recorded comparison or presentation operation. Fields and records live in vaft.data.particle.

Functions

analyze_particle_orbitEvaluate field, energy, invariants, ordering and defined bounce cycles. Convention
compare_particle_orbitsPair full and GC trajectories on common physical times without extrapolation.
particle_motion_caseCompute a reproducible matched full-orbit/GC reference experiment.
particle_to_guiding_centerConvert simultaneous particle initial data to a leading-order GC state. Convention
trace_guiding_centerIntegrate the static Hamiltonian GC equations with adaptive DOP853. Convention
trace_particle_orbitIntegrate a full Lorentz trajectory using the shared centered Boris step.

analyze_particle_orbit

Machine-independentConvention-sensitive source
analyze_particle_orbit(trajectory, *, bounce_coordinate=None)

Evaluate field, energy, invariants, ordering and defined bounce cycles.

NameTypeUnitDescription
trajectoryParticleTrajectory-

Native computed particle or GC states.

bounce_coordinatecallable, optionalm

Signed field-line arc coordinate s(position) for a known periodic bounce. None leaves action undefined; it is never inferred from an arbitrary 3-D history.

Returns
—dict-

Native-time arrays, dimensional scales, residuals and bounce evidence.

Convention

Full-orbit total energy uses laboratory kinetic energy plus q Phi. GC energy uses p_parallel^2/(2m) + mu B + q Phi. Canonical toroidal momentum uses x p_y - y p_x + q (x A_y - y A_x), in the field’s declared gauge.

Processing steps · Applicability · Limitations · Provenance

Processing steps

Sample fields; resolve parallel and perpendicular energy in the local drift frame; evaluate model-appropriate invariants and dimensionless ordering. Detect turns, then evaluate action only on a supplied periodic arc coordinate whose sampled cycle closes within resolution.

Applicability

Machine-independent. Static fields with adequate numerical resolution.

Limitations

Full-orbit mu is an instantaneous estimate; its gyrovariation is physical. Derivative diagnostics are NaN with an unavailable audit when their stencil crosses the domain boundary; local state diagnostics remain available. Fixed GC mu is not an adiabaticity test. Finite orbit momentum changes under nonaxisymmetry alone do not demonstrate transport or NTV torque.

Provenance

  1. J. R. Cary and A. J. Brizard, Rev. Mod. Phys. 81 (2009) 693.

compare_particle_orbits

Machine-independent source
compare_particle_orbits(full, guiding_center, *, time=None)

Pair full and GC trajectories on common physical times without extrapolation.

NameTypeUnitDescription
fullParticleTrajectory-

Full Lorentz orbit.

guiding_centerParticleTrajectory-

Independently integrated GC orbit of the same particle and field.

timearray_like, optionals

Strictly increasing comparison times; defaults to full samples in the common valid interval.

Returns
—ParticleComparison-

Local-center separation, time pairing and approximation evidence.

Processing steps · Applicability · Limitations · Provenance

Processing steps

Check particle, field and time compatibility; estimate the local full-orbit center in the drift frame; linearly interpolate both positions on a shared physical coordinate. Record initialization and ordering separately.

Applicability

Machine-independent. Matched initial conditions in a controlled GC regime.

Limitations

Local center subtraction is not higher-order gyroaveraging. Separation includes initialization, phase and GC approximation error; numerical and ordering scans are needed to attribute it. A one-gyroperiod time-window average is supplied separately, with incomplete edge windows omitted.

Provenance

  1. F. F. Chen, Introduction to Plasma Physics and Controlled Fusion, 3rd ed. (2016), Sec. 2.2.

particle_motion_case

Machine-independent source
particle_motion_case(kind='gyration', *, charge=1.0, mass=1.0, speed=None, pitch_angle=None, aspect_ratio=3.0, perturbation=0.02, duration=None, dt=0.05)

Compute a reproducible matched full-orbit/GC reference experiment.

NameTypeUnitDescription
kindstr, optional-

gyration, exb_drift, grad_b_drift, curvature_drift, toroidal_drift, magnetic_mirror, mirror_passing, tokamak_trapped, tokamak_passing or symmetry_breaking; gyration is the simplest reference default.

chargefloat, optionalC

Signed nonzero charge; 1 C is an illustrative SI reference particle.

massfloat, optionalkg

Positive mass; 1 kg is an illustrative SI reference particle.

speedfloat, optionalm/s

Drift-frame launch speed; None chooses a documented case default.

pitch_anglefloat, optionalrad

Launch angle from B in [0,pi]; None chooses trapped/passing defaults.

aspect_ratiofloat, optional-

Major/minor radius ratio of the toroidal reference; default three.

perturbationfloat, optional-

Signed 3-D harmonic amplitude for symmetry_breaking; default 0.02.

durationfloat, optionals

Physical integration duration; None uses the case reference interval.

dtfloat, optionals

Full-orbit step, GC maximum step is four times this numerical default.

Returns
—ParticleComparison-

Matched integrated trajectories with reference case and validity metadata.

Processing steps · Defaults · Applicability · Limitations · Provenance

Processing steps

Build a solenoidal static reference field, initialize a physical particle, apply the documented leading-order GC conversion, and integrate both models to the same physical end time. Pair only their common valid interval.

Defaults

Charge and mass define an illustrative SI particle, not an electron/ion mass ratio. Geometry, speed, pitch and duration are educational benchmark choices; all resolved values are recorded. dt is numerical convenience and must be reduced when charge/mass increases.

Applicability

Machine-independent. Controlled reference experiments, not discharge predictions.

Limitations

Tokamak references use an analytic circular field, not force-balanced VEST equilibrium. Symmetry-breaking output alone establishes no transport rate. Time-varying fields and the second invariant under slow variation are deferred.

Provenance

  1. Particle-motion work packages #2004 through #2009.

particle_to_guiding_center

Machine-independentConvention-sensitive source
particle_to_guiding_center(q, m, x, v, field)
Show source vaft/process/particle.py, lines 327–387
def particle_to_guiding_center(q, m, x, v, field):
    """Convert simultaneous particle initial data to a leading-order GC state.

    Parameters
    ----------
    q : float
        Signed nonzero charge [C].
    m : float
        Positive mass [kg].
    x : array_like
        Particle Cartesian position [m].
    v : array_like
        Particle simultaneous Cartesian velocity [m/s].
    field : ParticleField
        Static Cartesian field [-].

    Returns
    -------
    dict
        GC position, p_parallel, mu and declared transformation order [-].

    Convention
    ----------
    Subtract local E-cross-B velocity before estimating gyromotion. The
    magnetic moment and parallel momentum are leading-order drift-frame
    estimates, not a first-order Lie-transform particle/GC transformation.

    Applicability
    -------------
    Machine-independent. Magnetized weak-flow initial states.

    Limitations
    -----------
    Initial transformation error remains part of a full-orbit/GC comparison.

    Provenance
    ----------
    .. [1] F. F. Chen, Introduction to Plasma Physics and Controlled Fusion,
       3rd ed. (2016), Sec. 2.2.
    """
    x = _initial(q, m, x, 1.0, 1.0, 0.0)
    v = np.asarray(v, float)
    if v.shape != (3,) or not np.all(np.isfinite(v)):
        raise ValueError("v must be a finite 3-vector")
    B = field.magnetic(x)
    magnitude = np.linalg.norm(B)
    b = B / magnitude
    drift = np.cross(field.electric(x), B) / magnitude**2
    relative = v - drift
    parallel = relative @ b
    X = x - gyration_offset(q, m, B, relative)
    field.check_position(X)
    return {
        "position": X,
        "p_parallel": float(m * parallel),
        "mu": float(
            magnetic_moment(m, np.linalg.norm(relative - parallel * b), magnitude)
        ),
        "transformation": "leading-order local drift-frame gyration offset",
        "approximation_order": "zeroth-order GC initialization; no Lie-transform correction",
    }

Convert simultaneous particle initial data to a leading-order GC state.

NameTypeUnitDescription
qfloatC

Signed nonzero charge.

mfloatkg

Positive mass.

xarray_likem

Particle Cartesian position.

varray_likem/s

Particle simultaneous Cartesian velocity.

fieldParticleField-

Static Cartesian field.

Returns
—dict-

GC position, p_parallel, mu and declared transformation order.

Convention

Subtract local E-cross-B velocity before estimating gyromotion. The magnetic moment and parallel momentum are leading-order drift-frame estimates, not a first-order Lie-transform particle/GC transformation.

Applicability · Limitations · Provenance

Applicability

Machine-independent. Magnetized weak-flow initial states.

Limitations

Initial transformation error remains part of a full-orbit/GC comparison.

Provenance

  1. F. F. Chen, Introduction to Plasma Physics and Controlled Fusion, 3rd ed. (2016), Sec. 2.2.

trace_guiding_center

Machine-independentConvention-sensitive source
trace_guiding_center(q, m, X0, p_parallel0, mu, field, *, duration, dt, t0=0.0, rtol=1e-09, atol=1e-11)

Integrate the static Hamiltonian GC equations with adaptive DOP853.

NameTypeUnitDescription
qfloatC

Signed nonzero charge.

mfloatkg

Positive mass.

X0array_likem

Initial guiding-center Cartesian position.

p_parallel0floatkg m/s

Initial signed parallel kinetic momentum.

mufloatJ/T

Nonnegative magnetic moment, held constant by the model.

fieldParticleField-

Static field with Jacobian or explicit numerical derivative step.

durationfloats

Positive physical duration.

dtfloats

Maximum accepted integration step.

t0float, optionals

Initial timestamp, a coordinate origin.

rtolfloat, optional-

Relative numerical tolerance, a numerical convenience.

atolfloat, optional-

Absolute tolerance on dimensionless scaled state, a numerical convenience.

Returns
—ParticleTrajectory-

Native accepted steps with momentum, model-constant mu and termination.

Convention

Static SI Cartesian fields; this is a weak-flow, nonrelativistic GC model. Numerical energy conservation is tested, not enforced by projection.

Processing steps · Applicability · Limitations · Provenance

Processing steps

Scale position by a local gyroradius and momentum by characteristic kinetic momentum, integrate the Hamiltonian B-star equations, and preserve accepted states. A field boundary or B-star singularity terminates the trace.

Applicability

Machine-independent. Smooth magnetized static fields, small gyroradius ordering and weak electrostatic drift.

Limitations

DOP853 is not symplectic. No long-time invariant guarantee is claimed. mu conservation is imposed; assess adiabaticity against full Lorentz runs.

Provenance

  1. J. R. Cary and A. J. Brizard, Rev. Mod. Phys. 81 (2009) 693.

trace_particle_orbit

Machine-independent source
trace_particle_orbit(q, m, x0, v0, field, *, duration, dt, t0=0.0)

Integrate a full Lorentz trajectory using the shared centered Boris step.

NameTypeUnitDescription
qfloatC

Signed nonzero particle charge.

mfloatkg

Positive mass.

x0array_likem

Initial Cartesian position.

v0array_likem/s

Initial simultaneous Cartesian velocity.

fieldParticleField-

Static magnetic and electrostatic field in Cartesian SI units.

durationfloats

Positive physical duration.

dtfloats

Positive integration step; the last step is shortened to duration.

t0float, optionals

Initial physical timestamp; zero is a coordinate origin.

Returns
—ParticleTrajectory-

Native simultaneous states and explicit termination reason.

Processing steps · Applicability · Limitations · Provenance

Processing steps

Validate initial data, then use drift-kick-drift Boris updates. Check field domains at every sampled position. Preserve only valid completed steps.

Applicability

Machine-independent. Nonrelativistic collisionless motion in static fields.

Limitations

Fixed-step integration must resolve the largest gyrofrequency encountered. A boundary event retains the last valid step, not an inferred wall impact. Steps smaller than the timestamp spacing are rejected; shift t0 toward zero when resolving very short motion at a large absolute time origin.

Provenance

  1. J. P. Boris, Proc. 4th Conf. Numer. Sim. Plasmas, NRL (1970), 3.

results matching ""

    No results matching ""