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

[Netgen] Import netgen mesh to OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 21, 2005, 12:26
Default Import netgen mesh to OpenFOAM
  #1
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi,

A mesh was generated using netgen and then saved as neutral format with all the BCs. However, it was in mili-meter. How can I re-scale it to meter (before applying netgenNeutralToFOAM or after)? Thanks!

Pei
hsieh is offline   Reply With Quote

Old   April 21, 2005, 14:30
Default Does the scalePoints utility d
  #2
New Member
 
Chris Greenshields
Join Date: Mar 2009
Posts: 28
Rep Power: 17
chris is on a distinguished road
Does the scalePoints utility do what you need? It works for any OpenFOAM mesh:
scalePoints <root> <case> <xscalingfactor> <yscalingfactor> <zscalingfactor>
chris is offline   Reply With Quote

Old   April 21, 2005, 14:38
Default Thanks Chris, This is exact
  #3
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Thanks Chris,

This is exactly what I am looking for.

By the way, is there any cell quality check utility available so that I can use it to check the mesh generated by netgen.

Pei
hsieh is offline   Reply With Quote

Old   April 21, 2005, 15:36
Default checkMesh does a lot of mesh c
  #4
New Member
 
Chris Greenshields
Join Date: Mar 2009
Posts: 28
Rep Power: 17
chris is on a distinguished road
checkMesh does a lot of mesh checks and reports problems if any exist.

In general, you can search for utilities in the $FOAM_UTILITIES directory. They are sorted into different directories corresponding to different ranges of functionality and have names that convey what they do, e.g. scalePoints scales points, checkMesh checks a mesh, etc.
chris is offline   Reply With Quote

Old   April 21, 2005, 16:48
Default Thanks again Chris! This is
  #5
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Thanks again Chris!

This is very helpful to me.

Pei
hsieh is offline   Reply With Quote

Old   May 6, 2005, 12:31
Default Hi, Is there a utility that
  #6
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi,

Is there a utility that can combine every two tet elements to one Hex element? If it exists, then, majority of the elements will be Hex elements. The question will then be, is this mesh better than the all tet mesh?

Any thoughts?

Pei
hsieh is offline   Reply With Quote

Old   May 6, 2005, 12:42
Default Hi Pei, Two tets don't make
  #7
New Member
 
Michael Prinkey
Join Date: Mar 2009
Posts: 3
Rep Power: 17
prinkey is on a distinguished road
Hi Pei,

Two tets don't make a hex. I don't think there is much to be gained in terms of accuracy or performance by gluing tets together. The really interesting scheme is to build polyhedral meshes based as the geometric dual of tet mesh. This reduces cells counts signficantly and leads to better convergence.

This web site has a 2D version of this as a demo:

http://www.cs.cornell.edu/Info/Peopl.../Delaunay.html

The Delaunay triangularization is equivalent to the tet mesh in 3D. The Voronoi diagram is equivalent to the polyhedra in 3D. It is an interesting technique. It may become very common in mesh generation.
prinkey is offline   Reply With Quote

