BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem::gastables Namespace Reference

Classes

class  Arguments
 Command line front end of the gastable executable. More...
class  GasData
 The per species property record: the scalar data that describe a gas but do not depend on the state. More...
class  HeatPoly
 One temperature interval of the caloric description of a species. More...
class  HeatPolyCustom
 A caloric interval whose exponents are not the NASA-9 ones ( -2 … 4 ); used for the fitted cryogenic and hot extrapolations. More...
class  HeatPolyEmpty
 An empty polynomial that returns only zeros. More...
class  HeatPolyGlue
 A special polynomial that smoothly connects two other polynomials. More...
class  InputAlpha
 Reader for cubicalpha.inp, the fitted alpha function coefficients of Mahmoodi and Sedigh ( doi 10.1016/j.fluid.2016.12.015 ). More...
class  InputData
 Reader for gasdata.inp, the table of critical point and molecular data. More...
class  InputThermo
 a class that can read the thermo.inp More...
class  InputTransport
 Reader for trans.inp, the CEA transport property table. More...
struct  OpHeatPoly
struct  OpTransportPoly
class  RefGas
 A single chemical species with its caloric and transport properties. More...
class  RefGasFactory
 Builds RefGas objects from the shipped data tables. More...
class  TransportPoly
 One temperature interval of the transport description of a species. More...
class  TransportPolyCustom
 A transport interval whose exponents are not the CEA ones. More...
class  TransportPolyEmpty
 Placeholder for a species with no transport data at all. More...
class  TransportPolyGlue
 A short interval bridging two tabulated transport intervals. More...

Enumerations

enum class  State {
  PrintHelp = 0 , PrintTable = 1 , PrintUsage = 2 , PrintBanner = 3 ,
  Undefined = 4
}
enum class  RefGasMode { POLY = 0 , SPLINE = 1 , UNDEFINED = 2 }
 how a RefGas evaluates its properties More...
enum class  TransportPolyType { VISCOSITY , CONDUCTIVITY , UNDEFINED }
enum class  TransportPolyKind {
  DEFAULT , CUSTOM , GLUE , EMPTY ,
  UNDEFINED
}

Functions

void create_glue_poly (const real &aX, const real &aDeltaX, const Vector< real > &aF, Vector< real > &aC)
 this function creates the intermediate polynomials for cea
string data_path ()
 Return the directory holding the gas tables.
bool data_available ()
 Test whether the gas tables can be found.
string fix_capitals (const string &aLabel)
 fix capitalization of components, eg XE --> Xe
string fix_label (const string &aLabel)
 fix illogical naming in CEA, eg AL --> Al, CL --> Cl
real idgas_lambda (RefGas *aGas, const real T)
 calculate the conductivity in case there is no data in the database
real idgas_mu (RefGas *aGas, const real T)
 calculate the viscosity in case there is no data in the database
bool is_noble (const string &aLabel)
std::string_view trim_field (const std::string_view aField)
real parse_real (const std::string_view aField, const char *aContext)
 locale-independent, non-throwing replacement for std::stod in the fixed-column parsers; aborts with context on a malformed field
real parse_real_optional (const std::string_view aField, const real aFallback, const char *aContext)
 like parse_real, but an empty or whitespace-only field returns the given fallback instead of aborting
int parse_int (const std::string_view aField, const char *aContext)
 locale-independent, non-throwing replacement for std::stoi
std::string parse_field (const std::string &aLine, const size_t aPos, const size_t aCount, const char *aContext)
 bounds-checked substring for fixed-column records; aborts with context if the line is shorter than the requested window start

Variables

constexpr char gGastablesSubdir [] = "/fluid"
 subdirectory of the data path that holds the gas tables
constexpr char gGastablesMarker [] = "/gasdata.inp"
 a directory counts as the gas table directory if this file is in it
const real gTref = BELFEM_TREF
const real gPref = BELFEM_PREF
const real gTmax = 13000.0
const real gTmin = 100.0
const real gPmin = 1e-4
const real gDeltaT = 5.0
const uint gNumberOfSplinePoints = ( uint ) ( gTmax / gDeltaT ) + 1

Enumeration Type Documentation

◆ RefGasMode

