CONTENT

  1.  Introduction
  2. DYON output
    1. Files provided
    2. Running the scripts
    3. The main files (functions 'put_to_IMAS', 'get_from_IMAS' and test scripts)
    4. IDS core_profiles
    5. IDS core_sources
    6. IDS equilibrium
    7. IDS gas_injection
    8. IDS magnetics
    9. IDS radiation
    10. IDS wall
    11. Service functions
  3. DYON inputquit
  4. To be done

1. Introduction

This page contains a description of MATLAB scripts supporting the storage of DYON input and output data files in IMAS. 

The repository folder of the DYON output wrapper is ~g2yyakov/public/dyon/stable.

This document can be found on the ACH-PSNC Confluence page (DYON IMASification - Scientific Worfklows - PCSS Confluence (psnc.pl), https://docs.psnc.pl/display/WFMS/DYON+IMASification).

2.  DYON output

The storage of the DYON output in IMAS is supported by two MATLAB functions, put_to_IMAS and get_from_IMAS. Depending on the situation, they can be integrated to the code or used separately as wrappers providing the connection between DYON and IMAS. The scripts test_put_to_IMAS and test_get_from_IMAS are provided, which illustrate how the functions can be called as wrappers.

The available IMAS Data Dictionary (DD) does not satisfy all requirements of DYON. Therefore, the functions put_to_IMAS and get_from_IMAS are to be extended after the planned extension of the DD. 

Now the output data are placed into 7 IMAS IDS's (Interface Data Structures - sections of the IMAS DD describing tokamak subsystems or tokamak physics chapters): 'core_profiles', 'core_sources', 'equilibrium', 'gas_injection', 'magnetics', 'radiation', and 'wall' (this list is to be extended). The allocation of the data in the IDS's and the functions supporting it are described below.

2.1.  Files provided

File name Content
put_to_IMAS.mFunction saving IMAS output data to IMAS
get_from_IMAS.mFunction reading IMAS output data from IMAS
test_put_to_IMAS.mSample script invoking the function put_to_IMAS
test_get_from_IMAS.mSample script that invokes the function get_from_IMAS and compares the recovered data with the initial ones
put_core_profiles.mFunction saving data to the 'core_profiles' IDS
put_core_sources.mFunction saving data to the 'core_sources' IDS
put_equilibrium.mFunction saving data to the 'equilibrium' IDS
put_gas_injection.mFunction saving data to the 'gas_injection' IDS
put_magnetics.mFunction saving data to the 'magnetics' IDS
put_radiation.mFunction saving data to the 'radiation' IDS
put_wall.mFunction saving data to the 'wall' IDS
get_core_profiles.mFunction recovering the saved data from the 'core_profiles' IDS
get_core_sources.mFunction recovering the saved data from the 'core_sources' IDS
get_equilibrium.mFunction recovering the saved data from the 'equilibrium' IDS
get_gas_injection.mFunction recovering the saved data from the 'gas_injection' IDS
get_magnetics.mFunction recovering the saved data from the 'magnetics' IDS
get_radiation.mFunction recovering the saved data from the 'radiation' IDS
get_wall.mFunction recovering the saved data from the 'wall' IDS
arrange_ion_densities.mFunction putting the densities of all charge states and the properties of an ion to 'core_profiles'
arrange_neutral_density.mFunction putting the density and the properties of a neutral atom to 'core_profiles'
arrange_radiation.mFunction arranging the radiation power density (together with all atom attributes) for given radiation type and neutral/ion kind
extract_ion_densities.mFunction extracting the densities of all charge states from the 'core_profiles' IDS
find_source.mFunction finding the location of the source with a given data dictionary index in an AoS
find_species.mFunction finding the location of the species with a given label in AoS
compare_core_profiles.mFunction comparing the data restored from the 'core_profiles' IDS with the initial content
compare_core_sources.mFunction comparing the data restored from the 'core_sources' IDS with the initial content
compare_equilibrium.mFunction comparing the data restored from the 'equilibrium' IDS with the initial content
compare_magnetics.mFunction comparing the data restored from the 'magnetics' IDS with the initial content
compare_radiation.mFunction comparing the data restored from the 'radiation' IDS with the initial content
compare_wall.mFunction comparing the data restored from the 'wall' IDS with the initial content
STEP_10003_N_O_impurities_Cwall_2022_11_12_17_53_27.matExample of MAT-file with DYON results (received from Kim Hyun-Tae)
STEP_10003_v4_600kW_EBWCD_2022_6_20_21_24_29.matExample of MAT-file with DYON results (received from Kim Hyun-Tae)
README.txtBrief user guide
DYON-IMAS_wrappers_user_guide.pdfThis documentation in PDF-format

2.2. Running the scripts

To launch the test scripts, do the following:

1. Enter:

module load imasenv/<IMASversion> 

Here <IMASversion> is 3.37.0 or higher.

2. The scripts in its present form use the IMAS database 'step'. If you are planning to use it and this database is non-existent, enter the following command to create the database:
imasdb step

You can replace 'step' with another IMAS database name, but do not forget to create it and change the variable 'machine' in test_put_to_IMAS.m and test_get_from_IMAS.m.

3. Enter either 
     matlab
  or
     matlab -nodesktop -nosplash

In the nodesktop mode, MATLAB should work faster (I did not notice a significant difference - YY). When using the nodesktop mode, do not forget to run the command 'quit()' to end the session (otherwise, a dangling MATLAB session may remain).

4. Run test_put_to_IMAS.m in order to save in IMAS the data from an available DYON output MAT-file (you can change shot, run, IDS comments etc. by changing the parameters in this script).

5. Type 'viz' (on a console with imasenv loaded) to see the content of the IMAS database.

6. To get back the DYON output data, run test_get_from_IMAS.m. 

2.3. The main files (functions 'put_to_IMAS', 'get_from_IMAS' and test scripts)

The script test_put_to_IMAS.m loads a MAT-file containing the DYON results (the name of the file is defined in the script). It is assumed that there is a structure with the name 'output' among the variables loaded from the MAT-file and that this structure holds all the data that must be saved.

The script then defines the rest of arguments of the function 'put_to_IMAS' and invokes it. The dummy arguments of this function are as follows:

NameTypeDescription
outputstructstructure containing the DYON output to be saved
H_massfloatmass of the H isotope (in units of the proton mass)
machinesymbol arrayname of the IMAS database (usually a tokamak name)
shotintshot number
runintrun number
commentsymbol arraycomment characterizing the data to be saved (put into each IDS)
data_sourcesymbol array

text describing the origin of the data (put into each IDS)

The function creates an IMAS data entry for the given 'shot' and 'run' parameters (note that the database with the required name must exist; otherwise, an error is raised). Then it invokes several functions that put data to separate IDS's ('put_core_profiles', 'put_core_sources', 'put_equilibrium', 'put_gas_injection', 'put_magnetics', 'put_wall', and 'put_radiation') and closes the database. After that, the content of the 'output' structure is put to IMAS. The DD fields to which the data are placed can be found in the table IMAS interface with DYON - Google Documents. Some more comments will be given in next sections of this document for each IDS separately.

The script test_get_from_IMAS.m defines the input parameters of the function get_from_IMAS and invokes it. The dummy arguments of this function are as follows:

NameTypeDescription
machinesymbol arrayname of the IMAS database (usually a tokamak name)
shotintshot number
runintrun number

The function calls several functions that extract data from separate IDS's ('get_core_profiles', 'get_core_sources', 'get_equilibrium', 'get_gas_injection', 'get_magnetics', 'get_wall', and 'get_radiation') and closes the database. The function returns the 'output' structure, which is to be equivalent (after the script is complete) to the 'output' structure that was initially put to IMAS. In addition, the function prints to the screen the comments extracted from all IDS's.

The script in its current form contains some parts that are used for verification and debugging. It imports the original DYON output and compares it with the one recovered from IMAS. These part should be removed in the future when such comparison is not required.

2.4. IDS core_profiles

The quantities stored in this IDS include electron and ion temperatures, densities of electrons, several ion species and several neutral species, loop voltage, and plasma current. Although all these quantities are represented by single values, most of them are stored as 1D-profiles on the formal grid consisting of a single point. When the ion and neutral densities are recovered from the IDS, the ion species are selected in the array of structures by their charge numbers (not by their places in the array). This is done to permit more flexibility if the set of the ions simulated by the code changes. At present, the storage of ion quantities in the IDS is organized as follows:

ElementIon labelIon indexNeutral labelNeutral index
HH1--
BeBe2Be01
CC3C02
NN4N03
OO5O04
HeHe6He05
NeNe7Ne06

Here 'ion label' and 'ion index' are the label and the index of the species in the core_profiles.profiles1d.ion AoS (array of structures), respectively; 'neutral label' and 'neutral index' are the label and the index of the species in the core_profiles.profiles1d.neutral AoS (array of structures), respectively. 

For all ions except for H, several ion states (charge states) are defined, the index of the 'state' array element being equal to the ion charge number.

The following functions support I/O with the 'core_profiles' IDS:


function put_core_profiles (output, H_mass, idx, comment, data_source, imas_version, access_layer)

Write a suitable part of the 'output' structure to the 'core_profiles' IDS. 

This function invokes the functions 'arrange_ion_densities' and 'arrange_neutral_density'.

NameTypeDescription
outputstructstructure containing the DYON output to be saved
H_massfloatmass of the H isotope (in units of the proton mass)
idxintthe data entry identifies 
commentsymbol arraycomment characterizing the data to be saved
data_sourcesymbol arraytext describing the origin of the data
imas_versionsymbol arrayIMAS major version (prepared in the 'put_to_IMAS' function)
access_layersymbol arrayIMAS access layer version used when writing the IDS (prepared in the 'put_to_IMAS' function)


function [output, comment, data_source, imas_version, access_layer] = get_core_profiles (output, idx, get_time)

Add the data from the 'core_profiles' IDS to the 'output' structure. 

This function invokes the functi on ' extract_ion_densities '.

NameTypeDescription
outputstructstructure containing the DYON output recovered from IMAS
idxintthe data entry identifies 
get_timebooleanswitch on transferring the IDS time to the output time
commentsymbol arraycomment characterizing the recovered data
data_sourcesymbol arraytext describing the origin of the data
imas_versionsymbol arrayIMAS major version
access_layersymbol arrayIMAS access layer version used when writing the IDS


2.5. IDS core_sources

The source densities are stored as 1D-profiles on the formal grid consisting of a single point although they are represented by single values. 

When the data are recovered from the IDS, the sources are sought in the array of structures by their DD indices (not by their places in the array). This is done to permit more flexibility if the set of the sources calculated by the code changes. At present, the storage of sources in the IDS is organized as follows:

SourceDD indexIDS nameIDS index
Ohmic heating to electrons7Ohmic1
Electron energy loss for ionization601ionization2
Energy loss due to radiation including excitation, recombination, and bremsstrahlung200radiation3
Electron energy loss due to equilibration with ions402equipartition4
Electron energy loss due to particle transport400transport5
Ion energy loss due to particle transport400transport5
ECH power absorbed to electrons3ECH6
ECH + EBW power absorbed to electrons901ECH&EBW7
Ion energy loss due to charge exchange305CX8
Net electron heating power in a unit volume1net_power9
Net ion heating power in a unit volume1net_power9

Here 'IDS index' is the location of the source in the core_sources.source AoS (which can be changed if required). The 'IDS name' is the label of the source (a part of the source identifier), which is not used when the data are extracted from the IDS. The source 901 (ECH + EBW power absorbed to electrons) is a custom source missing in the DD.

The data are put to the 'core_sources' IDS by the function 'put_core_sources'. Its interface is as follows:


function put_core_sources (output, idx, comment, data_source, imas_version, access_layer)

NameTypeDescription
outputstructstructure containing the DYON output to be saved
idxintthe data entry identifies 
commentsymbol arraycomment characterizing the data to be saved
data_sourcesymbol arraytext describing the origin of the data
imas_versionsymbol arrayIMAS major version (prepared in the 'put_to_IMAS' function)
access_layersymbol arrayIMAS access layer version used when writing the IDS (prepared in the 'put_to_IMAS' function)


The data are extracted from the 'core_sources' IDS by the function 'get_core_sources'. Its interface is identical to that of 'get_core_profiles' (Section 2.4). 

2.6. IDS equilibrium

Data exchange with the 'equilibrium' IDS is carried out by the functions 'put_equilibrium' and 'get_equilibrium'. The interface of 'get_equilibrium' is identical to that of 'get_core_profiles' (Section 2.4). The interface of 'put_equilibrium' is identical to that of 'put_core_sources' (Section 2.5).

2.7. IDS gas_injection

Data exchange with the 'gas_injection' IDS is carried out by the functions 'put_gas_injection' and 'get_gas_injection'. The interface of 'get_gas_injection' is identical to that of 'get_core_profiles' (Section 2.4). The interface of 'put_gas_injection' is identical to that of 'put_core_sources' (Section 2.5).

The gas puffing units are electron/s in DYON and Pa*m^3/s in IMAS. The unit conversion is made on the assumption that the gas is H2 (D2) molecules with the temperature of 300 K:
PIMAS = PDYON k T / 2,
with P the gas puffing, T = 300 K, k = 1.3807*10-23 J/K.

2.8. IDS magnetics

Data exchange with the 'magnetics' IDS is carried out by the functions 'put_magnetics' and 'get_magnetics'. The interface of 'get_magnetics' is identical to that of 'get_core_profiles' (Section 2.4). The interface of 'put_magnetics' is identical to that of 'put_core_sources' (Section 2.5).

2.9. IDS radiation

The emission densities are stored as 1D-profiles on the formal grid consisting of a single point although they are represented by single values. 

When the data are recovered from the IDS, the emission processes are sought in the array of structures by their DD indices. At present, the storage of process in the IDS is organized as follows:

ProcessDD indexIDS nameIDS index

Total emission from line radiation

10

Line_radiation

1

Recombination and bremsstrahlung emission from ions

901

Recombination_and_bremsstrahlung

2

Radiation from charge exchange reactions between H isotope atoms and various ions

902

Charge_exchange

3

Here 'IDS index' is the location of the source in the 'radiation.process' AoS (which can be changed if required). The 'IDS name' is the label of the process (a part of the process identifier), which is not used when the data are extracted from the IDS. The processes with DD indices 901 and 902 are custom processes missing in the DD.

The radiating species are sought in the AoS's 'radiation.process(:).profiles1d(1).ion' and 'radiation.process(:).profiles1d(1).neutral' by their labels, which are the standard chemical element notations. 

Data exchange with the 'radiation' IDS is carried out by the functions 'put_radiation' and 'get_radiation'. The interface of 'get_radiation' is identical to that of 'get_core_profiles' (Section 2.4). The interface of 'put_radiation' is identical to that of 'put_core_sources' (Section 2.5). 

2.10. IDS wall

The 'wall' IDS is used to store sputtering coefficients. When the data are extracted from the IDS, each coefficient is found in the AoS by the labels of the sputtered and incident species, which are the standard chemical element notations.

Data exchange with the 'wall' IDS is carried out by the functions 'put_wall' and 'get_wall'. The interface of 'get_wall' is identical to that of 'get_core_profiles' (Section 2.4). The interface of 'put_wall' is identical to that of 'put_core_sources' (Section 2.5). 

2.11. Service functions

function [ion] = arrange_ion_densities (mass, Z_n, label, neutral_index, densities)

Prepare a structure containing the densities of all ion charge states of an element for the core_profiles IDS and other element characteristics.

NameTypeDescription
ionstructstructure containing the properties of the ion species
massfloation mass number
Z_nfloatcharge number of the nucleus
labelsymbol arraylabel of the ion chemical element
neutral_indexintindex of the respective neutral in the AoS
densities1d float arrayarray of densities, densities(Z) being the density of the charge state Z


function [neutral] = arrange_neutral_density (mass, Z_n, label, ion_index, density)

Prepare a structure containing the density of neutral atoms of an element for the core_profiles IDS.

NameTypeDescription
neutralstructstructure containing the properties of the neutral species
massfloation mass number
Z_nfloatcharge number of the nucleus
labelsymbol arraylabel of the chemical element
ion_indexintindex of the respective ion in the AoS 
densityfloatneutral density


function [neutral_sort] = arrange_radiation (label, mass, Z, power_density)

Arrange the structure holding the data about emissivity and other characteristics of a neutral species.

NameTypeDescription
neutral_sortstructstructure containing the emissivity and properties of the neutral species
labelsymbol arraylabel of the chemical element
massfloation mass number
Zfloatcharge number of the nucleus
power_densityfloatneutral density


function [density, ion_found] = extract_ion_densities (profiles, Z)

Extract densities of all charge states of an ion species from the core_profiles IDS.

NameTypeDescription
density1D float arraythe array elements with the numbers 1, ..., Z hold the densities of the corresponding charge states; the element Z+1 hold the neutral density
ion_foundbooleanequals to false if the ion with the given Z is missing
profilesstructtime slice of the AoS core_profiles.profiles_1d
Zfloatcharge number of the nucleus


function [AOS_index] = find_source (sources, dictionary_index)

Find location of the element with a given data dictionary index in an AOS (in particular, the source in core_sources.source and the process in radiation.process).

NameTypeDescription
AOS_indexintindex of the required element in the array
sourcesstructAoS where the search is performed
dictionary_indexintDD index of the required element


function index = find_species (species_list, label)

Find location of the element with a given label in AoS. The function is used to find the required spruttering coefficient in the 'wall' IDS. The label is the chemical element label; it is hold in the 'label' leaf of each AoS element.

NameTypeDescription
indexintindex of the required element in the array
species_liststructAoS where the search is performed
labelsymbol arraylabel of the required element


3.  DYON input

The importing of the DYON input from IMAS is supported by MATLAB function, main_input_get_data_from_IMAS.m. The input data for testing script can be loaded to IMAS via main_input_put_data_to_IMAS.m. Depending on the situation, they can be integrated to the code or used separately as wrappers providing the connection between DYON and IMAS.

Similarly as in script for input DYON data, the input data are placed into IMAS IDS's (Interface Data Structures). The allocation of the data in the IDS's and the functions supporting it are described below.

3.1. List of the script files

main_input_get_data_from_IMAS.m

Main script DYON input saving data from IMAS to MAT file: IMAS data

main_input_put_data_to_IMAS.m

Additional script saving DYON input data in the IMAS

get_from_IMAS.m

Auxiliary script for main_input_get_data_from_IMAS.m

Input_put_to_IMAS.m

Auxiliary script for main_input_put_data_to_IMAS.m

Input_put_core_profiles.m

Function saving data to the 'core_profiles' IDS

Input_put_ec_launchers.m

Function saving data to the 'ec_lauchers' IDS

Input_put_equilibrium.m

Function saving data to the 'equilibrium' IDS

Input_put_gas_injection.m

Function saving data to the 'gas_injection' IDS

Input_put_magnetics.m

Function saving data to the 'magnetics' IDS

Input_put_em_coupling.m

Function saving data to the ' em_coupling' IDS

Input_put_wall.m

Function saving data to the 'wall' IDS

Input_put_pf_active.m

Function saving data to the 'pf_active ' IDS

Input_put_pf_passive.m

Function saving data to the 'pf_passive' IDS

Input_put_pulse_shedule.m

Function saving data to the ' pulse_shedule ' IDS

Input_put_plasma_initiation.m

Function saving data to the ' plasma_initiation ' IDS

Input_put_tf.m

Function saving data to the ' tf ' IDS



Input_get_core_profiles.m

Function recovering the saved data from the 'core_profiles' IDS

Input_get_ec_launchers.m

Function recovering the saved data from the 'ec_lauchers' IDS

Input_get_equilibrium.m

Function recovering the saved data from the 'equilibrium' IDS

Input_get_gas_injection.m

Function recovering the saved data from the 'gas_injection' IDS

Input_get_magnetics.m

Function recovering the saved data from the 'magnetics' IDS

Input_get_em_coupling.m

Function recovering the saved data from the ' em_coupling' IDS

Input_get_wall.m

Function recovering the saved data from the 'wall' IDS

Input_get_pf_active.m

Function recovering the saved data from the 'pf_active ' IDS

Input_get_pf_passive.m

Function recovering the saved data from the 'pf_passive' IDS

Input_get_pulse_shedule.m

Function recovering the saved data from the ' pulse_shedule ' IDS

Input_get_plasma_initiation.m

Function recovering the saved data from the ' plasma_initiation ' IDS

MAST_27512__2023_3_17_22_1_45_p0=1.1563mPa.mat

Example of MAT-file with DYON results (received from Kim Hyun-Tae)


3.2. Running the scripts

To launch the test scripts, do the following:

  • Enter: module load imasenv/<IMASversion>. Here <IMASversion> is 3.38.1/rc or higher.
  • The scripts in its present form use the IMAS database 'step'. If you are planning to use it and this database is non-existent, enter the following command to create the database: imasdb step .You can replace 'step' with another IMAS database name, but do not forget to create it and change the variable 'machine' in main_input_get_data_from_IMAS.m and main_input_put_data_to_IMAS.m.
  • Enter: matlab
  • Run main_input_put_data_to_IMAS.m in order to save in IMAS the data from an available DYON input MAT-file (you can change shot, run, IDS comments etc. by changing the parameters in this script).
  • To get back the DYON input data, run test_get_from_IMAS.m.

3.3. The main files (functions main_input_put_data_to_IMAS.m ', 'input_put_to_IMAS' and main_input_get_data_from_IMAS.m, 'input_get_from_IMAS)


  • The script main_input_put_data_to_IMAS.m loads a MAT-file containing the DYON data (the name of the file is defined in the script). It is assumed that there is a structure with the name 'input' among the variables loaded from the MAT-file and that this structure holds all the data that must be saved. Currently the reference MAT-file is MAST_27512__2023_3_17_22_1_45_p0=1.1563mPa.mat that can be found on Gateway at:

afs/eufus.eu/user/g/g2hkim/public/DYONtoIMAS/stable/MAST_27512__2023_3_17_22_1_45_p0=1.1563mPa.mat

or

afs/eufus.eu/user/g/g2chmiel/public/imas_DYON/MAST_27512__2023_3_17_22_1_45_p0=1.1563mPa.mat

In the script there have to be defined machine name, shot number, run number and H_mass. The script  the script engages the function input_put_to_IMAS.


  • Function input_put_to_IMAS creates an IMAS data entry for the given 'shot' and 'run' parameters (note that the database with the required name must exist; otherwise, an error is raised). Then it invokes several functions that put data to separate IDS's ('input_put_core_profiles', 'input_put_equilibrium', 'input_put_gas_injection', ‘input_put_tf’, 'input_put_wall', ‘input_put_pf_active’, ‘input_put_pf_pasive’, ‘input_put_ec_launchers’, ‘input_put_pulse_shedule’, ‘input_put_plasma_initiation’, 'input_put_magnetics' and ‘input_put_em_coupling’) and closes the database. After that, the content of the 'input' structure is put to IMAS. The DYON data fields and IMAS IDS’s to which the data are placed can be found in the table IMAS interface with DYON - Google Documents:

https://docs.google.com/document/d/1CBK1mU8uYXuPSLk3-xa3osyHTGSHcr_1bHjSFS996gE/edit


  • In the similar way the data are loaded from IMAS IDS’s to the MAT-file called mat.

In the script main_input_get_data_from_IMAS there are also defined: machine name, shot number and run number. Note that values of machine, shot and run number have to be the same as given in main_input_put_data_to_IMAS script. Otherwise the database cannot be found. After all, opened and filled structure is saved to the MAT-file.

  • The script engage the function input_get_from_IMAS, which load data to MAT-file from different IDS’s defined in the body of the function via separate functions: 'input_get_core_profiles', 'input_get_equilibrium', 'input_get_gas_injection', ‘input_get_tf’, 'input_get_wall', ‘input_get_pf_active’, ‘input_get_pf_pasive’, ‘input_get_ec_launchers’, ‘input_get_pulse_shedule’, ‘input_get_plasma_initiation’, 'input_get_magnetics' and ‘input_get_em_coupling’. The function returns the 'input' structure, which is to be equivalent (after the script is complete) to the 'input' structure that was initially put to IMAS.

3.4. IDS core_profiles

input_put_core_profiles

The function load DYON data to core_profiles IDS. The quantities stored in this IDS include  prefill gas pressure with individual time. All data are stored as a single value for given time step.

Input_get_core_profiles

This function load prefill gas pressure with individual time to input.prefill.time and input.prefill.data MAT-file structure.

3.5. IDS equilibrium

input_put_equilibrium

The function load to the equilibrium IDS the DYON data: major radius of the plasma current, vertical position of the plasma current, minor radius of the plasma current, plasma elongation data, plasma cross sectional area data, plasma volume data, internal inductance data, as well as radial and vertical position of the mesh grid cells. All quantities are time dependent with a genetic time.

  • Input_get_equilibrium

This function load above mentioned variables from equilibrium IDS to MAT-file structure.

3.6. IDS gas injection

  • Input_put_gas_injection

The function load to the gas injection IDS the DYON data: gas influx data for individual time. The interface of 'input_put_gas_injection' is identical to that of 'input_put_core_profiles'.

The gas puffing units are electron/s in DYON and Pa*m^3/s in IMAS. The unit conversion is made on the assumption that the gas is H2 (D2) molecules with the temperature of 300 K: PIMAS = PDYON k T / 2, where P the gas puffing, T = 300 K, k = 1.3807*10-23 J/K.

  • Input_get_gas_injection

This function load above mentioned variables with appropriate conversion from gas injection IDS to MAT-file structure.

3.7. IDS tf

  • Input_put_tf

The function load to the toroidal field coils IDS called tf the quantity being the product of Bt (toroidal magnetic field) and R (major radius) in Tesla*meters for individual time.

  • Input_get_tf

The function load above mentioned variables from tf IDS to MAT-file structure.

3.8. IDS wall

  • Input_put_wall

The function load to the wall IDS the volume of vacuum space and data of the simulation boundary representing the first wall. The chamber boundary is described by R and Z coordinates.

  • Input_get_wall

This function load above mentioned variables from wall IDS to MAT-file structure.

3.9. IDS pf active

  • Input_put_pf_ active

The function load to the pf active IDS the voltage applied in each coil for individual time, currents induced in each coil for individual time, the number of current and voltage circuits as well as coil resistance of the coil vessel resistance DYON quantity.

  • Input_get_pf_ active

This function load above mentioned variables from pf active IDS to MAT-file structure.

3.10. IDS pf passive

  • Input_put_pf_ passive

The function load to the pf passive IDS the number of coil voltage and current vessel elements and vessel elements resistance of the coil vessel resistance DYON quantity.

  • Input_get_pf_ passive

This function load above mentioned variables from pf passive IDS to MAT-file structure.

3.11. IDS ec_launchers

  • Input_put_ ec_launchers

The function load to the ec launchers IDS the Injected ECH power, Toroidal angle of ECH injection, Poloidal angle of ECH injection, ECH frequency and CH mode. Note that the ECH O-mode in DYON(IMAS) is defined by 0 (1), while X-mode by 1 (-1). Therefore appropriate conversion have been applied.

  • Input_get_ ec_launchers

This function load above mentioned variables from ec launchers IDS to MAT-file structure with appropriate conversion.

3.12. IDS pulse_shedule

  • Input_put_pulse_shedule

The function load to the pulse shedule IDS the value of the loop voltage induced to the plasma current for individual time.

  • Input_get_pulse_shedule

This function load above mentioned variables from pulse_shedule IDS to MAT-file structure.

3.13. IDS plasma initiation

  • Input_put_ plasma initiation

The function load to the plasma initiation IDS the value of the stray magnetic field at the plasma position i.e. sqrt(Br^2 + Bz^2) for individual time.

  • Input_get_ plasma initiation

This function load above mentioned variables from plasma initiation IDS to MAT-file structure.

3.14. IDS magnetics

  • Input_put_magnetics

The function load to the magnetics IDS the value of the major radius and vertical  position of each flux loop as well magnetic flux loop voltage.

  • Input_get_magnetics

This function load above mentioned variables from magnetics IDS to MAT-file structure.

3.15. IDS em coupling

  • Input_put_em coupling

The function load to the em coupling IDS the value of the mutual inductance matrix between the circuits and vessel elements, mutual inductance between each flux loop and a grid in the vacuum space and mutual inductance between each flux loop and each coil/vessel element.

  • Input_get_em coupling

This function load above mentioned variables from em coupling IDS to MAT-file structure.



4. To be done

  • Extending the input script (pending the planned DD extension)
  • Adding code descriptions to all IDS's.
  • Switching to the HDF5 IMAS backend (pending HDF5 debugging on Gateway).
  • No labels