GRINS-0.7.0
antioch_kinetics.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 // This class
31 #include "grins/antioch_kinetics.h"
32 
33 // GRINS
34 #include "grins/antioch_mixture.h"
35 
36 // Antioch
37 #include "antioch/temp_cache.h"
38 #include "antioch/vector_utils.h"
39 
40 namespace GRINS
41 {
43  : _antioch_mixture( mixture ),
44  _antioch_kinetics( mixture.reaction_set(), 0 ),
45  _antioch_cea_thermo( mixture.cea_mixture() )
46  {}
47 
48  void AntiochKinetics::omega_dot( const libMesh::Real& T,
49  const libMesh::Real rho,
50  const std::vector<libMesh::Real>& mass_fractions,
51  std::vector<libMesh::Real>& omega_dot )
52  {
53  Antioch::TempCache<libMesh::Real> temp_cache(T);
54  this->omega_dot(temp_cache,rho,mass_fractions,omega_dot);
55  }
56 
57  void AntiochKinetics::omega_dot( const Antioch::TempCache<libMesh::Real>& temp_cache,
58  const libMesh::Real rho,
59  const std::vector<libMesh::Real>& mass_fractions,
60  std::vector<libMesh::Real>& omega_dot )
61  {
62  const unsigned int n_species = _antioch_mixture.n_species();
63 
64  libmesh_assert_equal_to( mass_fractions.size(), n_species );
65  libmesh_assert_equal_to( omega_dot.size(), n_species );
66 
67  std::vector<libMesh::Real> h_RT_minus_s_R(n_species, 0.0);
68  std::vector<libMesh::Real> molar_densities(n_species, 0.0);
69 
70  _antioch_cea_thermo.h_RT_minus_s_R( temp_cache, h_RT_minus_s_R );
71 
72  _antioch_mixture.molar_densities( rho, mass_fractions, molar_densities );
73 
74  _antioch_kinetics.compute_mass_sources( temp_cache.T,
75  molar_densities,
76  h_RT_minus_s_R,
77  omega_dot );
78  }
79 
80 }// end namespace GRINS
81 
82 #endif // GRINS_HAVE_ANTIOCH
Antioch::KineticsEvaluator< libMesh::Real > _antioch_kinetics
unsigned int n_species() const
void molar_densities(const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &molar_densities) const
Molar density for all species, [mol/m^3].
Antioch::CEAEvaluator< libMesh::Real > _antioch_cea_thermo
GRINS namespace.
void omega_dot(const libMesh::Real &T, const 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.
const AntiochMixture & _antioch_mixture

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