enum class belfem::gastables::RefGasMode
strong

how a RefGas evaluates its properties

POLY : directly from the piecewise NASA-9 polynomials, exact but with a linear search for the interval that holds T SPLINE : from cubic splines sampled off those polynomials, which is what the factory leaves every gas in

Enumerator
POLY 
SPLINE 
UNDEFINED 

◆ State

enum class belfem::gastables::State
strong
Enumerator
PrintHelp 
PrintTable 
PrintUsage 
PrintBanner 
Undefined 

◆ TransportPolyKind

Enumerator
DEFAULT 
CUSTOM 
GLUE 
EMPTY 
UNDEFINED 

◆ TransportPolyType

Enumerator
VISCOSITY 
CONDUCTIVITY 
UNDEFINED 

Function Documentation

◆ create_glue_poly()

void belfem::gastables::create_glue_poly ( const real & aX,
const real & aDeltaX,
const Vector< real > & aF,
Vector< real > & aC )
inline

this function creates the intermediate polynomials for cea

◆ data_available()

bool belfem::gastables::data_available ( )

Test whether the gas tables can be found.

Never aborts, so a caller can degrade gracefully rather than fail to construct.

◆ data_path()

string belfem::gastables::data_path ( )

Return the directory holding the gas tables.

If gBelfemDataPath is set, which Communicator::set_globals() does from $BELFEM_DATA and a config file may also do, its fluid subdirectory is returned without being checked, so a wrong path fails where the file is opened rather than falling through to a different directory. Otherwise share/fluid is searched relative to the working directory. Returns an empty string if neither holds the tables.

◆ fix_capitals()

string belfem::gastables::fix_capitals ( const string & aLabel)

fix capitalization of components, eg XE --> Xe

◆ fix_label()

string belfem::gastables::fix_label ( const string & aLabel)

fix illogical naming in CEA, eg AL --> Al, CL --> Cl

◆ idgas_lambda()

real belfem::gastables::idgas_lambda ( RefGas * aGas,
const real T )

calculate the conductivity in case there is no data in the database

◆ idgas_mu()

real belfem::gastables::idgas_mu ( RefGas * aGas,
const real T )

calculate the viscosity in case there is no data in the database

◆ is_noble()

bool belfem::gastables::is_noble ( const string & aLabel)
inline

◆ parse_field()

std::string belfem::gastables::parse_field ( const std::string & aLine,
const size_t aPos,
const size_t aCount,
const char * aContext )
inline

bounds-checked substring for fixed-column records; aborts with context if the line is shorter than the requested window start

◆ parse_int()

int belfem::gastables::parse_int ( const std::string_view aField,
const char * aContext )
inline

locale-independent, non-throwing replacement for std::stoi

◆ parse_real()

real belfem::gastables::parse_real ( const std::string_view aField,
const char * aContext )
inline

locale-independent, non-throwing replacement for std::stod in the fixed-column parsers; aborts with context on a malformed field

◆ parse_real_optional()

real belfem::gastables::parse_real_optional ( const std::string_view aField,
const real aFallback,
const char * aContext )
inline

like parse_real, but an empty or whitespace-only field returns the given fallback instead of aborting

◆ trim_field()

std::string_view belfem::gastables::trim_field ( const std::string_view aField)
inline

Variable Documentation

◆ gDeltaT

const real belfem::gastables::gDeltaT = 5.0

◆ gGastablesMarker

char belfem::gastables::gGastablesMarker[] = "/gasdata.inp"
constexpr

a directory counts as the gas table directory if this file is in it

◆ gGastablesSubdir

char belfem::gastables::gGastablesSubdir[] = "/fluid"
constexpr

subdirectory of the data path that holds the gas tables

◆ gNumberOfSplinePoints

const uint belfem::gastables::gNumberOfSplinePoints = ( uint ) ( gTmax / gDeltaT ) + 1

◆ gPmin

const real belfem::gastables::gPmin = 1e-4

◆ gPref

const real belfem::gastables::gPref = BELFEM_PREF

◆ gTmax

const real belfem::gastables::gTmax = 13000.0

◆ gTmin

const real belfem::gastables::gTmin = 100.0

◆ gTref

const real belfem::gastables::gTref = BELFEM_TREF