Classes | Public Member Functions | Static Public Member Functions | List of all members
reader Class Reference

Reads CCM files as written by PROSTAR/STARCCM. More...

Inheritance diagram for reader:
Inheritance graph
[legend]
Collaboration diagram for reader:
Collaboration graph
[legend]

Classes

class  options
 

Public Member Functions

 reader (const fileName &file, const reader::options &opts)
 
 ~reader ()
 
const reader::optionsoption () const
 
autoPtr< polyMeshmesh (const objectRegistry &registry, const fileName &remappingDictName=fileName::null)
 
bool hasGeometry ()
 
bool hasSolution ()
 
bool remapMeshInfo (const objectRegistry &registry, const fileName &remappingDictName=fileName::null)
 
void writeMesh (const polyMesh &mesh, IOstreamOption streamOpt=IOstreamOption(IOstreamOption::BINARY)) const
 
void writeAux (const objectRegistry &registry) const
 
bool readGeometry (const scalar scaleFactor=1.0)
 
void printInfo () const
 
void clearGeom ()
 
const labelListorigCellId () const
 
const labelListorigFaceId () const
 
const interfaceDefinitionsinterfaceDefinitionsInfo () const
 
const boundaryRegionboundaryTableInfo () const
 
const cellTablecellTableInfo () const
 
Map< wordfluids () const
 
Map< wordsolids () const
 
const solutionTablesolutions ()
 
const fieldTablefields ()
 
const fieldTablelagrangian ()
 
tmp< scalarFieldreadField (const word &solutionName, const word &fieldName, const bool wallData=false)
 
- Public Member Functions inherited from base
 base ()
 
 ~base ()
 
bool close ()
 

Static Public Member Functions

static void warnDuplicates (const word &context, const wordList &lst)
 

Additional Inherited Members

- Protected Types inherited from STARCDCore
enum  fileHeader { HEADER_CEL, HEADER_VRT, HEADER_BND }
 
enum  fileExt { CEL_FILE, VRT_FILE, BND_FILE, INP_FILE }
 
enum  matlType {
  starcdFluidType = 1, starcdSolidType = 2, starcdBaffleType = 3, starcdShellType = 4,
  starcdLineType = 5, starcdPointType = 6
}
 
enum  shapeType {
  starcdPoint = 1, starcdLine = 2, starcdShell = 3, starcdHex = 11,
  starcdPrism = 12, starcdTet = 13, starcdPyr = 14, starcdPoly = 255
}
 
- Protected Member Functions inherited from base
bool assertNoError (const char *msg) const
 
bool assertNoError (const std::string &msg) const
 
 base (const base &)=delete
 
void operator= (const base &)=delete
 
- Protected Member Functions inherited from STARCDCore
 STARCDCore ()=default
 
- Static Protected Member Functions inherited from base
static bool assertNoError (int err, const char *msg)
 
static bool assertNoError (int err, const std::string &msg)
 
- Static Protected Member Functions inherited from STARCDCore
static bool readHeader (IFstream &is, const enum fileHeader header)
 
static void writeHeader (Ostream &os, const enum fileHeader header)
 
static fileName starFileName (const fileName &baseName, const enum fileExt ext)
 
static void removeFiles (const fileName &baseName)
 
static label readPoints (IFstream &is, List< point > &points, List< label > &ids)
 
static void writePoints (Ostream &os, const UList< point > &points, const scalar scaleFactor=1.0)
 
- Protected Attributes inherited from base
std::unique_ptr< ccmGlobalState > globalState_
 
- Static Protected Attributes inherited from STARCDCore
static const Map< FixedList< int, 6 > > starToFoamFaceAddr
 
static const Map< FixedList< int, 6 > > foamToStarFaceAddr
 
static const char *const defaultBoundaryName
 
static const char *const defaultSolidBoundaryName
 

Detailed Description

Reads CCM files as written by PROSTAR/STARCCM.

The Default_Boundary_Region (region 0) is a special region that serves two purposes:

  1. it contains all wall and baffle boundaries that have not otherwise been assigned.
  2. it holds the outer bounds of flow domains (fluid/porous/solid)

The CCM node Meshes/FaceBasedTopology/Cells/Interfaces holds the mapping of the corresponding mesh faces, which can be used to merge these internal boundaries.

If solid cells exist, there are three possible courses of action:

  1. Remove all solid cells for subsequent flow calculations. This is the default.
  2. Treat solid cells like fluid cells, but convert the corresponding Default_Boundary_Region to Default_Boundary_Solid for easier identification. This treatment is useful for visualization purposes.
  3. Move solid cells to a separate mesh region. This would be useful for conjugate heat transfer, but is not implemented.
Files

The constant/remapping file is an IOdictionary that is READ_IF_PRESENT and can be used to remap certain information. eg,

    // rename/combine cellTable entries
    //   newName ( listOldNames );
    cellTable
    {
        fluid ( inletRegion outletRegion );
        cat1  ( CAT1 "cat1_(Back|Front|Gamma)" );
    }

    // rename boundary regions
    //   newName oldName;
    boundaryRegion
    {
        inlet_4  inlet_1;
        inlet_5  inlet_2;
        inlet_6  inlet_3;
    }

