GRINS-0.6.0
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
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 CachedValues &cache, unsigned int qp)
 
libMesh::Real cv (const CachedValues &cache, unsigned int qp)
 
libMesh::Real h_s (const CachedValues &cache, unsigned int qp, unsigned int species)
 
void h_s (const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &h_s)
 
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 
libMesh::Real cp (const libMesh::Real &T, const std::vector< libMesh::Real > &Y)
 
void omega_dot (const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &omega_dot)
 
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 CachedValues &cache, unsigned int qp)
 
template<>
libMesh::Real cp (const CachedValues &cache, unsigned int qp)
 
template<>
libMesh::Real cp (const libMesh::Real &T, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real cp (const libMesh::Real &T, const std::vector< libMesh::Real > &Y)
 
template<>
libMesh::Real cv (const CachedValues &cache, unsigned int qp)
 
template<>
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 
template<>
libMesh::Real h_s (const libMesh::Real &T, unsigned int species)
 
template<>
libMesh::Real cv (const CachedValues &cache, unsigned int qp)
 
template<>
libMesh::Real h_s (const CachedValues &cache, unsigned int qp, unsigned int species)
 
template<>
libMesh::Real h_s (const CachedValues &cache, unsigned int qp, unsigned int species)
 
template<>
void h_s (const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &h_s)
 
template<>
void h_s (const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &h_s)
 

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
 
boost::scoped_ptr< Thermo > _thermo
 
boost::scoped_ptr< AntiochKinetics_kinetics
 
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
 

Private Member Functions

 AntiochEvaluator ()
 
void specialized_build_thermo (const AntiochMixture &mixture, boost::scoped_ptr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
 
void specialized_build_thermo (const AntiochMixture &mixture, boost::scoped_ptr< 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 58 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  _thermo( NULL ),
46  _kinetics( new AntiochKinetics(mixture) ),
47  _temp_cache( new Antioch::TempCache<libMesh::Real>(1.0) )
48  {
49  this->build_thermo( mixture );
50  return;
51  }
boost::scoped_ptr< Thermo > _thermo
boost::scoped_ptr< AntiochKinetics > _kinetics
const AntiochMixture & _chem
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
void build_thermo(const AntiochMixture &mixture)
template<typename Thermo >
GRINS::AntiochEvaluator< Thermo >::~AntiochEvaluator ( )
virtual

Definition at line 54 of file antioch_evaluator.C.

55  {
56  return;
57  }
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 126 of file antioch_evaluator.h.

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

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

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

Helper method for managing _temp_cache.

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

Definition at line 85 of file antioch_evaluator.C.

86  {
87  if( _temp_cache->T != T )
88  {
89  _temp_cache.reset( new Antioch::TempCache<libMesh::Real>(T) );
90  }
91 
92  return;
93  }
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<typename Thermo>
libMesh::Real GRINS::AntiochEvaluator< Thermo >::cp ( const CachedValues cache,
unsigned int  qp 
)
template<typename Thermo>
libMesh::Real GRINS::AntiochEvaluator< Thermo >::cp ( const libMesh::Real &  T,
const std::vector< libMesh::Real > &  Y 
)
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::cp ( const CachedValues cache,
unsigned int  qp 
)

Definition at line 96 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, and GRINS::Cache::TEMPERATURE.

98  {
99  const libMesh::Real& T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
100  const std::vector<libMesh::Real>& Y = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp];
101 
103 
104  return _thermo->cp( *(_temp_cache.get()), Y );
105  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
boost::scoped_ptr< Thermo > _thermo
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::cp ( const CachedValues cache,
unsigned int  qp 
)

Definition at line 108 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, and GRINS::Cache::TEMPERATURE.

110  {
111  const libMesh::Real T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
112  const std::vector<libMesh::Real>& Y = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp];
113 
114  return _thermo->cp( T, T, Y );
115  }
boost::scoped_ptr< Thermo > _thermo
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::cp ( const libMesh::Real &  T,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 118 of file antioch_evaluator.C.

120  {
122 
123  return _thermo->cp( *(_temp_cache.get()), Y );
124  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
boost::scoped_ptr< Thermo > _thermo
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::cp ( const libMesh::Real &  T,
const std::vector< libMesh::Real > &  Y 
)

Definition at line 127 of file antioch_evaluator.C.

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

129  {
130  return _thermo->cp( T, T, Y );
131  }
boost::scoped_ptr< Thermo > _thermo
template<typename Thermo>
libMesh::Real GRINS::AntiochEvaluator< Thermo >::cv ( const CachedValues cache,
unsigned int  qp 
)

Referenced by test_evaluator().

template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::cv ( const CachedValues cache,
unsigned int  qp 
)

Definition at line 134 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, and GRINS::Cache::TEMPERATURE.

136  {
137  const libMesh::Real& T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
138  const std::vector<libMesh::Real>& Y = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp];
139 
141 
142  return _thermo->cv( *(_temp_cache.get()), Y );
143  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
boost::scoped_ptr< Thermo > _thermo
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::cv ( const CachedValues cache,
unsigned int  qp 
)

Definition at line 160 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, and GRINS::Cache::TEMPERATURE.

162  {
163  const libMesh::Real T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
164  const std::vector<libMesh::Real>& Y = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp];
165 
166  return _thermo->cv( T, T, Y );
167  }
boost::scoped_ptr< Thermo > _thermo
template<typename Thermo>
libMesh::Real GRINS::AntiochEvaluator< Thermo >::h_s ( const CachedValues cache,
unsigned int  qp,
unsigned int  species 
)

Referenced by test_evaluator().

template<typename Thermo>
void GRINS::AntiochEvaluator< Thermo >::h_s ( const CachedValues cache,
unsigned int  qp,
std::vector< libMesh::Real > &  h_s 
)
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 146 of file antioch_evaluator.C.

147  {
149 
150  return _thermo->h( *(_temp_cache.get()), species );;
151  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
boost::scoped_ptr< Thermo > _thermo
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::h_s ( const libMesh::Real &  T,
unsigned int  species 
)

Definition at line 154 of file antioch_evaluator.C.

155  {
156  return _thermo->h_tot( species, T ) + _chem.h_stat_mech_ref_correction(species);
157  }
libMesh::Real h_stat_mech_ref_correction(unsigned int species) const
boost::scoped_ptr< Thermo > _thermo
const AntiochMixture & _chem
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::h_s ( const CachedValues cache,
unsigned int  qp,
unsigned int  species 
)

Definition at line 170 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), and GRINS::Cache::TEMPERATURE.

173  {
174  const libMesh::Real& T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
175 
176  return this->h_s( T, species );
177  }
libMesh::Real h_s(const CachedValues &cache, unsigned int qp, unsigned int species)
template<>
libMesh::Real GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::h_s ( const CachedValues cache,
unsigned int  qp,
unsigned int  species 
)

Definition at line 180 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), and GRINS::Cache::TEMPERATURE.

183  {
184  const libMesh::Real T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
185 
186  return this->h_s(T, species);
187  }
libMesh::Real h_s(const CachedValues &cache, unsigned int qp, unsigned int species)
template<>
void GRINS::AntiochEvaluator< Antioch::CEAEvaluator< libMesh::Real > >::h_s ( const CachedValues cache,
unsigned int  qp,
std::vector< libMesh::Real > &  h_s 
)

Definition at line 190 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), and GRINS::Cache::TEMPERATURE.

193  {
194  const libMesh::Real& T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
195 
197 
198  _thermo->h( *(_temp_cache.get()), h_s );
199 
200  return;
201  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
boost::scoped_ptr< Thermo > _thermo
libMesh::Real h_s(const CachedValues &cache, unsigned int qp, unsigned int species)
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<>
void GRINS::AntiochEvaluator< Antioch::StatMechThermodynamics< libMesh::Real > >::h_s ( const CachedValues cache,
unsigned int  qp,
std::vector< libMesh::Real > &  h_s 
)

Definition at line 204 of file antioch_evaluator.C.

207  {
208  for( unsigned int s = 0; s < _chem.n_species(); s++ )
209  {
210  h_s[s] = this->h_s(cache,qp,s);
211  }
212 
213  return;
214  }
unsigned int n_species() const
libMesh::Real h_s(const CachedValues &cache, unsigned int qp, unsigned int species)
const AntiochMixture & _chem
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::M ( unsigned int  species) const
inline

Definition at line 154 of file antioch_evaluator.h.

155  {
156  return _chem.M(species);
157  }
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 161 of file antioch_evaluator.h.

162  {
163  return _chem.M_mix(mass_fractions);
164  }
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 CachedValues cache,
unsigned int  qp,
std::vector< libMesh::Real > &  omega_dot 
)

Definition at line 60 of file antioch_evaluator.C.

References GRINS::CachedValues::get_cached_values(), GRINS::CachedValues::get_cached_vector_values(), GRINS::Cache::MASS_FRACTIONS, GRINS::Cache::MIXTURE_DENSITY, and GRINS::Cache::TEMPERATURE.

Referenced by test_evaluator().

62  {
63  const libMesh::Real& T = cache.get_cached_values(Cache::TEMPERATURE)[qp];
64  const libMesh::Real rho = cache.get_cached_values(Cache::MIXTURE_DENSITY)[qp];
65  const std::vector<libMesh::Real>& Y = cache.get_cached_vector_values(Cache::MASS_FRACTIONS)[qp];
66 
67  this->omega_dot( T, rho, Y, omega_dot );
68 
69  return;
70  }
void omega_dot(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &omega_dot)
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 73 of file antioch_evaluator.C.

76  {
78 
79  _kinetics->omega_dot( *(_temp_cache.get()), rho, mass_fractions, omega_dot );
80 
81  return;
82  }
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
void omega_dot(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &omega_dot)
boost::scoped_ptr< AntiochKinetics > _kinetics
boost::scoped_ptr< Antioch::TempCache< libMesh::Real > > _temp_cache
template<typename Thermo >
libMesh::Real GRINS::AntiochEvaluator< Thermo >::R ( unsigned int  species) const
inline

Definition at line 168 of file antioch_evaluator.h.

169  {
170  return _chem.R(species);
171  }
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 175 of file antioch_evaluator.h.

176  {
177  return _chem.R_mix(mass_fractions);
178  }
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,
boost::scoped_ptr< Antioch::StatMechThermodynamics< libMesh::Real > > &  thermo,
thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >   
)
inlineprivate

