CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [CGNS] CGNS converters available (https://www.cfd-online.com/Forums/openfoam-meshing/61594-cgns-converters-available.html)

mbeaudoin March 18, 2008 12:21

CGNS converters available
 
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

hong October 9, 2008 06:16

Hi Martin, Please let me know
 
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.Chttp://www.cfd-online.com/OpenFOAM_D...lipart/sad.gif.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

mbeaudoin October 9, 2008 14:05

Hello Hong, You need to adj
 
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

hong October 10, 2008 06:35

Hello Martin, Thank you for y
 
Hello Martin,
Thank you for your information.
I read cgnsToFoam/Make/options,
and successed in build.

anders November 4, 2008 11:12

Hello, I'm trying to instal
 
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

mbeaudoin November 4, 2008 15:40

Hello Anders, Just read a f
 
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

anders November 5, 2008 05:43

Hello Martin, Thanks for yo
 
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

mbeaudoin November 5, 2008 10:46

Hello Anders, cgnsToFoam an
 
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

anders November 5, 2008 11:26

Hi Martin, No, I'm a new us
 
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

mbeaudoin November 5, 2008 15:20

Hi Anders > No, I'm a new u
 
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 November 7, 2008 19:51

Hello, The CGNS converters
 
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

anders November 10, 2008 04:19

Thanks a lot Martin! Actuall
 
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

ep4 November 28, 2008 08:25

Hi, i have installed the CG
 
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

mbeaudoin November 29, 2008 00:10

Hello Eric, The warnings ab
 
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

ep4 December 1, 2008 09:25

Hello Martin, thank you ver
 
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

mbeaudoin December 1, 2008 12:43

Hello Eric, Since you do ge
 
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

srikara December 10, 2008 00:49

Hi, I am trying to install t
 
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 December 10, 2008 01:09

Oh I forgot to mention that I
 
Oh I forgot to mention that I am installing the converters in the OF 1.5 version.

Thank you,
Srikara

bholbek December 10, 2008 06:45

Hi, i would like to use the
 
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

mbeaudoin December 10, 2008 17:29

Hello Srikara, > /bin/sh: a
 
Hello Srikara,

> /bin/sh: aclocal: command not found

You are missing a package called automake on your system.

Martin


All times are GMT -4. The time now is 04:47.