CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Using CGNS subroutines

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 24, 2015, 00:41
Default Using CGNS subroutines
  #1
Member
 
Join Date: Jul 2014
Posts: 31
Rep Power: 11
nba1942 is on a distinguished road
Hi, I am working on the code writing "boundary-node information" file through CGNS subroutines.

I had compiled lots of CGNS examples from "A User's Guide to CGNS", so now I know what is what about CGNS subroutines(at least about subroutines used in examples that I tried to compile).

But I still have no idea which subroutines I should use to get this thing work.

Here is what I want;

The program that reads up a grid file with several boundary conditions and writes out the boundary-node info., including the number of segments of a boundary condition and connectivities of nodes of which boundary elements consist.

For example, a boundary condition is assigned to a surface by a pre-processing program(eg. Pointwise or etc), and the program reads up the grid file. Then the program figures out "the number of segments of which elements consist" and "connectivities of nodes of elements". Then, the program writes out the information.

############################################
"the number of segments of far-field"
"connectivity 1(counter-clockwise)"
"connectivity 2(counter-clockwise)"
"connectivity 3(counter-clockwise)"
.
.
.
"the number of segments of solid-wall"
"connectivity 1(counter-clockwise)"
"connectivity 2(counter-clockwise)"
"connectivity 3(counter-clockwise)"
.
.
.
############################################

See fig1 & fig2. There are 2 boundary conditions, solid-wall and far-field.
For solid-wall, there are 2 elements consist of 5 segment, while for far-field, there are only 1 element consists of 3 segments. So, the file would be as below.

############################################
3
23 101 31
5
16 12 21
4 16 21
############################################

I can see that the subroutine "cg_boco_info_f" returns the number of boundary conditions and types of BCs, node index, etc. But I think "cg_boco_info_f" cannot give me information I need.

I need your advice on which subroutines I can use to get my program work for the mission.

I am waiting for any reply.

Thank you.
Attached Images
File Type: png fig1.png (10.4 KB, 1 views)
File Type: png fig2.png (5.6 KB, 1 views)
nba1942 is offline   Reply With Quote

Old   August 24, 2015, 19:14
Default
  #2
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 204
Rep Power: 16
t.teschner is on a distinguished road
If you are using pointwise as your mesh generator (and to store boundary conditions) then you would be surprised that they are handling the cgns file a bit differently. it is very logical to look for the boundary information in the boco subroutines, but as far as i remember, pointwise stores that information in sections and so you need to query cg_section_read_f to get your information.

have you compiled the cgnstools as well when compiling the cgns library? if so, you can have a look at cgnsview (in LIBDIR/src/cgnstools/cgnsview) which will display you the file structure in the terminal (or graphically if you have tcl/tk support), sometimes that helps to understand what is written where and how. cgnsview is particularly interesting as it lets you change the cgns data directly like in a text editor (though i think only in the graphical version)
t.teschner is offline   Reply With Quote

Old   August 25, 2015, 07:07
Default
  #3
Member
 
Join Date: Jul 2014
Posts: 31
Rep Power: 11
nba1942 is on a distinguished road
@t.teschner

sorry for late reply and thanks for reply!
actually I made a grid with 2 BCs using Pointwise and my program makes an error at below line.
################################################
if (iptset .ne. PointList) then
write(6,'('' Error. For this program, BCs must be set'',
+ '' up as PointList type'',a32)') PointSetTypeName(iptset)
stop
end if
################################################

but the grid made by "write_grid_unst.f90(which is one of examples in the guide)" doesn't have any problem at the line.

is this what you meant?

Again, Thanks for your reply!
nba1942 is offline   Reply With Quote

Old   August 25, 2015, 08:01
Default
  #4
Senior Member
 
Tom-Robin Teschner
Join Date: Dec 2011
Location: Cranfield, UK
Posts: 204
Rep Power: 16
t.teschner is on a distinguished road
no, i was just simply saying that all of your boundary information are stored in sections, well or at least if i remember correctly in sections and boco subroutines. what sort of error do you get at that point?
t.teschner 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
[CGNS] CGNS converters available mbeaudoin OpenFOAM Meshing & Mesh Conversion 137 December 14, 2018 04:20
[Gmsh] Cgns support for gmsh robyTKD OpenFOAM Meshing & Mesh Conversion 1 July 13, 2016 11:27
Boundary nodes in CGNS format nba1942 Mesh Generation & Pre-Processing 0 August 24, 2015 00:32
writing link between two CGNS files t.teschner Main CFD Forum 1 February 4, 2014 10:26
parallel support with CGNS format not yet implemented kirkrich SU2 3 January 18, 2013 15:39


All times are GMT -4. The time now is 12:29.