antioch-0.4.0
ideal_gas_micro_thermo.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 
27 #ifndef ANTIOCH_IDEAL_GAS_MICRO_THERMO_H
28 #define ANTIOCH_IDEAL_GAS_MICRO_THERMO_H
29 
30 namespace Antioch
31 {
32 
33  template <typename CoeffType>
34  class ChemicalMixture;
35 
36  template <typename CoeffType>
37  class TempCache;
38 
39 
40  template <typename MacroThermo, typename CoeffType = double>
42  {
43  public:
44  IdealGasMicroThermo(const MacroThermo & ext_thermo, const ChemicalMixture<CoeffType> & chem_mix);
46 
48  template <typename StateType>
49  const ANTIOCH_AUTO(StateType)
50  cv_vib(unsigned int s, const StateType & T) const
51  ANTIOCH_AUTOFUNC(StateType, (_chem_mix.chemical_species()[s]->n_tr_dofs() < CoeffType(2.))?zero_clone(T):
52  _ext_therm.cv(TempCache<StateType>(T),s) - this->cv_tr(s))
53 
55  template <typename StateType>
56  const ANTIOCH_AUTO(StateType)
57  cv_vib_over_R(unsigned int s, const StateType & T) const
58  ANTIOCH_AUTOFUNC(StateType, (_chem_mix.chemical_species()[s]->n_tr_dofs() < CoeffType(2.))?zero_clone(T):
59  _ext_therm.cv_over_R(TempCache<StateType>(T),s) - this->cv_tr_over_R(s))
60 
62  const CoeffType cv_rot(unsigned int s) const;
63 
65  const CoeffType cv_rot_over_R(unsigned int s) const;
66 
68  const CoeffType cv_trans(unsigned int s) const;
69 
71  const CoeffType cv_trans_over_R(unsigned int s) const;
72 
74  const CoeffType cv_tr(unsigned int s) const;
75 
77  const CoeffType cv_tr_over_R(unsigned int s) const;
78 
79  private:
80  const ChemicalMixture<CoeffType> & _chem_mix;
81  const MacroThermo & _ext_therm;
82  };
83 
84  template <typename MacroThermo, typename CoeffType>
85  inline
86  IdealGasMicroThermo<MacroThermo, CoeffType>::IdealGasMicroThermo(const MacroThermo & ext_therm, const ChemicalMixture<CoeffType> & chem_mix):
87  _chem_mix(chem_mix),
88  _ext_therm(ext_therm)
89  {
90  return;
91  }
92 
93  template <typename MacroThermo, typename CoeffType>
94  inline
96  {
97  return;
98  }
99 
100  template <typename MacroThermo, typename CoeffType>
101  inline
102  const CoeffType IdealGasMicroThermo<MacroThermo, CoeffType>::cv_tr_over_R(unsigned int s) const
103  {
104  return _chem_mix.chemical_species()[s]->n_tr_dofs();
105  }
106 
107  template <typename MacroThermo, typename CoeffType>
108  inline
109  const CoeffType IdealGasMicroThermo<MacroThermo, CoeffType>::cv_tr(unsigned int s) const
110  {
111  return _chem_mix.R(s) * (_chem_mix.chemical_species()[s])->n_tr_dofs();
112  }
113 
114  template <typename MacroThermo, typename CoeffType>
115  inline
116  const CoeffType IdealGasMicroThermo<MacroThermo, CoeffType>::cv_rot(unsigned int s) const
117  {
118  using std::max;
119 
120  return max(this->cv_tr(s) - this->cv_trans(s), CoeffType(0) );
121  }
122 
123  template <typename MacroThermo, typename CoeffType>
124  inline
126  {
127  return std::max(this->cv_tr_over_R(s) - this->cv_trans_over_R(s), CoeffType(0) );
128  }
129 
130  template <typename MacroThermo, typename CoeffType>
131  inline
132  const CoeffType IdealGasMicroThermo<MacroThermo, CoeffType>::cv_trans( const unsigned int species ) const
133  {
134  return CoeffType(1.5)*_chem_mix.R(species);
135  }
136 
137  template <typename MacroThermo, typename CoeffType>
138  inline
139  const CoeffType IdealGasMicroThermo<MacroThermo, CoeffType>::cv_trans_over_R( const unsigned int /*species*/ ) const
140  {
141  return CoeffType(1.5);
142  }
143 
144 
145 }
146 
147 
148 #endif
const CoeffType cv_rot_over_R(unsigned int s) const
cv_rot/R
Antioch::enable_if_c< is_eigen< T >::value, typename value_type< T >::type >::type max(const T &in)
Definition: eigen_utils.h:88
const CoeffType cv_tr(unsigned int s) const
cv_trans-rot
const CoeffType cv_tr_over_R(unsigned int s) const
cv_trans_rot/R
const CoeffType cv_trans_over_R(unsigned int s) const
cv_trans/R
const ANTIOCH_AUTO(StateType) cv_vib(unsigned int s
cv_vib
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 >
const CoeffType cv_trans(unsigned int s) const
cv_trans
Class storing chemical mixture properties.
const ChemicalMixture< CoeffType > & _chem_mix
The parameters are reduced parameters.
IdealGasMicroThermo(const MacroThermo &ext_thermo, const ChemicalMixture< CoeffType > &chem_mix)
_Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > zero_clone(const _Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols > &ex)
Definition: eigen_utils.h:145
const const StateType &T const ANTIOCH_AUTOFUNC(StateType,(_chem_mix.chemical_species()[s]->n_tr_dofs()< CoeffType(2.))?zero_clone(T):_ext_therm.cv(TempCache< StateType >(T), s)-this->cv_tr(s)) template< typename StateType > const ANTIOCH_AUTO(StateType) cv_vib_over_R(unsigned int s
cv_vib/R

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