.. include:: ../icons.inc .. _geom_tutorial: Extracting FW4 CAD surface ========================== The SALOME Geometry module is designed for: * Import and export of geometrical models in IGES, BREP, STEP, STL, XAO and VTK formats; * construction of geometrical objects using a wide range of functions; * viewing geometrical objects in the `OpenCASCADE `_ (OCC) viewer; * transformation of geometrical objects using various algorithms; * optimization of geometrical objects; * viewing information about geometrical objects using measurement tools; * designing shapes from sketches; * defining fields. The *Geometry* module includes many GUI features and functions that enable basic CAD modelling and allows importing several standard CAD interchange formats listed in a table below. +--------+--------------------------------------------------+ | Format | Short description | +========+==================================================+ | BREP | Used to store 3D models and is part of | | | Open CASCADE Technology (OCCT) | +--------+--------------------------------------------------+ | STEP | Standard for the Exchange of Product model data | +--------+--------------------------------------------------+ | IGES | Initial Graphics Exchange Specification | | | - vendor neutral file format of CAD model | +--------+--------------------------------------------------+ | STL | File format native to the stereolithography | +--------+--------------------------------------------------+ | XAO | CAD file format | +--------+--------------------------------------------------+ In this tutorial we will create surface CAD models of ITER blanket obtained from ITER design office. From these defeatured models we can then create meshes required for SMITER field line tracing. Before launching SMITER we need to ensure that STEP files are available for import and some intermediate study files for later tutorials by .. code-block:: console make -C study/step make -C study/tutorial or look under the location pointed by environment variable :envvar:`$SMITER_STUDY_EXAMPLES_DIR` for :file:`ITER-Blanket.stp` that we will be importing shortly. .. note:: In continuation we will be referring to the files provided under the :file:`study/` directory that may also be provided as a system-wide read-only source of examples provided with SMITER under :envvar:`$SMITER_STUDY_EXAMPLES_DIR` for tutorial and/or resources for testing and starting points that should appear in dialog box as a shortcut. Importing geometry ~~~~~~~~~~~~~~~~~~ We start SMITER and start a new case by clicking ont the Geometry module icon |geometry_module_icon| where we select :guilabel:`&New`. .. image:: images/geom_1.png :align: center With Geometry module activated we import a STEP file :file:`ITER-blanket.stp` through menu :menuselection:`&File --> Import --> STEP` that is located under :file:`study/step` directory as described above. This STEP file of around 200MB was exported by CAD "modeller". STEP is a standard CAD data interchange format. After the file was read the following question appears .. image:: images/geom_2.png :align: center to which we respond by :guilabel:`No` and then it will take several minutes to interpret all geometrical entities described inside. The "import" process is quite commonly long as the CAD kernel is interpreting the commands and builds the model in the same manner as it was designed by performing necessary geometric operations and checking for occlusions and trimming of algebraic surfaces by boundaries prescribed. By clicking on the "eye" |icon_visiblemesh| in front of assembly name ``tele0654...`` we show or hide selected object. When |icon_visiblemesh| is enabled then by clicking on :guilabel:`Fit All` icon the assembly appears completely. Since this is a group of many parts it appears in a grey color. .. image:: images/geom_4.png :align: center By selecting the assembly object it will appear highlighted and then from the menu :menuselection:`New Entity --> Explode` we select *Solid* :guilabel:`Sub-shapes Type`. .. image:: images/geom_5.png :align: center By clicking :guilabel:`A&pply and Close` and confirmation with :guilabel:`Explode` the shape containing 552 sub-shapes will be created. The exploding operation may take few minutes to complete as it is creating a new modelling tree that can be seen in the study. We will assign :guilabel:`Auto Color` property by right clicking on newly exploded *assembly* that has now "eye" hidden and will appear in different colors shortly. By clicking on the *first wall* panel number 4 the it is shown as selected in white and can be found highlighted under name ``FW_BODY`` somewhere in the middle of the :guilabel:`Object Browser`. We can then rename it to ``FW4_BODY`` by double click on the name or :kbd:`F2` for easier identification later on. .. image:: images/geom_7.png :align: center By right-click on the panel 4 again we select :guilabel:`Show Only` to continue working on this object in sequel. .. image:: images/geom_8.png :align: center We are only interested to extract plasma facing surfaces for meshing. This includes edges that may be hit by particles. At this point it may be good to save the study somewhere with :menuselection:`&File-->Save As`. It can be observed that the file saving and opening is much faster than importing. Because the modelling tree does not need to be checked or interpreted also reading models from HDF study files is quick comparing to STEP import. The size of binary HDF study is half of the STEP file in ASCII format. It is also a good practice to leave everything in study in order to see complete data at some later time and be able to modify the case for additional studies. Although only ``FW4_BODY`` is shown when saving, everything is saved, except the view on the data that follows usual hierarchical principles of display. Selecting plasma facing surfaces ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ At this point we may continue or open the :file:`study/tutorial/geom1.hfd` file and again select ``FW4_BODY`` to be on the :guilabel:`Show Only`. By having ``FW4_BODY`` selected we again create :menuselection:`New Entity --> Explode`. We change :guilabel:`Sub-shapes Type` to :guilabel:`Faces`. By presing :guilabel:`A&pply and Close` and confirming explosion then 217 faces are created. With :kbd:`Shift` and mouse click we select faces including edges as shown on the following image. .. image:: images/geom_9.png :align: center From these face selection we now create :menuselection:`New Entity --> Build --> Shell` and change shell :guilabel:`Name` to ``FW4``. .. image:: images/geom_10.png :align: center After :guilabel:`Apply and Close` new shell appears at the bottom of the :guilabel:`Object Browser`. We may wish to change the color of the panel and save the study at this point before proceeding to create a mesh from the newly created ``FW4`` shell or continuing with the shell extraction on the remaining panels. .. image:: images/geom_11.png :align: center The study with extracted ``FW4`` is available as :file:`study/tutorial/geom2.hdf`. We will be using ``FW4`` as a target on which power deposition will be calculated by firstly computing incidence angles and shadowing effects i.e. "wetted area" on the panel of interest. Unless we continue extracting shells and create the whole set of panels we can now simply :menuselection:`&File --> Import --> STEP` the whole first wall shell available as :file:`study/step/ITER-inner_wall_surfaces_sides.stp`. .. image:: images/geom_12.png :align: center .. note:: When enabling ``FW4`` and newly imported first wall for one segment complete first wall we see shadow and target overlapping each other at different areas. These slight differences are due to display approximation only and does not affect actual shape processing and meshing that is accurate at time of operation. The quality of display approximation is controlled by :menuselection:`&File-->Prefe&rences-->Default deflection coefficient`. Changing from default 0.001 to 0.0001 will increase display precision that can be sometimes confusing if not having this in mind. For preparing *shadow* around the *target* we could rotate the newly imported panels by selecting it and use menu :menuselection:`Operations-->Transformation-->Rotation`. We select :guilabel:`Axis` by clicking :guilabel:`OZ`. Required angle of rotation is -40 degrees with :guilabel:`Preview` see that the panels combine quite nicely. .. image:: images/geom_13.png :align: center However, this means that we will have twice as much CAD geometry to mesh. Therefore, we restrict ourselves just to one blanket segment in CAD and replicate meshes as needed in Mesh module once we have them. To complete this tutorial we just rename imported surface model to ``PANELS`` and save the study somewhere for meshing.