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

[mesh manipulation] extrudeMesh from STL Surface

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2012, 15:32
Default extrudeMesh from STL Surface
  #1
TRT
New Member
 
Join Date: Sep 2010
Posts: 15
Rep Power: 13
TRT is on a distinguished road
EDIT: Solved below.

Hi everyone,

I'm having a problem when running extrudeMesh from an STL surface. I'm doing this because I'm having problems with running the tandem snappyHexMesh+extrudeMesh, but that is another whole story (that I may post about in the future). This is a test surface I wrote quickly in order to test:

./constant/triSurface/mesh.stl
Code:

solid mesh
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 1.0 1.0 0.0
      vertex 0.0 1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 1.0 -1.0 0.0
      vertex 0.0 -1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 -1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex -1.0 1.0 0.0
      vertex 0.0 1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex -1.0 -1.0 0.0
      vertex 0.0 -1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 -1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
endsolid mesh
This is my extrudeMeshDict file:

./system/extrudeMeshDict
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  1.6                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      extrudeProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

constructFrom       surface;

surface            "./constant/triSurface/mesh.stl";

flipNormals         false;

extrudeModel        linearNormal;

nLayers             1;

expansionRatio      1.0;

linearNormalCoeffs
{
    thickness       5.0;
}

mergeFaces          false;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
After running extrudeMesh I get a mesh with no points, no faces and no cells. The output shows:
Code:

[...]

Extruding surface with :
    points     : 9
    faces      : 8
    normals[0] : (0 0 1)

Mesh bounding box : (-1 -1 -5) (1 1 5)
        with span : (2 2 10)
Merge distance    : 0.0002

Collapsing edges < 0.0002 ...

Merging edge (3 12) since length 0 << 0.0002
Merging edge (1 10) since length 0 << 0.0002
Merging edge (2 11) since length 0 << 0.0002
Merging edge (5 14) since length 0 << 0.0002
Merging edge (7 16) since length 0 << 0.0002
Cell:1 uses faces:5(0 1 2 17 25) of which too many are marked for removal:
    0 1 2
Cell:3 uses faces:5(1 3 4 19 27) of which too many are marked for removal:
    1 3 4

[...]


Does anyone know why this is happening, how to avoid this, or how is this supposed to be done?

Thanks in advance.

//************************************************** ******

EDIT: I noticed that the problem was caused because OpenFOAM calculates the normal by applying the right-hand rule to the vertices, and not with the facet normal entry. I should have taken this into account. By sorting the vertices accordingly the mesh is generated OK.

The .stl file should read:

./constant/triSurface/mesh.stl
Code:

solid mesh
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 1.0 1.0 0.0
      vertex 0.0 1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 1.0 0.0 0.0
      vertex 0.0 1.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 1.0 -1.0 0.0
      vertex 1.0 0.0 0.0
      vertex 0.0 -1.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 -1.0 0.0
      vertex 1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex -1.0 1.0 0.0
      vertex -1.0 0.0 0.0
      vertex 0.0 1.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex -1.0 -1.0 0.0
      vertex 0.0 -1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
  facet normal 0.0 0.0 1.0
    outer loop
      vertex 0.0 0.0 0.0
      vertex 0.0 -1.0 0.0
      vertex -1.0 0.0 0.0
    endloop
  endfacet
endsolid mesh
__________________
Terrassa Rocket Team Blog: http://terrassarocketteam.blogspot.com/

Last edited by TRT; April 20, 2012 at 07:25. Reason: Solved
TRT is offline   Reply With Quote

Old   March 26, 2018, 07:15
Default
  #2
Member
 
Luís Tiago Ferreira Fernandes
Join Date: Mar 2018
Posts: 30
Rep Power: 4
ltiago94 is on a distinguished road
hello,

what do you mean by changing the vertices? When you draw the geometry and later save in stl format, you have to draw each vertice in the same order as you drew the base block mesh?

Thanks

Tiago
ltiago94 is offline   Reply With Quote

Reply

Tags
extrudemesh, merging, stl, surface

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] Surface triangulation using snappyHexMesh shaileshbg OpenFOAM Meshing & Mesh Conversion 4 October 17, 2019 04:42
[ICEM] cannot set boundary after split STL surface guohf ANSYS Meshing & Geometry 0 June 11, 2018 00:33
[Gmsh] Extrude stl surface for building a prismatic layer KateEisenhower OpenFOAM Meshing & Mesh Conversion 12 April 21, 2016 16:54
[snappyHexMesh] STL surface ignored -snappyhexmesh Ananthakrishnan OpenFOAM Meshing & Mesh Conversion 4 July 9, 2015 05:31
[snappyHexMesh] Experimentally obtained STL file for internal Flow SnappyHexMesh Irish09 OpenFOAM Meshing & Mesh Conversion 9 April 7, 2012 08:50


All times are GMT -4. The time now is 16:12.