26 #ifndef GRINS_ANTIOCH_EVALUATOR_H
27 #define GRINS_ANTIOCH_EVALUATOR_H
29 #include "grins_config.h"
31 #ifdef GRINS_HAVE_ANTIOCH
40 #include "antioch/temp_cache.h"
41 #include "antioch/cea_evaluator.h"
42 #include "antioch/stat_mech_thermo.h"
43 #include "antioch/ideal_gas_micro_thermo.h"
55 template<
typename KineticsThermoCurveFit,
typename Thermo>
65 libMesh::Real
M(
unsigned int species )
const;
67 libMesh::Real
M_mix(
const std::vector<libMesh::Real>& mass_fractions )
const;
69 libMesh::Real
R(
unsigned int species )
const;
71 libMesh::Real
R_mix(
const std::vector<libMesh::Real>& mass_fractions )
const;
73 libMesh::Real
X(
unsigned int species, libMesh::Real
M, libMesh::Real mass_fraction )
const;
75 void X( libMesh::Real
M,
const std::vector<libMesh::Real> & mass_fractions,
76 std::vector<libMesh::Real> & mole_fractions )
const;
83 libMesh::Real
cp(
const libMesh::Real& T,
const libMesh::Real P,
const std::vector<libMesh::Real>& Y );
85 libMesh::Real
cv(
const libMesh::Real& T,
const libMesh::Real P,
const std::vector<libMesh::Real>& Y );
87 libMesh::Real
h_s(
const libMesh::Real& T,
unsigned int species );
90 void omega_dot(
const libMesh::Real& T, libMesh::Real rho,
91 const std::vector<libMesh::Real> mass_fractions,
102 libMesh::UniquePtr<Antioch::NASAEvaluator<libMesh::Real,KineticsThermoCurveFit> >
_nasa_evaluator;
104 libMesh::UniquePtr<AntiochKinetics<KineticsThermoCurveFit> >
_kinetics;
114 libMesh::UniquePtr<Antioch::TempCache<libMesh::Real> >
_temp_cache;
133 libMesh::UniquePtr<Antioch::StatMechThermodynamics<libMesh::Real> >& thermo,
134 thermo_type<Antioch::StatMechThermodynamics<libMesh::Real> > )
136 thermo.reset(
new Antioch::StatMechThermodynamics<libMesh::Real>( mixture.
chemical_mixture() ) );
140 libMesh::UniquePtr<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,KineticsThermoCurveFit>, libMesh::Real> > & thermo,
141 thermo_type<Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,KineticsThermoCurveFit>, libMesh::Real> > )
143 _nasa_evaluator.reset(
new Antioch::NASAEvaluator<libMesh::Real,KineticsThermoCurveFit>( mixture.
nasa_mixture() ) );
144 thermo.reset(
new Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,KineticsThermoCurveFit>,libMesh::Real>( *_nasa_evaluator, mixture.
chemical_mixture() ) );
150 template<
typename KineticsThermoCurveFit,
typename Thermo>
155 return _chem.M(species);
158 template<
typename KineticsThermoCurveFit,
typename Thermo>
162 M_mix(
const std::vector<libMesh::Real>& mass_fractions )
const
164 return _chem.M_mix(mass_fractions);
167 template<
typename KineticsThermoCurveFit,
typename Thermo>
172 return _chem.R(species);
175 template<
typename KineticsThermoCurveFit,
typename Thermo>
179 R_mix(
const std::vector<libMesh::Real>& mass_fractions )
const
181 return _chem.R_mix(mass_fractions);
184 template<
typename KineticsThermoCurveFit,
typename Thermo>
188 libMesh::Real mass_fraction )
const
190 return _chem.X(species,M,mass_fraction);
193 template<
typename KineticsThermoCurveFit,
typename Thermo>
196 const std::vector<libMesh::Real>& mass_fractions,
197 std::vector<libMesh::Real>& mole_fractions )
const
199 _chem.X(M,mass_fractions,mole_fractions);
202 template<
typename KineticsThermoCurveFit,
typename Thermo>
207 return _chem.species_index(species_name);
210 template<
typename KineticsThermoCurveFit,
typename Thermo>
215 return _chem.species_name(species_index);
218 template<
typename KineticsThermoCurveFit,
typename Thermo>
222 _clipped_T = std::max(_minimum_T, T);
226 if( _temp_cache->T2 != _clipped_T*_clipped_T )
227 _temp_cache.reset(
new Antioch::TempCache<libMesh::Real>(_clipped_T) );
232 #endif // GRINS_HAVE_ANTIOCH
234 #endif // GRINS_ANTIOCH_EVALUATOR_H
Wrapper class for evaluating chemistry and thermo properties using Antioch.
const libMesh::Real _minimum_T
void build_thermo(const AntiochMixture< KineticsThermoCurveFit > &mixture)
void specialized_build_thermo(const AntiochMixture< KineticsThermoCurveFit > &mixture, libMesh::UniquePtr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
libMesh::Real M(unsigned int species) const
const AntiochMixture< KineticsThermoCurveFit > & _chem
const Antioch::ChemicalMixture< libMesh::Real > & chemical_mixture() const
Accessor to underlying Antioch object.
void specialized_build_thermo(const AntiochMixture< KineticsThermoCurveFit > &mixture, libMesh::UniquePtr< Antioch::IdealGasMicroThermo< Antioch::NASAEvaluator< libMesh::Real, KineticsThermoCurveFit >, libMesh::Real > > &thermo, thermo_type< Antioch::IdealGasMicroThermo< Antioch::NASAEvaluator< libMesh::Real, KineticsThermoCurveFit >, libMesh::Real > >)
void check_and_reset_temp_cache(const libMesh::Real &T)
Helper method for managing _temp_cache.
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
std::string species_name(unsigned int species_index) const
libMesh::Real M_mix(const std::vector< libMesh::Real > &mass_fractions) const
void omega_dot(const libMesh::Real &T, libMesh::Real rho, const std::vector< libMesh::Real > mass_fractions, std::vector< libMesh::Real > &omega_dot)
libMesh::UniquePtr< AntiochKinetics< KineticsThermoCurveFit > > _kinetics
libMesh::Real R(unsigned int species) const
const Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > & nasa_mixture() const
libMesh::Real cp(const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
virtual ~AntiochEvaluator()
unsigned int species_index(const std::string &species_name) const
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
libMesh::UniquePtr< Thermo > _thermo
Primary thermo object.
Wrapper class for storing state for Antioch thermo and kinetics.
libMesh::Real h_s(const libMesh::Real &T, unsigned int species)
libMesh::UniquePtr< Antioch::NASAEvaluator< libMesh::Real, KineticsThermoCurveFit > > _nasa_evaluator
For some Thermo types, we also need to cache a NASAEvaluator.
libMesh::UniquePtr< Antioch::TempCache< libMesh::Real > > _temp_cache
libMesh::Real cv(const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)