ANSYS ICEM CFD™ Boundary Condition Library Description


 Last revised on March 3 2000.

Contents:
 

Introduction

The boundary conditions file and file format were changed with release 4.0 of ICEM CFD software.  The previous boundary condition file was called boco.  The new boundary condition file is  named family_boco.
 

Description of the new file format family_boco:

This file contains a list of boundary conditions for each family of the mesh.  Each boundary condition entry may contain any number of strings and/or numerical values, and there is no limit in length for the string data.

Description of the old file format boco:

This file contains a list of boundary conditions for each of the topological entities (domains, subfaces, edge entities, vertices, patches, patch families, families). Each boundary condition entry consists of two strings of five characters and ten real values:

flag1, flag2

value1, value2, ... value10

Boundary condition library:

The boundary condition library, bocolib.a, contains routines to access the information present in the boundary condition file. To use these routines, application codes must be linked to the boundary condition library located in the directory /$ICEM_ACN/icemcfd/output-interfaces/lib

The boundary condition library can read invariably the new and old boundary condition file.

This document describes the functions of the boundary condition library. Unless otherwise specified, the return code ier is equal to zero when the function is executed successfully. All functions are available for FORTRAN and C programming interface.
 
 

Open, Read and Close
 
 

C ier = bc_open(filename) ; 
FORTRAN call bcopen(filename, len, iunit, ier)
filename char*(*) filename of the boundary condition
len int length of filename
iunit int FORTRAN unit number
ier int return code
The functionbc_open()opens the boundary condition file for reading. It must be called before any other function of the boundary condition library.
___________________________


C void bc_close();
FORTRAN call bclose(iunit)
iunit int FORTRAN unit number
The functionbc_closecloses the boundary condition file. It should be the last function called from the boundary condition library.
___________________________


C ier = bc_read();
FORTRAN call bocoread(iunit, ier)

 
iunit int FORTRAN unit number
ier int return code
The function bc_read reads the boundary condition file and stores the information in memory. This routine must be called once, immediately after opening the boundary condition file.
__________________________


