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

[CAD formats] Alternative Mesh Generator from igs or stp format

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

Like Tree6Likes
  • 1 Post By wyldckat
  • 2 Post By philippose
  • 1 Post By philippose
  • 2 Post By philippose

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2014, 14:17
Default Alternative Mesh Generator from igs or stp format
  #1
Member
 
Sergey
Join Date: Nov 2013
Posts: 87
Rep Power: 12
skuznet is on a distinguished road
Hello!

Can anyone suggest me an alternative mesh generator capable to generate good quality mesh with boundary layers from igs or stp geometry so that it can be easily translated to OpenFOAM format?

Thank you!
skuznet is offline   Reply With Quote

Old   June 8, 2014, 09:21
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,974
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings Sergey,

The only open source mesh generator I'm aware of that can handle IGES and STEP is SALOME. As for how good/bad it might be, I have no idea, because I've never used it myself.

Best regards,
Bruno
skuznet likes this.
wyldckat is offline   Reply With Quote

Old   June 10, 2014, 16:48
Default
  #3
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hi,
A Good Evening!

There is yet another solution for meshing IGES and STEP files in the Open Source world..... Netgen (http://sourceforge.net/projects/netgen-mesher/).

Netgen allows you to directly load IGES and STEP files when installed with OpenCascade support, and allows meshes to be exported directly into OpenFOAM format.

Only unstructured tetrahedral meshes (in 3D) can be generated, though for my purposes this has worked fine since 2006 :-)

Can be installed on Windows and Linux platforms.

Hope this helps.

Have a nice day ahead!

Philippose
wyldckat and skuznet like this.
philippose is offline   Reply With Quote

Old   June 10, 2014, 21:11
Default
  #4
Member
 
Sergey
Join Date: Nov 2013
Posts: 87
Rep Power: 12
skuznet is on a distinguished road
Hi Bruno!

I was using SALOME. And it worked for first geometries I used. But when I made geometry more complex I started having problems. I still can create STL surfaces in salome and stitch them manually to form a closed domains for solid and fluid, snappyHexMesh seems to mesh it ok, however splitMeshRegions can't do the job properly, I've got a number of extra domains named domain0, domain1 ... additionally to my fluid and solid domains. And I could not get rid of this problem.
skuznet is offline   Reply With Quote

Old   June 10, 2014, 21:15
Default
  #5
Member
 
Sergey
Join Date: Nov 2013
Posts: 87
Rep Power: 12
skuznet is on a distinguished road
Dear philippose,
thanks for your reply. I will try to use netgen, hope i will work for me.

Does netgen keep the information about boundary names so that I can prescribe my inlets and outlets on the mesh or does it allow to create patches?
Does it create boundary layers?
Can it do multiregion mesh for OpenFOAM to be used for conjugate heat transfer?
skuznet is offline   Reply With Quote

Old   June 11, 2014, 17:20
Default
  #6
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Sergey,
Good Evening to you again.

The typical workflow for going from an IGES/STEP Geometry to OpenFOAM Mesh is as follows:
1. Open Geometry in Netgen

2. Create a usable mesh making use of the various size controls, mesh density definition methods, etc...

3. Define Boundary Patches using one the following methods:
....a. Open the Boundary conditions dialog, set the entire mesh to one boundary number .... then manually double click each surface (this automatically selects all the surface mesh elements on that face) and assign a boundary index number. Since multiple surfaces can have the same boundary number, this is equivalent to patches in OpenFOAM.

....b. If you had already coloured different faces in your original STEP geometry, netgen recognises these colours and carries them on to the mesh. You can then ask Netgen to automatically assign boundary numbers to surfaces based on the colour of that surface.

....c. Same as "b"... but you can provide a colour definition file to Netgen which contains a mapping from surface colour (specified in [r,g,b] triplets) to boundary numbers, and ask netgen to assign surfaces based on this file.

4. Export the mesh in either uncompressed or compressed native OpenFOAM format..... Each boundary number will be exported as one patch, and netgen automatically writes a "boundary" file too, which can then be modified to change the "Patch<n>" names to actual patch names based on your needs.

As for your question regarding multi-region meshes.... yes... Netgen does read in multi-region geometry, and mesh multiple regions (I have not personally tested this out, but I know it works.... whether it does what you expect it to do.... will have to be looked into :-)...)

