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

[CGNS] CGNS converters available

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

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2008, 12:21
Default CGNS converters available
  #1
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello,

We are pleased to announce that conversion between the CGNS standard format and OpenFOAM is now possible with two new converters that we have contributed to the openfoam-extend Subversion site.

The first one, foamToCGNS, will convert an OpenFOAM mesh, boundary conditions and solutions to a CGNS file. The CGNS solutions are always stored at the mesh nodes. The resulting CGNS mesh will be unstructured.

The second converter, cgnsToFoam will take a CGNS mesh (structured or unstructured) and its boundary conditions and will convert them to a valid OpenFoam mesh.

The solution stored in the CGNS file can also be extracted to be used as an initial solution.

Currently, both converters are able to deal only with stationnary flows on a fixed mesh.

The converters also depend on a set of libraries that both need to be installed and compiled as well.

The first one is cgnslib_2.5, a recent version of cgnslib from http://www.cgns.org/.

The second one is libcgnsoo_3.0, a C++ wrapper around cgnslib_2.5.

Allwmake files are provided for compiling the libraries and the converters. A set of simple test cases illustrating the use of both converters are also available.

We plan to eventually put some additionnal documentation on the OpenFoam Wiki about these converters. So watch the Sig Turbomachinery section of the Wiki for more information.

For now, the -help option will give you a rough description of the available options.

You might have to adjust the Allwmake and Make/options files for your own installation or for your version of OpenFoam. Please take a quick look at those files before compiling.

Here are the URLs for dowloading the CGNS converters, companion libraries and the test cases using svn.

Converters:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/OSIG/TurboMachinery/applications

Libraries:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/OSIG/TurboMachinery/src

Test cases:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r/OSIG/TurboMachinery/tutorials

Enjoy.

Martin Beaudoin, Hydro-Quebec - IREQ
Robert Magnan, Hydro-Quebec - IREQ
mbeaudoin is offline   Reply With Quote

Old   October 9, 2008, 06:16
Default Hi Martin, Please let me know
  #2
hong
Guest
 
Posts: n/a
Hi Martin,
Please let me know how to build CGNS converters.
I tried compile but not succeed.

After linking some files
(pointVolInterpolation.H
pointVolInterpolation.C
pointVolInterpolate.C )
to cgnsToFoam directory, I typed ./Allwnake under TurboMachinery.
I got following message.

wmake

Making dependency list for source file SolutionConverter.C
could not open file structure_t.H for source file SolutionConverter.C

:
:
:
Make/linux64GccDPOpt/SolutionConverter.o: In function `void Foam::pointVolInterpolation::interpolate<double>(F oam::GeometricField<double,> const&, Foam::GeometricField<double,>&) const':
SolutionConverter.C.text._ZNK4Foam21pointVolInterpolation11interpolat eIdEEvRKNS_14GeometricFieldIT_ NS_15pointPatchFieldENS_9pointMeshEEERNS2_IS3_NS_1 2fvPatchFieldENS_7volMeshEEE[v oid Foam::pointVolInterpolation::interpolate<double>(F oam::GeometricField<double,> const&, Foam::GeometricField<double,>&) const]+0x14): undefined reference to `Foam::pointVolInterpolation::debug'

:
:
:

