boozer
Input representing mapping from real-space to Boozer coordinates.
This input is required in simulations where the input with MHD eigenfunctions is used.
Mapping between cylindrical and Boozer coordinates assuming that psi is axisymmetric. |
- class a5py.ascot5io.boozer.Boozer(root, path, **kwargs)
Bases:
DataGroupMapping between cylindrical and Boozer coordinates assuming that psi is axisymmetric.
This input can be automatically created from tokamak field input.
- 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.
The dummy output is a very large rectangular wall.
- Returns:
- data
dict Input data that can be passed to
write_hdf5method of a corresponding type.
- data
- read()
Read data from HDF5 file.
- Returns:
- data
dict Data read from HDF5 stored in the same format as is passed to
write_hdf5().
- data
- static write_hdf5(fn, psimin, psimax, npsi, ntheta, nthetag, rmin, rmax, nr, zmin, zmax, nz, r0, z0, psi0, psi1, psi_rz, theta_psithetageom, nu_psitheta, nrzs, rs, zs, desc=None)
Write input data to the HDF5 file.
Note: the data in theta_psithetageom is assummed to span the whole interval (i.e. coinciding start and end points included) in the angular axis. This is needed so that we can add “padding” to this dataset. To be mores specic, the padding means that the dataset is artificially extended in the angular space. This is needed so that ASCOT5 can use the natural boundary condition when fitting the splines to the data: the data is effectively periodic but the periodic condition would assume x_end = x_ini when in fact x_end = x_ini + 2*pi e.g. for theta_psithetageom.
Note that the nu_psitheta data is also periodic, but there it is valid to use the natural boundary condition which sets y’’ = 0 (the nu data is has a local extrema at theta=0).
- Parameters:
- fn
str Full path to the HDF5 file.
- psimin
float Minimum psi grid value.
- psimax
float Maximum psi grid value.
- npsi
int Number of psi grid points.
- ntheta
int Number of boozer theta grid values.
- nthetag
int Number of geometric theta grid values.
- rmin
float Minimum R grid value.
- rmax
float Maximum R grid value.
- nr
int Number of R grid points.
- zmin
float Minimum z grid value.
- zmax
float Maximum z grid value.
- nz
int Number of z grid points.
- r0
float Magnetic axis R coordinate.
- z0
float Magnetic axis z coordinate.
- psi0
float Coordinate psi on axis.
- psi1
float Coordinate psi on separatrix.
- psi_rzarray_like (nr,nz)
Coordinate psi(R,z).
- theta_psithetageomarray_like (npsi,nthetag)
Coordinate theta(psi, thetag).
- nu_psithetaarray_like (npsi,ntheta)
nu(psi, theta).
- nrsz
int Number of separatrix Rz points.
- rsarray_like (nrsz,1)
Separatrix R coordinates, start and end points should coincide.
- zsarray_like (nrsz,1)
Separatrix z coordinates, start and end points should coincide.
- desc
str,optional Input’s description.
- fn
- Returns:
- name
str Name, i.e. “<type>_<qid>”, of the new input that was written.
- name
- Raises:
ValueErrorIf inputs were not consistent.