GRINS-0.8.0
antioch_evaluator.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #include "grins_config.h"
27 
28 #ifdef GRINS_HAVE_ANTIOCH
29 
30 // C++
31 #include <limits>
32 
33 // This class
35 
36 // GRINS
37 #include "grins/antioch_mixture.h"
38 #include "grins/cached_values.h"
39 
40 namespace GRINS
41 {
42  template<typename KineticsThermoCurveFit, typename Thermo>
45  : _chem( mixture ),
46  _kinetics( new AntiochKinetics<KineticsThermoCurveFit>(mixture) ),
47  _minimum_T( mixture.minimum_T() ),
48  _temp_cache( new Antioch::TempCache<libMesh::Real>(1.0) )
49  {
50  this->build_thermo( mixture );
51  }
52 
53  template<typename KineticsThermoCurveFit, typename Thermo>
55  omega_dot( const libMesh::Real& T, libMesh::Real rho,
56  const std::vector<libMesh::Real> mass_fractions,
57  std::vector<libMesh::Real>& omega_dot )
58  {
59  this->check_and_reset_temp_cache(T);
60 
61  _kinetics->omega_dot( *(_temp_cache.get()), rho, mass_fractions, omega_dot );
62  }
63 
64  template<>
65  libMesh::Real
66  AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> >::
67  cp( const libMesh::Real& T,
68  const libMesh::Real /*P*/,
69  const std::vector<libMesh::Real>& Y )
70  {
71  this->check_and_reset_temp_cache(T);
72  return this->_nasa_evaluator->cp( *(_temp_cache.get()), Y );
73  }
74 
75  template<>
76  libMesh::Real AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> >::
77  cv( const libMesh::Real& T,
78  const libMesh::Real /*P*/,
79  const std::vector<libMesh::Real>& Y )
80  {
81  this->check_and_reset_temp_cache(T);
82  return this->_nasa_evaluator->cv( *(_temp_cache.get()), Y );
83  }
84 
85  template<>
86  libMesh::Real AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> >::
87  h_s( const libMesh::Real& T, unsigned int species )
88  {
89  this->check_and_reset_temp_cache(T);
90 
91  return this->_nasa_evaluator->h( *(_temp_cache.get()), species );;
92  }
93 
94  template<>
95  libMesh::Real AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::StatMechThermodynamics<libMesh::Real> >::cp( const libMesh::Real& T,
96  const libMesh::Real /*P*/,
97  const std::vector<libMesh::Real>& Y )
98  {
99  return this->_thermo->cp( T, T, Y );
100  }
101 
102  template<>
103  libMesh::Real AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::StatMechThermodynamics<libMesh::Real> >::cv( const libMesh::Real& T,
104  const libMesh::Real /*P*/,
105  const std::vector<libMesh::Real>& Y )
106  {
107  return this->_thermo->cv( T, T, Y );
108  }
109 
110  template<>
111  libMesh::Real AntiochEvaluator<Antioch::CEACurveFit<libMesh::Real>,Antioch::StatMechThermodynamics<libMesh::Real> >::h_s( const libMesh::Real& T, unsigned int species )
112  {
113  return this->_thermo->h_tot( species, T ) + _chem.h_stat_mech_ref_correction(species);
114  }
115 
116 } // end namespace GRINS
117 
118 #endif //GRINS_HAVE_ANTIOCH
Wrapper class for evaluating chemistry and thermo properties using Antioch.
Wrapper class for evaluating chemical kinetics using Antioch.
void build_thermo(const AntiochMixture< KineticsThermoCurveFit > &mixture)
GRINS namespace.
void omega_dot(const libMesh::Real &T, libMesh::Real rho, const std::vector< libMesh::Real > mass_fractions, std::vector< libMesh::Real > &omega_dot)
Wrapper class for storing state for Antioch thermo and kinetics.

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1