CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

cgns grid problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2013, 05:24
Default cgns grid problem
  #1
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Hello
I am trying to read a cgns file with this error.

Code:
---------------------- Read grid file information -----------------------
Reading the CGNS file: GridT_NAL_PressureModel.cgns
CGNS file contains 1 database(s).
Database 1, Base: 1 zone(s), cell dimension of 3, physical dimension of 3.
Zone 1, Zone: 326907 vertices, 887691 cells, 326907 boundary vertices.
Reading grid coordinates...
Number of coordinate dimensions is 3.
Reading CoordinateX values from file.
Reading CoordinateY values from file.
Reading CoordinateZ values from file.
Reading connectivity information...
Number of connectivity sections is 7.


   !!! Error !!!
 Unrecognized element type.
 Now exiting...
The grid is taken from here

http://cfdcenter.aero.iisc.ernet.in/...grids_user.php

Is there a way to fix this ? cgnscheck seems to be ok

Code:
$ cgnscheck GridT_NAL_PressureModel.cgns 
reading CGNS file GridT_NAL_PressureModel.cgns

reading base "Base"
reading zone "Zone"
  reading element set "fluid"
  reading element set "pressure_farfield"
  reading element set "symmetry"
  reading element set "wall_wing"
  reading element set "wall_sting_modification"
  reading element set "wall_stingbase_outer"
  reading element set "wall_stingbase_inner"
  building volume faces hash table...
  finding exterior nodes...

checking base "Base"
checking zone "Zone"
  checking coordinates "GridCoordinates"
    checking coordinate "CoordinateX"
WARNING:dataclass not given
    checking coordinate "CoordinateY"
WARNING:dataclass not given
    checking coordinate "CoordinateZ"
WARNING:dataclass not given
  checking elements
  checking element set "fluid"
  checking element set "pressure_farfield"
  checking element set "symmetry"
  checking element set "wall_wing"
  checking element set "wall_sting_modification"
  checking element set "wall_stingbase_outer"
  checking element set "wall_stingbase_inner"
  checking boundary conditions
  checking BC "pressure_farfield"
    checking BC interface
  checking BC "symmetry"
    checking BC interface
  checking BC "wall_wing"
    checking BC interface
  checking BC "wall_sting_modification"
    checking BC interface
  checking BC "wall_stingbase_outer"
    checking BC interface
  checking BC "wall_stingbase_inner"
    checking BC interface

checking complete
3 warnings (3 shown)
praveen is offline   Reply With Quote

Old   February 19, 2013, 05:36
Default
  #2
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
The unrecognized element has

elemType = 20
praveen is offline   Reply With Quote

Old   February 20, 2013, 03:02
Default
  #3
Super Moderator
 
Thomas D. Economon
Join Date: Jan 2013
Location: Stanford, CA
Posts: 271
Rep Power: 14
economon is on a distinguished road
Hi Praveen,

It looks like the mesh has elements of type HEXA_20 (extra nodes at the midpoints of each hex edge), while our reader was written with HEXA_8 elements in mind. Please see the page here for more information: http://www.grc.nasa.gov/WWW/cgns/CGN...l#unstructgrid.

We are currently working to expand the CGNS input and output capabilities. In the meantime, if you are interested in modifying the current CGNS implementation to suit your needs, the code for the reader can be found in geometry_structure.cpp around lines 800-1500.

T
economon is offline   Reply With Quote

Old   February 20, 2013, 03:54
Default
  #4
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Thanks. I will try. I did notice some strange behaviour. We are finding number of nodes in the element here

Code:
               /*--- Find the number of nodes required to represent
             this type of element. ---*/

               if ( cg_npe(elemType, &npe) ) cg_error_exit();
               elemIndex[j-1][s-1] = npe;
When I print out npe for the elemType=20, it is showing zero

Code:
               default:
                  printf( "\n\n   !!! Error !!!\n" );
                  printf( " Unrecognized element type = %d.\n", elemType);
                  printf( " Number of nodes           = %d.\n", npe);
                  printf( " Now exiting...\n\n");
                  exit(0);
                  break;
Output

Code:
   !!! Error !!!
 Unrecognized element type = 20.
 Number of nodes           = 0.
 Now exiting...
Does this look right ?
praveen is offline   Reply With Quote

Old   February 20, 2013, 04:25
Default
  #5
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Looking at cgnslib.h, I see that type 20 is MIXED

