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

extrudeMesh from STL Surface

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

Reply
 
LinkBack Thread Tools Display Modes
Old   April 19, 2012, 15:32
Default [SOLVED] extrudeMesh from STL Surface
  #1
TRT
New Member
 
Join Date: Sep 2010
Posts: 15
Rep Power: 7
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

Reply

Tags
extrudemesh, merging, stl, surface

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make boundary patches in STL file nzy102 OpenFOAM Mesh Utilities 3 January 8, 2015 08:56
gmsh and boundary layers kanuk Open Source Meshers: Gmsh, Netgen, CGNS, ... 9 May 9, 2011 07:21
STL units and Surface elevation plot MAB FLOW-3D 11 May 9, 2010 15:55
Recover surface from surface mesh in IcemCFD Jerry Tanner CFX 0 August 20, 2008 12:48
free convection heat transfer from a heated horizontal surface through a liquid to a thin cooled fin Kaushik FLUENT 1 May 8, 2000 06:47


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