C ier = bc_init(filename);
FORTRAN call bocinit(filename, len, ier

 
filename char*(*) filename of topology file
len int length of string filename
ier int return code
The functionbc_initopens, reads and closes a boundary condition file. It can be used instead of the sequencebc_open(), bc_read()and bc_close().



Definitions

The boundary conditions are stored as a function of the type of topological entity, and the entity number. The variable mode is used to define the type of topological entity. The convention is as follows:
 

Topological type Mode number
Domain 1
Subface 2
Edge 3
Vertice 4
Patch 5
Patch family 6
Unstructured family [1,7]

 

Library functions to extract data from a "family_boco" file

All older functions of the boundary condition library can be used to read the family_boco file.  Therefore all codes written prior to ICEM CFD 4.0 still work weather the boundary condition file boco or family_boco is used.  However, the old boundary condition library functions  bear the same limitations as the old boundary condition file:

  • Maximum of 2 character variables and 10 numerical values per boundary condition
  • Maximum of 5 characters per character variable
  • Therefore it is better to use the new boundary condition functions.

    The new family_boco file links the boundary conditions to the families rather than to domains, subfaces, edges, vertices, as in the old boco file.  The connection between the families and the topological entities is recorded in a second file called family_topo.    For structured mesh, both files family_boco and family_topo must be read in order to be able to link a boundary condition to a certain topological entity of the mesh.   For unstructured mesh, each element pid corresponds to its family number, and therefore family boundary conditions as recorded in family_boco are sufficient to link the boundary condition to the mesh.

    For structured mesh, a new function called bc_init_both() must be used to open, read and close both the family_boco and family_topo files.  For unstructured mesh, the function bc_init() described above is used.
     

    C
    ier = bc_init_both(famboco_filename, famtopo_filename, nDomains, nSubfaces, nEdges, nVertices, nPatches, nPatchFam, nFreeSF);
    FORTRAN call bcinitb(famboco_filename, famtopo_filename, nDomains, nSubfaces, nEdges, nVertices, nPatches, nPatchFam, nFreeSF,ier

     
    famboco_filename char*(*) name of family_boco file
    famtopo_filename char*(*) name of family_topo file
    nDomains int number of domains in the model
    nSubfaces int number of subfaces in the model
    nEdges int number of edges in the model
    nVertices int number of vertices in the model
    nPatches int number of patches in the model (usually 0)
    nPatchFam int number of patch families in the model (usually 0)
    nFreeSF int number of free subfaces in the model (usually 0)
    ier int return code

     
    C ier = bc_family_name(mode, entity, family_name);
    FORTRAN (n.a.) 

     
    mode int topological type
    entity int entity number of the topological type
    family_name char *(*) family name
    ier int return code

     
     

    C

    ier = bc_get_data(mode, entity, ibc, types, values);
    FORTRAN (n.a.) 

     
    mode int topological type
    entity int entity number of the topological type
    ibc int boundary condition number for the entity
    types int ** array of variable types (BOCO_STRING or BOCO_FLOAT)
    values void *** array of variable values
    ier int return code

     
     

    Library functions to extract data from a "boco" file

    Even though all these functions can also be used with the new boundary condition file, family_boco, it is preferable to use the newer functions, which allow for unlimited number of string and numerical data in a boundary condition entry, and allow for unlimited string length.  When using these old functions with the new file format,  the string data will be cut down to 5 characters maximum, and no more than 2 strings and 10 numerical data will be return per boundary condition entry.   In short these old functions carry the same limitation as the old boundary condition file format.
     

    C ier = bc_num(mode, nentity, nbc);
    FORTRAN call bocum(mode, nentity, nbc,ier
    mode int topological type
    nentity int number of entities of this type
    nbc int number of boundary conditions for this topo type
    ier int return code

    This function returns the number of entities and boundary conditions for a topological type, nentity and nbc.

    ____________________
    C ier = bc_info(mode, nentity, nposib, nsiboca);
    FORTRAN call bocinfo(mode, nentity, nposib, nsiboca,ier

     
    mode int topological type
    nentity int number of entities of this type
    nposib(nentity+1) int pointers to the first b.c. of each entity
    nsiboca(nentity) int number of b.c. for each entity
    ier int return code
    The function bc_info returns 2 arrays, nposib and nsiboca: The first array, nposib, contains an array of pointers to the first boundary condition of each entity. The second array, nsiboca, contains the number of boundary conditions for each entity.
    ____________________


    C ier = bc_get_flags(iboco, bcflag1[6], bcflag2[6]);
    FORTRAN call gtflag(iboco, bcflag1, bcflag2, ier

     
    iboco int pointer to the boundary condition table; nposib(n)<=iboco<nposib(n)+nsiboca(n)
    bcflag1 char*6 first character variable for this boundary condition
    bcflag2 char*6 second character variable for this boundary condition
    ier int return code
    This function returns boundary condition flags bcflag1 and bcflag2.
    ____________________


    C ier = bc_get_values(iboco, bcvalue[10]);
    FORTRAN call gtval10(iboco, bcvalue, ier
    iboco int pointer to the boundary condition table; nposib(n)<=iboco<nposib(n)+nsiboca(n)
    bcvalue(10) real ten numerical values for this boundary condition
    ier int return code
    This function returns boundary condition values, bcvalue.

    ____________________



     
     

    C nboco = bc_nboco(mode, entity, ier);
    FORTRAN nboco = nboco(mode, entity, ier)
    mode int topological type
    entity int entity number of this topological type
    nboco int number of boundary conditions for this entity
    ier int return code
    This function returns the number of boundary condition(s) for a given entity,nboco. Since ICEM CFD 4.0 this function returns one additional boundary condition data to account for the family name.
    ____________________
    C ier = bc_flag(mode, entity, boco, bcflag1[6], bcflag2[6]);
    FORTRAN call bcflag(mode, entity, boco, bcflag1, bcflag2, ier)
    mode int topological type
    entity int entity number of this topological type
    boco int boundary condition number (index);  1<=boco<=nboco
    bcflag1 char*6 first character variable for this b.c.
    bcflag2 char*6 second character variable for this b.c.
    ier int return code

    This function returns the boundary condition flags, bcflag1 and bcflag2. It differs from bc_get_flags only in the way that it references the boundary condition. In bc_get_flags the pointer to the boundary condition in the global boundary condition table must be given. Here, the pointer is found internally using the combination mode, entity and boco.

    ____________________
    C ier = bc_value(mode, entity, boco, bcvalue[10]);
    FORTRAN call bcval10(mode, entity, boco, bcvalue, ier)
    mode int topological type
    entity int entity number of this topological type
    boco int boundary condition number (index); 1<=boco<=nboco
    bcvalue(10) real ten numerical values for this b.c.
    ier int return code
    This function returns boundary condition values bcvalue. It differs from bc_get_values only in the way it references the boundary condition. Inbc_get_values the pointer to the boundary condition in the global boundary condition table must be given. Here, the pointer is found internally using the combination mode, entity and boco.
    ____________________
    C nandat = bc_n_analysis_datas();
    FORTRAN n=nandat()
    Number of analysis data, nandat This feature is available only for MULCAD Version 3.1.2 or above.

    ____________________

    C ier = bc_flags_analysis_data(iandat, anflag1, anflag2);
    FORTRAN call flandat(mode, anflag1, anflag2, ier)
    iandat int analysis data number
    anflag1 char*5 first character variable for this data set
    anflag2 char*5 second character variable for this data set
    ier int return code
    This function returns analysis data flags, anflag1 and anflag2.
    ____________________
    C ier = bc_values_analysis_data(iandat, advalue[10]);
    FORTRAN call adval(iandat, advalue, ier)
    iandat int analysis data number
    advalue(10) real ten numerical values for this data set
    ier int return code
    This function returns the analysis data values, advalues.