antioch-0.4.0
transport_mixture.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // Antioch - A Gas Dynamics Thermochemistry Library
5 //
6 // Copyright (C) 2014-2016 Paul T. Bauman, Benjamin S. Kirk,
7 // Sylvain Plessis, Roy H. Stonger
8 //
9 // Copyright (C) 2013 The PECOS Development Team
10 //
11 // This library is free software; you can redistribute it and/or
12 // modify it under the terms of the Version 2.1 GNU Lesser General
13 // Public License as published by the Free Software Foundation.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
23 // Boston, MA 02110-1301 USA
24 //
25 //-----------------------------------------------------------------------el-
26 //
27 // $Id$
28 //
29 //--------------------------------------------------------------------------
30 //--------------------------------------------------------------------------
31 
32 #ifndef ANTIOCH_TRANSPORT_MIXTURE_H
33 #define ANTIOCH_TRANSPORT_MIXTURE_H
34 
35 // Antioch
40 #include "antioch/parsing_enum.h"
43 #include "antioch/parser_base.h"
44 
45 // C++
46 #include <vector>
47 #include <string>
48 
49 namespace Antioch
50 {
51 
52  template <typename CoeffType>
53  class ASCIIParser;
54 
55  template <typename CoeffType>
56  class ChemKinParser;
57 
58  template <typename CoeffType>
59  class XMLParser;
60 
62 
66  template<typename CoeffType=double>
67  class TransportMixture
68  {
69 
70  typedef unsigned int Species;
71 
72  public:
73 
75  const std::string & filename = DefaultFilename::transport_mixture(),
76  bool verbose = true, ParsingType type = ASCII );
77 
79  ParserBase<CoeffType> * parser);
80 
82 
84  unsigned int n_species() const;
85 
87  const std::vector<Species>& species_list() const;
88 
90  const std::map<Species,std::string>& species_inverse_name_map() const;
91 
93  const std::map<std::string, Species>& species_name_map() const;
94 
97 
98  void add_species( const unsigned int index,
99  CoeffType LJ_depth, CoeffType LJ_diameter,
100  CoeffType dipole_moment, CoeffType polarizability, CoeffType rotational_relaxation, CoeffType mass);
101 
102  const std::vector<TransportSpecies<CoeffType>*>& transport_species() const;
103 
104  const TransportSpecies<CoeffType>& transport_species( unsigned int s ) const;
105 
106  protected:
107 
109 
110  std::vector<TransportSpecies<CoeffType>*> _transport_species;
111 
112  private:
114 
115  };
116 
117 
118  /* ------------------------- Inline Functions -------------------------*/
119 
120  template<typename CoeffType>
121  inline
123  {
124  return _chemical_mixture.n_species();
125  }
126 
127  template<typename CoeffType>
128  inline
129  const std::vector<Species>& TransportMixture<CoeffType>::species_list() const
130  {
131  return _chemical_mixture.species_list();
132  }
133 
134  template<typename CoeffType>
135  inline
136  const std::map<Species,std::string>& TransportMixture<CoeffType>::species_inverse_name_map() const
137  {
138  return _chemical_mixture.species_inverse_name_map();
139  }
140 
141  template<typename CoeffType>
142  inline
143  const std::map<std::string,Species>& TransportMixture<CoeffType>::species_name_map() const
144  {
145  return _chemical_mixture.species_name_map();
146  }
147 
148  template<typename CoeffType>
149  inline
151  {
152  return _chemical_mixture;
153  }
154 
155  template<typename CoeffType>
156  inline
157  const std::vector<TransportSpecies<CoeffType>*>& TransportMixture<CoeffType>::transport_species() const
158  {
159  return _transport_species;
160  }
161 
162  template<typename CoeffType>
163  inline
165  {
166  antioch_assert_less(s,_transport_species.size());
167  antioch_assert(_transport_species[s]);
168 
169  return (*_transport_species[s]);
170  }
171 
172 } // end namespace Antioch
173 
174 #endif //ANTIOCH_TRANSPORT_MIXTURE_H
std::vector< TransportSpecies< CoeffType > * > _transport_species
const ChemicalMixture< CoeffType > & chemical_mixture() const
#define antioch_assert(asserted)
#define antioch_assert_less(expr1, expr2)
const std::vector< TransportSpecies< CoeffType > * > & transport_species() const
Class to encapsulate data relevant for transport for each chemical species.
void add_species(const unsigned int index, CoeffType LJ_depth, CoeffType LJ_diameter, CoeffType dipole_moment, CoeffType polarizability, CoeffType rotational_relaxation, CoeffType mass)
static const std::string & transport_mixture()
const std::vector< Species > & species_list() const
ChemicalMixture method.
const std::map< std::string, Species > & species_name_map() const
ChemicalMixture method.
const std::map< Species, std::string > & species_inverse_name_map() const
ChemicalMixture method.
const ChemicalMixture< CoeffType > & _chemical_mixture
Class storing chemical mixture properties.
unsigned int n_species() const
ChemicalMixture method.
The parameters are reduced parameters.
A parser is an instance related to a file.

Generated on Thu Jul 7 2016 11:09:46 for antioch-0.4.0 by  doxygen 1.8.8