|
[Sponsors] |
[snappyHexMesh] Convert a 3D mesh into a 2D mesh |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 3, 2020, 12:27 |
Convert a 3D mesh into a 2D mesh
|
#1 |
New Member
Join Date: Oct 2020
Posts: 2
Rep Power: 0 |
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 |
|
October 3, 2020, 19:23 |
|
#2 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9 |
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.
|
|
October 4, 2020, 06:14 |
|
#3 |
New Member
Join Date: Oct 2020
Posts: 2
Rep Power: 0 |
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. |
|
October 4, 2020, 10:59 |
|
#4 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9 |
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?
|
|
October 7, 2020, 04:43 |
|
#5 |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6 |
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 |
|
October 7, 2020, 13:36 |
|
#6 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9 |
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. |
|
December 4, 2020, 04:53 |
|
#7 |
New Member
Konrad Matena
Join Date: Dec 2020
Posts: 2
Rep Power: 0 |
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. |
|
December 4, 2020, 11:24 |
|
#8 |
Senior Member
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9 |
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. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
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 |