Recently, i have been trying to generate o type mesh by salome, but fail, because I did not find any online information about O-Grid by salome. My first question is that can we use it to generate O-Grid, if we can, how do we do that? Any suggestions or comments are welcome!
following guidelines, find enclosed a small Python script which allows you to implement an O-grid in SALOME.
The main steps are the following:
- in SHAPER, create a partition as shown below.
- ensure that extra-edges are removed by running “Remove Extra Edges” feature in GEOM ( currently not implemented in SHAPER)
- Extrude the meshed partition.
SF246.py (7.8 KB)
Thank you so much, NabilG!
Thank you very much @NabilG !
First, let me ask you for some clarifications please. Once you’ve made the sketch you did faces and partitions. What are faces and partitions and why do we need them? (Especially partitions, since faces are more intuitive). Apart from that, when I extrude the mesh, I get only one cell along the extrusion direction, whereas you seem to have many cell in the extrusion direction. How did you do that?
Second, a couple of remarks for absolute newcomers like myself that can help to get started with Nabil’s python script.
- Nabil didn’t code the part in Python. He made the part and meshed it in the Salome’s GUI. Then, you can go to File → dump study. That will generate a python code.
- In order to use Nabil’s script, do the following. Open the script in any text editor. Copy everything till “### Create Export” to a new text file. Give the new text file .py extension. Again you need to copy the lines 1 through 142 and the last two lines 201 and 202 from the Nabil’s script to the new .py file. Then open Salome, activate the Shaper module. Go to Files->load script and load the newly created text file. You’ll see the sketch in Salome. Then left click once on the Part_1 in the tree. Then go to Features->export to GEOM. Then activate the Geometry module. Left click once on the Partition_1_1 in the tree. Then go to Repair->remove extra edges. Then activate the Mesh module. Left click once on the NoExtraEdges_1 in the tree. Go to Mesh->create mesh. A window will pop up. Choose the 1D tab. For the algorithm pick “wire discretization”. Then left click once on the button right to the right from the “Hypothesis” field. Choose “number of segments” and give it 9 segments. Then choose the 2D tab. Choose “Quandrangle: Mapping” for the algorithm. Left click once on the button immediately to the right from the “Hypothesis” field. Choose “quadrangle parameters”. Choose “quadrangle preference” in the popped up window. Then go to Mesh->compute. Then left click once on the Mesh_1 in the tree. Then go to Modifications->extrusion. A window will pop up. From here follow my directions exactly, otherwise it will be a pain to figure out how to extrude the mesh. You must see “Mesh_1” typed into the “Objects” field. Left click once on the button with a curved arrow in the “Edges” box. Once you’ve done you’ll see “Mesh_1” typed into the “Objects” field. Then left click once on the button with a curved arrow in the “Faces” box. Once you’ve done that, you’ll see the “Mesh_1” typed into the “Object” field. Then pick “Extrusion to distance”. Give “100” to the Z axis. Then check “Preview” box. If you like what you see, click “Apply and close”. That’s it.
- If you attempt to load the entire Nabil’s script, you’ll get an error. The error is associated with the way the Shaper and the Geometry modules are connected. When you import the study from Shaper to Geometry a file is created automatically. Nabil’s script contains the name of that file. But when you load it to Salome you don’t have that file, Salome can’t find it and gives you the error. Therefore you have to use only the first part of Nabil’s script. And then use the rest of the script to reconstruct the actions you have to take in GUI. That’s what I did.