+ All Categories
Home > Engineering > Introductory manual for the open source meshing code SALOME

Introductory manual for the open source meshing code SALOME

Date post: 20-Mar-2017
Category:
Upload: filippos-kalofotias
View: 207 times
Download: 20 times
Share this document with a friend
12
Manual for 3D-meshing with SALOME Meshing of a semi-submerged sphere Filippos Kalofotias November,2016 1
Transcript
Page 1: Introductory manual for the open source meshing code SALOME

Manual for 3D-meshing with SALOMEMeshing of a semi-submerged sphere

Filippos Kalofotias

November,2016

1

Page 2: Introductory manual for the open source meshing code SALOME

The purpose of this manual is to assist the students of the course: Loadsand 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 descriptionin 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). Astep by step guide follows, for running SALOME, creating a 3D semi-submersedsphere, 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 (.isofile) using the following link: https://www.ubuntu.com/download/desktop.So as to run Ubuntu on Windows, a virtual machine should be created byusing VirtualBox. VirtualBox can be downloaded by clicking on the follow-ing link: https://www.virtualbox.org/wiki/Downloads. Detailed steps forthe whole installation procedure can be found at: https://www.lifewire.

com/run-ubuntu-within-windows-virtualbox-2202098. The recommendedsetup is to allocate at least 50GB of your hard disk drive and 3GB of RAM forthe operation of the virtual machine. Finally, students who want to practicefurther with SALOME and explore all its capabilities, are advised to study theSALOME 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 theUbuntu version of Linux operating system is explained. So as to downloadSALOME 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 supportedLinux platforms (Figure 1).

Figure 1: Download web page of SALOME

Once download has finished, the downloaded file can be found in the Downloadsfolder (by default). It has a .tgz extension and it is a self-extracting file. Copythe file from the Downloads folder to Home folder. Right-click on the file andchoose Extract here. After extraction, a folder with the same name has been

2

Page 3: Introductory manual for the open source meshing code SALOME

created. Enter the folder, right-click anywhere in the folder and choose openin terminal. In the terminal enter the following command: ./salome and pressENTER. You should be able to see Figure 2 on your screen. This is the startscreen 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 spherewill be created. So as to enter the Geometry module of SALOME click on thebutton 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 exceptfor: Object Browser, Standard and Modules. This can be done by right-clickingon the toolbar section and deselecting the toolbars one by one. Next we willcreate a 3D semi-submersed sphere. On the top of of the screen click on the

3

Page 4: Introductory manual for the open source meshing code SALOME

New Entity menu, go to Primitives and click on Sphere. You should be able tosee the dialog box in Figure 4.

Figure 4: Sphere dialog box

Inside the dialog box, click the option specified with the red circle. This waywe will define the sphere by determining its center and its radius. Next you candefine the center of the sphere by clicking the plus sign next to Geometry inthe Object Browser at the left side of the screen. Click on +O and the Centeroption of the dialog box should be automatically updated. We defined that thepoint (0, 0, 0) is the center of our sphere. Finally, fill the Radius option withthe desired value of 5m and click on Apply and Close. Using your mouse wheelinside the viewer part of Geometry module (cyan screen), you can zoom to yourcreated 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 onlyneed the under water part of it for simulation in NEMOH. NEMOH is a linear3D Diffraction theory, panel method solver and so it cannot calculate potentialsfor panels whose center is not under zero level. Moreover, the created sphere isa 3D object while we need to panel only the submerged surface of it. For thatreason 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 clickon Plane. You should be able to see the dialog box in Figure 6

4

Page 5: Introductory manual for the open source meshing code SALOME

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 15mfor the Size of the Plane and click on Apply and Close. You should be able tosee 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 theplane in terms only of surfaces. Click on the Operations menu and click onPartition. You should be able to see the dialog box in Figure 8.

5

Page 6: Introductory manual for the open source meshing code SALOME

Figure 8: Partition dialog box

From the Object Browser at the left choose Sphere 1 as Objects and Plane 1 asTool Objects. For Resulting Type choose Face and click Apply and Close. Youshould 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 tosee the dialog box in Figure 9. Choose from the Object Browser Partition 1 asyour Main Object, choose Face in the Sub-shapes Type menu and click Applyand 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 lowerhemispherical face to mesh. You can vanish from the viewer any of the threefaces 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

