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

[snappyHexMesh] Convert a 3D mesh into a 2D mesh

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 3, 2020, 12:27
Default Convert a 3D mesh into a 2D mesh
  #1
New Member
 
Join Date: Oct 2020
Posts: 2
Rep Power: 0
AKRES is on a distinguished road
Hello everyone


I have to solve a 2D case of a Numerical Wave Flume. However, I had to build the mesh in 3D using SnappyHexMeh due to some refinement around the free surface and above an obstacle in the center of the channel.


To be able to use Snappy I set as "patch" the regions that should have been "empty", ie the "front" and "back" regions. In order to transform the case from 3D to 2D I used "extrudeMesh", in order to have only one cell in the direction transverse to the fluid motion.


I then manually modified the "boundary" file in the "polymesh" folder, bringing the "front" and "back" faces that were initially set as "patch" to the "empty" condition.

I have already set, in the "0" folder, all conditions on the "front" and "back" regions as "empty" in order to simulate the 2D case.

The setFields command runs successfully, but the "interFoam" solver crashes immediately. Do any further changes need to be made to other files to properly start the case in 2D from a 3D mesh made with SnappyHexMesh?


Thank you all
AKRES is offline   Reply With Quote

Old   October 3, 2020, 19:23
Default
  #2
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Your procedure seems correct. We usually follow these 3 steps: 3D snappyHexMesh, 2D extrusion, and rewrite boundary conditions. What's the error message if there is any? As you are using interFoam, this is multi-phase solver and needs to be more careful on setting up boundary and initial condition. Can you first test your mesh using simpleFoam, which at least remove one uncertainty, i.e. multi-phase.
Marpole is offline   Reply With Quote

Old   October 4, 2020, 06:14
Default
  #3
New Member
 
Join Date: Oct 2020
Posts: 2
Rep Power: 0
AKRES is on a distinguished road
Dear Marpole,



Thank you for your time.



Unfortunately the "Foam Fatal Error" does not provide any explanation regarding the interruption of interFoam execution.
Because of this, I don't understand what mistakes I'm making.


Do you have any idea why no explanation is given for the error?


I will certainly follow your advice using simpleFoam.



Thanks again for your time.
Attached Files
File Type: txt interFoam.txt (3.5 KB, 13 views)
AKRES is offline   Reply With Quote

Old   October 4, 2020, 10:59
Default
  #4
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
I see the model has a few more features: dynamic mesh and wave. The failure could be caused by many factors. Meshing is one of them and may not be the cause. To isolate the problem, can you run one feature at one time, i.e. deactivate other features and focus on interfoam and mesh? Also you may want to check setField result by using paraFoam after command setField and before command interFoam?
Marpole is offline   Reply With Quote

Old   October 7, 2020, 04:43
Default
  #5
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
hello,
sorry to bother but seeing that you are working in something similar, i thought about giving a chance and ask,
I want to do a 2D case, from a 3D mesh too so,
1.I create the different boundaries in salome in the 3D model
2.I use snappyHex (with the creation of the background mesh with blockMesh)
-----up to here is what i know how to do correctly-----
3. I should use extrudeMesh? from the doc i could not find a lot of info http://cpp.openfoam.org/v8/extrudeMesh_8C.html
4. add the new patches? as the patch that is going to keep extrudedMesh is one of the empty faces, the patches then are added by topoSet? or you use another tool for this?
thanks
otaolafr is offline   Reply With Quote

Old   October 7, 2020, 13:36
Default
  #6
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Yes, after finishing snappyHexMesh, you should use extrudeMesh.



In order to use extrudeMesh, you'll need to write your own extrudeMeshDict and place it in folder system. Some example of extrudeMeshDict can be found in https://github.com/OpenFOAM/OpenFOAM...xtrudeMeshDict .



In the extrudeMeshDict, you will define a new name for the new patch, which you will change the patch type to "empty" for 2D model. You don't need to use topoSet for this change.
Marpole is offline   Reply With Quote

Old   December 4, 2020, 04:53
Default
  #7
New Member
 
Konrad Matena
Join Date: Dec 2020
Posts: 2
Rep Power: 0
Konrad95 is on a distinguished road
Hello Marpole,


how do I define a new name for the new patch and change the patch type to "empty" in the ExtrudeMeshDict?



Thank you very much in advance.
Konrad95 is offline   Reply With Quote

Old   December 4, 2020, 11:24
Default
  #8
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Hi Konrad,

If the model is not too complex, you can simply modify the patch type in file boundary in folder constant/polymesh. Hope this is a quick fix.
__________________
Charles L.
Marpole 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
[snappyHexMesh] Add Mesh Layers doesnt work on the whole surface Kryo OpenFOAM Meshing & Mesh Conversion 13 February 17, 2022 07:34
GeometricField -> mesh() Function Tobi OpenFOAM Programming & Development 10 November 19, 2020 11:33
Mesh motion with Translation & Rotation Doginal CFX 2 January 12, 2014 06:21
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03


All times are GMT -4. The time now is 08:53.