Old   May 6, 2005, 13:06
Default Hi, Mike, Thanks! (I wasn'
  #8
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi, Mike,

Thanks! (I wasn't thinking when I posted - about the two tets make a Hex)

This is a very interesting stuff.

Pei
hsieh is offline   Reply With Quote

Old   May 6, 2005, 18:17
Default Hi Pei, about the glueing t
  #9
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Pei,

about the glueing tets together into 'better' elements: I am looking at a very interesting paper "Generating a mixed Mesh of hexahedra, pentahedra and tetrahedra from an underlying tetrahedral mesh" by Sia Meshkat and Dafna Talmor. You should be able to find & download it from somewhere. It is an interesting method to heuristically combine tets into hexahedra as much as possible. It seems to be implemented in the PolyFEM mesher.
mattijs is offline   Reply With Quote

Old   May 10, 2005, 10:39
Default Hi, I posted the same quest
  #10
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 317
Rep Power: 18
hsieh is on a distinguished road
Hi,

I posted the same question on the netgen forum.

I exported a CAD (generated using SolidWorks) to step format and read it into netgen without any problem. I then meshed the model. There is one spot that had very dense elements. Is it possible to repair the step file in netgen? Or is it possible to set minimum element size in netgen?

I also tried to export the same model into iges and stl format. However, I got nothing when importing the stl file and lost one surface when importing the iges file.

Any suggestion will be highly appreciated.

Pei
hsieh is offline   Reply With Quote

Old   November 24, 2005, 05:06
Default I post a short guide at the Op
  #11
New Member
 
G Gruber
Join Date: Mar 2009
Location: Bavaria, Germany
Posts: 22
Rep Power: 17
gruber2 is on a distinguished road
I post a short guide at the OpenFoam Wiki for importing a Netgen-Mesh.
http://openfoamwiki.net/index.php/NetgenNeutralTo Foam
gruber2 is offline   Reply With Quote

Old   November 24, 2005, 05:11
Default sorry, here's the right Link:
  #12
New Member
 
G Gruber
Join Date: Mar 2009
Location: Bavaria, Germany
Posts: 22
Rep Power: 17
gruber2 is on a distinguished road
sorry, here's the right Link:
http://openfoamwiki.net/index.php/NetgenNeutralTo Foam
gruber2 is offline   Reply With Quote

Old   December 5, 2005, 17:40
Default I have imported several meshes
  #13
New Member
 
Lars Edvarsen
Join Date: Mar 2009
Posts: 14
Rep Power: 17
edvardsenpriv is on a distinguished road
I have imported several meshes with four-node tets from Netgen. However, even though it is possible to mesh hex elements (in addition to second order tets and hex, and surface elements) in Netgen, it seems not possible to import these by the netgenNeutralToFOAM utility. Am I doing it wrong, or is this simply not supported?

Lars
edvardsenpriv is offline   Reply With Quote

Old   December 6, 2005, 05:33
Default Not yet supported. Didn't know
  #14
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Not yet supported. Didn't know netgen could do hexes. If you send me small (< 10 cells) case with hexes I'll have a look.

- second order tets/hexes and surface elements are not supported.
mattijs is offline   Reply With Quote

Old   December 6, 2005, 06:43
Default Thanks, I'l send you some fil
  #15
New Member
 
Lars Edvarsen
Join Date: Mar 2009
Posts: 14
Rep Power: 17
edvardsenpriv is on a distinguished road
Thanks,
I'l send you some files as soon as I get to a proper computer with Linux and OpenFOAM.

I find the hex-meshing in Netgen particular nice if you have square/rectangular objects and especially if are analysing slender and edged objects in stress analysis. -Usually you get some tets as well when you use this option. I don't know if this makes converting more difficult.

It would also be nice if it was possible to import 2D surface mesh from Netgen as well, and then use extrudeMesh to create 2D meshes. Could that be possible?
edvardsenpriv is offline   Reply With Quote

Old   December 6, 2005, 14:13
Default extrudeMesh is quite new so no
  #16
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
extrudeMesh is quite new so not yet very polished.

It can extrude a surface where the surface
A] either is a patch from another case
B] or is read in from a file

If you run it in A] mode (specify -sourceRoot, -sourceCase, -sourcePath) it will write a 'faceMesh' file (which is the type that can be read in mode B])

This faceMesh format is easily writeable/parseable so you could write a converter from another surface format (e.g. .stl written by netgen)

See mesh/conversion/extrudeMesh/
mattijs is offline   Reply With Quote

Old   December 8, 2005, 05:14
Default It seems netgen cannot produce
  #17
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
It seems netgen cannot produce hexes, only tets (volume elements)

It can produce a quad surface mesh though by merging triangles. (but then what do you do with that? You could possibly write some tools to export it and 'extrudeMesh' a 2D geometry)
mattijs is offline   Reply With Quote

Old   February 23, 2006, 05:31
Default Hallo together, after many
  #18
mwendel
Guest
 
Posts: n/a
Hallo together,

after many tries I solved this problem.

I did have bad geometry data. Now I fixed this problem.

Now I'm only wondering about the error message in netgen:

Refinement :: ProjectToSurface ERROR: no geometry set

Does this message has any importance for my calculation?

The tricky thing is the calculation is running in OF with the solver simpleFoam but
anytime no mather how small delta t is the Courant number is growing extremely above 1!

What could be the reason?

bye,
Michael
  Reply With Quote

Old   February 23, 2006, 06:23
Default After netgenNeutralToFoam alwa
  #19
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
After netgenNeutralToFoam always run checkMesh on your case. It will tell you if there are any problems (Errors) with the mesh.

To get experience with meshing you could e.g. try recreating a simple 3D testcase for simpleFoam. E.g.

- make a 3D version using blockMesh of one of the simpleFoam tutorials and make sure it runs in simpleFoam.

- extract the surface of the mesh with surfaceMeshTriangulate as e.g. an .stl file

- try to tetgen mesh the interior of that surface.
mattijs is offline   Reply With Quote