And boundary layers...... unless your geometry is extremely simple, netgen does not support creation of boundary layers..... yet...... I had written a test routine a couple of years ago, but it is far from ready for normal usage, and I dont think I will be able to get back to that anytime soon :-(

Hope this helps.

Enjoy :-)

Philippose
skuznet likes this.
philippose is offline   Reply With Quote

Old   June 12, 2014, 13:38
Default
  #7
Member
 
Sergey
Join Date: Nov 2013
Posts: 87
Rep Power: 12
skuznet is on a distinguished road
Philippose, thank you so much for the explanation.

I tried the first way and it works. The only concern that when I'll have too many faces (im doing porous material, therefore there will be a great amount of faces) it would be very hard(and many mistakes) to go through each face and assign a index number.
regarding b) and c) - i don't know how to colour faces. Do you know if it Is possible to do in Abaqus before exporting in IGS or STP? Or can I do coloring in SALOME?


Also sometimes netgen hangs up during meshing or writing mesh in OF format. Do you know which version of net grid is more stable (windows or linux)?

Thank you!
Attached Images
File Type: jpg meshsnap.jpg (97.3 KB, 69 views)
skuznet is offline   Reply With Quote

Old   June 13, 2014, 16:11
Default
  #8
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 552
Rep Power: 25
philippose will become famous soon enough
Hello Sergey,
Great that you were able to come up with a usable mesh using Netgen :-) I agree with you that using Netgen to manually click through all those faces one by one would be extremely painful and very error-prone.

I have never used Abaqus, so I dont know if it is capable of giving different surfaces of the geometry different colours.

Are you using Abaqus to generate your geometry? What software do you use initially to create the CAD Model? Is it not possible to use the CAD Software to change the surface colours?

If the Geometry is easy to create and if you are not bound to a specific software, you could try using the open source CAD Software - FreeCAD (http://freecadweb.org/) to create your geometry. This software is capable of exporting STEP files, and if I remember right, can also give different surfaces different colours.


As for the problem with Netgen hanging.... Are you using the 32-bit or the 64-bit version of Netgen? I know for a fact that the memory limitations in 32-bit systems prevents you from creating meshes larger than around 1.2 Million cells using the 32-bit version..... However, the 64-bit version should work without any issues.

I have not had any stability issues with Netgen on Windows or Linux, and both platforms should be equally stable.


What you could try, is use the following settings for the meshing options:

1. Under the "general" tab, change "Mesh granularity" to "fine"
2. Under the "Mesh size" tab, "un-tick the option "close edges"
2. Specify a minimum mesh size other than "0" (depends on the scales of your geometry)
3. Under the "optimizer" tab...:
----> reduce the "bad element criterion" to 160
----> increase the surface optimisation steps to around 20
----> increase the volume optimisation steps to around 15 - 20

This should come up with a much better mesh.


Philippose
phonak and hogsonik like this.
philippose is offline   Reply With Quote

Old   July 3, 2014, 22:20
Default
  #9
Member
 
Sergey
Join Date: Nov 2013
Posts: 87
Rep Power: 12
skuznet is on a distinguished road
Dear Philippose,

Thank a lot!
A was able to generate meshes both for fluid and solid domains and export them into OpenFOAM format.
I was trying to combine them into one conjugateHeatTransfer case:
I created all folders:
0/fluid
0/solid
constant/fluid/
constant/solid/
system/fluid
system/solid

and copied there my meshes and also created all other files.

However, when I want to run this case I get an error:

Code:
UCOptSideNetGenCoarser_run$ chtMultiRegionSimpleFoam
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.x                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.2.x-37940e0cd1ae
Exec   : chtMultiRegionSimpleFoam
Date   : Jul 01 2014
Time   : 15:02:07
Host   : "ubuntu"
PID    : 5802
Case   : /media/ubuntu/run/UCcases/UCOptSideNetGenCoarser_run
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create fluid mesh for region fluid for time = 0

Create solid mesh for region solid for time = 0

*** Reading fluid mesh thermophysical properties for region fluid

    Adding to thermoFluid

Selecting thermodynamics package 
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

    Adding to rhoFluid

    Adding to UFluid

    Adding to phiFluid

    Adding to gFluid

    Adding to turbulence

Selecting turbulence model type laminar
    Adding to ghFluid

    Adding to ghfFluid

Selecting radiationModel none
    Adding fvOptions

No finite volume options present

*** Reading solid mesh thermophysical properties for region solid

    Adding to thermos

Selecting thermodynamics package 
{
    type            heSolidThermo;
    mixture         pureMixture;
    transport       constIso;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleEnthalpy;
}

    Adding to radiations

Selecting radiationModel opaqueSolid
Selecting absorptionEmissionModel constantAbsorptionEmission
Selecting scatterModel none
    Adding fvOptions

No finite volume options present

Time = 1


Solving for fluid region fluid
#0  Foam::error::printStack(Foam::Ostream&) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2   in "/lib/x86_64-linux-gnu/libc.so.6"
#3  void Foam::fvc::surfaceIntegrate<Foam::Vector<double> >(Foam::Field<Foam::Vector<double> >&, Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#4  Foam::tmp<Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::surfaceIntegrate<Foam::Vector<double> >(Foam::GeometricField<Foam::Vector<double>, Foam::fvsPatchField, Foam::surfaceMesh> const&) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#5   at gaussDivSchemes.C:0
#6  Foam::fv::gaussDivScheme<Foam::Tensor<double> >::fvcDiv(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libfiniteVolume.so"
#7  Foam::tmp<Foam::GeometricField<Foam::innerProduct<Foam::Vector<double>, Foam::Tensor<double> >::type, Foam::fvPatchField, Foam::volMesh> > Foam::fvc::div<Foam::Tensor<double> >(Foam::GeometricField<Foam::Tensor<double>, Foam::fvPatchField, Foam::volMesh> const&) in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
#8  Foam::compressible::laminar::divDevRhoReff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
#9  
 in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
#10  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#11  
 in "/home/sergkuznet/OpenFOAM/OpenFOAM-2.2.x/platforms/linux64GccDPOpt/bin/chtMultiRegionSimpleFoam"
Floating point exception (core dumped)
I have now idea what does it mean. Can I please take a look at this case? Maybe you can see what's going wrong with it.

Here is the case: (15 Mb):
https://dl.dropboxusercontent.com/u/...ser_run.tar.gz


Thank you!




Quote:
Originally Posted by philippose View Post
Hello Sergey,
Great that you were able to come up with a usable mesh using Netgen :-) I agree with you that using Netgen to manually click through all those faces one by one would be extremely painful and very error-prone.

