The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Functions
OpenFUSIONToolkit.TokaMaker.util Namespace Reference

Detailed Description

General utility and supporting functions for TokaMaker.

Authors
Chris Hansen
Date
April 2024

Functions

 compute_forces_components (tMaker_obj, psi, cell_centered=False)
 Compute terms needed for evaluating forces in passively conducting regions.
 
 create_isoflux (npts, r0, z0, a, kappa, delta, kappaL=None, deltaL=None)
 Create isoflux points using simple analytic form.
 
 create_power_flux_fun (npts, alpha, gamma)
 Build power law flux function of the form \( (1-\hat{\psi}^{\alpha})^{\gamma} \).
 
 create_spline_flux_fun (npts, x, y, axis_bc=[1, 0.0], edge_bc=[1, 0.0], normalize=True)
 Build cubic spline flux function.
 
 eval_green (x, xc)
 Evaluate Green's function for a toroidal filament.
 
 read_eqdsk (filename)
 Read gEQDSK file.
 
 read_ifile (filename)
 Read i-file inverse equilibrium file.
 
 read_kfile (path, machine_dict, e_coil_names=None, f_coil_names=None)
 
 read_mhdin (path, e_coil_names=None, f_coil_names=None)
 

Function Documentation

◆ compute_forces_components()

compute_forces_components (   tMaker_obj,
  psi,
  cell_centered = False 
)

Compute terms needed for evaluating forces in passively conducting regions.

Parameters
tMaker_objTokaMaker equilibrium object
psi\( \psi \) corresponding to desired currents
cell_centeredEvaluate at cell centers instead of node points?
Returns
J_cond, B_cond, mask, R

◆ create_isoflux()

create_isoflux (   npts,
  r0,
  z0,
  a,
  kappa,
  delta,
  kappaL = None,
  deltaL = None 
)

Create isoflux points using simple analytic form.

Parameters
nptsNumber of points to sample (evenly spaced in \(\theta\))
r0Major radial position for magnetic axis
z0Vertical position for magnetic axis
aMinor radius
kappaElongation (upper only if kappaL is set)
deltaTriangularity (upper only if deltaL is set)
kappaLLower elongation (default: kappa)
deltaLLower triangularity (default: delta)
Returns
Point list [npts,2]

◆ create_power_flux_fun()

create_power_flux_fun (   npts,
  alpha,
  gamma 
)

Build power law flux function of the form \( (1-\hat{\psi}^{\alpha})^{\gamma} \).

Parameters
nptsNumber of points for definition
alphaInner exponent
gammaOuter exponent
Returns
Flux function definition dictionary

◆ create_spline_flux_fun()

create_spline_flux_fun (   npts,
  x,
  y,
  axis_bc = [1,0.0],
  edge_bc = [1,0.0],
  normalize = True 
)

Build cubic spline flux function.

Parameters
nptsNumber of points for definition
xLocation of spline "knots" in normalized flux
yValue of flux function at spline "knots"
axis_bcSciPy BC specification on axis ( \( \hat{\psi} = 0 \))
edge_bcSciPy BC specification on LCFS ( \( \hat{\psi} = 1 \))
Returns
Flux function definition dictionary

◆ eval_green()

eval_green (   x,
  xc 
)

Evaluate Green's function for a toroidal filament.

Parameters
xObservation point [2]
xcCoil location [:,2]
Returns
\(\psi(x)\) due to a coil with unit current [A] at xc

◆ read_eqdsk()

read_eqdsk (   filename)

Read gEQDSK file.

Parameters
filenamePath to gEQDSK file
Returns
Dictionary containing gEQDSK information

◆ read_ifile()

read_ifile (   filename)

Read i-file inverse equilibrium file.

Parameters
filenamePath to file
Returns
Dictionary containing i-file information

◆ read_kfile()

read_kfile (   path,
  machine_dict,
  e_coil_names = None,
  f_coil_names = None 
)
Read k-file.

@param path Path to file
@param e_coil_names Names of E coils (hardcoded, generates indexed names if None)
@param f_coil_names Names of F coils (hardcoded, generates indexed names if None)
@param machine_dict Result from read_mhdin (contents of mhdin.dat file)
@result probes_dict Dictionary containing probe values and weights (0 if not selected).
@result loops_dict Dictionary containing loop values and weights (0 if not selected).
@result e_coil_dict Dictionary containing E copil values and weights (0 if not selected).
@result f_coil_dict Dictionary containing F coil values and weights (0 if not selected).
@result raw Dictionary containing all other data from k-file.

◆ read_mhdin()

read_mhdin (   path,
  e_coil_names = None,
  f_coil_names = None 
)
Read mhdin.dat file.

@param path Path to file
@param e_coil_names Names of E coils (hardcoded, generates indexed names if None)
@param f_coil_names Names of F coils (hardcoded, generates indexed names if None)
@result machine_dict Dictionary containing coil coordinates and turns, loop names, and probe names and angles.
@result raw Dictionary containing all other data from mhdin.dat