GRINS-0.8.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-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 #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 
64  AntiochChemistry( const GetPot& input, const std::string& material );
65 
67  AntiochChemistry( libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > & chem_mixture );
68 
69  virtual ~AntiochChemistry(){}
70 
72  libMesh::Real M( unsigned int species ) const;
73 
75  libMesh::Real M_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
76 
78 
79  libMesh::Real R( unsigned int species ) const;
80 
82  libMesh::Real R_mix( const std::vector<libMesh::Real>& mass_fractions ) const;
83 
85  libMesh::Real X( unsigned int species, libMesh::Real M, libMesh::Real mass_fraction ) const;
86 
88  void X( libMesh::Real M, const std::vector<libMesh::Real>& mass_fractions,
89  std::vector<libMesh::Real>& mole_fractions ) const;
90 
92  libMesh::Real molar_density( const unsigned int species,
93  const libMesh::Real rho,
94  const libMesh::Real mass_fraction ) const;
95 
97  void molar_densities( const libMesh::Real rho,
98  const std::vector<libMesh::Real>& mass_fractions,
99  std::vector<libMesh::Real>& molar_densities ) const;
100 
101  unsigned int n_species() const;
102 
103  unsigned int species_index( const std::string& species_name ) const;
104 
105  std::string species_name( unsigned int species_index ) const;
106 
108  const Antioch::ChemicalMixture<libMesh::Real>& chemical_mixture() const;
109 
111  const AntiochChemistry& chemistry() const;
112 
113  protected:
114 
115  libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > _antioch_gas;
116 
117  private:
118 
120 
121  };
122 
123  /* ------------------------- Inline Functions -------------------------*/
124  inline
125  libMesh::Real AntiochChemistry::M( unsigned int species ) const
126  {
127  return _antioch_gas->M(species);
128  }
129 
130  inline
131  libMesh::Real AntiochChemistry::M_mix( const std::vector<libMesh::Real>& mass_fractions ) const
132  {
133  return _antioch_gas->M(mass_fractions);
134  }
135 
136  inline
137  libMesh::Real AntiochChemistry::R( unsigned int species ) const
138  {
139  return _antioch_gas->R(species);
140  }
141 
142  inline
143  libMesh::Real AntiochChemistry::R_mix( const std::vector<libMesh::Real>& mass_fractions ) const
144  {
145  return _antioch_gas->R(mass_fractions);
146  }
147 
148  inline
149  libMesh::Real AntiochChemistry::X( unsigned int species, const libMesh::Real M,
150  const libMesh::Real mass_fraction ) const
151  {
152  return _antioch_gas->X(species,M,mass_fraction);
153  }
154 
155  inline
156  void AntiochChemistry::X( libMesh::Real M,
157  const std::vector<libMesh::Real>& mass_fractions,
158  std::vector<libMesh::Real>& mole_fractions ) const
159  {
160  _antioch_gas->X(M,mass_fractions,mole_fractions);
161  return;
162  }
163 
164  inline
165  unsigned int AntiochChemistry::n_species() const
166  {
167  return _antioch_gas->n_species();
168  }
169 
170  inline
171  unsigned int AntiochChemistry::species_index( const std::string& species_name ) const
172  {
173  return _antioch_gas->species_name_map().find(species_name)->second;
174  }
175 
176  inline
177  const Antioch::ChemicalMixture<libMesh::Real>& AntiochChemistry::chemical_mixture() const
178  {
179  return *_antioch_gas.get();
180  }
181 
182  inline
183  libMesh::Real AntiochChemistry::molar_density( const unsigned int species,
184  const libMesh::Real rho,
185  const libMesh::Real mass_fraction ) const
186  {
187  return _antioch_gas->molar_density( species, rho, mass_fraction );
188  }
189 
190  inline
191  void AntiochChemistry::molar_densities( const libMesh::Real rho,
192  const std::vector<libMesh::Real>& mass_fractions,
193  std::vector<libMesh::Real>& molar_densities ) const
194  {
195  _antioch_gas->molar_densities( rho, mass_fractions, molar_densities );
196  return;
197  }
198 
199  inline
201  {
202  return *this;
203  }
204 
205 } // end namespace GRINS
206 
207 #endif // GRINS_HAVE_ANTIOCH
208 
209 #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 Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1