GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GRINS::AntiochEvaluator< Thermo > Class Template Reference

Wrapper class for evaluating chemistry and thermo properties using Antioch. More...

#include <antioch_evaluator.h>

Inheritance diagram for GRINS::AntiochEvaluator< Thermo >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::AntiochEvaluator< Thermo >:
Collaboration graph
[legend]

Public Member Functions

 AntiochEvaluator (const AntiochMixture &mixture)
 
virtual ~AntiochEvaluator ()
 
libMesh::Real M (unsigned int species) const
 
libMesh::Real M_mix (const std::vector< libMesh::Real > &mass_fractions) const
 
libMesh::Real R (unsigned int species) const
 
libMesh::Real R_mix (const std::vector< libMesh::Real > &mass_fractions) const
 
libMesh::Real X (unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
 
void X (libMesh::Real M, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &mole_fractions) const
 
unsigned int species_index (const std::string &species_name) const
 
std::string species_name (unsigned int species_index) const
 
libMesh::Real cp (const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
 
libMesh::Real cv (const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
 
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 
void omega_dot (const libMesh::Real &T, libMesh::Real rho, const std::vector< libMesh::Real > mass_fractions, std::vector< libMesh::Real > &omega_dot)
 
template<>
libMesh::Real cp (const libMesh::Real &T, const libMesh::Real, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real cp (const libMesh::Real &T, const libMesh::Real, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real cv (const libMesh::Real &T, const libMesh::Real, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real cv (const libMesh::Real &T, const libMesh::Real, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 
template<>
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 

Protected Member Functions

void check_and_reset_temp_cache (const libMesh::Real &T)
 Helper method for managing _temp_cache. More...
 
void build_thermo (const AntiochMixture &mixture)
 

Protected Attributes

const AntiochMixture_chem
 
libMesh::UniquePtr< Thermo > _thermo
 
libMesh::UniquePtr< AntiochKinetics_kinetics
 
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
 

Private Member Functions

 AntiochEvaluator ()
 
void specialized_build_thermo (const AntiochMixture &mixture, libMesh::UniquePtr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
 
void specialized_build_thermo (const AntiochMixture &mixture, libMesh::UniquePtr< Antioch::CEAEvaluator< libMesh::Real > > &thermo, thermo_type< Antioch::CEAEvaluator< libMesh::Real > >)
 

Detailed Description

template<typename Thermo>
class GRINS::AntiochEvaluator< Thermo >

Wrapper class for evaluating chemistry and thermo properties using Antioch.

This class is expected to be constructed after threads have been forked and will only live during the lifetime of the thread. 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 55 of file antioch_evaluator.h.

Constructor & Destructor Documentation

template<typename Thermo >
GRINS::AntiochEvaluator< Thermo >::AntiochEvaluator ( const AntiochMixture mixture)

Definition at line 43 of file antioch_evaluator.C.

References GRINS::AntiochEvaluator< Thermo >::build_thermo().

44  : _chem( mixture ),
45  _kinetics( new AntiochKinetics(mixture) ),
46  _temp_cache( new Antioch::TempCache<libMesh::Real>(1.0) )
47  {
48  this->build_thermo( mixture );
49  }
libMesh::UniquePtr< AntiochKinetics > _kinetics
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
const AntiochMixture & _chem
void build_thermo(const AntiochMixture &mixture)
template<typename Thermo >
virtual GRINS::AntiochEvaluator< Thermo >::~AntiochEvaluator ( )
inlinevirtual

Definition at line 61 of file antioch_evaluator.h.

61 {};
template<typename Thermo >
GRINS::AntiochEvaluator< Thermo >::AntiochEvaluator ( )
private

Member Function Documentation

template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::build_thermo ( const AntiochMixture mixture)
inlineprotected

Definition at line 113 of file antioch_evaluator.h.

References GRINS::AntiochEvaluator< Thermo >::specialized_build_thermo().

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

114  { specialized_build_thermo( mixture, _thermo, thermo_type<Thermo>() ); }
void specialized_build_thermo(const AntiochMixture &mixture, libMesh::UniquePtr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
libMesh::UniquePtr< Thermo > _thermo
template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::check_and_reset_temp_cache ( const libMesh::Real &  T)
inlineprotected

Helper method for managing _temp_cache.

T MUST be pass-by-reference because of the structure of Antioch::TempCache!

Definition at line 199 of file antioch_evaluator.h.

200  {
201  // We can't compare T because it's a reference, so we may have already
202  // changed it upstream. So, we compare the next cheapest thing.
203  if( _temp_cache->T2 != T*T )
204  _temp_cache.reset( new Antioch::TempCache<libMesh::Real>(T) );
205  }
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::cp ( const libMesh::Real &  T,
const libMesh::Real  ,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 62 of file antioch_evaluator.C.

65  {
67  return _thermo->cp( *(_temp_cache.get()), Y );
68  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
libMesh::UniquePtr< Thermo > _thermo
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::cp ( const libMesh::Real &  T,
const libMesh::Real  ,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 71 of file antioch_evaluator.C.

References GRINS::AntiochEvaluator< Thermo >::cp().

74  {
75  return _thermo->cp( T, T, Y );
76  }
libMesh::UniquePtr< Thermo > _thermo
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::cp ( const libMesh::Real &  T,
const libMesh::Real  P,
const std::vector< libMesh::Real > &  Y 
)
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::cv ( const libMesh::Real &  T,
const libMesh::Real  ,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 79 of file antioch_evaluator.C.

82  {
84  return _thermo->cv( *(_temp_cache.get()), Y );
85  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
libMesh::UniquePtr< Thermo > _thermo
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::cv ( const libMesh::Real &  T,
const libMesh::Real  P,
const std::vector< libMesh::Real > &  Y 
)
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::cv ( const libMesh::Real &  T,
const libMesh::Real  ,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 88 of file antioch_evaluator.C.

References GRINS::AntiochEvaluator< Thermo >::cv().

91  {
92  return _thermo->cv( T, T, Y );
93  }
libMesh::UniquePtr< Thermo > _thermo
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::h_s ( const libMesh::Real &  T,
unsigned int  species 
)
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::h_s ( const libMesh::Real &  T,
unsigned int  species 
)

Definition at line 96 of file antioch_evaluator.C.

97  {
99 
100  return _thermo->h( *(_temp_cache.get()), species );;
101  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
libMesh::UniquePtr< Thermo > _thermo
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::h_s ( const libMesh::Real &  T,
unsigned int  species 
)

Definition at line 104 of file antioch_evaluator.C.

105  {
106  return _thermo->h_tot( species, T ) + _chem.h_stat_mech_ref_correction(species);
107  }
libMesh::Real h_stat_mech_ref_correction(unsigned int species) const
const AntiochMixture & _chem
libMesh::UniquePtr< Thermo > _thermo
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::M ( unsigned int  species) const
inline

Definition at line 141 of file antioch_evaluator.h.

142  {
143  return _chem.M(species);
144  }
const AntiochMixture & _chem
libMesh::Real M(unsigned int species) const
Species molar mass (molecular weight), [kg/mol].
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::M_mix ( const std::vector< libMesh::Real > &  mass_fractions) const
inline

Definition at line 148 of file antioch_evaluator.h.

149  {
150  return _chem.M_mix(mass_fractions);
151  }
libMesh::Real M_mix(const std::vector< libMesh::Real > &mass_fractions) const
Mixture molar mass (molecular weight), [kg/mol].
const AntiochMixture & _chem
template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::omega_dot ( const libMesh::Real &  T,
libMesh::Real  rho,
const std::vector< libMesh::Real >  mass_fractions,
std::vector< libMesh::Real > &  omega_dot 
)

Definition at line 52 of file antioch_evaluator.C.

55  {
57 
58  _kinetics->omega_dot( *(_temp_cache.get()), rho, mass_fractions, omega_dot );
59  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
libMesh::UniquePtr< AntiochKinetics > _kinetics
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
void omega_dot(const libMesh::Real &T, libMesh::Real rho, const std::vector< libMesh::Real > mass_fractions, std::vector< libMesh::Real > &omega_dot)
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::R ( unsigned int  species) const
inline

Definition at line 155 of file antioch_evaluator.h.

156  {
157  return _chem.R(species);
158  }
const AntiochMixture & _chem
libMesh::Real R(unsigned int species) const
Species gas constant, [J/kg-K].
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::R_mix ( const std::vector< libMesh::Real > &  mass_fractions) const
inline

Definition at line 162 of file antioch_evaluator.h.

Referenced by do_transport_eval(), and test_evaluator().

163  {
164  return _chem.R_mix(mass_fractions);
165  }
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
Mixture gas constant, [J/kg-K].
const AntiochMixture & _chem
template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::specialized_build_thermo ( const AntiochMixture mixture,
libMesh::UniquePtr< Antioch::StatMechThermodynamics< libMesh::Real > > &  thermo,
thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >   
)
inlineprivate

Definition at line 120 of file antioch_evaluator.h.

References GRINS::AntiochChemistry::chemical_mixture().

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

123  {
124  thermo.reset( new Antioch::StatMechThermodynamics<libMesh::Real>( mixture.chemical_mixture() ) );
125  return;
126  }
template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::specialized_build_thermo ( const AntiochMixture mixture,
libMesh::UniquePtr< Antioch::CEAEvaluator< libMesh::Real > > &  thermo,
thermo_type< Antioch::CEAEvaluator< libMesh::Real > >   
)
inlineprivate

Definition at line 128 of file antioch_evaluator.h.

References GRINS::AntiochMixture::cea_mixture().

131  {
132  thermo.reset( new Antioch::CEAEvaluator<libMesh::Real>( mixture.cea_mixture() ) );
133  return;
134  }
template<typename Thermo >
unsigned int GRINS::AntiochEvaluator< Thermo >::species_index ( const std::string &  species_name) const
inline

Definition at line 185 of file antioch_evaluator.h.

186  {
188  }
unsigned int species_index(const std::string &species_name) const
std::string species_name(unsigned int species_index) const
const AntiochMixture & _chem
template<typename Thermo >
std::string GRINS::AntiochEvaluator< Thermo >::species_name ( unsigned int  species_index) const
inline

Definition at line 192 of file antioch_evaluator.h.

193  {
195  }
unsigned int species_index(const std::string &species_name) const
const AntiochMixture & _chem
std::string species_name(unsigned int species_index) const
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::X ( unsigned int  species,
libMesh::Real  M,
libMesh::Real  mass_fraction 
) const
inline

Definition at line 169 of file antioch_evaluator.h.

170  {
171  return _chem.X(species,M,mass_fraction);
172  }
libMesh::Real M(unsigned int species) const
const AntiochMixture & _chem
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
Species mole fraction, unitless.
template<typename Thermo >
void GRINS::AntiochEvaluator< Thermo >::X ( libMesh::Real  M,
const std::vector< libMesh::Real > &  mass_fractions,
std::vector< libMesh::Real > &  mole_fractions 
) const
inline

Definition at line 176 of file antioch_evaluator.h.

178  {
179  _chem.X(M,mass_fractions,mole_fractions);
180  return;
181  }
libMesh::Real M(unsigned int species) const
const AntiochMixture & _chem
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
Species mole fraction, unitless.

Member Data Documentation

template<typename Thermo >
const AntiochMixture& GRINS::AntiochEvaluator< Thermo >::_chem
protected

Definition at line 95 of file antioch_evaluator.h.

template<typename Thermo >
libMesh::UniquePtr<AntiochKinetics> GRINS::AntiochEvaluator< Thermo >::_kinetics
protected

Definition at line 100 of file antioch_evaluator.h.

template<typename Thermo >
libMesh::UniquePtr<Antioch::TempCache<libMesh::Real> > GRINS::AntiochEvaluator< Thermo >::_temp_cache
protected

Definition at line 102 of file antioch_evaluator.h.

template<typename Thermo >
libMesh::UniquePtr<Thermo> GRINS::AntiochEvaluator< Thermo >::_thermo
protected

Definition at line 98 of file antioch_evaluator.h.


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

Generated on Thu Jun 2 2016 21:52:30 for GRINS-0.7.0 by  doxygen 1.8.10