Old   February 23, 2006, 07:55
Default Thank you very much for your a
  #20
mwendel
Guest
 
Posts: n/a
Thank you very much for your answer! I will try to get more experience.

If you have some time left could you please have a look at this?
I already tried checkMesh for my calculation and the result is this one:

-----------------------------------------
openfoam@linux:~/OpenFOAM/openfoam-1.2/run/tutorials/simpleFoam> checkMesh . strom1 &
[2] 8230
[1] Done netgenNeutralToFoam /home/openfoam/OpenFOAM/openfoam-1.2/run/tutorials/simpleFoam strom1 /home/d
ata/strom1
openfoam@linux:~/OpenFOAM/openfoam-1.2/run/tutorials/simpleFoam> /*-----------------------------------------------------------
----------------*\
| ========= | |
| \ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \ / O peration | Version: 1.2 |
| \ / A nd | Web: http://www.openfoam.org |
| \/ M anipulation | |
\*---------------------------------------------------------------------------*/

Exec : checkMesh . strom1
Date : Feb 23 2006
Time : 11:13:48
Host : linux
PID : 8230
Root : /home/openfoam/OpenFOAM/openfoam-1.2/run/tutorials/simpleFoam
Case : strom1
Nprocs : 1
Create time

Create polyMesh for time = constant

Time = constant
Boundary definition OK.

Number of points: 17041
edges: 105113
faces: 170083
internal faces: 157969
cells: 82013
boundary patches: 39
point zones: 0
face zones: 0
cell zones: 0

Checking topology and geometry ...
Point usage check OK.

Upper triangular ordering OK.

Topological cell zip-up check OK.

Face vertices OK.

Face-face connectivity OK.


Basic topo ok ...

Checking patch topology for multiply connected surfaces ...

Patch Faces Points Surface
patch0 0 0 ok (empty)
patch1 1736 936 ok (not multiply connected)
patch2 2949 1639 ok (not multiply connected)
patch3 8 10 ok (not multiply connected)
patch4 6 8 ok (not multiply connected)
patch5 2050 1095 ok (not multiply connected)
patch6 692 409 ok (not multiply connected)
patch7 325 191 ok (not multiply connected)
patch8 72 51 ok (not multiply connected)
patch9 425 292 ok (not multiply connected)
patch10 101 73 ok (not multiply connected)
patch11 463 317 ok (not multiply connected)
patch12 99 89 ok (not multiply connected)
patch13 26 28 ok (not multiply connected)
patch14 11 13 ok (not multiply connected)
patch15 26 28 ok (not multiply connected)
patch16 31 31 ok (not multiply connected)
patch17 35 34 ok (not multiply connected)
patch18 1370 772 ok (not multiply connected)
patch19 13 15 ok (not multiply connected)
patch20 107 80 ok (not multiply connected)
patch21 101 75 ok (not multiply connected)
patch22 104 76 ok (not multiply connected)
patch23 63 58 ok (not multiply connected)
patch24 106 78 ok (not multiply connected)
patch25 47 49 ok (not multiply connected)
patch26 154 114 ok (not multiply connected)
patch27 52 53 ok (not multiply connected)
patch28 94 79 ok (not multiply connected)
patch29 74 66 ok (not multiply connected)
patch30 47 49 ok (not multiply connected)
patch31 182 118 ok (not multiply connected)
patch32 57 59 ok (not multiply connected)
patch33 165 115 ok (not multiply connected)
patch34 18 19 ok (not multiply connected)
patch35 28 22 ok (not multiply connected)
patch36 94 67 ok (not multiply connected)
patch37 157 99 ok (not multiply connected)
patch38 26 27 ok (not multiply connected)


Patch topo ok ...
Topology check done.

Domain bounding box: min = (361.135 -727.72 646.119) max = (1400 -500 1143.09) meters.

Checking geometry...
Boundary openness in x-direction = 3.47468e-11
Boundary openness in y-direction = 7.23006e-10
Boundary openness in z-direction = -5.53448e-10
Boundary closed (OK).
Max cell openness = 1.13687e-13 Max aspect ratio = 17.6561. All cells OK.

Minumum face area = 0.000589342. Maximum face area = 707.438. Face area magnitudes OK.

Min volume = 2.99897e-05. Max volume = 6015.89. Total volume = 5.62317e+07. Cell volumes OK.

