antioch-0.4.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
Antioch::StatMechThermodynamics< CoeffType > Class Template Reference

#include <ascii_parser.h>

Public Member Functions

 StatMechThermodynamics (const ChemicalMixture< CoeffType > &chem_mixture)
 
virtual ~StatMechThermodynamics ()
 Destructor. More...
 
CoeffType cv_trans (const unsigned int species) const
 
CoeffType cv_trans_over_R (const unsigned int species) const
 
CoeffType cv_rot (const unsigned int species) const
 
CoeffType cv_rot_over_R (const unsigned int species) const
 
CoeffType cv_tr (const unsigned int species) const
 
CoeffType cv_tr_over_R (const unsigned int species) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_tr (const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType cv_vib (const unsigned int species, const StateType &Tv) const
 
template<typename StateType >
StateType cv_vib_over_R (const unsigned int species, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_vib (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType cv_el (const unsigned int species, const StateType &Te) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_el (const typename Antioch::value_type< VectorStateType >::type &Te, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType cv_ve (const unsigned int species, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_ve (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType cv (const unsigned int species, const StateType &T, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cp (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType h_tot (const unsigned int species, const StateType &T, const StateType &Tv) const
 
template<typename StateType >
StateType h_tot (const unsigned int species, const StateType &T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
h_tot (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
h_tot (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_tot (const unsigned int species, const StateType &T, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tot (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_tot (const unsigned int species, const StateType &T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tot (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_tr (const unsigned int species, const StateType &T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tr (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_vib (const unsigned int species, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_vib (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_el (const unsigned int species, const StateType &Te) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_el (const typename Antioch::value_type< VectorStateType >::type &Te, const VectorStateType &mass_fractions) const
 
template<typename StateType >
StateType e_ve (const unsigned int species, const StateType &Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_ve (const typename Antioch::value_type< VectorStateType >::type &Te, const VectorStateType &mass_fractions) const
 
CoeffType e_ve_min () const
 
template<typename VectorStateType >
void e_and_cv_ve (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type &e_ve, typename Antioch::value_type< VectorStateType >::type &cv_ve) const
 
CoeffType e_0 (const unsigned int species) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_0 (const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
Tv_from_e_ve (const typename Antioch::value_type< VectorStateType >::type &e_ve, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type Tv=-1) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_e_tot (const typename Antioch::value_type< VectorStateType >::type &e_tot, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T=-1) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_e_tr (const typename Antioch::value_type< VectorStateType >::type &e_tr, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T=-1) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_h_tot (const typename Antioch::value_type< VectorStateType >::type &h_tot, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T=-1) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_h_tot_Tv (const typename Antioch::value_type< VectorStateType >::type &h_tot, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T=-1) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
s (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_tr (const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_vib (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_el (const typename Antioch::value_type< VectorStateType >::type &Te, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv_ve (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cv (const typename Antioch::value_type< VectorStateType >::type &, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
cp (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
h_tot (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
h_tot (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tot (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tot (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_tr (const typename Antioch::value_type< VectorStateType >::type &T, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_vib (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_el (const typename Antioch::value_type< VectorStateType >::type &Te, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_ve (const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
e_0 (const VectorStateType &mass_fractions) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
Tv_from_e_ve (const typename Antioch::value_type< VectorStateType >::type &e_ve, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type Tv) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_e_tot (const typename Antioch::value_type< VectorStateType >::type &e_tot, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_e_tr (const typename Antioch::value_type< VectorStateType >::type &e_tr, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_h_tot (const typename Antioch::value_type< VectorStateType >::type &h_tot, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
T_from_h_tot_Tv (const typename Antioch::value_type< VectorStateType >::type &h_tot, const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type T) const
 
template<typename VectorStateType >
enable_if_c< has_size
< VectorStateType >::value,
typename Antioch::value_type
< VectorStateType >::type >
::type 
s (const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
 

Protected Attributes

const ChemicalMixture
< CoeffType > & 
_chem_mixture
 

Private Member Functions

 StatMechThermodynamics ()
 Default constructor. More...
 

Detailed Description

template<typename CoeffType = double>
class Antioch::StatMechThermodynamics< CoeffType >

Definition at line 82 of file ascii_parser.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::StatMechThermodynamics< CoeffType >::StatMechThermodynamics ( const ChemicalMixture< CoeffType > &  chem_mixture)
inline

Definition at line 499 of file stat_mech_thermo.h.

500  : _chem_mixture(chem_mixture)
501  {
502  // NOP
503  }
const ChemicalMixture< CoeffType > & _chem_mixture
template<typename CoeffType >
Antioch::StatMechThermodynamics< CoeffType >::~StatMechThermodynamics ( )
inlinevirtual

Destructor.

virtual so this can be subclassed by the user.

Definition at line 507 of file stat_mech_thermo.h.

508  {
509  // NOP
510  }
template<typename CoeffType = double>
Antioch::StatMechThermodynamics< CoeffType >::StatMechThermodynamics ( )
private

Default constructor.

Private to force to user to supply a ChemicalMixture object.

Member Function Documentation

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cp ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture total specific heat at constant pressure, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cp ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 771 of file stat_mech_thermo.h.

774  {
775  return (this->cv(T,Tv,mass_fractions) + this->_chem_mixture.R(mass_fractions));
776  }
const ChemicalMixture< CoeffType > & _chem_mixture
StateType cv(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::cv ( const unsigned int  species,
const StateType &  T,
const StateType &  Tv 
) const
inline
Returns
species total specific heat at constant volume, J/kg. Note that the input translational/rotational temperature is currently not used, as these modes are assumed to be fully excited. However, the API is here in case this assumption is removed later.

Definition at line 743 of file stat_mech_thermo.h.

746  {
747  return (this->cv_tr(species) + this->cv_ve(species, Tv));
748  }
CoeffType cv_tr(const unsigned int species) const
StateType cv_ve(const unsigned int species, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture total specific heat at constant volume, J/kg. Note that the input translational/rotational temperature is currently not used, as these modes are assumed to be fully excited. However, the API is here in case this assumption is removed later.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv ( const typename Antioch::value_type< VectorStateType >::type &  ,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 757 of file stat_mech_thermo.h.

760  {
761  return (this->cv_tr(mass_fractions) + this->cv_ve(Tv, mass_fractions));
762  }
CoeffType cv_tr(const unsigned int species) const
StateType cv_ve(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::cv_el ( const unsigned int  species,
const StateType &  Te 
) const
inline
Returns
species electronic specific heat at constant volume.

Definition at line 645 of file stat_mech_thermo.h.

References antioch_assert_equal_to, Antioch::ChemicalSpecies< CoeffType >::gas_constant(), Antioch::ChemicalSpecies< CoeffType >::ndg_e(), Antioch::ChemicalSpecies< CoeffType >::theta_e(), and Antioch::zero_clone().

Referenced by test_cv_el().

647  {
648  using std::exp;
649 
650  // convenience
651  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
652  const std::vector<CoeffType>& theta_e = chem_species.theta_e();
653  const std::vector<unsigned int>& ndg_e = chem_species.ndg_e();
654 
655  antioch_assert_equal_to(ndg_e.size(), theta_e.size());
656 
657  StateType cv_el = Antioch::zero_clone(Te);
658 
659  // Really < 2? Yes, b/c theta_e[0] = 0.0 always. See
660  // antioch_default_electronic_data.dat
661  if (theta_e.size() < 2) return cv_el;
662 
663  typedef typename Antioch::raw_value_type<StateType>::type raw_type;
664  const raw_type one = static_cast<raw_type>(1);
665 
666  const StateType Teinv = one/Te;
667  const StateType Te2inv = Teinv*Teinv;
668 
669  StateType
670  num = Antioch::zero_clone(Te), dnum = Antioch::zero_clone(Te),
671  den = Antioch::zero_clone(Te), dden = Antioch::zero_clone(Te);
672 
673  for (unsigned int level=0; level<theta_e.size(); level++)
674  {
675  const StateType
676  expval = exp (-theta_e[level] * Teinv),
677  den_l = static_cast<raw_type>(ndg_e[level])*expval,
678  num_l = den_l*theta_e[level],
679  dden_l = num_l*Te2inv,
680  dnum_l = dden_l*theta_e[level];
681 
682  num += num_l;
683  den += den_l;
684 
685  dden += dden_l;
686  dnum += dnum_l;
687  }
688 
689  const StateType invden = one/den;
690 
691  cv_el = chem_species.gas_constant()*(dnum - num*dden*invden) * invden;
692 
693  return cv_el;
694  }
const ChemicalMixture< CoeffType > & _chem_mixture
#define antioch_assert_equal_to(expr1, expr2)
StateType cv_el(const unsigned int species, const StateType &Te) const
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_el ( const typename Antioch::value_type< VectorStateType >::type &  Te,
const VectorStateType &  mass_fractions 
) const
Returns
mixture electronic specific heat at constant volume.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_el ( const typename Antioch::value_type< VectorStateType >::type &  Te,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 703 of file stat_mech_thermo.h.

705  {
707  cv_el = mass_fractions[0]*this->cv_el(0, Te);
708 
709  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
710  {
711  cv_el += mass_fractions[s]*this->cv_el(s, Te);
712  }
713 
714  return cv_el;
715  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType cv_el(const unsigned int species, const StateType &Te) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_rot ( const unsigned int  species) const
inline
Returns
species rotational specific heat at constant volume. By convention, we lump the translational/rotational components

\[ C^{tr}_{v,s} \equiv C^{trans}_{v,s} + C^{rot}_{v,s} \]

so then

\[ C^{rot}_{v,s} \equiv C^{tr}_{v,s} - C^{trans}_{v,s} \]

Definition at line 528 of file stat_mech_thermo.h.

References std::max(), and Antioch::max().

529  {
530  using std::max;
531 
532  return max(this->cv_tr(species) - this->cv_trans(species), CoeffType(0) );
533  }
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
Definition: eigen_utils.h:88
CoeffType cv_tr(const unsigned int species) const
max(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
CoeffType cv_trans(const unsigned int species) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_rot_over_R ( const unsigned int  species) const
inline
Returns
species rotational specific heat at constant volume. By convention, we lump the translational/rotational components

\[ C^{tr}_{v,s} \equiv C^{trans}_{v,s} + C^{rot}_{v,s} \]

so then

\[ \frac{C^{rot}_{v,s}}{\mathrm{R}} \equiv \frac{C^{tr}_{v,s}}{\mathrm{R}} - \frac{C^{trans}_{v,s}}{\mathrm{R}} \]

Definition at line 537 of file stat_mech_thermo.h.

References std::max(), and Antioch::max().

538  {
539  using std::max;
540 
541  return max(this->cv_tr_over_R(species) - this->cv_trans_over_R(species), CoeffType(0) );
542  }
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
Definition: eigen_utils.h:88
CoeffType cv_tr_over_R(const unsigned int species) const
max(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
CoeffType cv_trans_over_R(const unsigned int species) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_tr ( const unsigned int  species) const
inline
Returns
species translational/rotational specific heat at constant volume.

Definition at line 546 of file stat_mech_thermo.h.

Referenced by test_cv_tr().

547  {
548  return _chem_mixture.R(species)*(_chem_mixture.chemical_species()[species])->n_tr_dofs();
549  }
const ChemicalMixture< CoeffType > & _chem_mixture
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_tr ( const VectorStateType &  mass_fractions) const
Returns
mixture translational/rotational specific heat at constant volume.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_tr ( const VectorStateType &  mass_fractions) const
inline

Definition at line 565 of file stat_mech_thermo.h.

566  {
568  cv_tr = mass_fractions[0]*this->cv_tr(0);
569 
570  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
571  {
572  cv_tr += mass_fractions[s]*this->cv_tr(s);
573  }
574 
575  return cv_tr;
576  }
const ChemicalMixture< CoeffType > & _chem_mixture
CoeffType cv_tr(const unsigned int species) const
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_tr_over_R ( const unsigned int  species) const
inline
Returns
species translational/rotational specific heat over R at constant volume.

Definition at line 553 of file stat_mech_thermo.h.

554  {
555  return (_chem_mixture.chemical_species()[species])->n_tr_dofs();
556  }
const ChemicalMixture< CoeffType > & _chem_mixture
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_trans ( const unsigned int  species) const
inline
Returns
species translational specific heat at constant volume. Since the translational modes are assumed to be fully polulated this is simply

\[ C^{trans}_{v,s} \equiv \frac{\partial e^{trans}_s}{\partial T} = \frac{3}{2} R_s \]

Definition at line 514 of file stat_mech_thermo.h.

515  {
516  return CoeffType(1.5)*_chem_mixture.R(species);
517  }
const ChemicalMixture< CoeffType > & _chem_mixture
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::cv_trans_over_R ( const unsigned int  species) const
inline
Returns
species translational specific over R heat at constant volume. Since the translational modes are assumed to be fully polulated this is simply

\[ \frac{C^{trans}_{v,s}}{\mathrm{R}} = \frac{3}{2} \]

Definition at line 521 of file stat_mech_thermo.h.

522  {
523  return CoeffType(1.5);
524  }
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::cv_ve ( const unsigned int  species,
const StateType &  Tv 
) const
inline
Returns
species vibrational/electronic specific heat constant volume.

Definition at line 720 of file stat_mech_thermo.h.

722  {
723  return (this->cv_vib(species, Tv) + this->cv_el(species, Tv));
724  }
StateType cv_el(const unsigned int species, const StateType &Te) const
StateType cv_vib(const unsigned int species, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_ve ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture vibrational/electronic specific heat constant volume.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_ve ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 733 of file stat_mech_thermo.h.

736  {
737  return (this->cv_vib(Tv, mass_fractions) + this->cv_el(Tv, mass_fractions));
738  }
StateType cv_el(const unsigned int species, const StateType &Te) const
StateType cv_vib(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::cv_vib ( const unsigned int  species,
const StateType &  Tv 
) const
inline
Returns
species vibrational specific heat constant volume.

Definition at line 581 of file stat_mech_thermo.h.

Referenced by test_cv_vib().

583  {
584  return this->cv_vib_over_R(species,Tv) * (_chem_mixture.chemical_species()[species])->gas_constant();
585  }
const ChemicalMixture< CoeffType > & _chem_mixture
StateType cv_vib_over_R(const unsigned int species, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_vib ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture vibrational specific heat constant volume.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::cv_vib ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 628 of file stat_mech_thermo.h.

630  {
632  cv_vib = mass_fractions[0]*this->cv_vib(0, Tv);
633 
634  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
635  {
636  cv_vib += mass_fractions[s]*this->cv_vib(s, Tv);
637  }
638 
639  return cv_vib;
640  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType cv_vib(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::cv_vib_over_R ( const unsigned int  species,
const StateType &  Tv 
) const
inline
Returns
species vibrational specific heat over R constant volume.

Definition at line 590 of file stat_mech_thermo.h.

References antioch_assert_equal_to, Antioch::ChemicalSpecies< CoeffType >::ndg_v(), Antioch::ChemicalSpecies< CoeffType >::theta_v(), and Antioch::zero_clone().

592  {
593  using std::exp;
594 
595  // convenience
596  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
597  const std::vector<CoeffType>& theta_v = chem_species.theta_v();
598  const std::vector<unsigned int>& ndg_v = chem_species.ndg_v();
599 
600  antioch_assert_equal_to(ndg_v.size(), theta_v.size());
601 
602  // Use an input datum to make sure we get the size right
603  StateType cv_vib_over_R = Antioch::zero_clone(Tv);
604 
605  if (theta_v.empty())
606  return cv_vib_over_R;
607 
608  for (unsigned int level=0; level<ndg_v.size(); level++)
609  {
610  typedef typename Antioch::raw_value_type<StateType>::type raw_type;
611  const StateType expval = exp(theta_v[level]/Tv);
612  const StateType expvalminusone = expval - raw_type(1);
613 
614  cv_vib_over_R += (static_cast<CoeffType>(ndg_v[level])*
615  theta_v[level]*theta_v[level]*expval/(expvalminusone*expvalminusone)/(Tv*Tv));
616  }
617 
618  return cv_vib_over_R;
619  }
const ChemicalMixture< CoeffType > & _chem_mixture
#define antioch_assert_equal_to(expr1, expr2)
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
StateType cv_vib_over_R(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::e_0 ( const unsigned int  species) const
inline
Returns
species formation energy, J/kg.

Definition at line 1052 of file stat_mech_thermo.h.

References Antioch::ChemicalSpecies< CoeffType >::formation_enthalpy().

1053  {
1054  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
1055  return chem_species.formation_enthalpy();
1056  }
const ChemicalMixture< CoeffType > & _chem_mixture
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_0 ( const VectorStateType &  mass_fractions) const
Returns
mixture formation energy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_0 ( const VectorStateType &  mass_fractions) const
inline

Definition at line 1065 of file stat_mech_thermo.h.

1066  {
1068  e_0 = mass_fractions[0]*this->e_0(0);
1069 
1070  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
1071  {
1072  e_0 += mass_fractions[s]*this->e_0(s);
1073  }
1074 
1075  return e_0;
1076  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
CoeffType e_0(const unsigned int species) const
template<typename CoeffType >
template<typename VectorStateType >
void Antioch::StatMechThermodynamics< CoeffType >::e_and_cv_ve ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type &  e_ve,
typename Antioch::value_type< VectorStateType >::type &  cv_ve 
) const
inline
Returns
mixture vibrational/electronic energy (same as e_ve()) and specific heat (same as cv_ve()), calculated together for efficiency.

Definition at line 1041 of file stat_mech_thermo.h.

1045  {
1046  e_ve = this->e_ve (Tv, mass_fractions);
1047  cv_ve = this->cv_ve(Tv, mass_fractions);
1048  }
StateType e_ve(const unsigned int species, const StateType &Tv) const
StateType cv_ve(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_el ( const unsigned int  species,
const StateType &  Te 
) const
inline
Returns
species electronic energy, J/kg.

Definition at line 960 of file stat_mech_thermo.h.

References antioch_assert_equal_to, Antioch::ChemicalSpecies< CoeffType >::gas_constant(), Antioch::ChemicalSpecies< CoeffType >::ndg_e(), Antioch::ChemicalSpecies< CoeffType >::theta_e(), and Antioch::zero_clone().

962  {
963  using std::exp;
964 
965  // convenience
966  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
967  const std::vector<CoeffType>& theta_e = chem_species.theta_e();
968  const std::vector<unsigned int>& ndg_e = chem_species.ndg_e();
969 
970  antioch_assert_equal_to(ndg_e.size(), theta_e.size());
971 
972  StateType e_el = Antioch::zero_clone(Te);
973 
974  if (theta_e.size() < 2) return e_el;
975 
976  StateType num = Antioch::zero_clone(Te), den = Antioch::zero_clone(Te);
977 
978  for (unsigned int level=0; level<theta_e.size(); level++)
979  {
980  const StateType expval = exp (-theta_e[level] / Te);
981  num += static_cast<StateType>(ndg_e[level])*theta_e[level]*expval;
982  den += static_cast<StateType>(ndg_e[level])*expval;
983  }
984 
985  return chem_species.gas_constant() * num / den;
986  }
const ChemicalMixture< CoeffType > & _chem_mixture
#define antioch_assert_equal_to(expr1, expr2)
StateType e_el(const unsigned int species, const StateType &Te) const
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_el ( const typename Antioch::value_type< VectorStateType >::type &  Te,
const VectorStateType &  mass_fractions 
) const
Returns
mixture electronic energy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_el ( const typename Antioch::value_type< VectorStateType >::type &  Te,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 995 of file stat_mech_thermo.h.

997  {
999  e_el = mass_fractions[0]*this->e_el(0, Te);
1000 
1001  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
1002  {
1003  e_el += mass_fractions[s]*this->e_el(s, Te);
1004  }
1005 
1006  return e_el;
1007  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType e_el(const unsigned int species, const StateType &Te) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const unsigned int  species,
const StateType &  T,
const StateType &  Tv 
) const
inline
Returns
species total internal energy, J/kg.

Definition at line 837 of file stat_mech_thermo.h.

Referenced by test_T_from_e_tot().

840  {
841  return (this->e_tr(species, T) + this->e_ve(species, Tv) + this->e_0(species));
842  }
StateType e_ve(const unsigned int species, const StateType &Tv) const
StateType e_tr(const unsigned int species, const StateType &T) const
CoeffType e_0(const unsigned int species) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture total internal energy, J/kg.
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const unsigned int  species,
const StateType &  T 
) const
inline
Returns
species total internal energy, J/kg. Assumes thermal equilibrium of translational/rotational and vibrational/electronic temperature.

Definition at line 862 of file stat_mech_thermo.h.

864  {
865  return this->e_tot(species, T, T);
866  }
StateType e_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
Returns
mixture total internal energy, J/kg. Assumes thermal equilibrium of translational/rotational and vivbrational/electronic temperature.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 852 of file stat_mech_thermo.h.

855  {
856  return (this->e_tr(T, mass_fractions) + this->e_ve(Tv, mass_fractions) + this->e_0(mass_fractions));
857  }
StateType e_ve(const unsigned int species, const StateType &Tv) const
StateType e_tr(const unsigned int species, const StateType &T) const
CoeffType e_0(const unsigned int species) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 875 of file stat_mech_thermo.h.

877  {
878  return this->e_tot(T, T, mass_fractions);
879  }
StateType e_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_tr ( const unsigned int  species,
const StateType &  T 
) const
inline
Returns
species translational/rotational energy, J/kg.

Definition at line 884 of file stat_mech_thermo.h.

886  {
887  return this->cv_tr(species)*T;
888  }
CoeffType cv_tr(const unsigned int species) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tr ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
Returns
mixture translational/rotational energy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_tr ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 897 of file stat_mech_thermo.h.

899  {
901  e_tr = mass_fractions[0]*this->e_tr(0, T);
902 
903  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
904  {
905  e_tr += mass_fractions[s]*this->e_tr(s, T);
906  }
907 
908  return e_tr;
909  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType e_tr(const unsigned int species, const StateType &T) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_ve ( const unsigned int  species,
const StateType &  Tv 
) const
inline
Returns
species vibrational/electronic energy, J/kg.

Definition at line 1012 of file stat_mech_thermo.h.

1014  {
1015  return (this->e_vib(species,Tv) + this->e_el(species,Tv));
1016  }
StateType e_vib(const unsigned int species, const StateType &Tv) const
StateType e_el(const unsigned int species, const StateType &Te) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_ve ( const typename Antioch::value_type< VectorStateType >::type &  Te,
const VectorStateType &  mass_fractions 
) const
Returns
mixture vibrational/electronic energy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_ve ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 1025 of file stat_mech_thermo.h.

1027  {
1028  return (this->e_vib(Tv,mass_fractions) + this->e_el(Tv,mass_fractions));
1029  }
StateType e_vib(const unsigned int species, const StateType &Tv) const
StateType e_el(const unsigned int species, const StateType &Te) const
template<typename CoeffType >
CoeffType Antioch::StatMechThermodynamics< CoeffType >::e_ve_min ( ) const
inline
Returns
the minimum valid mixture vibrational/electronic energy, J/kg. We allow for a user-specified minimum vibrational temperature, Tv. This in turn sets an a priori minimum valid species vibrational/electronic temperature. However, the minimum valid value for a mixture depends on the species mass fractions and must be computed. That is what this method does.

Definition at line 1033 of file stat_mech_thermo.h.

References antioch_not_implemented.

1034  {
1036  }
#define antioch_not_implemented()
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::e_vib ( const unsigned int  species,
const StateType &  Tv 
) const
inline
Returns
species vibrational energy, J/kg.

Definition at line 914 of file stat_mech_thermo.h.

References antioch_assert_equal_to, Antioch::ChemicalSpecies< CoeffType >::gas_constant(), Antioch::ChemicalSpecies< CoeffType >::ndg_v(), and Antioch::ChemicalSpecies< CoeffType >::theta_v().

916  {
917  using std::exp;
918 
919  // convenience
920  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
921  const std::vector<CoeffType>& theta_v = chem_species.theta_v();
922  const std::vector<unsigned int>& ndg_v = chem_species.ndg_v();
923 
924  antioch_assert_equal_to(ndg_v.size(), theta_v.size());
925 
926  StateType e_vib = 0.0;
927 
928  if (theta_v.empty()) return e_vib;
929 
930  for (unsigned int level=0; level<ndg_v.size(); level++)
931  e_vib += ndg_v[level]*chem_species.gas_constant()*theta_v[level]/(exp(theta_v[level]/Tv) - 1.);
932 
933  return e_vib;
934  }
const ChemicalMixture< CoeffType > & _chem_mixture
#define antioch_assert_equal_to(expr1, expr2)
StateType e_vib(const unsigned int species, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_vib ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture vibrational energy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::e_vib ( const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 943 of file stat_mech_thermo.h.

945  {
947  e_vib = mass_fractions[0]*this->e_vib(0, Tv);
948 
949  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
950  {
951  e_vib += mass_fractions[s]*this->e_vib(s, Tv);
952  }
953 
954  return e_vib;
955  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType e_vib(const unsigned int species, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const unsigned int  species,
const StateType &  T,
const StateType &  Tv 
) const
inline
Returns
species total enthalpy, J/kg.

Definition at line 781 of file stat_mech_thermo.h.

References Antioch::ChemicalSpecies< CoeffType >::gas_constant().

784  {
785  const ChemicalSpecies<CoeffType>& chem_species = *(_chem_mixture.chemical_species()[species]);
786  return (this->e_tot(species, T, Tv) + chem_species.gas_constant()*T);
787  }
const ChemicalMixture< CoeffType > & _chem_mixture
StateType e_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType >
template<typename StateType >
StateType Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const unsigned int  species,
const StateType &  T 
) const
inline
Returns
species total enthalpy, J/kg. Assumes thermal equilibrium of translational/rotational and vibrational/electronic temperature.

Definition at line 793 of file stat_mech_thermo.h.

795  {
796  return this->h_tot(species, T, T);
797  }
StateType h_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
Returns
mixture specific enthalpy, J/kg.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
Returns
mixture specific enthalpy, J/kg. Assumes thermal equilibrium of translational/rotational and vivbrational/electronic temperature.
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 806 of file stat_mech_thermo.h.

809  {
811  h_tot = mass_fractions[0]*this->h_tot(0, T, Tv);
812 
813  for( unsigned int s = 1; s < _chem_mixture.n_species(); s++ )
814  {
815  h_tot += mass_fractions[s]*this->h_tot(s, T, Tv);
816  }
817 
818  return h_tot;
819  }
const ChemicalMixture< CoeffType > & _chem_mixture
enable_if_c< has_size< VectorStateType >::value, typename Antioch::value_type< VectorStateType >::type >::type s(const typename Antioch::value_type< VectorStateType >::type &T, const typename Antioch::value_type< VectorStateType >::type &p, const VectorStateType &mass_fractions) const
StateType h_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::h_tot ( const typename Antioch::value_type< VectorStateType >::type &  T,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 828 of file stat_mech_thermo.h.

830  {
831  return this->h_tot(T, T, mass_fractions);
832  }
StateType h_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::s ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  p,
const VectorStateType &  mass_fractions 
) const

Computes the mixture specific entropy (J/kg-K) from input temperature (K) and pressure (Pa).

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::s ( const typename Antioch::value_type< VectorStateType >::type &  T,
const typename Antioch::value_type< VectorStateType >::type &  p,
const VectorStateType &  mass_fractions 
) const
inline

Definition at line 1223 of file stat_mech_thermo.h.

References antioch_not_implemented.

1226  {
1228  }
#define antioch_not_implemented()
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_e_tot ( const typename Antioch::value_type< VectorStateType >::type &  e_tot,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T = -1 
) const

Computes the mixture temperature (K) from input total energy per unit mass (J/kg).

Referenced by test_T_from_e_tot().

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_e_tot ( const typename Antioch::value_type< VectorStateType >::type &  e_tot,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T 
) const
inline

Definition at line 1100 of file stat_mech_thermo.h.

References std::max(), Antioch::max(), std::min(), and Antioch::min().

1103  {
1104  using std::abs;
1105  using std::max;
1106  using std::min;
1107 
1108  typedef typename Antioch::value_type<VectorStateType>::type StateType;
1109 
1110  // Cache the translational/rotational specific heat - this will be used repeatedly
1111  // and involves (2*NS-1) flops to compute, and since this has no functional
1112  // dependence on temperature it will not change throughout the Newton iteration.
1114  Cv_tr = this->cv_tr(mass_fractions);
1115 
1116  // Similarly for mixture formation energy
1118  E_0 = this->e_0(mass_fractions);
1119 
1120  // if the user does not provide an initial guess for the temperature
1121  // assume it is all in translation/rotation to compute a starting value.
1122  if (T < 0)
1123  {
1124  T = (e_tot - E_0) / Cv_tr;
1125  T = min(max(T,StateType(10.)),StateType(20000.));
1126 
1127  // FIXME: Use Antioch::Limits or similar? (i.e., don't
1128  // hardcode min and max T)
1129 
1130  // make sure the initial guess is valid
1131  //T = max(T, Limits::CompNSLimits::T_min());
1132  T = max(T, StateType(10.));
1133  T = min(T, StateType(2.e4));
1134  }
1135 
1136  // compute the translational/rotational temperature of the mixture using Newton-Rhapson iteration
1137  CoeffType delta_T = std::numeric_limits<StateType>::max();
1138  const unsigned int max_iterations = 100;
1139 
1140  const CoeffType dT_reltol= std::numeric_limits<CoeffType>::epsilon() * 100;
1141 
1142  // NOTE: FIN-S uses a hardcoded, absolute tolerance on delta_T of
1143  // 1e-8. Using a relative tolerance here of 100*epsilon.
1144  for (unsigned int iter = 0;
1145  abs(delta_T/T) > dT_reltol &&
1146  T >= 0.;
1147  ++iter)
1148  {
1149  if (iter == max_iterations)
1150  throw FailedNewtonTTvInversion ("ERROR: failed to converge T_from_e_tot!");
1151 
1152  // compute the residual, defined as the mismatch between the input e_tot and
1153  // the value corresponding to the current T iterate
1155  Re = 0., dRevdT = 0.;
1156 
1157  this->e_and_cv_ve(T, mass_fractions, Re, dRevdT);
1158  Re += this->e_tr(T, mass_fractions) + E_0 - e_tot;
1159  dRevdT += Cv_tr;
1160 
1161  delta_T = -Re / dRevdT;
1162  T += delta_T;
1163  }
1164 
1165  return T;
1166  }
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
Definition: eigen_utils.h:88
CoeffType cv_tr(const unsigned int species) const
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type min(const T &in)
Definition: eigen_utils.h:98
max(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
StateType e_tot(const unsigned int species, const StateType &T, const StateType &Tv) const
StateType e_tr(const unsigned int species, const StateType &T) const
typename _Scalar int _Rows int _Cols int _Options int _MaxRows int _MaxCols inline min(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &a, const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &b) ANTIOCH_AUTOFUNC(_Matrix< _Scalar ANTIOCH_COMMA _Rows ANTIOCH_COMMA _Cols ANTIOCH_COMMA _Options ANTIOCH_COMMA _MaxRows ANTIOCH_COMMA _MaxCols >
CoeffType e_0(const unsigned int species) const
void e_and_cv_ve(const typename Antioch::value_type< VectorStateType >::type &Tv, const VectorStateType &mass_fractions, typename Antioch::value_type< VectorStateType >::type &e_ve, typename Antioch::value_type< VectorStateType >::type &cv_ve) const
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_e_tr ( const typename Antioch::value_type< VectorStateType >::type &  e_tr,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T = -1 
) const

Computes the mixture temperature (K) from input translational/rotational energy per unit mass (J/kg).

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_e_tr ( const typename Antioch::value_type< VectorStateType >::type &  e_tr,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T 
) const
inline

Definition at line 1176 of file stat_mech_thermo.h.

References antioch_not_implemented.

1179  {
1181  }
#define antioch_not_implemented()
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_h_tot ( const typename Antioch::value_type< VectorStateType >::type &  h_tot,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T = -1 
) const

Computes the mixture temperature (K) from input enthalpy per unit mass (J/kg).

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_h_tot ( const typename Antioch::value_type< VectorStateType >::type &  h_tot,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T 
) const
inline

Definition at line 1191 of file stat_mech_thermo.h.

References antioch_not_implemented.

1194  {
1196  }
#define antioch_not_implemented()
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_h_tot_Tv ( const typename Antioch::value_type< VectorStateType >::type &  h_tot,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T = -1 
) const

Computes the mixture temperature (K) from input vibrational/electronic temperature Tv (K) and enthalpy per unit mass (J/kg).

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::T_from_h_tot_Tv ( const typename Antioch::value_type< VectorStateType >::type &  h_tot,
const typename Antioch::value_type< VectorStateType >::type &  Tv,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  T 
) const
inline

Definition at line 1206 of file stat_mech_thermo.h.

References antioch_not_implemented.

1210  {
1212  }
#define antioch_not_implemented()
template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::Tv_from_e_ve ( const typename Antioch::value_type< VectorStateType >::type &  e_ve,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  Tv = -1 
) const

Computes the mixture vibrational temperature (K) from input vibrational-electronic energy per unit mass (J/kg).

template<typename CoeffType = double>
template<typename VectorStateType >
enable_if_c< has_size<VectorStateType>::value, typename Antioch::value_type<VectorStateType>::type >::type Antioch::StatMechThermodynamics< CoeffType >::Tv_from_e_ve ( const typename Antioch::value_type< VectorStateType >::type &  e_ve,
const VectorStateType &  mass_fractions,
typename Antioch::value_type< VectorStateType >::type  Tv 
) const
inline

Definition at line 1086 of file stat_mech_thermo.h.

References antioch_not_implemented.

1089  {
1091  }
#define antioch_not_implemented()

Member Data Documentation

template<typename CoeffType = double>
const ChemicalMixture<CoeffType>& Antioch::StatMechThermodynamics< CoeffType >::_chem_mixture
protected

Definition at line 485 of file stat_mech_thermo.h.


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

Generated on Thu Jul 7 2016 11:09:50 for antioch-0.4.0 by  doxygen 1.8.8