antioch-0.4.0
List of all members | Public Member Functions | Friends
Antioch::SpeciesViscosityBase< Subclass, CoeffType > Class Template Reference

Base class for species viscosity models. More...

#include <species_viscosity_base.h>

Public Member Functions

 SpeciesViscosityBase ()
 
virtual ~SpeciesViscosityBase ()
 
template<typename StateType >
StateType operator() (const StateType &T) const
 Evaluates viscosity at temperature T. More...
 
template<typename StateType >
void extrapolate_max_temp (const StateType &Tmax)
 Extrapolate to input maximum temperature, given in [K]. More...
 
void reset_coeffs (const std::vector< CoeffType > &coeffs)
 Resets coefficients associated with the viscosity model. More...
 
void print (std::ostream &os=std::cout) const
 Formatted print, by default to std::cout. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const SpeciesViscosityBase< Subclass, CoeffType > &mu)
 Formatted print. More...
 

Detailed Description

template<typename Subclass, typename CoeffType>
class Antioch::SpeciesViscosityBase< Subclass, CoeffType >

Base class for species viscosity models.

We use the curiously recurring template pattern to enforce the interface that subclasses must adhere in order to ulimately be used in the MixtureViscosity class. Subclasses must implement:

  1. op_impl — this should implement operator()
  2. reset_coeffs_impl — should implement reset_coeffs
  3. print_impl — should implement print

Definition at line 46 of file species_viscosity_base.h.

Constructor & Destructor Documentation

template<typename Subclass, typename CoeffType>
Antioch::SpeciesViscosityBase< Subclass, CoeffType >::SpeciesViscosityBase ( )
inline

Definition at line 50 of file species_viscosity_base.h.

50 {};
template<typename Subclass, typename CoeffType>
virtual Antioch::SpeciesViscosityBase< Subclass, CoeffType >::~SpeciesViscosityBase ( )
inlinevirtual

Definition at line 52 of file species_viscosity_base.h.

52 {};

Member Function Documentation

template<typename Subclass , typename CoeffType >
template<typename StateType >
void Antioch::SpeciesViscosityBase< Subclass, CoeffType >::extrapolate_max_temp ( const StateType &  Tmax)
inline

Extrapolate to input maximum temperature, given in [K].

Some species viscosity models, e.g. KineticsTheoryViscosity, use interpolated quantities for a given temperature range. If the viscosity is to be evaluated outside that range, an error will occur. This method will reconstruct the interpolation table, but use a linear extrapolation from the max in the existing table to the input maximum temperature.

This method is only applicable to a subset of species viscosity models. Others will throw a runtime error.

Definition at line 97 of file species_viscosity_base.h.

98  {
99  return static_cast<Subclass*>(this)->extrapolate_max_temp_impl(Tmax);
100  }
template<typename Subclass , typename CoeffType >
template<typename StateType >
StateType Antioch::SpeciesViscosityBase< Subclass, CoeffType >::operator() ( const StateType &  T) const
inline

Evaluates viscosity at temperature T.

Definition at line 89 of file species_viscosity_base.h.

90  {
91  return static_cast<const Subclass*>(this)->op_impl(T);
92  }
template<typename Subclass , typename CoeffType >
void Antioch::SpeciesViscosityBase< Subclass, CoeffType >::print ( std::ostream &  os = std::cout) const

Formatted print, by default to std::cout.

Definition at line 109 of file species_viscosity_base.h.

110  {
111  static_cast<const Subclass*>(this)->print_impl(os);
112  }
template<typename Subclass , typename CoeffType>
void Antioch::SpeciesViscosityBase< Subclass, CoeffType >::reset_coeffs ( const std::vector< CoeffType > &  coeffs)

Resets coefficients associated with the viscosity model.

Definition at line 103 of file species_viscosity_base.h.

104  {
105  static_cast<Subclass*>(this)->reset_coeffs_impl(coeffs);
106  }

Friends And Related Function Documentation

template<typename Subclass, typename CoeffType>
std::ostream& operator<< ( std::ostream &  os,
const SpeciesViscosityBase< Subclass, CoeffType > &  mu 
)
friend

Formatted print.

Definition at line 79 of file species_viscosity_base.h.

80  {
81  mu.print(os);
82  return os;
83  }

The documentation for this class was generated from the following file:

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