Code:
483  CGNS_ENUMV( MIXED ) =20,
and such type it does return npe=0

Code:
513 #define  CG_NPE_MIXED     0
.
.

536 #define  NPE_MIXED     0
Do you know how to distinguish the element type in this case ?

Update: The MIXED element format is explained here

http://cgns.sourceforge.net/Proposed...ts_of_sids.pdf

on page No. 68. I think its not so easy to modify su2 to handle this case.

Last edited by praveen; February 20, 2013 at 05:22.
praveen is offline   Reply With Quote

Old   February 26, 2013, 19:23
Default
  #6
Super Moderator
 
Thomas D. Economon
Join Date: Jan 2013
Location: Stanford, CA
Posts: 271
Rep Power: 14
economon is on a distinguished road
Indeed, we wrote the reader to handle separate element types rather than mixed elements within one zone (this seems to be how the mesh generation software that we most frequently use exports unstructured CGNS meshes).

That being said, it certainly isn't impossible to modify the current reader to handle this situation. In fact, I am sure other folks might be interested in something like this too. If you think you might want to give this a try, please feel free to ask questions about the current implementation in SU2.
economon is offline   Reply With Quote

Old   February 27, 2013, 12:21
Default
  #7
Member
 
Sean (J.X.) Shi
Join Date: May 2012
Location: US
Posts: 34
Rep Power: 14
momo_sjx is on a distinguished road
I had the same problem.
I do not know how to fix that by modifying the code. So I used ICEM to convert the cell type. i.e. convert quad cell to triangle cell.
Then the cgns format can be converted to su2 format by the program.
It worked for me, although the number of elements increased, and costed more computational time, but the result was pretty good.
momo_sjx is offline   Reply With Quote

Old   February 27, 2013, 17:18
Default
  #8
Super Moderator
 