The constant/boundaryRegion file is an IOMap<dictionary> that is written. It contains the boundary type and names. eg,

    (
        0
        {
            BoundaryType    wall;
            Label           Default_Boundary_Region;
        }
        1
        {
            BoundaryType    inlet;
            Label           inlet_1;
        }
        ...

        4
        {
            BoundaryType    pressure;
            Label           outlet;
        }
    )

The constant/cellTable file is an IOMap<dictionary> that is written. It contains the cellTable information. eg,

    (
        1
        {
            Label           inletRegion;
            MaterialType    fluid;
            MaterialId      1;
        }
        2
        {
            Label           cat1;
            MaterialType    fluid;
            MaterialId      1;
            PorosityId      1;
        }
        3
        {
            Label           outletRegion;
            MaterialType    fluid;
            MaterialId      1;
        }
    )
Note
this class is still under development
  • any/all of the class names and members may change
Source files

Definition at line 179 of file ccmReader.H.

Constructor & Destructor Documentation

◆ reader()

reader ( const fileName file,
const reader::options opts 
)

Definition at line 643 of file ccmReader.C.

References base::assertNoError(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, base::globalState_, Foam::isFile(), and reader::option().

Here is the call graph for this function:

◆ ~reader()

~reader ( )

Definition at line 702 of file ccmReader.C.

Member Function Documentation

◆ warnDuplicates()

void warnDuplicates ( const word context,
const wordList lst 
)
static

Definition at line 64 of file ccmReaderAux.C.

References Foam::endl(), HashTable::find(), forAllConstIters(), Foam::Info, HashTable::insert(), and Foam::nl.

Here is the call graph for this function:

◆ option()

const Foam::ccm::reader::options & option ( ) const

Definition at line 710 of file ccmReader.C.

Referenced by reader::reader().

Here is the caller graph for this function:

◆ mesh()

Foam::autoPtr< Foam::polyMesh > mesh ( const objectRegistry registry,
const fileName remappingDictName = fileName::null 
)

Definition at line 2594 of file ccmReaderMesh.C.

References IOobject::AUTO_WRITE, polyMesh::defaultRegion, mesh, meshPtr, autoPtr::New(), and IOobject::NO_READ.

Here is the call graph for this function:

◆ hasGeometry()

bool hasGeometry ( )

Definition at line 557 of file ccmReader.C.

◆ hasSolution()

bool hasSolution ( )

Definition at line 564 of file ccmReader.C.

◆ remapMeshInfo()

bool remapMeshInfo ( const objectRegistry registry,
const fileName remappingDictName = fileName::null 
)

Definition at line 586 of file ccmReader.C.

References dictionary::isDict(), IOobject::NO_WRITE, IOobject::READ_IF_PRESENT, and dictionary::subDict().

Here is the call graph for this function:

◆ writeMesh()

void writeMesh ( const polyMesh mesh,
IOstreamOption  streamOpt = IOstreamOption(IOstreamOption::BINARY) 
) const

Definition at line 572 of file ccmReader.C.

References Foam::endl(), Foam::Info, and mesh.

Here is the call graph for this function:

◆ writeAux()

void writeAux ( const objectRegistry registry) const

Definition at line 176 of file ccmReaderAux.C.

References IOstreamOption::ASCII, and IOstreamOption::BINARY.

◆ readGeometry()

bool readGeometry ( const scalar  scaleFactor = 1.0)

Definition at line 529 of file ccmReader.C.

◆ printInfo()

void printInfo ( ) const

Definition at line 515 of file ccmReader.C.

References Foam::endl(), Foam::Info, and Foam::nl.

Here is the call graph for this function:

◆ clearGeom()

void clearGeom ( )

Definition at line 2573 of file ccmReaderMesh.C.

◆ origCellId()

const labelList& origCellId ( ) const
inline

Definition at line 506 of file ccmReader.H.

◆ origFaceId()

const labelList& origFaceId ( ) const
inline

Definition at line 512 of file ccmReader.H.

◆ interfaceDefinitionsInfo()

const interfaceDefinitions& interfaceDefinitionsInfo ( ) const
inline

Definition at line 518 of file ccmReader.H.

◆ boundaryTableInfo()

const boundaryRegion& boundaryTableInfo ( ) const
inline

Definition at line 524 of file ccmReader.H.

◆ cellTableInfo()

const cellTable& cellTableInfo ( ) const
inline

Definition at line 530 of file ccmReader.H.

◆ fluids()

Map<word> fluids ( ) const
inline

Definition at line 536 of file ccmReader.H.

References cellTable::fluids().

Here is the call graph for this function:

◆ solids()

Map<word> solids ( ) const
inline

Definition at line 542 of file ccmReader.H.

References cellTable::solids().

Here is the call graph for this function:

◆ solutions()

const solutionTable& solutions ( )
inline

Definition at line 548 of file ccmReader.H.

◆ fields()

const fieldTable& fields ( )
inline

Definition at line 555 of file ccmReader.H.

◆ lagrangian()

const fieldTable& lagrangian ( )
inline

Definition at line 562 of file ccmReader.H.

◆ readField()

Foam::tmp< Foam::scalarField > readField ( const word solutionName,
const word fieldName,
const bool  wallData = false 
)

Definition at line 350 of file ccmReaderSolution.C.

References cellId, forAll, n, tmp::New(), tmp::ref(), and List::setSize().

Here is the call graph for this function:

The documentation for this class was generated from the following files: