CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Other] Boolean operation on OpenFOAM mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 1 Post By wc34071209
  • 1 Post By cutter
  • 1 Post By cutter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 13, 2014, 11:20
Default Boolean operation on OpenFOAM mesh
  #1
Senior Member
 
Yuehan
Join Date: Nov 2012
Posts: 142
Rep Power: 13
wc34071209 is on a distinguished road
Hi everybody,

I am wondering if there are some Boolean operations available for OpenFOAM's mesh.

For instance, I have two boxes, one is big and the other is small and inside the big one. I can blockMesh the big box to obtain the base mesh. Then if there is a subtract operation of mesh, I can just subtract the cells located inside the small box.

I know that snappyHexMesh can do it well, but I still think if Boolean operation is worth a try.

Thanks.
Makkus likes this.
wc34071209 is offline   Reply With Quote

Old   October 20, 2014, 09:28
Default
  #2
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
Hi,

I think this can be achieved using setSet (see http://openfoamwiki.net/index.php/SetSet). You basically have to define a cell set consisting of the cells in the small box and remove these cells from the big block mesh afterwards.

Make sure the cells of your blockMesh blocks are aligned with the surface of the smaller box!

Good luck!

Cutter
mizzou likes this.
cutter is offline   Reply With Quote

Old   October 23, 2014, 09:00
Default
  #3
Senior Member
 
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16
cutter is on a distinguished road
note: If your geometry is that simple you could have created the whole thing with blockMesh right from the beginning.
mizzou likes this.
cutter is offline   Reply With Quote

Old   September 11, 2019, 15:59
Default Use snappyHexMesh
  #4
Member
 
Jairo A. Gutiérrez S
Join Date: Nov 2014
Posts: 57
Rep Power: 11
jairoandres is on a distinguished road
You can do it using SnappyHexMesh is the small geometry (the one to be used as tool to remove from the large one) is complex.

I had written this tutorial for myself, but I gladly share it with you:

- Decide if it is a external or internal flow problem. A external flow problem is for example a “wind tunnel” simulation. An internal flow problem is the flow through a pipe. For both cases, a single or multiple STL files are using as a TOOL to snap the mesh from a blockMesh background mesh.

-Construct the STL file of the geometry. The best option I have tested is the newest geometry - CAD - software : OnShape. It is free to register and needs no installation. I did not get good results with freeCad. It is mandatory to Save the STL as ASCII STL. FreeCad does not work straightforward. Note: Click on the “import” and then right click on the part and hit “export”.

-Split the the STL faces (if required). This is required as OpenFOAM needs to recognize the faces as patches after the SnappyHexMesh procedure is carried. If this is not done, all the faces will be assigned to the same group (for example wall). There are two ways to accomplish this:
1) Use SimScale geometry editor to split the STL faces https://www.simscale.com/forum/t/how...ent-faces/8276. As the new STL file cannot be downloaded in a straightforward way, it is required to “mesh” the STL and then download the OpenFOAM case. The OpenFoam case will have the splitted STL inside the TriSurface folder. This option works well for me.
2) Use OnShape split geometry option: https://www.simscale.com/forum/t/how...ent-faces/8276. I have not tried this but was recommended by the SimScale staff.

-After placing the STL in the triSurface directory and set up the other data, run the geometry construction script or do: blockMesh → transformPoints -translate '(0 1 0)' ***or anything required to move the block grid in position for the STL***, surfaceFeatureExtract → snappyHexMesh. *** It would be useful to check the STL tools I include below
Modify the names of the boundaries in the boundary file to include the new named zones of the STL. Also, update the same information in the 0 - files from the fields (U and other fields). The names of the new boundary - patches must be included there.
jairoandres is offline   Reply With Quote

Old   September 12, 2019, 07:32
Default
  #5
Senior Member
 
Carlo_P
Join Date: May 2019
Location: Italy
Posts: 176
Rep Power: 7
Carlo_P is on a distinguished road
If you want, you can also build the internal geoemtry with Blockmesh
Run Blockmesh and then run foamToSurface. The mesh in BlockMesh geo.stl is now a STL Ascii file.


Change the blockMeshDict for create the external Block
Run BlockMesh
Run snappy.


P.s. for create different patches, you can run splittPatch -angle or a similar command and you have the surface splitted by the angle
Carlo_P is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Salome] Script for converting a mesh from Salome-Platform to OpenFOAM nsf OpenFOAM Meshing & Mesh Conversion 86 February 8, 2023 11:30
Getting Started with OpenFOAM wyldckat OpenFOAM 25 August 14, 2022 14:55
[Commercial meshers] About the Commercial and Closed Source Meshers discussed here wyldckat OpenFOAM Meshing & Mesh Conversion 3 July 22, 2020 23:09
[Other] vtk mesh or Abaqus mesh to OpenFOAM bigphil OpenFOAM Meshing & Mesh Conversion 27 November 23, 2015 18:31
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 06:33.