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)

makaveli_lcf February 13, 2012 03:47

Hi all!

Some update from my side to use CGNS converters with Ubuntu 10.04 LTS
http://openfoamwiki.net/index.php/Si...untu_10.04_LTS

I would like personally thank people from Turbomachinery Group for their great contribution!

Cheers engineers,
Alex

gautamdevpendyala November 2, 2012 02:14

Hi all,
I have an mesh file in NetCDF format. I want to process it in fluent. Would anyone please tell how can i convert NetCDF format to cgns or fluent openable formats???
Thanks

thomas.ponweiser April 9, 2013 09:04

cgnsToFoam still available?
 
Is the cgnsToFoam tool still available?

The instructions given at http://openfoamwiki.net/index.php/Si...GNS_Converters seem to be outdated - the SVN repository is not reachable (any more). From a first Google search I also did not get a clue...

Thank in advance!
Thomas

haakon April 9, 2013 09:53

The repositories are probably down together with the rest of 1.6-ext. See the message on top of OpenFOAM-WIKI: http://www.openfoamwiki.net/index.php/Main_Page so I would not take that as a sign of the tool being deprecated (however I have never used it and cannot tell you whether it still works or not).

normy March 25, 2015 08:47

install cgnsToFoam on fe30
 
Hi Foamers!
I wanted to ask if anyone had managed to install cgnsToFoam on foam 3.0 ext:(. I read the wiki page, but I think they are a bit outdated that information, including all package about turbomachinery. Any Idea?
Thanks a lot in advance for your help!
Normy

Sethu July 1, 2015 21:09

cgnstofoam_not able to build with latest libcgns_3.2.1
 
Dear all,

I could able to successfully build cgnsToFoam and foamToCgns with libcgns_2.5 that was available in,
https://openfoamwiki.net/index.php/S...GNS_Converters

But when I tried to build the same with libcgns_3.2.1 (as my current pre processor can only export this version of cgns format), I failed in building the libraries. The error message that I get while executing Allwmake is,

file.C: In member function 'void CGNSOO::file::open(const string&, CGNSOO::file::openmode_t)':
file.C:64:22: error: 'MODE_READ' was not declared in this scope
case READONLY : m = MODE_READ; break;
^
file.C:65:22: error: 'MODE_MODIFY' was not declared in this scope
case READWRITE: m = MODE_MODIFY; break;
^
file.C:66:22: error: 'MODE_WRITE' was not declared in this scope
case WRITE : m = MODE_WRITE; break;
^
make[2]: *** [file.lo] Error 1
make[2]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0'
make: *** [all] Error 2
+ make install
Making install in src
make[1]: Entering directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/cgnslib_3.1.4/platforms/linuxGccDPOpt/include -g -O2 -g -O2 -MT file.lo -MD -MP -MF .deps/file.Tpo -c -o file.lo file.C
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/cgnslib_3.1.4/platforms/linuxGccDPOpt/include -g -O2 -g -O2 -MT file.lo -MD -MP -MF .deps/file.Tpo -c file.C -fPIC -DPIC -o .libs/file.o
file.C: In member function 'void CGNSOO::file::open(const string&, CGNSOO::file::openmode_t)':
file.C:64:22: error: 'MODE_READ' was not declared in this scope
case READONLY : m = MODE_READ; break;
^
file.C:65:22: error: 'MODE_MODIFY' was not declared in this scope
case READWRITE: m = MODE_MODIFY; break;
^
file.C:66:22: error: 'MODE_WRITE' was not declared in this scope
case WRITE : m = MODE_WRITE; break;
^
make[1]: *** [file.lo] Error 1
make[1]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
make: *** [install-recursive] Error 1
+ popd
~/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src


It seems that libcgnsoo_3.0 has some issue with the current libcgns_3.2.1.
Any help or suggestions would be really helpful.

Regards,

Sethu

niuhong October 30, 2016 08:46

Quote:

Originally Posted by braennstroem (Post 226173)
Hi Martin,

nice work with the cgns converter! Did you consider to add a cgns output to the simplefunctionObjects for writing patch/planes during the simulation as well? This would be great :-)

Best Regards!
Fabian

hello!I want to convert cgns(from cfx) to openfoam,but i don't know how to download the cgnstofoam?Could you tell me the method?

Thankyou very much!

niuhong October 30, 2016 08:47

Quote:

Originally Posted by Sethu (Post 552918)
Dear all,

I could able to successfully build cgnsToFoam and foamToCgns with libcgns_2.5 that was available in,
https://openfoamwiki.net/index.php/S...GNS_Converters

But when I tried to build the same with libcgns_3.2.1 (as my current pre processor can only export this version of cgns format), I failed in building the libraries. The error message that I get while executing Allwmake is,

