efield

Electric field input.

Electric field is present in all simulations and it is automatically accounted for when orbit-following is enabled. To “disable” electric field, set the values to zero everywhere. The easiest and most computationally effective way to accomplish this is to use E_TC input.

a5py.ascot5io.efield.E_TC

Uniform electric field in Cartesian basis.

a5py.ascot5io.efield.E_1DS

One-dimensional electric field interpolated with cubic splines.

class a5py.ascot5io.efield.E_TC(root, path, **kwargs)

Bases: DataGroup

Uniform electric field in Cartesian basis.

This input fixes the electric field vector, in Cartesian basis, so that the field has same value and direction everywhere. This input is meant for testing purposes or for disabling electric field in simulations. To disable electric field, use write_hdf5_dummy().

static create_dummy()

Create dummy data that has correct format and is valid, but can be non-sensical.

This method is intended for testing purposes or to provide data whose presence is needed but which is not actually used in simulation.

This dummy input sets electric field to zero everywhere.

Returns:
datadict

Input data that can be passed to write_hdf5 method of a corresponding type.

read()

Read data from HDF5 file.

Returns:
datadict

Data read from HDF5 stored in the same format as is passed to write_hdf5().

static write_hdf5(fn, exyz, desc=None)

Write input data to the HDF5 file.

Parameters:
fnstr

Full path to the HDF5 file.

exyzarray_like (3,1)

Electric field value in cartesian coordinates [V/m].

descstr, optional

Input description.

Returns:
namestr

Name, i.e. “<type>_<qid>”, of the new input that was written.

Raises:
ValueError

If inputs were not consistent.

class a5py.ascot5io.efield.E_1DS(root, path, **kwargs)

Bases: DataGroup

One-dimensional electric field interpolated with cubic splines.

This input tabulates the gradient of the electric field potential with respect to minor radius on 1D (radial) grid which is then interpolated with splines during the simulation.

static create_dummy()

Create dummy data that has correct format and is valid, but can be non-sensical.

This method is intended for testing purposes or to provide data whose presence is needed but which is not actually used in simulation.

This dummy input sets electric field to zero everywhere.

Returns:
datadict

Input data that can be passed to write_hdf5 method of a corresponding type.

read()

Read data from HDF5 file.

Returns:
datadict

Data read from HDF5 stored in the same format as is passed to write_hdf5().

static write_hdf5(fn, nrho, rhomin, rhomax, dvdrho, reff, desc=None)

Write input data to the HDF5 file.

Parameters:
fnstr

Full path to the HDF5 file.

nrhoint

Number of rho slots in data.

rhominfloat

Minimum rho value.

rhomaxfloat

Maximum rho value.

dvdrhoarray_like (nrho,1)

Derivative of electric potential with respect to minor radius [V/m].

If reff = 1 m, this is essentially equal to dv/dr.

refffloat

Effective minor radius of the plasma used to convert dv/drho to SI units as drho/dr=1/reff [m].

descstr, optional

Input description.

Returns:
namestr

Name, i.e. “<type>_<qid>”, of the new input that was written.

Raises:
ValueError

If inputs were not consistent.