OpenFoam Workflow (2): Create a Mesh in Salome

Please like, comment and share, if you enjoyed this video :-)

0:00 Import the STEP file in Salome Shaper
1:45 Define the Groups for inlet, outlet and walls
4:25 Setup the mesh parameters
6:35 Generate the mesh (compute)
7:30 Export mesh to a UNV file

Transcript

Welcome back to the second part of our tutorial, where we will demonstrate how to import the STEP file created in the first part into Salome. To do this, we'll start by creating a new file in Salome.

Our initial workspace in Salome is the "Shaper," which appears as follows. We can import our CAD file in STEP format. Click on the "No Ex" button, and a submenu will appear where you should select "STEP." As mentioned in the first tutorial, other formats like STL or ESS can also be used, but STEP is highly compatible. Choose "Import File" and select our previously created "tutorial One Step" file. Keep the default settings and ensure it's imported into "Part 1." Click "Apply."

Now, the dimensions might appear very small, so zoom in to see the details. Here, you can see our pipe and elbow. In the menu, locate "Tutorial One Geometry." Our first task is to define where we want our Inlet, Outlet, and Walls. To do this, go to "FE Features" and then "Group Features."

Begin by defining the Inlet. It's crucial to note that Salome is case-sensitive, so use lowercase letters for consistency. We'll call it "inlet" and set the type to "Face." The number assigned here is not crucial but will be useful later. Click "Apply" and "Continue."

Next, define the Outlet as "outlet." Remember to keep it lowercase. It will have a number assignment as well, which is not a critical detail.

Now, let's define the Walls. Select everything, then exclude the Inlet and Outlet by removing the assigned numbers (4 and 5 in this example). Click "Apply and Continue."

With Inlet, Outlet, and Walls defined, we've completed this step in Salome. Now, let's move on to creating a mesh.

Switch from the Shaper workspace to the Mesh workspace. In the menu, click on the "Tutorial" folder, and make sure "No Shape" results are activated. Then, click the "Create Mesh" button. This will create a new mesh specifically for this part.

For the 3D algorithm, choose "Netgen 3D" and set the parameters to a maximum of 5 mm and a minimum of 1 mm. These values depend on your specific geometry. For the 2D algorithm, select "Netgen 1D-2D" and set it to 0.5 and 1. Leave the rest of the settings as they are. Click "Apply and Close."

Now, the settings for the mesh are configured, but it hasn't been generated yet. To generate the mesh, right-click on it and select "Compute." The mesh generation will take place, and you'll see the results. The size of the mesh elements is adapted to the geometry, with some parts being 1 mm and others 5 mm, based on your specified parameters.

With the mesh generated, it's time to export it. Save it as a UNV file, which works well with OpenFOAM. Go to "File" and name it "tutorial2_unvfile." The other settings can remain as they are. Click "Save."

Now, in your case folder, you'll find the "tutorial2_unvfile." In the next episode, we'll explore how to convert this mesh for use in OpenFOAM.