Introductory manual for the open source meshing code SALOME
1. Manual for 3D-meshing with SALOME
Meshing of a semi-submerged sphere
Filippos Kalofotias
November,2016
1
2. The purpose of this manual is to assist the students of the course: Loads
and Motions in Waves, in the implementation of their assignment. The assign-
ment involves the use of linear 3D diffraction theory potential solver, NEMOH
(Babarit and Delhommeau, 2015). As it can be expected a geometric description
in terms of panels is needed for NEMOH input. The geometry and mesh (panels)
will be created with the use of open source code SALOME (SALOME, 2016). A
step by step guide follows, for running SALOME, creating a 3D semi-submersed
sphere, dividing it in panels and extracting and manipulating geometric informa-
tion. SALOME operates in Linux operating system. Students who are not famil-
iar with Linux operating systems can download the latest version of Ubuntu (.iso
file) using the following link: https://www.ubuntu.com/download/desktop.
So as to run Ubuntu on Windows, a virtual machine should be created by
using VirtualBox. VirtualBox can be downloaded by clicking on the follow-
ing link: https://www.virtualbox.org/wiki/Downloads. Detailed steps for
the whole installation procedure can be found at: https://www.lifewire.
com/run-ubuntu-within-windows-virtualbox-2202098. The recommended
setup is to allocate at least 50GB of your hard disk drive and 3GB of RAM for
the operation of the virtual machine. Finally, students who want to practice
further with SALOME and explore all its capabilities, are advised to study the
SALOME tutorials following the link:
http://www.salome-platform.org/user-section/salome-tutorials/copy_
of_salome-tutorial
Download and Run
In this section, the procedure for downloading and running SALOME in the
Ubuntu version of Linux operating system is explained. So as to download
SALOME you need to follow the web link:
http://www.salome-platform.org/downloads/current-version
On the top of the web page and under the title: Binaries for officially supported
Linux platforms (Figure 1).
Figure 1: Download web page of SALOME
Once download has finished, the downloaded file can be found in the Downloads
folder (by default). It has a .tgz extension and it is a self-extracting file. Copy
the file from the Downloads folder to Home folder. Right-click on the file and
choose Extract here. After extraction, a folder with the same name has been
2
3. created. Enter the folder, right-click anywhere in the folder and choose open
in terminal. In the terminal enter the following command: ./salome and press
ENTER. You should be able to see Figure 2 on your screen. This is the start
screen of SALOME. You are ready to start creating your geometry.
Figure 2: Start screen of SALOME
Create Geometry
For the purposes of practice and of the assignment, a semi-submersed sphere
will be created. So as to enter the Geometry module of SALOME click on the
button which is in the red circle in Figure 2. In the pop-up window click New.
You should be able then to see Figure 3 on your screen.
Figure 3: Start screen of Geometry module in SALOME
For practicality reasons it is recommended to deactivate all the toolbars except
for: Object Browser, Standard and Modules. This can be done by right-clicking
on the toolbar section and deselecting the toolbars one by one. Next we will
create a 3D semi-submersed sphere. On the top of of the screen click on the
3
4. New Entity menu, go to Primitives and click on Sphere. You should be able to
see the dialog box in Figure 4.
Figure 4: Sphere dialog box
Inside the dialog box, click the option specified with the red circle. This way
we will define the sphere by determining its center and its radius. Next you can
define the center of the sphere by clicking the plus sign next to Geometry in
the Object Browser at the left side of the screen. Click on +O and the Center
option of the dialog box should be automatically updated. We defined that the
point (0, 0, 0) is the center of our sphere. Finally, fill the Radius option with
the desired value of 5m and click on Apply and Close. Using your mouse wheel
inside the viewer part of Geometry module (cyan screen), you can zoom to your
created sphere as it is shown in Figure 5.
Figure 5: 3D Sphere of 5m radius as created in SALOME
The created sphere can be meshed immediately. The problem is that we only
need the under water part of it for simulation in NEMOH. NEMOH is a linear
3D Diffraction theory, panel method solver and so it cannot calculate potentials
for panels whose center is not under zero level. Moreover, the created sphere is
a 3D object while we need to panel only the submerged surface of it. For that
reason manipulation is needed. First we need to cut the sphere in two halves.
A plane will be created. Click on the New Entity menu, go to Basics and click
on Plane. You should be able to see the dialog box in Figure 6
4
5. Figure 6: Plane dialog box
In the Object Browser at the left, click on +O for the center of the plane (Point)
and /OZ for the orientation of the plane (Vector). Finally fill a value of 15m
for the Size of the Plane and click on Apply and Close. You should be able to
see Figure 7.
Figure 7: Sphere cut by plane at z = 0m
Next, we will create a joint object of the common parts of the sphere and the
plane in terms only of surfaces. Click on the Operations menu and click on
Partition. You should be able to see the dialog box in Figure 8.
5
6. Figure 8: Partition dialog box
From the Object Browser at the left choose Sphere 1 as Objects and Plane 1 as
Tool Objects. For Resulting Type choose Face and click Apply and Close. You
should be able to see within the Object Browser a new entity called Partition 1.
Next, click on the New Entity menu and click Explode. You should be able to
see the dialog box in Figure 9. Choose from the Object Browser Partition 1 as
your Main Object, choose Face in the Sub-shapes Type menu and click Apply
and Close. You should able to see in the Object Browser, under Partition 1,
that 3 different faces (Face 1-3) have been created. We only need the lower
hemispherical face to mesh. You can vanish from the viewer any of the three
faces by clicking the eye-symbol at the left. The face we want to mesh is Face 1
(Figure 10).
Figure 9: Explode dialog box
6
7. Figure 10: Surface of hemisphere to be meshed
Mesh Geometry
For meshing the derived surface hemisphere the Mesh module of SALOME will
be employed. To do so, click on the button which is in the green circle in Figure
2. You do not need to close the Geometry module before. You should be able
to see the start screen of Mesh module in Figure 11.
Figure 11: Start screen of Mesh module in SALOME
Next, Face 1 will be meshed. Click on Mesh menu on the top and click on
Create Mesh. The Create Mesh dialog box in Figure 12 should appear.
7
8. Figure 12: Create Mesh dialog box
From Object Browser choose Face 1 as Geometry. Next, we have to choose
the type of meshing. SALOME supports a big number of different meshing
algorithms. NEMOH operates with quadrilaterals and this is how we will mesh
our hemispherical surface. Moreover, we will try to create quadrilaterals which
are close to squares. First, at the 2D tab, we choose Quadrangle (Mapping)
in the Algorithm menu. Next, at the 1D tab we choose Wire Discretization
as Algorithm. For assigning a Hypothesis for Wire Discretization, click on the
button in the red circle in Figure 13. Then, click Local Length. By assigning
different values for Length, the mesh is refined for smaller ones and it is coarsened
for larger ones. For the purposes of the assignment use a value of 1m. Finally,
click Apply and Close.
Figure 13: Wire discretization dialog box
Now, in the Object Browser, you should see a new entity called Mesh 1. Right-
click on it and click on Compute. The mesh is now computed and the mesh
results should be shown as in Figure 14. Click Close. The final mesh should
appear in your screen as in Figure 15. The panel coordinates can now be
extracted.
8
9. Figure 14: Meshing results
Figure 15: Final mesh produced by SALOME
Export and Convert .dat file
After meshing our geometry, the geometric information has to be exported and
manipulated so as to be used as input for NEMOH. To do so, right-click on
Mesh 1 in the Object Browser of Mesh module. Go to Export and click on DAT
file. A dialog box opens where you can choose the name and the location to
save the .dat file containing the coordinates of the mesh cross-sections and the
connectivity information. The exported file has to be manipulated so as to be
used as input by NEMOH. First, download the .zip file containing the input
9
10. files needed for NEMOH to run by clicking on the following link:
http://lheea.ec-nantes.fr/lib/exe/fetch.php/emo/nemoh/cylinder.zip
The downloaded .zip file will be by default in the Downloads folder. Right-click
on it and click Extract here. Next, download the .zip file containing the Linux
executable for file conversion by clicking on the following link:
http://lheea.ec-nantes.fr/lib/exe/fetch.php/emo/nemoh/nemohconverterv2.
zip
The downloaded .zip file will be by default in the Downloads folder. Right click
on it and click on Extract here. The extracted file now is a Linux executable
(bash) file. Right click on it and click on Properties. Click on the Permissions
tab and check: Allow executing file as program. Click on Close. Next a number
of folders has to be created. Go to Home folder. Create a new folder by right-
clicking and choosing New Folder. Name it as conversion. Inside the conversion
folder create four folders, namely: converter, mesh, results and salome. Place
the Linux executable file within the converter folder. Then place the Nemoh.cal
file extracted by the downloaded input files within the conversion folder. Fi-
nally, place the .dat file extracted by SALOME in the salome folder. Enter the
converter folder where the Linux executable file has been placed. Right-click
and choose Open in Terminal. Give the following command: ./NEMOHCon-
verterV2.sh and press ENTER. Alternatively, write just the first few letters and
press TAB. Figure 16 should appear on your screen.
Figure 16: NEMOH file converter for SALOME open in terminal
Write the exact name of the .dat file placed in salome folder followed by its
extension, for our case, Mesh 1.dat and press ENTER. Next, give the name
of the converted file and press ENTER always followed by its extension. The
file is created by the converter. For our case use Mesh 1 new.dat. You will
be asked to give permission to overwrite file. Whenever asked, press o and
ENTER. Once done and after some time you should see on your screen Figure
17. The converted file will be at the mesh and salome folders. The Nemoh.cal
file has also been updated in terms of number of nodes and panels. These
two updated files will be used as input to NEMOH. Finally, it is important to
create a shared folder between Windows (host) and the Ubuntu (guest) for file
for copying the updated files to Windows. First, in Windows, create a folder
called shared, inside the Documents folder. Next, click on Settings menu of
10
11. VirtualBox (Figure 18). Click on Shared Folder from the left menu and click
on the button in the red circle in Figure 19 and give the path of the created
shared folder in Windows and click OK. Next, go in the Home folder of Ubuntu.
Right-click and choose New Document. Rename it to mount share. Double-click
on it and write: sudo mount -tvboxsf shared ubu shared. Then Save and Exit
the document. Again, Right-click on the mount share document and click on
Properties. Click on Permissions tab and turn on the option: Allow executing
file as program and Close. Now, if you want to exchange files with Windows
you just have to run this file by opening a Terminal in the Home folder and
write: ./mount share. The Terminal will ask for the password you give to enter
Ubuntu as a user. Type it and press ENTER. You should be able to see a folder
with the name: ubu shared at the left of Home folder. Whatever you copy in
this folder automatically is also copied to the shared folder in Windows.
Figure 17: Results of file conversion for NEMOH use
Figure 18: VirtualBox settings
11
12. Figure 19: VirtualBox Shared Folders
References
Aur´elien Babarit and G´erard Delhommeau. Theoretical and numerical aspects
of the open source BEM solver NEMOH. Proceedings of the 11th Euro-
pean Wave and Tidal Energy Conference., (September 2015):1–12, 2015. doi:
hal-01198800.
SALOME. www.salome-platform.org, 2016. URL http://www.
salome-platform.org/.
12