Severe non-orthogonality for face 336 between cells 92 and 94: Angle = 79.2671 deg.
Severe non-orthogonality for face 1350 between cells 369 and 2054: Angle = 70.0797 deg.
Severe non-orthogonality for face 1534 between cells 419 and 48874: Angle = 84.3621 deg.
Severe non-orthogonality for face 1776 between cells 486 and 8357: Angle = 70.7913 deg.
Severe non-orthogonality for face 2161 between cells 591 and 34010: Angle = 78.4641 deg.
Severe non-orthogonality for face 3697 between cells 1034 and 18764: Angle = 88.6111 deg.
Severe non-orthogonality for face 3820 between cells 1066 and 51325: Angle = 83.8202 deg.
Severe non-orthogonality for face 16286 between cells 4569 and 65747: Angle = 81.9993 deg.
Severe non-orthogonality for face 22152 between cells 6267 and 6301: Angle = 82.9692 deg.
Severe non-orthogonality for face 26534 between cells 7543 and 52382: Angle = 88.2805 deg.
Severe non-orthogonality for face 30325 between cells 8654 and 55600: Angle = 81.6248 deg.
Severe non-orthogonality for face 31502 between cells 9006 and 58413: Angle = 74.8721 deg.
Severe non-orthogonality for face 33551 between cells 9633 and 25026: Angle = 80.6119 deg.
Severe non-orthogonality for face 35785 between cells 10327 and 33475: Angle = 70.3908 deg.
Severe non-orthogonality for face 35840 between cells 10345 and 55671: Angle = 82.2179 deg.
Severe non-orthogonality for face 38964 between cells 11334 and 68902: Angle = 70.2847 deg.
Severe non-orthogonality for face 46241 between cells 13627 and 16615: Angle = 74.8655 deg.
Severe non-orthogonality for face 47244 between cells 13968 and 39864: Angle = 70.2747 deg.
Severe non-orthogonality for face 55125 between cells 16638 and 16647: Angle = 75.7119 deg.
Severe non-orthogonality for face 56400 between cells 17087 and 17099: Angle = 80.0657 deg.
Severe non-orthogonality for face 56883 between cells 17250 and 35566: Angle = 75.4201 deg.
Severe non-orthogonality for face 57419 between cells 17439 and 70925: Angle = 73.6532 deg.
Severe non-orthogonality for face 62206 between cells 19109 and 19153: Angle = 80.5995 deg.
Severe non-orthogonality for face 62207 between cells 19109 and 19157: Angle = 70.0506 deg.
Severe non-orthogonality for face 63973 between cells 19729 and 73877: Angle = 71.7097 deg.
Severe non-orthogonality for face 67643 between cells 21025 and 35566: Angle = 71.7168 deg.
Severe non-orthogonality for face 69348 between cells 21620 and 38711: Angle = 76.9285 deg.
Severe non-orthogonality for face 72369 between cells 22695 and 61843: Angle = 75.22 deg.
Severe non-orthogonality for face 75913 between cells 23997 and 30500: Angle = 72.5625 deg.
Severe non-orthogonality for face 78650 between cells 25026 and 62062: Angle = 72.1217 deg.
Severe non-orthogonality for face 86052 between cells 27921 and 37200: Angle = 79.3182 deg.
Severe non-orthogonality for face 86397 between cells 28068 and 28114: Angle = 83.0879 deg.
Severe non-orthogonality for face 88478 between cells 28924 and 80883: Angle = 70.0968 deg.
Severe non-orthogonality for face 91084 between cells 30038 and 55621: Angle = 79.9479 deg.
Severe non-orthogonality for face 91311 between cells 30143 and 31352: Angle = 79.4695 deg.
Severe non-orthogonality for face 97162 between cells 32650 and 73764: Angle = 74.8266 deg.
Severe non-orthogonality for face 100261 between cells 34010 and 66922: Angle = 83.0119 deg.
Severe non-orthogonality for face 113366 between cells 40232 and 52027: Angle = 77.4111 deg.
Severe non-orthogonality for face 113368 between cells 40232 and 74039: Angle = 74.1887 deg.
Severe non-orthogonality for face 116547 between cells 41832 and 51481: Angle = 85.3043 deg.
Severe non-orthogonality for face 119612 between cells 43454 and 72046: Angle = 72.4974 deg.
Severe non-orthogonality for face 120281 between cells 43832 and 77761: Angle = 76.539 deg.
Severe non-orthogonality for face 121238 between cells 44372 and 47189: Angle = 75.9111 deg.
Severe non-orthogonality for face 126215 between cells 47179 and 76186: Angle = 79.1131 deg.
Severe non-orthogonality for face 129370 between cells 49202 and 55404: Angle = 79.0275 deg.
Severe non-orthogonality for face 133036 between cells 51626 and 51944: Angle = 77.0457 deg.
Severe non-orthogonality for face 133791 between cells 52183 and 65844: Angle = 80.9647 deg.
Severe non-orthogonality for face 133907 between cells 52268 and 52270: Angle = 86.0048 deg.
Severe non-orthogonality for face 133911 between cells 52270 and 56575: Angle = 85.5242 deg.
Severe non-orthogonality for face 135818 between cells 53619 and 54818: Angle = 76.248 deg.
Severe non-orthogonality for face 135943 between cells 53698 and 53743: Angle = 79.1755 deg.
Severe non-orthogonality for face 137499 between cells 54815 and 54816: Angle = 70.1582 deg.
Severe non-orthogonality for face 138603 between cells 55668 and 78998: Angle = 71.7581 deg.
Severe non-orthogonality for face 138609 between cells 55671 and 60650: Angle = 77.1783 deg.
Severe non-orthogonality for face 144005 between cells 60088 and 62062: Angle = 79.5463 deg.
Severe non-orthogonality for face 145464 between cells 61506 and 61512: Angle = 74.4984 deg.
Severe non-orthogonality for face 145465 between cells 61506 and 61522: Angle = 72.2424 deg.
Severe non-orthogonality for face 149754 between cells 66023 and 70925: Angle = 73.1265 deg.
Severe non-orthogonality for face 154234 between cells 71949 and 74554: Angle = 81.0243 deg.
Severe non-orthogonality for face 155131 between cells 73578 and 73877: Angle = 73.8154 deg.
Severe non-orthogonality for face 155570 between cells 74554 and 80883: Angle = 80.6423 deg.
Number of non-orthogonality errors: 0. Number of severely non-orthogonal faces: 61.
Mesh non-orthogonality Max: 88.6111 average: 16.499
Non-orthogonality check OK.