Thomas D. Economon
Join Date: Jan 2013
Location: Stanford, CA
Posts: 271
Rep Power: 14
economon is on a distinguished road
Ah, I had been curious about that, because we had heard that some ICEM grids were causing problems with the CGNS reader in SU2 (I don't have access to ICEM).

So, you can confirm that having mixed element types is indeed the issue w/ CGNS meshes from ICEM in SU2? Was it 2D or 3D? Same issues for interior vs. boundary elements?

Thanks for the feedback. This will help guide some upgrades to the CGNS reader in SU2...
economon is offline   Reply With Quote

Old   February 28, 2013, 00:09
Default
  #9
Member
 
Sean (J.X.) Shi
Join Date: May 2012
Location: US
Posts: 34
Rep Power: 14
momo_sjx is on a distinguished road
In my cases, y++<1, so I used hybrid mesh, namely inflation of quad(2d) or hex(3d) cells on the boundary (airfoil).
After then, I used ICEM to convert all quad to tri (2d) or all cell to tetra (3d) in the Edit Mesh Tab. Otherwise, same error would occur, as shown in #1.
Finally, the exported CGNS grid can be successfully converted and used in SU2.
momo_sjx is offline   Reply With Quote

Old   March 7, 2013, 04:01
Default
  #10
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
Dear Praveen,

Did you find a workaround for this problem?
I am also trying to use the same mesh for the workshop and I have the same problem.

We created a converter from GridPro to SU2, but at first we would like to try the organiser's grids with both SU2 and OpenFOAM
vinz is offline   Reply With Quote

Old   March 7, 2013, 04:41
Default
  #11
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
No. I am planning to write a separate converter from cgns to su2 format but I have not had time to work on it.
praveen is offline   Reply With Quote

Old   March 11, 2013, 05:33
Default
  #12
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
Dear all,

My colleague Martin SPEL modified the source code in order to be able to handle the zones with mixed elements. It actually had nothing to do with HEX 20 elements.

There was also another problem which was that we couldn't run the CGNS conversion if the code was compiled with MPI activated. It is now possible, since we only check if we are running parallel or not (not compilation based).

Please, find attached the modified file.
Attached Files
File Type: zip geometry_structure.cpp.zip (54.6 KB, 58 views)
vinz is offline   Reply With Quote

Old   March 12, 2013, 01:44
Default
  #13
Super Moderator
 
Thomas D. Economon
Join Date: Jan 2013
Location: Stanford, CA
Posts: 271
Rep Power: 14
economon is on a distinguished road
Vincent,

Thank you for sharing: this is a great contribution! If it is alright with you and your colleague, I would like to adapt the code that you have shared and place it into the current version of SU2 so that it will be available in the next release.

I'll be in touch to discuss further,
Tom
economon is offline   Reply With Quote

Old   March 12, 2013, 03:35
Default
  #14
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
Thanks for this. I tried it on my cgns grid. I am able to save the mesh in su2 format but cannot run the cfd with the cgns mesh, some segmentation fault.

However I do not get segmentation fault if I run with the converted su2 mesh file.
praveen is offline   Reply With Quote

Old   March 12, 2013, 09:43
Default
  #15
Senior Member
 
Vincent RIVOLA
Join Date: Mar 2009
Location: France
Posts: 283
Rep Power: 18
vinz is on a distinguished road
Hi Praveen,

Totally normal from what I understood. SU2 does not handle CGNS in parallel so far.
So you have to first run a serial computation, at least up to the CGNS conversion. And then you can run your parallel computation using the SU2 mesh obtained from the previous computation.

A bit tricky, but at least it works

@Tom: No problem, I sent you an email regarding the code.
vinz is offline   Reply With Quote

Old   March 12, 2013, 09:58
Default
  #16
Super Moderator
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 343
Blog Entries: 6
Rep Power: 18
praveen is on a distinguished road
I was making a serial run on the cgns file when the segmentation occurred. But yes, I can just use the converted file. Thanks.
praveen is offline   Reply With Quote

Old   March 12, 2013, 14:20
Default
  #17
Member
 
Sean (J.X.) Shi
Join Date: May 2012
Location: US
Posts: 34
Rep Power: 14
momo_sjx is on a distinguished road
Thanks a lot, it works.
Help me saving much computational cost.
momo_sjx is offline   Reply With Quote

Old   September 2, 2013, 20:12
Default
  #18
Member
 
Eduardo Molina
Join Date: Sep 2010
Location: Brazil
Posts: 35
Rep Power: 16
EMolina is on a distinguished road
Hi all,


For those who are failing to convert quad cells using cgns from ICEMCFD 14.5, just select cgns version 2.4 and SU2 is able to convert the files. I saw here in CFDOnline that other people are facing the same CGNS problem with version later than ICEM 12.1.


Cheers.
EMolina is offline   Reply With Quote

Old   September 2, 2013, 20:34
Default
  #19
Member
 
Eduardo Molina
Join Date: Sep 2010
Location: Brazil
Posts: 35
Rep Power: 16
EMolina is on a distinguished road
Hi all,


For those who are failing to convert quad cells using cgns from ICEMCFD 14.5, just select cgns version 2.4 and SU2 is able to convert the files. I saw here in CFDOnline that other people are facing the same CGNS problem with version later than ICEM 12.1.


Cheers.
EMolina is offline   Reply With Quote

Old   March 10, 2014, 13:27
Default
  #20
JuB
New Member
 
Join Date: Jan 2014
Posts: 3
Rep Power: 12
JuB is on a distinguished road
Hello Guys,

I keep getting a similar error but I cannot compile with the archive *.cpp attached above.Am I supposed to do so? Does anyone have any idea what the problem may be?

Code:
---------------------- Read grid file information -----------------------
Reading the CGNS file: Patrulha6.cgns
CGNS file contains 1 database(s).
Database 1, Unstructured data: 1 zone(s), cell dimension of 3, physical dimension of 3.
Zone 1, Patrulha5: 6743713 vertices, 6203599 cells, 0 boundary vertices.
Reading grid coordinates...
Number of coordinate dimensions is 3.
Reading CoordinateX values from file.
Reading CoordinateY values from file.
Reading CoordinateZ values from file.
Reading connectivity information...
Number of connectivity sections is 20.


   !!! Error !!!
 Unrecognized element type.
 Now exiting...
Thank you all,
Regards
JuB
JuB is offline   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
On grid independent solution for pulsatile flow David FLUENT 5 March 25, 2022 04:33
Help,Mixsim,Generate Grid problem whale1011 FLUENT 1 December 20, 2012 20:40
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 18:51
Re: Convergence problem for refined grid CFD_Novice Main CFD Forum 13 February 17, 2008 23:56
nonstaggered grid problem Zhi-Xing Yu Main CFD Forum 7 August 26, 1998 14:22


All times are GMT -4. The time now is 16:45.