.. _meshing_tutorial: Meshing CAD models ================== .. include:: ../icons.inc In this tutorial we will create meshes for SMITER from surface CAD models extracted beforehand. Unless we continue from :ref:`geom_tutorial` tutorial we need to ensure that study files are available for reading with .. code-block:: console make -C study/tutorial We open :file:`study/mesh1.hdf` study that contains CAD geometry with ``FW4`` and ``PANELS`` from which we will create target and shadow meshes. Before we go to meshing we activate the Geometry module with a click on |icon_geometry_module| button from the toolbar. We setup visibility of both models by clicking on |icon_visiblemesh| icons and :guilabel:`Fit All` to get ready for meshing. Mesh for the target is usually required to be higher density that the shadow as we want better wetted pattern on the target. It is always good practice to find the correct mesh density by firstly trying rough meshes that are still acceptable from past experience and then doubling the density by recomputing the meshes. Meshing FW4 ~~~~~~~~~~~ Now we can move to Mesh module by clicking |icon_mesh_module| in the main toolbar. While being in *Mesh* module we again select ``FW4`` geometry and set visibility by |icon_visiblemesh| and :guilabel:`Fit All` and the ``FW4`` panel appears in the Mesh module. .. image:: images/mesh_1.png :align: center From the menu we select :menuselection:`Mesh --> Create mesh` or |icon_mesh_init| button the meshing toolbar where we setup dialog with the :guilabel:`Name` to ``target`` and :guilabel:`Mesh type` to ``Triangular``. For :guilabel:`Algorithm` we select :guilabel:`Triangle: Mefisto` as shown in the following image. .. image:: images/mesh_2.png :align: center Before pressing :guilabel:`A&pply and Close` we click on :guilabel:`Assign a set of hypotesses` and within :guilabel:`Hypothesis Construction` dialog change :guilabel:`Name` to ``Max Size Target`` and :guilabel:`Length` to ``20``. This will create :guilabel:`Hypothesis` for :guilabel:`Wire discretisation` :guilabel:`Algorithm` in :guilabel:`1D` tab. At :guilabel:`A&pply and Close` and :menuselection:`Mesh --> Compute` from the menu or |icon_mesh_compute| button from the meshing toolbar we get newly created mesh statistics stating 18545 triangles created ifor the ``target`` mesh. After :guilabel:`Close` and inpecting :guilabel:`Object Browser` and zooming mesh we obtain the follwoing image. .. image:: images/mesh_3.png :align: center Creating shadow mesh ~~~~~~~~~~~~~~~~~~~~ For creating the ``panels`` mesh we again :menuselection:`Mesh --> Create mesh` or |icon_mesh_init| with ``PANELS`` selected from the :guilabel:`Geometry`. The only difference is that we :guilabel:`Assign a set of hypotheses` for :guilabel:`2D: Automatic Triangulation` with ``Max Size Shadow`` :guilabel:`Name` and :guilabel:`Length` set to ``50`` that created arounf 165000 triangles shadow mesh with some errors in shape evaluation that seems OK. .. image:: images/mesh_4.png :align: center We will now create rotated panels with menu selection :menuselection:`Modification --> Transformation --> Rotation`, where we :guilabel:`Select whole mesh...` named ``panels``. Rotation axis and point of rotation needs to be entered as shown in the folowing image. .. image:: images/mesh_5.png :align: center With :guilabel:`Preview` enabled we :guilabel:`Copy Elements` with :guilabel:`Angle` ``-40`` degrees of rotation that gets created in the study after :guilabel:`A&pply and Close`. Translating target ~~~~~~~~~~~~~~~~~~ In order to avoid intersection of the *target* with the *shadow* panels due do different meshing density and numerical errors we translate the *target* panel by less that 0.01 mm inwards. From menu :menuselection:`Modification --> Transformation --> Translation` we open a dialog for translation. The relative translation vector can be easily determined by firstly clicking on the center of the panel in "two-point" mode and then dividing that point position by 1000 or so to get small translation in the correct direction inwards. .. image:: images/mesh_6.png :align: center With this operation we have now prepared all meshes necessary to compute the case and can save the study somewhere. Mesh ``panels`` will serve as a *shadow* and ``target_translated`` will be a *target* for SMITER. Computing the case ================== In this tutorial we will create SMITER case with meshes prepared in :ref:`meshing_tutorial` tutorial. Unless we continue from :ref:`meshing_tutorial` tutorial we need to ensure that study files are available for reading with .. code-block:: console make -C smiter/salome/study/tutorial We open :file:`study/mesh2.hdf` study that contains first wall CAD geometry with corresponding *target* and *shadow* meshes. .. image:: images/mesh_7.png :align: center We change the following :guilabel:`beqparameters` in associated *Eqdsk* meshes by right clicking on them and selecting :guilabel:`Edit ctl` to: beq_bdryopt=9 Required for limiter case. We set this for meshes shadow and target. beq_fldspec=3 Mapping equilibrium field to cylindrical (axisymmetric). Set for meshes wall, shadow and target. beq_bdryopt=3 Set this for wall mesh :file:`LIMITER-554.eqdsk`. It calculates the value of flux at plasma boundary while also including the wall silhouette. beq_nzetap=1 Set for shadow and target. For hierarhical data structure (HDS) we need to increase "bin size" :guilabel:`Hdsgen` CTL :guilabel:`hdsgenparameters` limit_geoobj_in_bin=200 Default value was 20 objects (triangles). See Val-F11-fw246t-fw4t for similar test case parameters or press :guilabel:`Help` button when setting parameters. After right clicking on :guilabel:`Compute case` the following results appear automatically. .. image:: images/mesh_8.png :align: center When comparing the wetted pattern with NF55 benchmark case we see similarity in the shape. Maximal heat flux should be proportional to power loss :math:`1.76 MW/ 7.5 MW \cdot 2.2 MW/m^2=0.52 MW/m^2`, while here we observe :math:`Q_{max}=1.0 MW/m^2` The study is available as :file:`study/tutorial/fwd1.hdf`. The difference is due to small shadow. If we increase the shadow by rotating left and dight we get :math:`Q_{max}=0.47` which is close to the estimation and available as :file:`study/tutorial/fwd2.hdf` and shown in the following figure. .. image:: images/mesh_9.png :align: center