CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Pre-Processing

reduce 3D to 2D mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2013, 04:21
Default reduce 3D to 2D mesh
  #1
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Hi everybody,

I have a rather strange problem, namely, I have a 3D geometry but I want to perform a 2D simulation based on it. It would be a start if I could use the setSet or a similar utility to extract only my boundary faces (at one side) and use that as my 2D mesh, but I really don't know how to start - has anyone done this before? Or is there another way to get a 2D geometry?

Thanks a lot,
Natalie
Natalie2210 is offline   Reply With Quote

Old   April 22, 2013, 05:48
Default
  #2
Member
 
Andreas Wendy
Join Date: Aug 2012
Posts: 73
Rep Power: 13
A.Wendy is on a distinguished road
how do you create your mesh before. in snappyhexmesh you can for example also create a 2d mesh when the front and back faces are empty and nly 1 cell in the depth.
A.Wendy is offline   Reply With Quote

Old   April 22, 2013, 06:27
Default
  #3
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Hi!

I export my mesh from Altair Hypermesh. It provides the possibility to export geometry in an OF format, but, as far as I know, for this option I need a tetrahedral volume mesh.

SnappyHexMesh exports also a 2D geometry to every 3D geometry it creates? Maybe I should write to the Hypermesh support and ask whether this option is also available in Hypermesh.

Kind regards,
Natalie
Natalie2210 is offline   Reply With Quote

Old   April 22, 2013, 07:06
Default
  #4
Member
 
Andreas Wendy
Join Date: Aug 2012
Posts: 73
Rep Power: 13
A.Wendy is on a distinguished road
if you want to run a 2d simulation and want you use snappyhexmesh for meshing. you only have to be sure that your patches are defined the right way. so you can run snappy hexmesh and get no refinement in the third dimensiobns. what does your mesh in your third dimension looks like? if you only have 1 element you should run a 2d simulation by setting the front and back face to "empty"
A.Wendy is offline   Reply With Quote

Old   April 22, 2013, 15:01
Default
  #5
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Natalie,

Potentially, you could use the utility "extrudeMesh", which are located in

Code:
<OpenFOAM>/applications/utilities/mesh/generation/extrudeMesh
and the description reads:

Code:
    Extrude mesh from existing patch (by default outwards facing normals;
    optional flips faces) or from patch read from file.

    Note: Merges close points so be careful.

    Type of extrusion prescribed by run-time selectable model.
Best regards

Niels
ngj is offline   Reply With Quote

Old   April 23, 2013, 04:16
Default
  #6
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Actually, I have only 1 element in the third direction and I've tried just setting the front and back face to empty.. seems I got it wrong somehow, I will have a look at the tutorials.

@A Wendy:
Can I import my 3D geometry into snappyHexMesh and get somehow a 2D mesh by extracting patches? Or what do you mean?

Thanks a lot,
Natalie
Natalie2210 is offline   Reply With Quote

Old   April 23, 2013, 06:08
Default
  #7
Member
 
Andreas Wendy
Join Date: Aug 2012
Posts: 73
Rep Power: 13
A.Wendy is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
Actually, I have only 1 element in the third direction and I've tried just setting the front and back face to empty.. seems I got it wrong somehow, I will have a look at the tutorials.

@A Wendy:
Can I import my 3D geometry into snappyHexMesh and get somehow a 2D mesh by extracting patches? Or what do you mean?

Thanks a lot,
Natalie
hi sorry i mixed something. if you want to create a 2d mesh with snappyhex mesh you have a 3d mexh first and can use extrudeMesh to create a mesh with 1 element in the depth. but if you do not set the front and back in the blockMeshdict snappyhexmesh will not create a clean front face.
you can have a look a at this example I created
http://ubuntuone.com/722FQ4i7HA8A6KVDsVbYs4

best wishes

Andy
A.Wendy is offline   Reply With Quote

Old   May 2, 2013, 02:37
Default
  #8
Member
 
Join Date: Feb 2013
Posts: 30
Rep Power: 13
Natalie2210 is on a distinguished road
Hi!

I'm afraid my browser does not find the homepage you posted a link to .. could you copy the example somehow into this forum?

Thanks,
Natalie
Natalie2210 is offline   Reply With Quote

Old   May 2, 2013, 03:37
Default
  #9
Member
 
Andreas Wendy
Join Date: Aug 2012
Posts: 73
Rep Power: 13
A.Wendy is on a distinguished road
Quote:
Originally Posted by Natalie2210 View Post
Hi!

