antioch-0.4.0
sutherland_viscosity.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_SUTHERLAND_VISCOSITY_H
33 #define ANTIOCH_SUTHERLAND_VISCOSITY_H
34 
35 // Antioch
37 #include "antioch/cmath_shims.h"
39 
40 // C++
41 #include <cmath>
42 #include <vector>
43 #include <iostream>
44 
45 namespace Antioch
46 {
47  template<typename CoeffType=double>
48  class SutherlandViscosity : public SpeciesViscosityBase<SutherlandViscosity<CoeffType>,CoeffType>
49  {
50  protected:
51 
52  CoeffType _mu_ref;
53  CoeffType _T_ref;
54 
55  public:
56 
57  SutherlandViscosity( const CoeffType mu_ref, const CoeffType T_ref );
58 
59  SutherlandViscosity( const std::vector<CoeffType>& coeffs );
60 
62 
63  void reset_coeffs( const CoeffType mu_ref, const CoeffType T_ref );
64 
66  friend class SpeciesViscosityBase<SutherlandViscosity<CoeffType>,CoeffType>;
67 
68  protected:
69 
70  template <typename StateType>
71  ANTIOCH_AUTO(StateType)
72  op_impl( StateType& T ) const
73  ANTIOCH_AUTOFUNC(StateType, _mu_ref*ant_pow(T,CoeffType(1.5))/(T+_T_ref))
74 
75  void reset_coeffs_impl( const std::vector<CoeffType>& coeffs );
76 
77  void print_impl(std::ostream& os) const;
78 
80 
84  template <typename StateType>
85  void extrapolate_max_temp_impl(const StateType& Tmax);
86 
87  private:
88 
90 
91  };
92 
93  template<typename CoeffType>
94  SutherlandViscosity<CoeffType>::SutherlandViscosity( const CoeffType mu_ref, const CoeffType T_ref )
95  : SpeciesViscosityBase<SutherlandViscosity<CoeffType>,CoeffType>(),
96  _mu_ref(mu_ref), _T_ref(T_ref)
97  {
98  }
99 
100  template<typename CoeffType>
101  SutherlandViscosity<CoeffType>::SutherlandViscosity( const std::vector<CoeffType>& coeffs )
102 #ifndef NDEBUG
104  _mu_ref(-1), _T_ref(-1)
105 #else
107  _mu_ref(coeffs[0]), _T_ref(coeffs[1])
108 #endif
109  {
110 #ifndef NDEBUG
111  antioch_assert_equal_to( coeffs.size(), 2 );
112  _mu_ref = coeffs[0];
113  _T_ref = coeffs[1];
114 #endif
115  }
116 
117  template<typename CoeffType>
118  void SutherlandViscosity<CoeffType>::print_impl(std::ostream& os) const
119  {
120  os << _mu_ref << "*T^(3/2)/(T + " << _T_ref << ")" << std::endl;
121  }
122 
123  template<typename CoeffType>
124  inline
125  void SutherlandViscosity<CoeffType>::reset_coeffs( const CoeffType mu_ref, const CoeffType T_ref )
126  {
127  _mu_ref = mu_ref;
128  _T_ref = T_ref;
129  }
130 
131  template<typename CoeffType>
132  inline
133  void SutherlandViscosity<CoeffType>::reset_coeffs_impl( const std::vector<CoeffType>& coeffs )
134  {
135  antioch_assert_equal_to(coeffs.size(), 2);
136  this->reset_coeffs(coeffs[0], coeffs[1]);
137  }
138 
139  template<typename CoeffType>
140  template <typename StateType>
141  inline
143  {
144  antioch_error_msg("Extrapolation not well defined for SutherlandViscosity!");
145  }
146 
147 } // end namespace Antioch
148 
149 #endif //ANTIOCH_SUTHERLAND_VISCOSITY_H
Base class for species viscosity models.
#define antioch_assert_equal_to(expr1, expr2)
void extrapolate_max_temp_impl(const StateType &Tmax)
No extrapolation needed.
#define antioch_error_msg(errmsg)
op_impl(StateType &T) const ANTIOCH_AUTOFUNC(StateType
#define ANTIOCH_AUTOFUNC(Type, Expr)
const ANTIOCH_AUTO(StateType) KineticsTheoryThermalConductivity< ThermoEvaluator
The parameters are reduced parameters.
void reset_coeffs(const CoeffType mu_ref, const CoeffType T_ref)

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