Foam::dimensionSet const&, std::vector<foam::vector<double>, std::allocator<foam::vector<double> > > const&, bool, Foam::word, Foam::fvMesh&)]+0xaf9): undefined reference to `Foam::pointVolInterpolation::~pointVolInterpolati on()'
collect2: ld returned 1 exit status
  Reply With Quote

Old   October 9, 2008, 14:05
Default Hello Hong, You need to adj
  #3
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Hong,

You need to adjust your file cgnsToFoam/Make/options.

Read the comments at the top of that file.

I guess a proper Readme file would be usefull here as well.

It will be added when I will port the converters to OF 1.5.

Martin
mbeaudoin is offline   Reply With Quote

Old   October 10, 2008, 06:35
Default Hello Martin, Thank you for y
  #4
hong
Guest
 
Posts: n/a
Hello Martin,
Thank you for your information.
I read cgnsToFoam/Make/options,
and successed in build.
  Reply With Quote

Old   November 4, 2008, 11:12
Default Hello, I'm trying to instal
  #5
New Member
 
Anders Östman
Join Date: Mar 2009
Posts: 7
Rep Power: 17
anders is on a distinguished road
Hello,

I'm trying to install the cgnsToFoam converter in OF 1.5. When I compile the utility I get the error message:

cgnsToFoam.C:43:35: error: pointVolInterpolation.H: No such file or directory

It seems like pointVolInterpolation is not longer a part of the OpenFOAM distribution.

Has anybody managed to compile the cgnsToFoam utility for OF 1.5.

Any help is greatly appreciated!

Regards,
Anders
anders is offline   Reply With Quote

Old   November 4, 2008, 15:40
Default Hello Anders, Just read a f
  #6
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Anders,

Just read a few posts up from this thread. (Or read the header from the file cgnsToFoam/Make/options.)

The compilation will not get much further though. The code still needs some adjustments for compiling with 1.5.

The source code for the CGNS converters for OF 1.5 will be posted on openfoam-extend under the Breeder_1.5 branch asap.

Martin
mbeaudoin is offline   Reply With Quote

Old   November 5, 2008, 05:43
Default Hello Martin, Thanks for yo
  #7
New Member
 
Anders Östman
Join Date: Mar 2009
Posts: 7
Rep Power: 17
anders is on a distinguished road
Hello Martin,

Thanks for your information about the work with porting the CGNS converter to OF 1.5. You guys in the turbomachinery group are doing a good job!

I'm a new user of OpenFOAM, I'm now in the process of trying it out. We have until now used our own in-house gridgenerator and solver. I'm now very curious in comparing results using OpenFOAM with our own solver. In that process I need the cgnsToFoam converter for converting the grids created using our gridgenerator.

I would be very grateful if you could just e-mail me a OF 1.4 executable of the cgnsToFoam. That would help me a lot :-) .

If you would like the e-mail me the executable, my address is: anders@cfdnorway.no

Thanks in advance.

Anders
anders is offline   Reply With Quote

Old   November 5, 2008, 10:46
Default Hello Anders, cgnsToFoam an
  #8
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Anders,

cgnsToFoam and foamToCGNS compile without any problem with OF 1.4.1-dev and OF 1.4.1.

Have you tried to compile the converters with either versions of OF 1.4.1?

Martin
mbeaudoin is offline   Reply With Quote

Old   November 5, 2008, 11:26
Default Hi Martin, No, I'm a new us
  #9
New Member
 
Anders Östman
Join Date: Mar 2009
Posts: 7
Rep Power: 17
anders is on a distinguished road
Hi Martin,

No, I'm a new user of OF and have only installed OF 1.5, I was hoping that I did not have to install older versions. But I can do that if that is the best way of getting the converter.

Regards,
Anders
anders is offline   Reply With Quote

Old   November 5, 2008, 15:20
Default Hi Anders > No, I'm a new u
  #10
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hi Anders

> No, I'm a new user of OF and have only installed OF 1.5, I was hoping that I did not have to install older versions. But I can do that if that is the best way of getting the converter.

Well, if you want to run a binary version of the CGNS converters for OF 1.4.1, you will have to install OF 1.4.1 or 1.4.1-dev anyway because of the runtime dependency of the converters on OF dynamic libraries.

So give it a try, or wait a little bit for the 1.5 version of the converters.

Martin
mbeaudoin is offline   Reply With Quote

Old   November 7, 2008, 19:51
Default Hello, The CGNS converters
  #11
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello,

The CGNS converters are now available for OpenFOAM 1.5

Here are the svn URLs for dowloading from openfoam-extend the CGNS converters, the companion libraries and the test cases.

Converters:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r_1.5/OSIG/TurboMachinery/applications

Libraries:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r_1.5/OSIG/TurboMachinery/src

Test cases:
https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r_1.5/OSIG/TurboMachinery/tutorials

I am also in the process of writing some basic documentation for these converters.
The information will be available at the following URL on the OpenFOAM Wiki: http://openfoamwiki.net/index.php/Si...GNS_Converters

In the meantime, here is a quick recipe for downloading, compiling and testing the converters:

# Downloading the code from openfoam-extend
svn checkout https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breede r_1.5/OSIG/TurboMachinery

# Compiling the converters
cd TurboMachinery/src
./Allwmake
cd ../applications
./Allwmake

# Testing the converters
cd ../tutorials/cgnsConverters/
./Allrun


Enjoy.

Martin Beaudoin, Hydro-Quebec - IREQ
mbeaudoin is offline   Reply With Quote

Old   November 10, 2008, 04:19
Default Thanks a lot Martin! Actuall
  #12
New Member
 
Anders Östman
Join Date: Mar 2009
Posts: 7
Rep Power: 17
anders is on a distinguished road
Thanks a lot Martin!
Actually I downloaded the 1.4.1 version of OF this weekend and managed to compile and run the cgnsToFoam converter. But this makes use of OF much easier. I will try to download and install it this evening.

Regards,
Anders
anders is offline   Reply With Quote

Old   November 28, 2008, 08:25
Default Hi, i have installed the CG
  #13
ep4
Member
 
Pattyn Eric
Join Date: Mar 2009
Posts: 61
Rep Power: 17
ep4 is on a distinguished road
Hi,

i have installed the CGNS converters and i'm trying to convert some CGNS files to foam with cgnsToFoam.
However, i encounter some problems like:

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

--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 2 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "QUAD_4" found in zone 0, section 3 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "BAR_2" found in zone 0, section 4 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "NODE" found in zone 0, section 5 has no OpenFOAM equivalence - skipping
--> FOAM Warning :
From function polyMesh::polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
Found 262798 undefined faces in mesh; adding to default patch.
Output of mesh and boundary conditions

Other case:

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

--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 1 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 2 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 3 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 4 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 5 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 6 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 7 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 8 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 9 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 10 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 11 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 12 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 13 has no OpenFOAM equivalence - skipping
--> FOAM Warning : Cell type "TRI_3" found in zone 0, section 14 has no OpenFOAM equivalence - skipping
--> FOAM Warning : BC "intake" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "exhaust" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "intake ramp" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "downstream" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "lower" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "upper" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "upstream" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "strake" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "vertical tail" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "horizontal tail" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "side" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "wing" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "fuselage" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning : BC "symmetry" : patch defined by a unsupported PointSetType_t - skipped.
--> FOAM Warning :
From function polyMesh::polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 576
Found 27656 undefined faces in mesh; adding to default patch.
Output of mesh and boundary conditions



Is there any constraints on the cgns file, mesh or boundary name which i shuold respect ? Or is it an another problem ?

Thank you in advance

Eric
ep4 is offline   Reply With Quote

Old   November 29, 2008, 00:10
Default Hello Eric, The warnings ab
  #14
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Eric,

The warnings about the "Cell type" is for the non-3D cell types present in your CGNS file:
triangles (TRI_3)
rectangle (QUAD_4)
line segments (BAR_2)
points (NODE)

As of now, the cgnsToFoam converter only supports the following type of 3D cells for unstructured mesh:
tetrahedron (TETRA_4)
pyramids (PYRA_5)
prisms (PENTA_6)
hexahedron (HEXA_8)

It looks like your unstructured mesh has a lot of 2D elements (triangles and rectangles).

The current implementation of cgnsToFoam will not reconstruct 3D cells from a bunch of 2D faces. This 3D topology information is normally known from your CGNS generator, so you need to find a way to export your mesh as 3D cells (tets, hexs, pyramids or prisms) and not as 2D faces.

Is your unstructured mesh exported in CGNS as a bunch of 2D faces, or do you have 3D cells in your mesh as well?

As for the following type of message:
"FOAM Warning : BC "exhaust" : patch defined by a unsupported PointSetType_t - skipped.",

It looks like some, if not all, of your boundary conditions are defined in your CGNS file as something other than a point list, or a point range.

Which software did you use for generating your CGNS file?

Is it possible for you to share this CGNS file?

We have developped the CGNS converters based on the outputs generated by the commercial softwares we are using for our CFD simulations and mesh modelling.

During that process, we have discovered that the CGNS "standard" can be implemented differently from vendor to vendor, so your CGNS file might be yet another implementation that we need to make some adjustments for.

Martin
mbeaudoin is offline   Reply With Quote

Old   December 1, 2008, 09:25
Default Hello Martin, thank you ver
  #15
ep4
Member
 
Pattyn Eric
Join Date: Mar 2009
Posts: 61
Rep Power: 17
ep4 is on a distinguished road
Hello Martin,

thank you very much for your detailed answer.
The meshes i'm trying to convert contain 3D cells as 2D cells, for the boundaries. Actually, i can see the geometry made of 3D cells which are well converted. The problem i have is that i lose the bidimensional boundaries where i will have to impose conditions in order to run an OpenFOAM simulation. Typically, it creates one "defaultWall" in place of my boundary surfaces.
I don't understand how you define boundary conditions if you export only 3D elements. Do you recreate the boundaries surfaces after the conversion?

Generally, the CGNS files we have have been generated by different software. In this case, i think they have been generated with IcemCFD. I don't know which commercial software you are using.

Thank you again.

Eric
ep4 is offline   Reply With Quote

Old   December 1, 2008, 12:43
Default Hello Eric, Since you do ge
  #16
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Eric,

Since you do get all the 3D cells out of the conversion, the real problem here seems to be related to the BC information that is stored in the CGNS file and defined by an "unsupported PointSetType_t".

The best way for me to help you if to either get hold of your CGNS file, or for you to reproduce the problem using another CGNS file that you could share.

Martin
mbeaudoin is offline   Reply With Quote

Old   December 10, 2008, 00:49
Default Hi, I am trying to install t
  #17
New Member
 
srikara's Avatar
 
Srikara Mahishi
Join Date: Mar 2009
Location: Bangalore
Posts: 22
Rep Power: 17
srikara is on a distinguished road
Hi,
I am trying to install the cgns converters following the instructions given in the openwiki website.
I am getting the following error message while running the ./Allclean command to compile the libraries:

/bin/rm -f LINUX/*.o
cd . && aclocal -I config
/bin/sh: aclocal: command not found
make: *** [aclocal.m4] Error 127

Just in case if it helps, I have downloaded all the files in my user directory. It would be really helpful if someone could let me know what the problem could be.

Thank you in advance,
Srikara
srikara is offline   Reply With Quote

Old   December 10, 2008, 01:09
Default Oh I forgot to mention that I
  #18
New Member
 
srikara's Avatar
 
Srikara Mahishi
Join Date: Mar 2009
Location: Bangalore
Posts: 22
Rep Power: 17
srikara is on a distinguished road
Oh I forgot to mention that I am installing the converters in the OF 1.5 version.

Thank you,
Srikara
srikara is offline   Reply With Quote

Old   December 10, 2008, 06:45
Default Hi, i would like to use the
  #19
New Member
 
Bastien Holbek
Join Date: Mar 2009
Posts: 15
Rep Power: 17
bholbek is on a distinguished road
Hi,

i would like to use the cgns converters and i have a question concerning the boundaries condition conversion.
I have a OpenFoam case, i convert it to cgns but when using this file with a in-house program, all the boundary conditions are set to NULL.
Reconverting this cgns file to OpenFoam case, i have other boundary conditions, which do not correspond to the initial OpenFoam case. For example, the folowing initial conditions

boundaryname1
{
type wall;
nFaces 788;
startFace 20078407;
}
boundaryname2
{
type wall;
nFaces 10217;
startFace 20079195;
}


become, after foamToCGNS and then cgnsToFoam,

boundaryname1
{
type patch;
physicalType empty;
nFaces 788;
startFace 20087646;
}
boundaryname2
{
type patch;
physicalType inlet;
nFaces 10217;
startFace 20088434;

Walls have been changed in empty and inlet conditions. Are there specifications to avoid such problems?

Thank you

Bastien
bholbek is offline   Reply With Quote

Old   December 10, 2008, 17:29
Default Hello Srikara, > /bin/sh: a
  #20
Senior Member
 
Martin Beaudoin
Join Date: Mar 2009
Posts: 332
Rep Power: 22
mbeaudoin will become famous soon enough
Hello Srikara,

> /bin/sh: aclocal: command not found

You are missing a package called automake on your system.

Martin
mbeaudoin 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
Issues with CGNS formatted mesh in SU2 jlwhelan28 SU2 5 February 13, 2017 12:48
[Gmsh] Cgns support for gmsh robyTKD OpenFOAM Meshing & Mesh Conversion 1 July 13, 2016 12:27
SU2 not built with CGNS support. maximus23 SU2 Installation 5 May 11, 2016 13:05
writing link between two CGNS files t.teschner Main CFD Forum 1 February 4, 2014 11:26
parallel support with CGNS format not yet implemented kirkrich SU2 3 January 18, 2013 16:39


All times are GMT -4. The time now is 06:08.