GRINS-0.6.0
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
GRINS::AntiochChemistry Class Reference

Wrapper class for Antioch::ChemicalMixture. More...

#include <antioch_chemistry.h>

Inheritance diagram for GRINS::AntiochChemistry:
Inheritance graph
[legend]

Public Member Functions

 AntiochChemistry (const GetPot &input)
 
virtual ~AntiochChemistry ()
 
libMesh::Real M (unsigned int species) const
 Species molar mass (molecular weight), [kg/mol]. More...
 
libMesh::Real M_mix (const std::vector< libMesh::Real > &mass_fractions) const
 Mixture molar mass (molecular weight), [kg/mol]. More...
 
libMesh::Real R (unsigned int species) const
 Species gas constant, [J/kg-K]. More...
 
libMesh::Real R_mix (const std::vector< libMesh::Real > &mass_fractions) const
 Mixture gas constant, [J/kg-K]. More...
 
libMesh::Real X (unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
 Species mole fraction, unitless. More...
 
void X (libMesh::Real M, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &mole_fractions) const
 Mole fraction for all species, unitless. More...
 
libMesh::Real molar_density (const unsigned int species, const libMesh::Real rho, const libMesh::Real mass_fraction) const
 Species molar density, [mol/m^3]. More...
 
void molar_densities (const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &molar_densities) const
 Molar density for all species, [mol/m^3]. More...
 
unsigned int n_species () const
 
unsigned int species_index (const std::string &species_name) const
 
std::string species_name (unsigned int species_index) const
 
const Antioch::ChemicalMixture< libMesh::Real > & chemical_mixture () const
 Accessor to underlying Antioch object. More...
 
const AntiochChemistrychemistry () const
 Accessor for this class. More...
 

Protected Attributes

boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
 

Private Member Functions

 AntiochChemistry ()
 

Detailed Description

Wrapper class for Antioch::ChemicalMixture.

This class is expected to be constructed before threads have been forked and will live during the whole program. By default, Antioch is working in SI units. Note that this documentation will always be built regardless if Antioch is included in the GRINS build or not. Check configure output to confirm that Antioch was included in the build.

Definition at line 60 of file antioch_chemistry.h.

Constructor & Destructor Documentation

GRINS::AntiochChemistry::AntiochChemistry ( const GetPot &  input)

Definition at line 38 of file antioch_chemistry.C.

References _antioch_gas, and n_species().

39  : _antioch_gas(NULL)
40  {
41  if( !input.have_variable("Physics/Chemistry/species") )
42  {
43  std::cerr << "Error: Must specify species list to use Antioch." << std::endl;
44  libmesh_error();
45  }
46 
47  unsigned int n_species = input.vector_variable_size("Physics/Chemistry/species");
48  std::vector<std::string> species_list(n_species);
49 
50  for( unsigned int s = 0; s < n_species; s++ )
51  {
52  species_list[s] = input( "Physics/Chemistry/species", "DIE!", s );
53  }
54 
55  _antioch_gas.reset( new Antioch::ChemicalMixture<libMesh::Real>( species_list ) );
56 
57  return;
58  }
unsigned int n_species() const
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
GRINS::AntiochChemistry::~AntiochChemistry ( )
virtual

Definition at line 60 of file antioch_chemistry.C.

61  {
62  return;
63  }
GRINS::AntiochChemistry::AntiochChemistry ( )
private

Member Function Documentation

const Antioch::ChemicalMixture< libMesh::Real > & GRINS::AntiochChemistry::chemical_mixture ( ) const
inline

Accessor to underlying Antioch object.

Definition at line 178 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by GRINS::AntiochEvaluator< Thermo >::specialized_build_thermo().

179  {
180  return *_antioch_gas.get();
181  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
const AntiochChemistry & GRINS::AntiochChemistry::chemistry ( ) const
inline

Accessor for this class.

Definition at line 201 of file antioch_chemistry.h.

202  {
203  return *this;
204  }
libMesh::Real GRINS::AntiochChemistry::M ( unsigned int  species) const
inline

Species molar mass (molecular weight), [kg/mol].

Definition at line 122 of file antioch_chemistry.h.

References _antioch_gas.

123  {
124  return _antioch_gas->M(species);
125  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real GRINS::AntiochChemistry::M_mix ( const std::vector< libMesh::Real > &  mass_fractions) const
inline

Mixture molar mass (molecular weight), [kg/mol].

Definition at line 128 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by main().

129  {
130  return _antioch_gas->M(mass_fractions);
131  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
void GRINS::AntiochChemistry::molar_densities ( const libMesh::Real  rho,
const std::vector< libMesh::Real > &  mass_fractions,
std::vector< libMesh::Real > &  molar_densities 
) const
inline

Molar density for all species, [mol/m^3].

Definition at line 192 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by GRINS::AntiochKinetics::omega_dot().

195  {
196  _antioch_gas->molar_densities( rho, mass_fractions, molar_densities );
197  return;
198  }
void molar_densities(const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &molar_densities) const
Molar density for all species, [mol/m^3].
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real GRINS::AntiochChemistry::molar_density ( const unsigned int  species,
const libMesh::Real  rho,
const libMesh::Real  mass_fraction 
) const
inline

Species molar density, [mol/m^3].

Definition at line 184 of file antioch_chemistry.h.

References _antioch_gas.

187  {
188  return _antioch_gas->molar_density( species, rho, mass_fraction );
189  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int GRINS::AntiochChemistry::n_species ( ) const
inline

Definition at line 162 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by AntiochChemistry(), GRINS::AntiochMixture::build_stat_mech_ref_correction(), do_transport_eval(), main(), and GRINS::AntiochKinetics::omega_dot().

163  {
164  return _antioch_gas->n_species();
165  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real GRINS::AntiochChemistry::R ( unsigned int  species) const
inline

Species gas constant, [J/kg-K].

R_universal/M(species)

Definition at line 134 of file antioch_chemistry.h.

References _antioch_gas.

135  {
136  return _antioch_gas->R(species);
137  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real GRINS::AntiochChemistry::R_mix ( const std::vector< libMesh::Real > &  mass_fractions) const
inline

Mixture gas constant, [J/kg-K].

Definition at line 140 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by main(), and test_evaluator().

141  {
142  return _antioch_gas->R(mass_fractions);
143  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int GRINS::AntiochChemistry::species_index ( const std::string &  species_name) const
inline

Definition at line 168 of file antioch_chemistry.h.

References _antioch_gas.

169  {
170 #if ANTIOCH_MAJOR_VERSION < 1 && ANTIOCH_MINOR_VERSION < 3
171  return _antioch_gas->active_species_name_map().find(species_name)->second;
172 #else
173  return _antioch_gas->species_name_map().find(species_name)->second;
174 #endif
175  }
std::string species_name(unsigned int species_index) const
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
std::string GRINS::AntiochChemistry::species_name ( unsigned int  species_index) const

Definition at line 65 of file antioch_chemistry.C.

References _antioch_gas.

Referenced by do_transport_eval(), main(), and test_evaluator().

66  {
67  libmesh_assert_less(species_index, _antioch_gas->n_species());
68 
69 #if ANTIOCH_MAJOR_VERSION < 1 && ANTIOCH_MINOR_VERSION < 3
70  std::string name = "dummy";
71 
72  for( std::map<std::string,unsigned int>::const_iterator it = _antioch_gas->active_species_name_map().begin();
73  it != _antioch_gas->active_species_name_map().end(); it++ )
74  {
75  if( it->second == species_index )
76  {
77  name = it->first;
78  }
79  }
80 
81  if( name == std::string("dummy") )
82  {
83  std::cerr << "Error: Could not find a species name for the given index!"
84  << std::endl;
85  libmesh_error();
86  }
87 
88  return name;
89 #else
90  return _antioch_gas->species_inverse_name_map().find(species_index)->second;
91 #endif
92  }
unsigned int species_index(const std::string &species_name) const
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real GRINS::AntiochChemistry::X ( unsigned int  species,
libMesh::Real  M,
libMesh::Real  mass_fraction 
) const
inline

Species mole fraction, unitless.

Definition at line 146 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by main().

148  {
149  return _antioch_gas->X(species,M,mass_fraction);
150  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real M(unsigned int species) const
Species molar mass (molecular weight), [kg/mol].
void GRINS::AntiochChemistry::X ( libMesh::Real  M,
const std::vector< libMesh::Real > &  mass_fractions,
std::vector< libMesh::Real > &  mole_fractions 
) const
inline

Mole fraction for all species, unitless.

Definition at line 153 of file antioch_chemistry.h.

References _antioch_gas.

156  {
157  _antioch_gas->X(M,mass_fractions,mole_fractions);
158  return;
159  }
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::Real M(unsigned int species) const
Species molar mass (molecular weight), [kg/mol].

Member Data Documentation

boost::scoped_ptr<Antioch::ChemicalMixture<libMesh::Real> > GRINS::AntiochChemistry::_antioch_gas
protected

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

Generated on Mon Jun 22 2015 21:32:21 for GRINS-0.6.0 by  doxygen 1.8.9.1