desc.magnetic_fields.SourceFreeField
- class desc.magnetic_fields.SourceFreeField(surface, M, N, NFP=None, sym=None, B0=None, I=0.0, Y=0.0)Source
Compute source free magnetic fields.
Implements the Neumann formulation in multiply connected geometry described in [1].
Let 𝒳 be an open set with continuously differentiable closed boundary ∂𝒳. This class solves the following partial differential equation for the globally defined harmonic remainder ϕ, represented in the solver by
Phi_tilde. The physical harmonic field carrying the prescribed periods isB0.∆φ(x) = 0 x ∈ 𝒳
(B - ∇φ - B₀)(x) = 0 x ∈ 𝒳
n dot (∇φ + B₀)(x) = 0 x ∈ ∂𝒳
n dot B(x) = 0 x ∈ ∂𝒳
curl (B - B₀)(x) = 0 x ∈ 𝒳
div B(x) = 0 ∀x
- Parameters:
surface (Surface) – Geometry defining ∂𝒳.
M (int) – Poloidal Fourier resolution to interpolate potential on ∂𝒳.
N (int) – Toroidal Fourier resolution to interpolate potential on ∂𝒳.
NFP (int) – Field periodicity of potential on ∂𝒳. Default is
surface.NFPwhich is correct only if the globally defined part ofB0produces an NFP periodic field.sym (str) – Symmetry for the Fourier basis interpolating the globally defined potential remainder. Default is
sinwhen the surface is stellarator symmetric andFalseotherwise. PassFalseexplicitly when the boundary data do not share the surface symmetry.B0 (_MagneticField) – Magnetic field due to sources other than the selected
IandYharmonic representatives. The complete auxiliary field is exposed asB0; the field supplied here is exposed asB0_base.I (float) – Net toroidal current. Its physical harmonic representative is the field of a unit-period toroidal filament on an axis inferred from
surface. The filament lies inside the surface and is therefore intended for an exterior source-free domain. Default is zero.Y (float) – Net poloidal current. Its physical harmonic representative is
Y * grad(phi), implemented as a toroidal magnetic field with magnitudeY / R. Default is zero.
References
Methods
change_resolution(*args, **kwargs)Change the maximum poloidal and toroidal resolution.
compute(names, grid[, params, transforms, ...])Compute the quantity given by name on grid.
constant_offset_surface(offset[, grid, M, ...])Create a new FourierRZToroidalSurface with constant offset from self.
copy([deepcopy])Return a (deep)copy of this object.
equiv(other)Compare equivalence between DESC objects.
from_input_file(path, **kwargs)Create a surface from Fourier coefficients in a DESC or VMEC input file.
from_qp_model([major_radius, aspect_ratio, ...])Create a surface from a near-axis model for quasi-poloidal symmetry.
from_shape_parameters([major_radius, ...])Create a surface using a generalized Miller parameterization.
from_values(coords, theta[, zeta, M, N, ...])Create a surface from given R,Z coordinates in real space.
get_axis()Get the axis of the surface.
get_coeffs(m[, n])Get Fourier coefficients for given mode number(s).
load(load_from[, file_format])Initialize from file.
pack_params(p)Convert a dictionary of parameters into a single array.
save(file_name[, file_format, file_mode])Save the object.
set_coeffs(m[, n, R, Z])Set specific Fourier coefficients.
Convert a single array of concatenated parameters into a dictionary.
Attributes
Complete auxiliary field, including the I and Y periods.
User-supplied field excluding the built period fields.
Net toroidal-current period in T m.
Maximum radial mode number.
Maximum poloidal mode number.
Poloidal resolution of the potential remainder.
Maximum toroidal mode number.
Number of (toroidal) field periods.
Toroidal resolution of the potential remainder.
Basis for the globally defined potential remainder.
Spectral basis for R.
Spectral coefficients for R.
Net poloidal-current period in T m.
Spectral basis for Z.
Spectral coefficients for Z.
total number of optimizable parameters.
dictionary of integers of sizes of each optimizable parameter.
Name of the surface.
string names of parameters that have been declared optimizable.
dictionary of arrays of optimizable parameters.
Flux surface label.
Surface geometry defining boundary.
Whether the surface is stellarator symmetric.
Symmetry of the potential remainder (no symmetry if False).
arrays of indices for each parameter in concatenated array.