file.C: In member function 'void CGNSOO::file::open(const string&, CGNSOO::file::openmode_t)':
file.C:64:22: error: 'MODE_READ' was not declared in this scope
case READONLY : m = MODE_READ; break;
^
file.C:65:22: error: 'MODE_MODIFY' was not declared in this scope
case READWRITE: m = MODE_MODIFY; break;
^
file.C:66:22: error: 'MODE_WRITE' was not declared in this scope
case WRITE : m = MODE_WRITE; break;
^
make[2]: *** [file.lo] Error 1
make[2]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0'
make: *** [all] Error 2
+ make install
Making install in src
make[1]: Entering directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
/bin/bash ../libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/cgnslib_3.1.4/platforms/linuxGccDPOpt/include -g -O2 -g -O2 -MT file.lo -MD -MP -MF .deps/file.Tpo -c -o file.lo file.C
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I.. -I/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/cgnslib_3.1.4/platforms/linuxGccDPOpt/include -g -O2 -g -O2 -MT file.lo -MD -MP -MF .deps/file.Tpo -c file.C -fPIC -DPIC -o .libs/file.o
file.C: In member function 'void CGNSOO::file::open(const string&, CGNSOO::file::openmode_t)':
file.C:64:22: error: 'MODE_READ' was not declared in this scope
case READONLY : m = MODE_READ; break;
^
file.C:65:22: error: 'MODE_MODIFY' was not declared in this scope
case READWRITE: m = MODE_MODIFY; break;
^
file.C:66:22: error: 'MODE_WRITE' was not declared in this scope
case WRITE : m = MODE_WRITE; break;
^
make[1]: *** [file.lo] Error 1
make[1]: Leaving directory `/home/nrcs-cae/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src/libcgnsoo_3.0/src'
make: *** [install-recursive] Error 1
+ popd
~/OpenFOAM/nrcs-cae-2.3.x/application/OSIG/TurboMachinery/src


It seems that libcgnsoo_3.0 has some issue with the current libcgns_3.2.1.
Any help or suggestions would be really helpful.

Regards,

Sethu

hello!I want to convert cgns(from cfx) to openfoam,but i don't know how to download the cgnstofoam?Could you tell me the method?

Thankyou very much!

niuhong October 30, 2016 08:48

Quote:

Originally Posted by hamcer (Post 220094)
hi DSpreitz,



In the end, I haven't installed the cgnsTools in ubuntu, because it is used only for display cgns files and it'is difficult to installed it;
for the geometry cgns we are using NUMECA IGG Software in our laboratory, and I use Paraview to see the outcome of the conversion,
I think you needn't install adfviewer.

hope it help you.

hello!I want to convert cgns(from cfx) to openfoam,but i don't know how to download the cgnstofoam?Could you tell me the method?

Thankyou very much!

hamcer November 5, 2016 01:45

Quote:

Originally Posted by niuhong (Post 623465)
hello!I want to convert cgns(from cfx) to openfoam,but i don't know how to download the cgnstofoam?Could you tell me the method?

Thankyou very much!


...........

hamcer November 5, 2016 01:47

Hello,
it's been a long time that I left OpenFOAM.
Try using ANSYStofoam utility. if you are not forced to install the old OpenFOAM 1.5-dev (I do not know if it still exists). or, use the very new OpenFOAM 16.10.
hope that help you.

swm November 5, 2016 21:51

Can cgns mesh be transfered to plot3d format?

Traction January 19, 2017 16:17

I succeeded by transforming the .cgns to an .unv with the help of Salome. The unv mesh can be converted into an OpenFOAM mesh by using the ideasUnvToFoam utility.

volker1 July 27, 2017 04:45

Hello,

I work in nuclear fusion where different aspects of a component are typically investigated by different specialized groups.
Depending on the requirements, different commercial codes or own specialized codes are used.
This makes it difficult to make use of the results of others on the detailed CFD level of the original investigation and often much information will be lost in subsequent multi physics simulations. In extreme cases even all previous results are just lumped into a single parameter.
To avoid such waste of information, one should do special calculations with an adequate CFD code (like OpenFOAM), too.
Then all data is available on a similar detail level and - provided that an interface is available - may be reasonably merged.

From this I would think that a working interface to commercial codes could boost the success of OpenFOAM.
And here CGNS as an OpenSource project should fit perfectly to the ideas of OpenFOAM.
I think it is a real pity that the CGNS converters are not part of current OF packages any more!


In my application I like to be able to use thermal and flow analyses from others with commercial codes like CFX as background fields for my OF simulations (although such analyses would be basically possible with OF, too, but why do duplicate work ?) so I wanted to have the CGNS conversion capability and tried to activate it at least for me.

Now I am at a stage where things look like they work fine enough and for those who are interested I try to summarize my findings:

1. The download of the cgns converters is described at:

https://openfoamwiki.net/index.php/S...GNS_Converters

Note that you need to have subversion (-> https://subversion.apache.org/) installed to use the repositories listed there.

I verified today that the first option
"svn checkout svn://svn.code.sf.net/p/openfoam-extend/svn/trunk/Breeder_2.0/OSIG/TurboMachinery"
still works.

2. Compilation with a current OF installation (I now have 4.1) is not straightforward, I think I had to use some files from version 2.2.2.
What you really need for the converters is compiling the libraries libcgnsoo_3.0 and cgnslib_2.5.
The compilation of the cgnstools and the other stuff is optional.

However to be able to read CGNS files from current CFD codes you better compile the converters with a more recent CGNS library (-> http://cgns.github.io/).
As meanwhile the CGNS standard file format changed from ADF to HDF5 (->https://support.hdfgroup.org/HDF5/) one may also compile the CGNS library and tools with a current HDF5 library.
I did not succeed here yet, but there also exists cgnstools converters 'hdf2adf' and 'adf2hdf' that can do that job.

I have an Ubuntu installation where a CGNS library (libcgns.so.3.1) and the 'hdf2adf' and 'adf2hdf' converters may be easily installed by the package system.

3. It is also interesting to know that *.cgns files may have the solution either stored at the vertex or cell center locations. One may find out which location with the cgnstool 'cgnsview' or try 'convert_location' and look at the output.
So if like to try out forth and back conversion from and to OF for verification you won't get the original al result because foamToCGNS writes out data to the vertex locations (while OF data is at cell centers). Beyond that, for me the converters seem to work all right and it was simple to make them convert all fields. By default only valid CGNS names are converted, the cgnstool ’cgnsnames' lists them.

4. As you often do not want to use the foreign CGNS mesh directly for your calculations, you can map the data to your calculation case using 'mapFields'. However 'mapFields' not always works fine for OF cases that have been generated from CGNS files. In a case where 'mapFields' reported warnings and just wrote an unchanged target field 'checkMesh' indicated many problems with the transformed mesh.

My summary: it was some effort to get up to date CGNS capabilities for OpenFOAM but it was worth it in my case.

Hope this helps someone.

harsha_kulkarni December 14, 2018 00:30

Hello friends,


I am trying to install cgnstools_2.5 but it is showing following error


make[1]: Entering directory '/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnstools_2.5/cgnstools/adfviewer'
cc -DPROTOTYPE -O2 -I../common -I/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnslib_2.5 -I/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnslib_2.5/adf -c adfwish.c
In file included from adfwish.c:15:0:
tk.h:38:17: fatal error: tcl.h: No such file or directory
compilation terminated.
Makefile:126: recipe for target 'adfwish.o' failed
make[1]: *** [adfwish.o] Error 1
make[1]: Leaving directory '/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnstools_2.5/cgnstools/adfviewer'
Makefile:53: recipe for target 'prog-adfviewer' failed
make: *** [prog-adfviewer] Error 2
----- adfviewer -----
make[1]: Entering directory '/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnstools_2.5/cgnstools/adfviewer'
installing shell scripts to /home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnstools_2.5/cgnstools/platforms/linux64Gcc47DPOpt/bin
cc -DPROTOTYPE -O2 -I../common -I/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnslib_2.5 -I/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnslib_2.5/adf -c adfwish.c
In file included from adfwish.c:15:0:
tk.h:38:17: fatal error: tcl.h: No such file or directory
compilation terminated.
Makefile:126: recipe for target 'adfwish.o' failed
make[1]: *** [adfwish.o] Error 1
make[1]: Leaving directory '/home/harsha/OpenFOAM/harsha-2.4.0/application/openfoam-extend-Breeder2.0-OSIG-TurboMachinery-master/src/cgnstools_2.5/cgnstools/adfviewer'
Makefile:81: recipe for target 'install-adfviewer' failed
make: *** [install-adfviewer] Error 2

volker1 December 14, 2018 02:37

Hi,

from:
Quote:

Originally Posted by harsha_kulkarni (Post 719144)
fatal error: tcl.h: No such file or directory

I assume that probably tcl source files are not installed on your system.
tcl.h should be in /usr/include/tcl8.x

Enter e.g. "linux tcl.h" for more info on tcl from the web.

This may not be the only further software required for compilation.
I remember it took me a while until I got the cgnstools running and I did not manage to include HDF properly.

harsha_kulkarni December 14, 2018 02:49

Quote:

Originally Posted by volker1 (Post 719155)
Hi,

from:


I assume that probably tcl source files are not installed on your system.
tcl.h should be in /usr/include/tcl8.x

Enter e.g. "linux tcl.h" for more info on tcl from the web.

This may not be the only further software required for compilation.
I remember it took me a while until I got the cgnstools running and I did not manage to include HDF properly.




yes it is there tcl8.6 in /usr/include/
I also add tcl.h from internet in cngtools
but error persist

volker1 December 14, 2018 04:20

Hi,

I see. I am sorry I am no expert in compilation strategies, so just some ideas that hopefully help:

- check out tcl paths if just "tcl" or a version "tclx.y"is listed. For the first case there should be a symlink "tcl -> tcl8.6" in /usr/include

- make sure you have read access for this directory and file and/or compile as root.

- check out the #include statement in "tk.h"

Good luck!


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