GRINS-0.7.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-2016 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 Thermo>
44  : _chem( mixture ),
45  _kinetics( new AntiochKinetics(mixture) ),
46  _temp_cache( new Antioch::TempCache<libMesh::Real>(1.0) )
47  {
48  this->build_thermo( mixture );
49  }
50 
51  template<typename Thermo>
52  void AntiochEvaluator<Thermo>::omega_dot( const libMesh::Real& T, libMesh::Real rho,
53  const std::vector<libMesh::Real> mass_fractions,
54  std::vector<libMesh::Real>& omega_dot )
55  {
56  this->check_and_reset_temp_cache(T);
57 
58  _kinetics->omega_dot( *(_temp_cache.get()), rho, mass_fractions, omega_dot );
59  }
60 
61  template<>
62  libMesh::Real AntiochEvaluator<Antioch::CEAEvaluator<libMesh::Real> >::cp( const libMesh::Real& T,
63  const libMesh::Real /*P*/,
64  const std::vector<libMesh::Real>& Y )
65  {
66  this->check_and_reset_temp_cache(T);
67  return _thermo->cp( *(_temp_cache.get()), Y );
68  }
69 
70  template<>
71  libMesh::Real AntiochEvaluator<Antioch::StatMechThermodynamics<libMesh::Real> >::cp( const libMesh::Real& T,
72  const libMesh::Real /*P*/,
73  const std::vector<libMesh::Real>& Y )
74  {
75  return _thermo->cp( T, T, Y );
76  }
77 
78  template<>
79  libMesh::Real AntiochEvaluator<Antioch::CEAEvaluator<libMesh::Real> >::cv( const libMesh::Real& T,
80  const libMesh::Real /*P*/,
81  const std::vector<libMesh::Real>& Y )
82  {
83  this->check_and_reset_temp_cache(T);
84  return _thermo->cv( *(_temp_cache.get()), Y );
85  }
86 
87  template<>
88  libMesh::Real AntiochEvaluator<Antioch::StatMechThermodynamics<libMesh::Real> >::cv( const libMesh::Real& T,
89  const libMesh::Real /*P*/,
90  const std::vector<libMesh::Real>& Y )
91  {
92  return _thermo->cv( T, T, Y );
93  }
94 
95  template<>
96  libMesh::Real AntiochEvaluator<Antioch::CEAEvaluator<libMesh::Real> >::h_s( const libMesh::Real& T, unsigned int species )
97  {
98  this->check_and_reset_temp_cache(T);
99 
100  return _thermo->h( *(_temp_cache.get()), species );;
101  }
102 
103  template<>
104  libMesh::Real AntiochEvaluator<Antioch::StatMechThermodynamics<libMesh::Real> >::h_s( const libMesh::Real& T, unsigned int species )
105  {
106  return _thermo->h_tot( species, T ) + _chem.h_stat_mech_ref_correction(species);
107  }
108 
109 } // end namespace GRINS
110 
111 #endif //GRINS_HAVE_ANTIOCH
libMesh::Real cv(const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
libMesh::Real cp(const libMesh::Real &T, const libMesh::Real P, const std::vector< libMesh::Real > &Y)
Wrapper class for evaluating chemistry and thermo properties using Antioch.
Wrapper class for evaluating chemical kinetics using Antioch.
void omega_dot(const libMesh::Real &T, libMesh::Real rho, const std::vector< libMesh::Real > mass_fractions, std::vector< libMesh::Real > &omega_dot)
GRINS namespace.
Wrapper class for storing state for Antioch thermo and kinetics.
void build_thermo(const AntiochMixture &mixture)

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10