I have never used Abaqus, so I dont know if it is capable of giving different surfaces of the geometry different colours.

Are you using Abaqus to generate your geometry? What software do you use initially to create the CAD Model? Is it not possible to use the CAD Software to change the surface colours?

If the Geometry is easy to create and if you are not bound to a specific software, you could try using the open source CAD Software - FreeCAD (http://freecadweb.org/) to create your geometry. This software is capable of exporting STEP files, and if I remember right, can also give different surfaces different colours.


As for the problem with Netgen hanging.... Are you using the 32-bit or the 64-bit version of Netgen? I know for a fact that the memory limitations in 32-bit systems prevents you from creating meshes larger than around 1.2 Million cells using the 32-bit version..... However, the 64-bit version should work without any issues.

I have not had any stability issues with Netgen on Windows or Linux, and both platforms should be equally stable.


What you could try, is use the following settings for the meshing options:

1. Under the "general" tab, change "Mesh granularity" to "fine"
2. Under the "Mesh size" tab, "un-tick the option "close edges"
2. Specify a minimum mesh size other than "0" (depends on the scales of your geometry)
3. Under the "optimizer" tab...:
----> reduce the "bad element criterion" to 160
----> increase the surface optimisation steps to around 20
----> increase the volume optimisation steps to around 15 - 20

This should come up with a much better mesh.


Philippose
skuznet is offline   Reply With Quote

Reply

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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
[snappyHexMesh] Snappyhex mesh: poor inlet mesh Swagga5aur OpenFOAM Meshing & Mesh Conversion 1 December 3, 2016 16:59
[ICEM] Generating Mesh for STL Car in Windtunnel Simulation tommymoose ANSYS Meshing & Geometry 48 April 15, 2013 04:24
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11
Convergence moving mesh lr103476 OpenFOAM Running, Solving & CFD 30 November 19, 2007 14:09


All times are GMT -4. The time now is 11:55.