antioch-0.4.0
mixture_averaged_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_WILKE_TRANSPORT_MIXTURE_H
33 #define ANTIOCH_WILKE_TRANSPORT_MIXTURE_H
34 
35 // C++
36 #include <vector>
37 
38 namespace Antioch
39 {
40  // Forward declarations
41  template <typename CoeffType>
42  class ChemicalMixture;
43 
44  template <typename CoeffType>
45  class TransportMixture;
46 
48 
58  template<class CoeffType = double>
60  {
61  public:
62 
64 
66 
68  CoeffType Mr_Ms_to_the_one_fourth( const unsigned int r,
69  const unsigned int s ) const;
70 
72  CoeffType denominator( const unsigned int r,
73  const unsigned int s ) const;
74 
77 
80 
81  protected:
82 
84 
86 
87  std::vector<std::vector<CoeffType> > _Mr_Ms_to_the_one_fourth;
88 
90 
91  std::vector<std::vector<CoeffType> > _denom;
92 
93  };
94 
95  template<class CoeffType>
97  : _mixture(mixture),
98  _Mr_Ms_to_the_one_fourth(mixture.n_species()),
99  _denom(mixture.n_species())
100  {
101  using std::pow;
102 
103  for( unsigned int r = 0; r < mixture.n_species(); r++ )
104  {
105  _Mr_Ms_to_the_one_fourth[r].resize(mixture.n_species());
106  _denom[r].resize(mixture.n_species());
107 
108  for( unsigned int s = 0; s < mixture.n_species(); s++ )
109  {
110  const CoeffType Mr = mixture.chemical_mixture().M(r);
111  const CoeffType Ms = mixture.chemical_mixture().M(s);
112 
113  _Mr_Ms_to_the_one_fourth[r][s] = pow( Mr/Ms, CoeffType(0.25) );
114  _denom[r][s] = std::sqrt(8.0*(1.0+Ms/Mr));
115  }
116  }
117  }
118 
119  template<class CoeffType>
120  inline
122  const unsigned int s ) const
123  {
124  return _Mr_Ms_to_the_one_fourth[r][s];
125  }
126 
127 
128  template<class CoeffType>
129  inline
131  const unsigned int s ) const
132  {
133  return _denom[r][s];
134  }
135 
136  template<class CoeffType>
137  inline
139  {
140  return _mixture.chemical_mixture();
141  }
142 
143  template<class CoeffType>
144  inline
146  {
147  return _mixture;
148  }
149 
150 } // end namespace Antioch
151 
152 #endif // ANTIOCH_WILKE_TRANSPORT_MIXTURE_H
const ChemicalMixture< CoeffType > & chemical_mixture() const
const ChemicalMixture< CoeffType > & chem_mixture() const
chemical mixture, mostly for backward compatibility
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)
Class storing chemical mixture properties.
Definition: ascii_parser.h:55
CoeffType Mr_Ms_to_the_one_fourth(const unsigned int r, const unsigned int s) const
MixtureAveragedTransportMixture(const TransportMixture< CoeffType > &mixture)
const TransportMixture< CoeffType > & transport_mixture() const
transport mixture
Class storing chemical mixture properties.
unsigned int n_species() const
ChemicalMixture method.
std::vector< std::vector< CoeffType > > _denom
Cache for denominator term.
The parameters are reduced parameters.
std::vector< std::vector< CoeffType > > _Mr_Ms_to_the_one_fourth
Cache for numerator term.
Mixture object for MixtureAveragedTransport model.

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