antioch-0.4.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Friends
Antioch::BlottnerViscosity< CoeffType > Class Template Reference

#include <blottner_parsing.h>

Inheritance diagram for Antioch::BlottnerViscosity< CoeffType >:
Antioch::SpeciesViscosityBase< BlottnerViscosity< CoeffType >, CoeffType >

Public Member Functions

 BlottnerViscosity (const CoeffType a, const CoeffType b, const CoeffType c)
 
 BlottnerViscosity (const std::vector< CoeffType > &coeffs)
 
virtual ~BlottnerViscosity ()
 
void reset_coeffs (const CoeffType a, const CoeffType b, const CoeffType c)
 
StateType operator() (const StateType &T) const
 Evaluates viscosity at temperature T. More...
 
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...
 

Protected Member Functions

template<typename StateType >
StateType op_impl (const StateType &T) const
 
void reset_coeffs_impl (const std::vector< CoeffType > coeffs)
 
void print_impl (std::ostream &os) const
 
template<typename StateType >
void extrapolate_max_temp_impl (const StateType &Tmax)
 No extrapolation needed. More...
 

Protected Attributes

CoeffType _a
 
CoeffType _b
 
CoeffType _c
 

Private Member Functions

 BlottnerViscosity ()
 

Friends

class SpeciesViscosityBase< BlottnerViscosity< CoeffType >, CoeffType >
 Friend base class so we can make implementation protected. More...
 

Detailed Description

template<typename CoeffType = double>
class Antioch::BlottnerViscosity< CoeffType >

Definition at line 38 of file blottner_parsing.h.

Constructor & Destructor Documentation

template<typename CoeffType >
Antioch::BlottnerViscosity< CoeffType >::BlottnerViscosity ( const CoeffType  a,
const CoeffType  b,
const CoeffType  c 
)

Definition at line 90 of file blottner_viscosity.h.

93  : SpeciesViscosityBase<BlottnerViscosity<CoeffType>,CoeffType>(),
94  _a(a), _b(b), _c(c)
95  {
96  return;
97  }
template<typename CoeffType >
Antioch::BlottnerViscosity< CoeffType >::BlottnerViscosity ( const std::vector< CoeffType > &  coeffs)

Definition at line 100 of file blottner_viscosity.h.

References Antioch::BlottnerViscosity< CoeffType >::_a, Antioch::BlottnerViscosity< CoeffType >::_b, Antioch::BlottnerViscosity< CoeffType >::_c, and antioch_assert_equal_to.

101  : SpeciesViscosityBase<BlottnerViscosity<CoeffType>,CoeffType>(),
102  _a(-1.0), _b(-1.0), _c(-1.0)
103  {
104  antioch_assert_equal_to( coeffs.size(), 3);
105  _a = coeffs[0];
106  _b = coeffs[1];
107  _c = coeffs[2];
108  return;
109  }
#define antioch_assert_equal_to(expr1, expr2)
template<typename CoeffType = double>
virtual Antioch::BlottnerViscosity< CoeffType >::~BlottnerViscosity ( )
inlinevirtual

Definition at line 55 of file blottner_viscosity.h.

55 {};
template<typename CoeffType = double>
Antioch::BlottnerViscosity< CoeffType >::BlottnerViscosity ( )
private

Member Function Documentation

void Antioch::SpeciesViscosityBase< BlottnerViscosity< CoeffType > , CoeffType >::extrapolate_max_temp ( const StateType &  Tmax)
inherited

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.

template<typename CoeffType >
template<typename StateType >
void Antioch::BlottnerViscosity< CoeffType >::extrapolate_max_temp_impl ( const StateType &  Tmax)
inlineprotected

No extrapolation needed.

Implementation needed for the interface, but we just throw an error is this is called since it's not defined for BlottnerViscosity.

Definition at line 156 of file blottner_viscosity.h.

References antioch_error_msg.

157  {
158  antioch_error_msg("Extrapolation not well defined for BlottnerViscosity!");
159  }
#define antioch_error_msg(errmsg)
template<typename CoeffType >
template<typename StateType >
StateType Antioch::BlottnerViscosity< CoeffType >::op_impl ( const StateType &  T) const
inlineprotected

Definition at line 123 of file blottner_viscosity.h.

124  {
125  using std::log;
126  using std::exp;
127  StateType logT = log(T);
128  const CoeffType zero_point_one = 0.1L;
129 
130  return zero_point_one*exp( (_a*logT + _b)*logT + _c );
131  }
StateType Antioch::SpeciesViscosityBase< BlottnerViscosity< CoeffType > , CoeffType >::operator() ( const StateType &  T) const
inherited

Evaluates viscosity at temperature T.

void Antioch::SpeciesViscosityBase< BlottnerViscosity< CoeffType > , CoeffType >::print ( std::ostream &  os = std::cout) const
inherited

Formatted print, by default to std::cout.

template<typename CoeffType >
void Antioch::BlottnerViscosity< CoeffType >::print_impl ( std::ostream &  os) const
protected

Definition at line 112 of file blottner_viscosity.h.

113  {
114  os << 0.1 << "*exp(" << _a << "*(logT)^2 + " << _b << "*logT + " << _c << ")" << std::endl;
115 
116  return;
117  }
template<typename CoeffType >
void Antioch::BlottnerViscosity< CoeffType >::reset_coeffs ( const CoeffType  a,
const CoeffType  b,
const CoeffType  c 
)
inline

Definition at line 135 of file blottner_viscosity.h.

Referenced by tester(), and vectester().

138  {
139  _a = a;
140  _b = b;
141  _c = c;
142  return;
143  }
void Antioch::SpeciesViscosityBase< BlottnerViscosity< CoeffType > , CoeffType >::reset_coeffs ( const std::vector< CoeffType > &  coeffs)
inherited

Resets coefficients associated with the viscosity model.

template<typename CoeffType >
void Antioch::BlottnerViscosity< CoeffType >::reset_coeffs_impl ( const std::vector< CoeffType >  coeffs)
inlineprotected

Definition at line 147 of file blottner_viscosity.h.

References antioch_assert_equal_to.

148  {
149  antioch_assert_equal_to(coeffs.size(), 3);
150  this->reset_coeffs( coeffs[0], coeffs[1], coeffs[2] );
151  }
#define antioch_assert_equal_to(expr1, expr2)
void reset_coeffs(const CoeffType a, const CoeffType b, const CoeffType c)

Friends And Related Function Documentation

template<typename CoeffType = double>
friend class SpeciesViscosityBase< BlottnerViscosity< CoeffType >, CoeffType >
friend

Friend base class so we can make implementation protected.

Definition at line 60 of file blottner_viscosity.h.

Member Data Documentation

template<typename CoeffType = double>
CoeffType Antioch::BlottnerViscosity< CoeffType >::_a
protected
template<typename CoeffType = double>
CoeffType Antioch::BlottnerViscosity< CoeffType >::_b
protected
template<typename CoeffType = double>
CoeffType Antioch::BlottnerViscosity< CoeffType >::_c
protected

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

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