GRINS-0.6.0
cantera_evaluator.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 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 #ifndef GRINS_CANTERA_EVALUATOR_H
27 #define GRINS_CANTERA_EVALUATOR_H
28 
29 #include "grins_config.h"
30 
31 #ifdef GRINS_HAVE_CANTERA
32 
33 // GRINS
34 #include "grins/cantera_mixture.h"
35 #include "grins/cantera_thermo.h"
37 #include "grins/cantera_kinetics.h"
38 
39 namespace GRINS
40 {
42 
49  {
50  public:
51 
52  CanteraEvaluator( CanteraMixture& mixture );
54 
55  // Chemistry
56  libMesh::Real M( unsigned int species ) const;
57 
58  libMesh::Real M_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
59 
60  libMesh::Real R( unsigned int species ) const;
61 
62  libMesh::Real R_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
63 
64  libMesh::Real X( unsigned int species, libMesh::Real M, libMesh::Real mass_fraction ) const;
65 
66  void X( libMesh::Real M, const std::vector<libMesh::Real>& mass_fractions,
67  std::vector<libMesh::Real>& mole_fractions ) const;
68 
69  unsigned int species_index( const std::string& species_name ) const;
70 
71  std::string species_name( unsigned int species_index ) const;
72 
73  // Thermo
74  libMesh::Real cp( const CachedValues& cache, unsigned int qp ) const;
75 
76  libMesh::Real cv( const CachedValues& cache, unsigned int qp ) const;
77 
78  libMesh::Real h_s(const CachedValues& cache, unsigned int qp, unsigned int species) const;
79 
80  void h_s(const CachedValues& cache, unsigned int qp, std::vector<libMesh::Real>& h) const;
81 
82  libMesh::Real h_s( const libMesh::Real& T, unsigned int species );
83 
84  // Transport
85  libMesh::Real mu( const CachedValues& cache, unsigned int qp ) const;
86 
87  libMesh::Real k( const CachedValues& cache, unsigned int qp ) const;
88 
89  void mu_and_k( const CachedValues& cache, unsigned int qp,
90  libMesh::Real& mu, libMesh::Real& k );
91 
92  void D( const CachedValues& cache, unsigned int qp,
93  std::vector<libMesh::Real>& D ) const;
94 
95  // Kinetics
96  void omega_dot( const CachedValues& cache, unsigned int qp,
97  std::vector<libMesh::Real>& omega_dot ) const;
98 
99  void omega_dot( const libMesh::Real& T, libMesh::Real rho,
100  const std::vector<libMesh::Real> mass_fractions,
101  std::vector<libMesh::Real>& omega_dot );
102 
103  libMesh::Real cp( const libMesh::Real& /*T*/,
104  const std::vector<libMesh::Real>& /*Y*/ )
105  {
106  libmesh_not_implemented();
107  return 0.0;
108  }
109 
110  libMesh::Real mu( const libMesh::Real& /*T*/,
111  const std::vector<libMesh::Real>& /*Y*/ )
112  {
113  libmesh_not_implemented();
114  return 0.0;
115  }
116 
117  libMesh::Real k( const libMesh::Real& /*T*/,
118  const std::vector<libMesh::Real>& /*Y*/ )
119  {
120  libmesh_not_implemented();
121  return 0.0;
122  }
123 
124  void D( const libMesh::Real /*rho*/,
125  const libMesh::Real /*cp*/,
126  const libMesh::Real /*k*/,
127  std::vector<libMesh::Real>& /*D*/ )
128  {
129  libmesh_not_implemented();
130  return;
131  }
132 
133  protected:
134 
136 
138 
140 
142 
143  private:
144 
146 
147  };
148 
149  /* ------------------------- Inline Functions -------------------------*/
150  inline
151  libMesh::Real CanteraEvaluator::M( unsigned int species ) const
152  {
153  return _chem.M(species);
154  }
155 
156  inline
157  libMesh::Real CanteraEvaluator::M_mix( const std::vector<libMesh::Real>& mass_fractions ) const
158  {
159  return _chem.M_mix(mass_fractions);
160  }
161 
162  inline
163  libMesh::Real CanteraEvaluator::R( unsigned int species ) const
164  {
165  return _chem.R(species);
166  }
167 
168  inline
169  libMesh::Real CanteraEvaluator::R_mix( const std::vector<libMesh::Real>& mass_fractions ) const
170  {
171  return _chem.R_mix(mass_fractions);
172  }
173 
174  inline
175  libMesh::Real CanteraEvaluator::X( unsigned int species, libMesh::Real M, libMesh::Real mass_fraction ) const
176  {
177  return _chem.X(species,M,mass_fraction);
178  }
179 
180  inline
181  void CanteraEvaluator::X( libMesh::Real M, const std::vector<libMesh::Real>& mass_fractions,
182  std::vector<libMesh::Real>& mole_fractions ) const
183  {
184  _chem.X(M,mass_fractions,mole_fractions);
185  return;
186  }
187 
188  inline
189  unsigned int CanteraEvaluator::species_index( const std::string& species_name ) const
190  {
191  return _chem.species_index(species_name);
192  }
193 
194  inline
195  std::string CanteraEvaluator::species_name( unsigned int species_index ) const
196  {
197  return _chem.species_name(species_index);
198  }
199 
200  inline
201  libMesh::Real CanteraEvaluator::cp( const CachedValues& cache, unsigned int qp ) const
202  {
203  return _thermo.cp(cache,qp);
204  }
205 
206  inline
207  libMesh::Real CanteraEvaluator::cv( const CachedValues& cache, unsigned int qp ) const
208  {
209  return _thermo.cv(cache,qp);
210  }
211 
212  inline
213  libMesh::Real CanteraEvaluator::h_s(const CachedValues& cache, unsigned int qp, unsigned int species) const
214  {
215  return _thermo.h(cache,qp,species);
216  }
217 
218  inline
219  void CanteraEvaluator::h_s(const CachedValues& cache, unsigned int qp, std::vector<libMesh::Real>& h) const
220  {
221  _thermo.h(cache,qp,h);
222  return;
223  }
224 
225  inline
226  libMesh::Real CanteraEvaluator::h_s( const libMesh::Real& T, unsigned int species )
227  {
228  return _thermo.h(T,species);
229  }
230 
231  inline
232  libMesh::Real CanteraEvaluator::mu( const CachedValues& cache, unsigned int qp ) const
233  {
234  return _transport.mu(cache,qp);
235  }
236 
237  inline
238  libMesh::Real CanteraEvaluator::k( const CachedValues& cache, unsigned int qp ) const
239  {
240  return _transport.k(cache,qp);
241  }
242 
243  inline
244  void CanteraEvaluator::mu_and_k( const CachedValues& cache, unsigned int qp,
245  libMesh::Real& mu, libMesh::Real& k )
246  {
247  mu = _transport.mu(cache,qp);
248  k = _transport.k(cache,qp);
249  return;
250  }
251 
252  inline
253  void CanteraEvaluator::D( const CachedValues& cache, unsigned int qp,
254  std::vector<libMesh::Real>& D ) const
255  {
256  return _transport.D(cache,qp,D);
257  }
258 
259  inline
260  void CanteraEvaluator::omega_dot( const CachedValues& cache, unsigned int qp,
261  std::vector<libMesh::Real>& omega_dot ) const
262  {
263  return _kinetics.omega_dot(cache,qp,omega_dot);
264  }
265 
266  inline
267  void CanteraEvaluator::omega_dot( const libMesh::Real& T, libMesh::Real rho,
268  const std::vector<libMesh::Real> mass_fractions,
269  std::vector<libMesh::Real>& omega_dot )
270  {
271  return _kinetics.omega_dot_TRY(T,rho,mass_fractions,omega_dot);
272  }
273 
274 } // end namespace GRINS
275 
276 #endif // GRINS_HAVE_CANTERA
277 
278 #endif // GRINS_CANTERA_EVALUATOR_H
libMesh::Real R(unsigned int species) const
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
void omega_dot_TRY(const libMesh::Real &T, const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &omega_dot) const
libMesh::Real h_s(const CachedValues &cache, unsigned int qp, unsigned int species) const
void D(const libMesh::Real, const libMesh::Real, const libMesh::Real, std::vector< libMesh::Real > &)
void D(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &D) const
libMesh::Real mu(const libMesh::Real &, const std::vector< libMesh::Real > &)
libMesh::Real M_mix(const std::vector< libMesh::Real > &mass_fractions) const
void omega_dot(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &omega_dot) const
libMesh::Real cp(const CachedValues &cache, unsigned int qp) const
libMesh::Real cv(const CachedValues &cache, unsigned int qp) const
Wrapper class for evaluating thermo properties using Cantera.
libMesh::Real R(unsigned int species) const
CanteraTransport _transport
libMesh::Real mu(const CachedValues &cache, unsigned int qp) const
void omega_dot(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &omega_dot) const
std::string species_name(unsigned int species_index) const
CanteraThermodynamics _thermo
libMesh::Real k(const CachedValues &cache, unsigned int qp) const
unsigned int species_index(const std::string &species_name) const
libMesh::Real cp(const libMesh::Real &, const std::vector< libMesh::Real > &)
unsigned int species_index(const std::string &species_name) const
void D(const CachedValues &cache, unsigned int qp, std::vector< libMesh::Real > &D) const
GRINS namespace.
void mu_and_k(const CachedValues &cache, unsigned int qp, libMesh::Real &mu, libMesh::Real &k)
std::string species_name(unsigned int species_index) const
libMesh::Real k(const libMesh::Real &, const std::vector< libMesh::Real > &)
Wrapper class for evaluating thermochemistry and transport properties using Cantera.
libMesh::Real M_mix(const std::vector< libMesh::Real > &mass_fractions) const
libMesh::Real mu(const CachedValues &cache, unsigned int qp) const
libMesh::Real M(unsigned int species) const
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
libMesh::Real cv(const CachedValues &cache, unsigned int qp) const
libMesh::Real k(const CachedValues &cache, unsigned int qp) const
Wrapper class for storing state for computing thermochemistry and transport properties using Cantera...
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
libMesh::Real h(const CachedValues &cache, unsigned int qp, unsigned int species) const
Wrapper class for evaluating transport properties using Cantera.
libMesh::Real cp(const CachedValues &cache, unsigned int qp) const
libMesh::Real M(unsigned int species) const

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1