GRINS-0.7.0
antioch_chemistry.h
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 #ifndef GRINS_ANTIOCH_CHEMISTRY_H
27 #define GRINS_ANTIOCH_CHEMISTRY_H
28 
29 #include "grins_config.h"
30 
31 #ifdef GRINS_HAVE_ANTIOCH
32 
33 // GRINS
34 #include "grins/property_types.h"
35 #include "grins/parameter_user.h"
36 
37 // libMesh
38 #include "libmesh/libmesh_common.h"
39 #include "libmesh/auto_ptr.h" // libMesh::UniquePtr
40 
41 // Antioch
42 #include "antioch/vector_utils_decl.h"
43 #include "antioch/vector_utils.h"
44 #include "antioch/chemical_mixture.h"
45 
46 // libMesh forward declarations
47 class GetPot;
48 
49 namespace GRINS
50 {
52 
60  {
61  public:
62 
63  AntiochChemistry( const GetPot& input, const std::string& material );
64 
65  virtual ~AntiochChemistry();
66 
68  libMesh::Real M( unsigned int species ) const;
69 
71  libMesh::Real M_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
72 
74 
75  libMesh::Real R( unsigned int species ) const;
76 
78  libMesh::Real R_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
79 
81  libMesh::Real X( unsigned int species, libMesh::Real M, libMesh::Real mass_fraction ) const;
82 
84  void X( libMesh::Real M, const std::vector<libMesh::Real>& mass_fractions,
85  std::vector<libMesh::Real>& mole_fractions ) const;
86 
88  libMesh::Real molar_density( const unsigned int species,
89  const libMesh::Real rho,
90  const libMesh::Real mass_fraction ) const;
91 
93  void molar_densities( const libMesh::Real rho,
94  const std::vector<libMesh::Real>& mass_fractions,
95  std::vector<libMesh::Real>& molar_densities ) const;
96 
97  unsigned int n_species() const;
98 
99  unsigned int species_index( const std::string& species_name ) const;
100 
101  std::string species_name( unsigned int species_index ) const;
102 
104  const Antioch::ChemicalMixture<libMesh::Real>& chemical_mixture() const;
105 
107  const AntiochChemistry& chemistry() const;
108 
109  protected:
110 
111  libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > _antioch_gas;
112 
113  private:
114 
116 
117  };
118 
119  /* ------------------------- Inline Functions -------------------------*/
120  inline
121  libMesh::Real AntiochChemistry::M( unsigned int species ) const
122  {
123  return _antioch_gas->M(species);
124  }
125 
126  inline
127  libMesh::Real AntiochChemistry::M_mix( const std::vector<libMesh::Real>& mass_fractions ) const
128  {
129  return _antioch_gas->M(mass_fractions);
130  }
131 
132  inline
133  libMesh::Real AntiochChemistry::R( unsigned int species ) const
134  {
135  return _antioch_gas->R(species);
136  }
137 
138  inline
139  libMesh::Real AntiochChemistry::R_mix( const std::vector<libMesh::Real>& mass_fractions ) const
140  {
141  return _antioch_gas->R(mass_fractions);
142  }
143 
144  inline
145  libMesh::Real AntiochChemistry::X( unsigned int species, const libMesh::Real M,
146  const libMesh::Real mass_fraction ) const
147  {
148  return _antioch_gas->X(species,M,mass_fraction);
149  }
150 
151  inline
152  void AntiochChemistry::X( libMesh::Real M,
153  const std::vector<libMesh::Real>& mass_fractions,
154  std::vector<libMesh::Real>& mole_fractions ) const
155  {
156  _antioch_gas->X(M,mass_fractions,mole_fractions);
157  return;
158  }
159 
160  inline
161  unsigned int AntiochChemistry::n_species() const
162  {
163  return _antioch_gas->n_species();
164  }
165 
166  inline
167  unsigned int AntiochChemistry::species_index( const std::string& species_name ) const
168  {
169  return _antioch_gas->species_name_map().find(species_name)->second;
170  }
171 
172  inline
173  const Antioch::ChemicalMixture<libMesh::Real>& AntiochChemistry::chemical_mixture() const
174  {
175  return *_antioch_gas.get();
176  }
177 
178  inline
179  libMesh::Real AntiochChemistry::molar_density( const unsigned int species,
180  const libMesh::Real rho,
181  const libMesh::Real mass_fraction ) const
182  {
183  return _antioch_gas->molar_density( species, rho, mass_fraction );
184  }
185 
186  inline
187  void AntiochChemistry::molar_densities( const libMesh::Real rho,
188  const std::vector<libMesh::Real>& mass_fractions,
189  std::vector<libMesh::Real>& molar_densities ) const
190  {
191  _antioch_gas->molar_densities( rho, mass_fractions, molar_densities );
192  return;
193  }
194 
195  inline
197  {
198  return *this;
199  }
200 
201 } // end namespace GRINS
202 
203 #endif // GRINS_HAVE_ANTIOCH
204 
205 #endif // GRINS_ANTIOCH_CHEMISTRY_H
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int n_species() const
libMesh::Real M_mix(const std::vector< libMesh::Real > &mass_fractions) const
Mixture molar mass (molecular weight), [kg/mol].
libMesh::Real R_mix(const std::vector< libMesh::Real > &mass_fractions) const
Mixture gas constant, [J/kg-K].
Wrapper class for Antioch::ChemicalMixture.
const Antioch::ChemicalMixture< libMesh::Real > & chemical_mixture() const
Accessor to underlying Antioch object.
unsigned int species_index(const std::string &species_name) const
const AntiochChemistry & chemistry() const
Accessor for this class.
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].
GRINS namespace.
std::string species_name(unsigned int species_index) const
libMesh::Real R(unsigned int species) const
Species gas constant, [J/kg-K].
libMesh::Real molar_density(const unsigned int species, const libMesh::Real rho, const libMesh::Real mass_fraction) const
Species molar density, [mol/m^3].
ParameterUser base class. Utility methods for subclasses.
libMesh::Real X(unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
Species mole fraction, unitless.
libMesh::Real M(unsigned int species) const
Species molar mass (molecular weight), [kg/mol].

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