NAME

Physics::CPD::Stellarator - Model and visualise the Wendelstein 7-X stellarator

SYNOPSIS

use Physics::CPD::Stellarator;

my $w7x = Physics::CPD::Stellarator->new(
    electron_density     => 8e19,    # m^-3
    electron_temperature => 4000,    # eV
    ion_temperature      => 2000,    # eV
    magnetic_field       => 2.5,     # T
    heating_power        => 10,      # MW
);

print $w7x->device_report;

printf "ISS04 tau_E = %.3f s\n", $w7x->confinement_time_iss04;
printf "stored W    = %.1f MJ\n", $w7x->stored_energy_MJ;

# visualisations (written to PNG files)
$w7x->plot_3d( output => 'w7x_3d.png' );
$w7x->plot_cross_sections( output => 'w7x_cross.png' );
$w7x->plot_profiles( output => 'w7x_profiles.png' );
$w7x->plot_confinement_scan( parameter => 'heating_power',
                             from => 1, to => 20 );

DESCRIPTION

Physics::CPD::Stellarator extends Physics::CPD with the geometry and engineering/plasma parameters needed to simulate a stellarator, using the Wendelstein 7-X (W7-X) device at IPP Greifswald as its default configuration. It inherits every plasma calculation of the base class and adds:

  • device parameters - major/minor radius, five field periods, coil counts, rotational transform iota, design beta limit, pulse length;

  • derived physics - aspect ratio, plasma volume and surface, the ISS04 international stellarator confinement-time scaling, stored thermal energy, the Sudo density limit, plasma-beta and density-limit fractions, the Lawson triple product, and the electron-cyclotron-heating resonant field;

  • three-dimensional geometry - the last-closed flux surface described as a VMEC-style Fourier series R(u,v), Z(u,v), the helical magnetic axis, nested flux surfaces and a set of tilted modular field coils; and

  • plotting - 3-D design diagrams, poloidal cross sections through a field period, radial profiles and confinement-scaling scans, rendered with PDL::Graphics::Gnuplot.

Geometry accessors (boundary_point, magnetic_axis, cross_section, surface_grid, modular_coils) are pure Perl and return array references, so they can be used and tested without PDL. Only the plot_* methods require PDL and PDL::Graphics::Gnuplot; they are loaded on demand and render to an image file (default terminal pngcairo), so they work on headless machines.

KEY ATTRIBUTES

config_name, major_radius (5.5 m), minor_radius (0.53 m), num_field_periods (5), iota (0.96), magnetic_field (2.5 T), heating_power (10 MW), num_nonplanar_coils (50), num_planar_coils (20), beta_limit (0.05), pulse_length (1800 s), gyrotron_frequency (140 GHz), and boundary_coeffs (the Fourier boundary, overridable to model any stellarator equilibrium).

PHYSICS METHODS

aspect_ratio, plasma_volume, plasma_surface_area, rotational_transform, safety_factor, confinement_time_iss04, stored_energy / stored_energy_MJ, sudo_density_limit, beta_fraction, density_fraction, triple_product, ecrh_resonance_field, density_profile, temperature_profile, device_report.

GEOMETRY METHODS

boundary_point($u,$v,$scale), surface_point_xyz, magnetic_axis($n), cross_section($v,$nu,$scale), surface_grid($nu,$nv,$scale), modular_coils($count,$npts).

PLOTTING METHODS

plot_3d, plot_cross_sections, plot_profiles, plot_confinement_scan. Each accepts an output filename (and optional terminal, size and method-specific options) and returns the filename it wrote.

SEE ALSO

Physics::CPD, PDL::Graphics::Gnuplot.

W7-X reference: Klinger et al., "Overview of first Wendelstein 7-X high- performance operation", Nucl. Fusion 59 (2019). ISS04 scaling: Yamada et al., Nucl. Fusion 45 (2005) 1684.

AUTHOR

Generated for the Physics-Stellarator project.

LICENSE

Copyright (C) 2026 the Physics-Stellarator authors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. See https://www.gnu.org/licenses/gpl-3.0.html.