Definition at line 133 of file antioch_evaluator.h.

References GRINS::AntiochChemistry::chemical_mixture().

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

136  {
137  thermo.reset( new Antioch::StatMechThermodynamics<libMesh::Real>( mixture.chemical_mixture() ) );
138  return;
139  }
template<typename Thermo>
void GRINS::AntiochEvaluator< Thermo >::specialized_build_thermo ( const AntiochMixture mixture,
boost::scoped_ptr< Antioch::CEAEvaluator< libMesh::Real > > &  thermo,
thermo_type< Antioch::CEAEvaluator< libMesh::Real > >   
)
inlineprivate

Definition at line 141 of file antioch_evaluator.h.

References GRINS::AntiochMixture::cea_mixture().

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

Definition at line 198 of file antioch_evaluator.h.

199  {
201  }
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 205 of file antioch_evaluator.h.

206  {
208  }
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 182 of file antioch_evaluator.h.

183  {
184  return _chem.X(species,M,mass_fraction);
185  }
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 189 of file antioch_evaluator.h.

191  {
192  _chem.X(M,mass_fractions,mole_fractions);
193  return;
194  }
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 108 of file antioch_evaluator.h.

template<typename Thermo>
boost::scoped_ptr<AntiochKinetics> GRINS::AntiochEvaluator< Thermo >::_kinetics
protected

Definition at line 113 of file antioch_evaluator.h.

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

Definition at line 115 of file antioch_evaluator.h.

template<typename Thermo>
boost::scoped_ptr<Thermo> GRINS::AntiochEvaluator< Thermo >::_thermo
protected

Definition at line 111 of file antioch_evaluator.h.


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