I'm afraid my browser does not find the homepage you posted a link to .. could you copy the example somehow into this forum?

Thanks,
Natalie
hi,

i cleaned up my webspace. here is the new link

http://ubuntuone.com/3kPBj7ob4yfD8bcHMzZyFK


Andy
A.Wendy is offline   Reply With Quote

Old   October 20, 2020, 09:53
Default
  #10
New Member
 
aglios 900
Join Date: Oct 2020
Posts: 1
Rep Power: 0
aglios900 is on a distinguished road
Quote:
Originally Posted by A.Wendy View Post
hi,

i cleaned up my webspace. here is the new link

http://ubuntuone.com/3kPBj7ob4yfD8bcHMzZyFK


Andy
Hi,
my browser does not find the link you posted .. could you repost it please?

aglios
aglios900 is offline   Reply With Quote

Old   December 11, 2020, 12:25
Default Mesh quality issues after using extrudeMesh
  #11
New Member
 
Benjamin Norris
Join Date: Oct 2020
Location: California
Posts: 17
Rep Power: 5
bknorris is on a distinguished road
Hi everyone,

I am having some difficulties with the extrudeMesh utility and was wondering if anyone could give me some assistance.

I have generated a 3D mesh around an STL file with snappyHexMesh. After meshing completes, I run checkMesh and the utility reports "Mesh OK". I then run extrudeMesh and createPatch to generate a 2D mesh from one of the 3D mesh walls. When I run checkMesh on this result, I get several skewFace errors.

I gather from reading other forum posts that extrudeMesh might combine nearby points, thereby creating very thin cells (particularly near the STL surface). I have tried using the mergeTol = 0 setting in the extrudeMeshDict, to no avail. I have also tried setting the writeFormat in controlDict to "binary" as recommended in other forum posts, but this has not helped my specific case either.

I have attached the relevant dict files here, including the checkMesh logs for the 3D and 2D cases. Any help resolving this issue would be greatly appreciated.

Thanks,

Ben
Attached Files
File Type: zip MKK_Meshing_Issues.zip (9.5 KB, 6 views)
bknorris is offline   Reply With Quote

Old   December 15, 2020, 12:15
Default Solved: Mesh quality issues after using extrudeMesh
  #12
New Member
 
Benjamin Norris
Join Date: Oct 2020
Location: California
Posts: 17
Rep Power: 5
bknorris is on a distinguished road
Hi everyone,

I thought I would post an update to my last post about extrudeMesh creating mesh quality issues. I have been playing around with some different blockMesh and snappyHexMesh settings, and seem to have stumbled on something that works.

I had set up my blockMeshDict to have 0.25 m^3 cells initially. The mesh was 68 m x 0.25 m x 4 m, e.g.,

Code:
scale 1;

vertices
(
    ( 19 23 -3 ) // 0
    ( 87 23 -3 ) // 1
    ( 87 23.25 -3 ) // 2
    ( 19 23.25 -3 ) // 3
    ( 19 23 1 ) // 4
    ( 87 23 1 ) // 5
    ( 87 23.25 1 ) // 6
    ( 19 23.25 1 ) // 7

);

blocks
(
    hex (0 1 2 3 4 5 6 7) (272 1 16) simpleGrading (1 1 1)
);
When I ran snappyHexMesh to add my STL surface and refine the grid to Level 3, checkMesh reported no errors. But, as I said before, running this 3D grid through extrudeMesh created some skewfaces that were causing my multiphase simulation to crash.

The solution for me was to simply increase the number of cells in x-coordinate of the blockMeshDict by a small amount, e.g.,

Code:
hex (0 1 2 3 4 5 6 7) (280 1 16) simpleGrading (1 1 1)
and now both snappy and extrude report no checkMesh errors. I believe this behavior arises from extrudeMesh, as it does some kind of spatial averaging of nearby cells near boundaries like my STL surface. Small cells get distorted, causing skewface or orthogonality issues.

Hopefully this will help anyone who is having similar issues. I did not find that increasing the writePrecision or changing the writeFormat from ascii to binary, helped at all in my case.
bknorris is offline   Reply With Quote

Reply


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 06:09
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
[Gmsh] 2D Mesh Generation Tutorial for GMSH aeroslacker OpenFOAM Meshing & Mesh Conversion 12 January 19, 2012 03:52
basic of mesh refinement arya CFX 4 June 19, 2007 12:21


All times are GMT -4. The time now is 13:10.