Page 7: Introductory manual for the open source meshing code SALOME

Figure 10: Surface of hemisphere to be meshed

Mesh Geometry

For meshing the derived surface hemisphere the Mesh module of SALOME willbe employed. To do so, click on the button which is in the green circle in Figure2. You do not need to close the Geometry module before. You should be ableto 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 onCreate Mesh. The Create Mesh dialog box in Figure 12 should appear.

7

Page 8: Introductory manual for the open source meshing code SALOME

Figure 12: Create Mesh dialog box

From Object Browser choose Face 1 as Geometry. Next, we have to choosethe type of meshing. SALOME supports a big number of different meshingalgorithms. NEMOH operates with quadrilaterals and this is how we will meshour hemispherical surface. Moreover, we will try to create quadrilaterals whichare close to squares. First, at the 2D tab, we choose Quadrangle (Mapping)in the Algorithm menu. Next, at the 1D tab we choose Wire Discretizationas Algorithm. For assigning a Hypothesis for Wire Discretization, click on thebutton in the red circle in Figure 13. Then, click Local Length. By assigningdifferent values for Length, the mesh is refined for smaller ones and it is coarsenedfor 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 meshresults should be shown as in Figure 14. Click Close. The final mesh shouldappear in your screen as in Figure 15. The panel coordinates can now beextracted.

8

Page 9: Introductory manual for the open source meshing code SALOME

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 andmanipulated so as to be used as input for NEMOH. To do so, right-click onMesh 1 in the Object Browser of Mesh module. Go to Export and click on DATfile. A dialog box opens where you can choose the name and the location tosave the .dat file containing the coordinates of the mesh cross-sections and theconnectivity information. The exported file has to be manipulated so as to beused as input by NEMOH. First, download the .zip file containing the input

9

Page 10: Introductory manual for the open source meshing code SALOME

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-clickon it and click Extract here. Next, download the .zip file containing the Linuxexecutable 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 clickon 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 Permissionstab and check: Allow executing file as program. Click on Close. Next a numberof 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 conversionfolder create four folders, namely: converter, mesh, results and salome. Placethe Linux executable file within the converter folder. Then place the Nemoh.calfile extracted by the downloaded input files within the conversion folder. Fi-nally, place the .dat file extracted by SALOME in the salome folder. Enter theconverter folder where the Linux executable file has been placed. Right-clickand choose Open in Terminal. Give the following command: ./NEMOHCon-verterV2.sh and press ENTER. Alternatively, write just the first few letters andpress 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 itsextension, for our case, Mesh 1.dat and press ENTER. Next, give the nameof the converted file and press ENTER always followed by its extension. Thefile is created by the converter. For our case use Mesh 1 new.dat. You willbe asked to give permission to overwrite file. Whenever asked, press o andENTER. Once done and after some time you should see on your screen Figure17. The converted file will be at the mesh and salome folders. The Nemoh.calfile has also been updated in terms of number of nodes and panels. Thesetwo updated files will be used as input to NEMOH. Finally, it is important tocreate a shared folder between Windows (host) and the Ubuntu (guest) for filefor copying the updated files to Windows. First, in Windows, create a foldercalled shared, inside the Documents folder. Next, click on Settings menu of

10

Page 11: Introductory manual for the open source meshing code SALOME

VirtualBox (Figure 18). Click on Shared Folder from the left menu and clickon the button in the red circle in Figure 19 and give the path of the createdshared 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-clickon it and write: sudo mount -tvboxsf shared ubu shared. Then Save and Exitthe document. Again, Right-click on the mount share document and click onProperties. Click on Permissions tab and turn on the option: Allow executingfile as program and Close. Now, if you want to exchange files with Windowsyou just have to run this file by opening a Terminal in the Home folder andwrite: ./mount share. The Terminal will ask for the password you give to enterUbuntu as a user. Type it and press ENTER. You should be able to see a folderwith the name: ubu shared at the left of Home folder. Whatever you copy inthis 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

Page 12: Introductory manual for the open source meshing code SALOME

Figure 19: VirtualBox Shared Folders

References

Aurelien Babarit and Gerard Delhommeau. Theoretical and numerical aspectsof 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


Recommended