Writing 61 non-orthogonal faces to set nonOrthoFaces

Face pyramids OK.

Severe skewness for boundary face 165751 skewness = 2.10123
Severe skewness for boundary face 166452 skewness = 14.8409
Severe skewness for boundary face 166455 skewness = 17.9423
Severe skewness for boundary face 168615 skewness = 10.6255
Severe skewness for boundary face 168620 skewness = 2.72177
Severe skewness for boundary face 168654 skewness = 8.97226
Severe skewness for boundary face 168680 skewness = 2.70097
Severe skewness for boundary face 168713 skewness = 9.70816
--> FOAM Warning :
From function primitiveMesh::checkFaceSkewness(const bool report, labelHashSet* setPtr) const
in file meshes/primitiveMesh/primitiveMeshCheck.C at line 838
Large face skewness detected. Max skewness = 1794.23 percent.
This may impair the quality of the result.
8 highly skew faces detected.
Writing 8 skew faces to set skewFaces

Minumum edge length = 0.00927362. Maximum edge length = 46.6226.

All angles in faces are convex or less than 10 degrees concave.

Geometry check done.

Number of cells by type:
hexahedra: 0
prisms: 0
wedges: 0
pyramids: 0
tet wedges: 0
tetrahedra: 82013
polyhedra: 0
Number of regions: 1 (OK).
Failed 1 mesh checks.


Time = 0
No mesh.


End
---------------------------------------

1) In my view checkMesh detected some skewFaces which aren't so good. Is that right? Is this the failed 1 mesh checks?

2) When I'm running the calcution for 0.5 seconds, velocity 1 m/s there's a singularity error in Ux, Uy and Uz. Does it depend on delta t? My current one is 0.005s.

3) For the time 0.2 seconds everything is fine, but after push 'Accept'-button in paraFoam the program shut down and the error message is:

Cannot find face 170058 in any of the patches.
It seems your patches are not consistent with the mesh : internalFaces: 157969 total number of faces: 170083

From function label polyBoundaryMesh :: whichPatch (const label faceIndex) const
in file meshes/polymeshes/polyBoundaryMesh/polyBoundaryMesh.C at line 415.
FOAM aborting

I hope I haven`t written too much and you can understand all my questions.
bye michael
  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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
OpenFOAM v3.0+ ?? SBusch OpenFOAM 22 December 26, 2016 15:24
[Salome] import mesh from salome to openfoam dome90 OpenFOAM Meshing & Mesh Conversion 2 April 21, 2016 00:58
Suggestion for a new sub-forum at OpenFOAM's Forum wyldckat Site Help, Feedback & Discussions 20 October 28, 2014 10:04
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


All times are GMT -4. The time now is 19:48.