4.8. Using IMAS in SMITER

The ITER Integrated Modelling and Analysis Suite (IMAS) and the European Integrated Modelling (EU-IM) effort, in the frame of the EUROfusion Code Development WPCD project, orchestrate the computation of fusion codes with Kepler scientific workflow engine. Complex integrated modelling (IM) workflows developed by the EU-IM Team on top of the Kepler framework, integrate several physics codes involving different time and space scales. The IMAS is a framework based on an underlying Physics Data Model (PDM) that allows the coupling of codes via standardized data structures named IDS (Interface Data Structures). These data structures are served within personal or global databases, and are accessible with several programming languages (Fortran, C++, Java, Python, and Matlab).

IMAS is optional feature that brings IMAS get/put functionality to SMITER in standalone way. Meaning that IMAS is compiled from ITER GIT repository and included in SMITER. Local database in SMITER is created in $HOME/public/imasdb/smiter tree.

To include IMAS in SMITER one needs to specify application.mk build type such as:

SMITER_APPLICATION ?= smiter-imas-8.5.2

After starting SMITER with IMAS built-in one can test functionality in Python console with:

>>> import imas
>>> help(imas.ids)

Here we will describe how to read meshes from IDS and write meshes to IDS.

4.8.1. Grid description

The grid (or mesh) is an assemblage of multiple connected elements, provided through their geometry data, which as a whole represents a discrete approximation of geometry of a real-life physical object, required for solving physical or mathematical problems like fluid flow and heat transfer, producing virtual presentations of simulations intended for analysis of simulation results and other computing related work in connection with the real-life object.

As previously mentioned, each grid is constructed by many low level components of various geometrical types, hereafter referred to as objects, as the same term is used for geometrical types.

The main objects forming the grid are:
  1. points or nodes,
  2. edges,
  3. faces, also known as two-dimensional cells, and
  4. three-dimensional cells

4.8.2. Extracting prepared IDS

To download prepared IDS, run the following commands from salome directory

$ make -C study/imas

This will download and extract the IDS to ~/public/imasdb/smiter/3/0. If loaded module file then user can recreate IMAS examples with commands like

$ module load SMITER/1.4.0
$ make -C ${SMITER_STUDY_EXAMPLES_DIR}/imas

4.8.3. Reading mesh from IDS

4.8.3.1. ITER vessel mesh

To read the mesh from IDS, activate SMITER module. We already have a prepared IDS with the following settings:

run: 5
shot: 4
user: $USER
device: smiter

Where $USER is your system username.

Click on the imas_read_ids or click on Smiter ‣ IMAS ‣ Read mesh from IDS from the menu.

../_images/imas_1.png

Now change the Run field to 5, Shot field to 4, User to your system username.

Click Apply. If everything went OK, a message will show in the end.

../_images/imas_2.png

Click Ok and afterwards Close.

Now we can view the mesh in SMESH module. Activate SMESH module. View the mesh by right clicking on it in the SALOME Object browser, in this case right click on IDS-5-4-edge_profiles-slice-0 in SALOME Object browser and select Show.

../_images/imas_3.png

4.8.4. Writing mesh to an IDS

To write a mesh to an IDS, we first have to have a mesh. We will use a prepared mesh of ITER Vessel which has been meshed with tetrahedrons. You can use the prepared one and skip the next step, or do the next step and manually create the Vessel mesh.

4.8.4.1. Creating Vessel geometry

To do this, run SMITER and activate the SMITER module. Then click on the vessel_icon to activate the Vessel dialog. Click on Accept and wait for the Vessel geometry to complete.

A object named “Primitive Vacuum vessel” will show up under Geometry in SALOME Object browser. To view it, activate the GEOM module and click on the eye right of the “Primitiv Vacuum vessel” object in the SALOME Object browser.

../_images/imas_tetrahedron_1.png

4.8.4.2. Meshing Vessel geometry

  1. Now activate the SMESH module. Click on Mesh ‣ Create Mesh.

    ../_images/imas_tetrahedron_2.png
  2. For the input geometry, select the Vessel geometry, by clicking on it in the SALOME Object browser.

    ../_images/imas_tetrahedron_3.png
  3. Now in the 3D tab, under Algorithm select NETGEN 3D.

    ../_images/imas_tetrahedron_4.png
  4. Right of the Hypothesis and the input field is a cog wheel. Click on it and select NETGEN 3D Parameters.

    ../_images/imas_tetrahedron_5.png

    A dialog will show up in which we won’t change anything. Click Ok.

  5. Now switch to the 2D tab and under Algorithm select NETGEN 1D-2D.

    ../_images/imas_tetrahedron_6.png
  6. Again click on the cog wheel that is right of the input field for Hypothesis and select NETGEN 2D Simple Parameters.

    ../_images/imas_tetrahedron_7.png
  7. A dialog will open in which we will change the Number of segments value from 15 to 5.

    ../_images/imas_tetrahedron_8.png
  8. Click Ok and then on the main mesh dialog click Apply and Close.

  9. Now right click on the mesh in SALOME Object browser and click on Compute.

    ../_images/imas_tetrahedron_9.png

    Wait until the meshing is complete.

  10. After it is complete you can right click on the mesh in SALOME Object browser and click on Show to view the result.

../_images/imas_tetrahedron_10.png

We have a prepared 3D mesh to be written to an IDS.

4.8.4.3. Writing mesh to IDS

Activate SMITER module and click on imas_write_ids icon or from the menu select Smiter ‣ IMAS ‣ Write mesh to IDS.

The following dialog will show up.

../_images/imas_tetrahedron_11.png

We can change SHOT and RUN values, but the other values should not be changed.

Now highlight the mesh in the SALOME Object browser. When we click on Apply, all the highlighted meshes will be read and written to the IDS. In this case we will only select one mesh.

../_images/imas_tetrahedron_12.png

Click Apply and wait until it finishes. A message of success will pop up.

../_images/imas_tetrahedron_13.png

We can go back to Reading mesh from IDS to read the mesh in the newly created IDS.

4.8.5. Reading G-EQDSK from IDS

To read the mesh from IDS, activate SMITER module. We already have a prepared IDS with the following settings:

run: 2
shot: 0
user: $USER
device: smiter

Where $USER is your system username.

Click on the imas_read_eqdsk_ids or click on Smiter ‣ IMAS ‣ Read G-EQDSK from IDS from the menu.

../_images/imas_read_eqdsk_from_ids_1.png

Now change the Run field to 2, Shot field to 0, User to your system username.

Click Apply. If everything went OK, a message will show in the end.

../_images/imas_read_eqdsk_from_ids_2.png

Click Ok and afterwards Close.

Now the G-EQDSK file with .eqdsk extension can be found at the saved location. The same G_EQDSK file can be used in the SMITER case computations.

4.8.6. Writing G-EQDSK to IDS

To write an existing G-EQDSK format file to IDS, first ctivate SMITER module and click on imas_write_eqdsk_ids icon or from the menu select Smiter ‣ IMAS ‣ Write G-EQDSK to IDS.

The following dialog will show up.

../_images/imas_write_eqdsk_to_ids_1.png

You can change SHOT and RUN values, but the other values should not be changed.

Now select the folder where the file is to be saved and set the file name. When you click on Apply, the contents of the G-EQDSK file will be read from the file and written to the IDS. A message of success will pop up.

../_images/imas_write_eqdsk_to_ids_2.png

You can go back to Reading G-EQDSK from IDS to read the Equilibrium related data from the newly created IDS.