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

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

#include <antioch_chemistry.h>

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

Public Member Functions

 AntiochChemistry (const GetPot &input, const std::string &material)
 Deprecated Constructor. More...
 
 AntiochChemistry (libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > &chem_mixture)
 User passes in built ChemicalMixture and this class takes ownership. More...
 
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...
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Protected Attributes

libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
 

Private Member Functions

 AntiochChemistry ()
 

Additional Inherited Members

- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 

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 59 of file antioch_chemistry.h.

Constructor & Destructor Documentation

GRINS::AntiochChemistry::AntiochChemistry ( const GetPot &  input,
const std::string &  material 
)

Deprecated Constructor.

Definition at line 44 of file antioch_chemistry.C.

References _antioch_gas, and GRINS::MaterialsParsing::parse_chemical_species().

46  : ParameterUser("AntiochChemistry")
47  {
48  {
49  std::string warning = "==============================================\n";
50  warning += "WARNING: This AntiochChemistry constructor is DEPREACTED!\n";
51  warning += " Prefer alternate constructor where parsing\n";
52  warning += " is done outside this class.\n";
53  warning += "==============================================\n";
54 
55  libmesh_warning(warning);
56  }
57  std::vector<std::string> species_list;
58  MaterialsParsing::parse_chemical_species(input,material,species_list);
59 
60  bool verbose_antioch_read = input("Materials/"+material+"/GasMixture/Antioch/verbose_read",false);
61 
62  std::string species_data_filename = input("Materials/"+material+"/GasMixture/Antioch/species_data", "default" );
63  if( species_data_filename == std::string("default") )
64  species_data_filename = Antioch::DefaultInstallFilename::chemical_mixture();
65 
66  std::string vibration_data_filename = input("Materials/"+material+"/GasMixture/Antioch/vibration_data", "default" );
67  if( vibration_data_filename == std::string("default") )
68  vibration_data_filename = Antioch::DefaultInstallFilename::vibrational_data();
69 
70  std::string electronic_data_filename = input("Materials/"+material+"/GasMixture/Antioch/electronic_data", "default" );
71  if( electronic_data_filename == std::string("default") )
72  electronic_data_filename = Antioch::DefaultInstallFilename::electronic_data();
73 
74  // By default, Antioch is using its ASCII parser. We haven't added more options yet.
75  _antioch_gas.reset( new Antioch::ChemicalMixture<libMesh::Real>( species_list,
76  verbose_antioch_read,
77  species_data_filename,
78  vibration_data_filename,
79  electronic_data_filename ) );
80  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
ParameterUser(const std::string &user_name)
static void parse_chemical_species(const GetPot &input, const std::string &material, std::vector< std::string > &species_names)
Helper function for parsing the chemical species.
GRINS::AntiochChemistry::AntiochChemistry ( libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > &  chem_mixture)

User passes in built ChemicalMixture and this class takes ownership.

Todo:
Use std::move when we have C++11

Definition at line 83 of file antioch_chemistry.C.

84  : ParameterUser("AntiochChemistry")
85  {
87  _antioch_gas.reset( chem_mixture.release() );
88  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
ParameterUser(const std::string &user_name)
virtual GRINS::AntiochChemistry::~AntiochChemistry ( )
inlinevirtual

Definition at line 69 of file antioch_chemistry.h.

69 {}
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 177 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by GRINS::AntiochEvaluator< Antioch::CEACurveFit< libMesh::Real >, Thermo >::specialized_build_thermo().

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

Accessor for this class.

Definition at line 200 of file antioch_chemistry.h.

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

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

Definition at line 125 of file antioch_chemistry.h.

References _antioch_gas.

126  {
127  return _antioch_gas->M(species);
128  }
libMesh::UniquePtr< 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 131 of file antioch_chemistry.h.

References _antioch_gas.

132  {
133  return _antioch_gas->M(mass_fractions);
134  }
libMesh::UniquePtr< 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 191 of file antioch_chemistry.h.

References _antioch_gas.

194  {
195  _antioch_gas->molar_densities( rho, mass_fractions, molar_densities );
196  return;
197  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
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].
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 183 of file antioch_chemistry.h.

References _antioch_gas.

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

Definition at line 165 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by do_transport_eval(), and main().

166  {
167  return _antioch_gas->n_species();
168  }
libMesh::UniquePtr< 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 137 of file antioch_chemistry.h.

References _antioch_gas.

138  {
139  return _antioch_gas->R(species);
140  }
libMesh::UniquePtr< 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 143 of file antioch_chemistry.h.

References _antioch_gas.

Referenced by main().

144  {
145  return _antioch_gas->R(mass_fractions);
146  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int GRINS::AntiochChemistry::species_index ( const std::string &  species_name) const
inline

Definition at line 171 of file antioch_chemistry.h.

References _antioch_gas.

172  {
173  return _antioch_gas->species_name_map().find(species_name)->second;
174  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
std::string species_name(unsigned int species_index) const
std::string GRINS::AntiochChemistry::species_name ( unsigned int  species_index) const

Definition at line 90 of file antioch_chemistry.C.

References _antioch_gas.

Referenced by do_transport_eval(), and main().

91  {
92  libmesh_assert_less(species_index, _antioch_gas->n_species());
93 
94  return _antioch_gas->species_inverse_name_map().find(species_index)->second;
95  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int species_index(const std::string &species_name) const
libMesh::Real GRINS::AntiochChemistry::X ( unsigned int  species,
libMesh::Real  M,
libMesh::Real  mass_fraction 
) const
inline

Species mole fraction, unitless.

Definition at line 149 of file antioch_chemistry.h.

References _antioch_gas.

151  {
152  return _antioch_gas->X(species,M,mass_fraction);
153  }
libMesh::UniquePtr< 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 156 of file antioch_chemistry.h.

References _antioch_gas.

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

Member Data Documentation

libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > GRINS::AntiochChemistry::_antioch_gas
protected

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

Generated on Tue Dec 19 2017 12:47:29 for GRINS-0.8.0 by  doxygen 1.8.9.1