antioch-0.4.0
wilke_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_WILKE_MIXTURE_H
33 #define ANTIOCH_WILKE_MIXTURE_H
34 
35 // Antioch
38 
39 // C++
40 #include <vector>
41 
42 namespace Antioch
43 {
44 
45  // forward declaration
46  template <typename CoeffType>
47  class ChemicalMixture;
48 
49  // back to the old original, can't link it to the new stuff
50  template<class CoeffType = double> // type
52  {
53  public:
54 
55  WilkeMixture( const ChemicalMixture<CoeffType> & mixture);
56  ~WilkeMixture();
57 
58  CoeffType Mr_Ms_to_the_one_fourth( const unsigned int r,
59  const unsigned int s ) const;
60 
61  CoeffType denominator( const unsigned int r,
62  const unsigned int s ) const;
63 
66 
69 
70  protected:
71 
73 
75  std::vector<std::vector<CoeffType> > _Mr_Ms_to_the_one_fourth;
76 
78  std::vector<std::vector<CoeffType> > _denom;
79 
80 
81  };
82 
83  template<class CoeffType>
85  : _mixture(mixture),
86  _Mr_Ms_to_the_one_fourth(mixture.n_species()),
87  _denom(mixture.n_species())
88  {
90  using std::pow;
91 
92  for( unsigned int r = 0; r < mixture.n_species(); r++ )
93  {
94  _Mr_Ms_to_the_one_fourth[r].resize(mixture.n_species());
95  _denom[r].resize(mixture.n_species());
96 
97  for( unsigned int s = 0; s < mixture.n_species(); s++ )
98  {
99  const CoeffType Mr = mixture.chemical_mixture().M(r);
100  const CoeffType Ms = mixture.chemical_mixture().M(s);
101 
102  _Mr_Ms_to_the_one_fourth[r][s] = pow( Mr/Ms, CoeffType(0.25) );
103  _denom[r][s] = std::sqrt(8.0*(1.0+Ms/Mr));
104  }
105  }
106 
107  return;
108  }
109 
110  template<class CoeffType>
112  {
113  return;
114  }
115 
116  template<class CoeffType>
117  inline
118  CoeffType WilkeMixture<CoeffType>::Mr_Ms_to_the_one_fourth( const unsigned int r,
119  const unsigned int s ) const
120  {
121  return _Mr_Ms_to_the_one_fourth[r][s];
122  }
123 
124 
125  template<class CoeffType>
126  inline
127  CoeffType WilkeMixture<CoeffType>::denominator( const unsigned int r,
128  const unsigned int s ) const
129  {
130  return _denom[r][s];
131  }
132 
133  template<class CoeffType>
134  inline
136  {
137  return _mixture;
138  }
139 
140  template<class CoeffType>
141  inline
143  {
144  return _mixture;
145  }
146 
147 } // end namespace Antioch
148 
149 #endif // ANTIOCH_WILKE_MIXTURE_H
const ChemicalMixture< CoeffType > & chem_mixture() const
chemical mixture, mostly for backward compatibility
const ChemicalMixture< CoeffType > & chemical_mixture() const
method to send this back
CoeffType denominator(const unsigned int r, const unsigned int s) const
Antioch::enable_if_c< Antioch::is_valarray< T >::value, typename Antioch::state_type< T >::type >::type pow(const T &in, const T2 &n)
unsigned int n_species() const
Returns the number of species in this mixture.
const ChemicalMixture< CoeffType > & _mixture
Definition: wilke_mixture.h:72
#define antioch_deprecated()
std::vector< std::vector< CoeffType > > _Mr_Ms_to_the_one_fourth
Cache for numerator term.
Definition: wilke_mixture.h:75
CoeffType Mr_Ms_to_the_one_fourth(const unsigned int r, const unsigned int s) const
Class storing chemical mixture properties.
The parameters are reduced parameters.
const ChemicalMixture< CoeffType > & transport_mixture() const
chemical mixture, for backward compatibility
std::vector< std::vector< CoeffType > > _denom
Cache for denominator term.
Definition: wilke_mixture.h:78
WilkeMixture(const ChemicalMixture< CoeffType > &mixture)
Definition: wilke_mixture.h:84

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