antioch-0.4.0
species_viscosity_base.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 #ifndef ANTIOCH_SPECIES_VISCOSITY_BASE_H
28 #define ANTIOCH_SPECIES_VISCOSITY_BASE_H
29 
30 // C++
31 #include <vector>
32 #include <ostream>
33 
34 namespace Antioch
35 {
37 
45  template<typename Subclass, typename CoeffType>
47  {
48  public:
49 
51 
52  virtual ~SpeciesViscosityBase(){};
53 
55  template <typename StateType>
56  StateType operator()( const StateType& T ) const;
57 
59 
69  template <typename StateType>
70  void extrapolate_max_temp(const StateType& Tmax);
71 
73  void reset_coeffs( const std::vector<CoeffType>& coeffs );
74 
76  void print(std::ostream& os = std::cout) const;
77 
79  friend std::ostream& operator<<(std::ostream& os, const SpeciesViscosityBase<Subclass,CoeffType>& mu)
80  {
81  mu.print(os);
82  return os;
83  }
84  };
85 
86  template<typename Subclass, typename CoeffType>
87  template <typename StateType>
88  inline
89  StateType SpeciesViscosityBase<Subclass,CoeffType>::operator()( const StateType& T ) const
90  {
91  return static_cast<const Subclass*>(this)->op_impl(T);
92  }
93 
94  template<typename Subclass, typename CoeffType>
95  template <typename StateType>
96  inline
98  {
99  return static_cast<Subclass*>(this)->extrapolate_max_temp_impl(Tmax);
100  }
101 
102  template<typename Subclass, typename CoeffType>
103  void SpeciesViscosityBase<Subclass,CoeffType>::reset_coeffs( const std::vector<CoeffType>& coeffs )
104  {
105  static_cast<Subclass*>(this)->reset_coeffs_impl(coeffs);
106  }
107 
108  template<typename Subclass, typename CoeffType>
110  {
111  static_cast<const Subclass*>(this)->print_impl(os);
112  }
113 
114 } // end namespace Antioch
115 
116 #endif // ANTIOCH_SPECIES_VISCOSITY_BASE_H
Base class for species viscosity models.
StateType operator()(const StateType &T) const
Evaluates viscosity at temperature T.
void reset_coeffs(const std::vector< CoeffType > &coeffs)
Resets coefficients associated with the viscosity model.
void print(std::ostream &os=std::cout) const
Formatted print, by default to std::cout.
The parameters are reduced parameters.
void extrapolate_max_temp(const StateType &Tmax)
Extrapolate to input maximum temperature, given in [K].

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