.. include:: ../icons.inc .. _imas: 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 :file:`${HOME}/public/imasdb/smiter` tree. To include IMAS in SMITER one needs to specify :file:`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. 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 Extracting prepared IDS ^^^^^^^^^^^^^^^^^^^^^^^ To download prepared IDS, run the following commands from salome directory .. code-block:: console $ make -C study/imas This will download and extract the IDS to :file:`~/public/imasdb/smiter/3/0`. If loaded module file then user can recreate IMAS examples with commands like .. code-block:: console $ module load SMITER/1.4.0 $ make -C ${SMITER_STUDY_EXAMPLES_DIR}/imas .. _section-read-IDS: Reading mesh from IDS ^^^^^^^^^^^^^^^^^^^^^ .. _iter-vessel: 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 :menuselection:`&Smiter --> &IMAS --> Read mesh from IDS` from the menu. .. image:: images/imas_1.* :align: center :width: 30% Now change the ``Run`` field to ``5``, ``Shot`` field to ``4``, ``User`` to your system username. Click :guilabel:`Apply`. If everything went ``OK``, a message will show in the end. .. image:: images/imas_2.* :align: center Click :guilabel:`Ok` and afterwards :guilabel:`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 :file:`IDS-5-4-edge_profiles-slice-0` in ``SALOME Object browser`` and select :guilabel:`Show`. .. image:: images/imas_3.* :align: center :width: 50% 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. 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 :guilabel:`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**. .. image:: images/imas_tetrahedron_1.* :align: center Meshing Vessel geometry """"""""""""""""""""""" 1. Now activate the ``SMESH`` module. Click on :menuselection:`Mesh --> Create Mesh`. .. image:: images/imas_tetrahedron_2.* :align: center 2. For the input geometry, select the **Vessel** geometry, by clicking on it in the **SALOME Object browser**. .. image:: images/imas_tetrahedron_3.* :align: center 3. Now in the ``3D`` tab, under ``Algorithm`` select ``NETGEN 3D``. .. image:: images/imas_tetrahedron_4.* :align: center 4. Right of the ``Hypothesis`` and the input field is a **cog wheel**. Click on it and select ``NETGEN 3D Parameters``. .. image:: images/imas_tetrahedron_5.* :align: center A dialog will show up in which we won't change anything. Click :guilabel:`&Ok`. 5. Now switch to the ``2D`` tab and under ``Algorithm`` select ``NETGEN 1D-2D``. .. image:: images/imas_tetrahedron_6.* :align: center 6. Again click on the ``cog wheel`` that is right of the input field for ``Hypothesis`` and select ``NETGEN 2D Simple Parameters``. .. image:: images/imas_tetrahedron_7.* :align: center 7. A dialog will open in which we will change the ``Number of segments`` value from ``15`` to ``5``. .. image:: images/imas_tetrahedron_8.* :align: center 8. Click :guilabel:`&Ok` and then on the main mesh dialog click :guilabel:`A&pply and Close`. 9. Now right click on the mesh in ``SALOME Object browser`` and click on :guilabel:`Compute`. .. image:: images/imas_tetrahedron_9.* :align: center 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. .. image:: images/imas_tetrahedron_10.* :align: center We have a prepared ``3D`` mesh to be written to an IDS. .. index:: writingIDS Writing mesh to IDS """"""""""""""""""" Activate SMITER module and click on |imas_write_ids| icon or from the menu select :menuselection:`&Smiter --> &IMAS --> Write mesh to IDS`. The following dialog will show up. .. image:: images/imas_tetrahedron_11.* :align: center 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 :guilabel:`Apply`, all the highlighted meshes will be read and written to the IDS. In this case we will only select one mesh. .. image:: images/imas_tetrahedron_12.* :align: center Click :guilabel:`Apply` and wait until it finishes. A message of success will pop up. .. image:: images/imas_tetrahedron_13.* :align: center We can go back to :ref:`section-read-IDS` to read the mesh in the newly created IDS. .. _section-read-eqdsk-IDS: 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 :menuselection:`&Smiter --> &IMAS --> Read G-EQDSK from IDS` from the menu. .. image:: images/imas_read_eqdsk_from_ids_1.* :align: center :width: 30% Now change the ``Run`` field to ``2``, ``Shot`` field to ``0``, ``User`` to your system username. Click :guilabel:`Apply`. If everything went ``OK``, a message will show in the end. .. image:: images/imas_read_eqdsk_from_ids_2.* :align: center Click :guilabel:`Ok` and afterwards :guilabel:`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. .. _section-write-eqdsk-IDS: 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 :menuselection:`&Smiter --> &IMAS --> Write G-EQDSK to IDS`. The following dialog will show up. .. image:: images/imas_write_eqdsk_to_ids_1.* :align: center 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 :guilabel:`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. .. image:: images/imas_write_eqdsk_to_ids_2.* :align: center You can go back to :ref:`section-read-eqdsk-IDS` to read the Equilibrium related data from the newly created IDS.