CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Pointwise & Gridgen (https://www.cfd-online.com/Forums/pointwise/)
-   -   To get boundary info. from CGNS grid file. (https://www.cfd-online.com/Forums/pointwise/164863-get-boundary-info-cgns-grid-file.html)

nba1942 January 4, 2016 04:38

To get boundary info. from CGNS grid file.
 
Hi.

I am trying to extract boundary information from structured grid written in CGNS format.

I already have dealt with an unstructured grid generated using pointwise, which stores boundary info. in sections unlike other ordinary grid generators(as I know).

So I could get boundary info. using "cg_element_read" subroutine from a section.

But in this case, I realized that pointwise stores the information in zones not in sections.

I tried "1to1"(as "the user's guide" says) subroutine or "boco" subroutine, but they returns ier=1(which means errors occur while using the subroutine).

I wanna know what subroutines other people are using to get BC information from structured CGNS file.

I am waiting for any reply :)

Thanks for reading!

Kim

dgarlisch January 6, 2016 13:06

2 Attachment(s)
First, I strongly suggest you obtain a copy of CGNSView (64-bit). It is free and I think it is part of the CGNS distribution. CGNSView will let you browse the structure of any valid CGNS file!


Pointwise exports structured boundary zones (BCs) as a ZoneBC_t / BC_t sub-node of each structured block node (Zone_t).

The CGNS path to each BC patch is:
Code:

/Base:CGNSBase_t/BlkName:Zone_t/ZoneBC:ZoneBC_t/
    Bc1Name:BC_t
    Bc2Name:BC_t
    ...
    BcXName:BC_t

Under each BC_t node is a FamilyName:FamilyName_t node that gives the BcName. You will find the BC details under the corresponding node:
Code:

/Base:CGNSBase_t/BcName:Family_t/
I have attached a PDF doc that gives more detail.

nw_ds March 29, 2016 02:09

I can't find any version for CGNSVIEW . The website says that it has been discontinued. So if you have any link for it would be much appreciated.

dgarlisch March 29, 2016 15:11

Quote:

Originally Posted by nw_ds (Post 592088)
I can't find any version for CGNSVIEW . The website says that it has been discontinued. So if you have any link for it would be much appreciated.

CGNS is now on github.

CGNSview is in the cgnstools folder.

This is a source-only distribution. You will need to build it yourself. I am not aware of any pre-built, CGNS distributions.

Good luck!

Eeethon May 28, 2016 09:49

Quote:

Originally Posted by dgarlisch (Post 579797)
First, I strongly suggest you obtain a copy of CGNSView (64-bit). It is free and I think it is part of the CGNS distribution. CGNSView will let you browse the structure of any valid CGNS file!


Pointwise exports structured boundary zones (BCs) as a ZoneBC_t / BC_t sub-node of each structured block node (Zone_t).

The CGNS path to each BC patch is:
Code:

/Base:CGNSBase_t/BlkName:Zone_t/ZoneBC:ZoneBC_t/
    Bc1Name:BC_t
    Bc2Name:BC_t
    ...
    BcXName:BC_t

Under each BC_t node is a FamilyName:FamilyName_t node that gives the BcName. You will find the BC details under the corresponding node:
Code:

/Base:CGNSBase_t/BcName:Family_t/
I have attached a PDF doc that gives more detail.

Hey, dgarlisch.
I recently working on writing a code to read a CGNS file for my CFD code, but there's a problem which really makes me mad! The problem is that when I export a CGNS grid file form Pointwise, all physical boundary condition has been set to be Familyspecified. I check the CGNS file with CGNSview, and found that the excat boundary condition is store in Familyname in "/Base/Zone 1-split-1/ZoneBC/dom-1-split-1". I kown if I can read this value, I can match it with BC family, and get the physical boundary. However, I have found the CGNS function to read this value for long time but I have not found it yet. Would you please help me out! Thanks

dgarlisch May 31, 2016 10:37

in cgnslib.h there are a series of functions that deal with family_t nodes:

int cg_nfamilies(int file_number, int B, int *nfamilies);
int cg_family_read(int file_number, int B, int F, char *family_name, int *nboco, int *ngeos);
int cg_family_write(int file_number, int B, const char * family_name, int *F);

int cg_fambc_read(int file_number, int B, int F, int BC, char *fambc_name, CGNS_ENUMT(BCType_t) *bocotype);
int cg_fambc_write(int file_number, int B, int F, const char * fambc_name, CGNS_ENUMT(BCType_t) bocotype, int *BC);

Pointwise uses the cg_family_write() and cg_fambc_write() functions to export the BC data.

For more CGNS details see:
CGNS Mid-Level Library
CGNS Families
SIDS

The Pointwise CGNS exporter follows the docs linked above.


All times are GMT -4. The time now is 01:15.