Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 H2 (D2D2) 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.

...

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


 DYON input

Description The importing of the scripts processing the DYON input (to be done)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.

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)


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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.



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).