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

Container class for species viscosities. More...

#include <blottner_parsing.h>

Inheritance diagram for Antioch::MixtureViscosity< Viscosity, CoeffType >:
Antioch::MixtureTransportBase< CoeffType >

Public Types

typedef Viscosity species_viscosity_type
 

Public Member Functions

 MixtureViscosity (const TransportMixture< CoeffType > &transport_mixture)
 
 ~MixtureViscosity ()
 
template<typename StateType >
StateType operator() (const unsigned int s, const StateType &T) const
 Evaluate viscosity for species s. More...
 
void add (const std::string &species_name, const std::vector< CoeffType > &coeffs)
 Add species viscosity. More...
 
void reset_coeffs (const unsigned int s, const std::vector< CoeffType > coeffs)
 Reset model coefficients for viscosity model of species s. More...
 
template<typename StateType >
void extrapolate_max_temp (const StateType &Tmax)
 Extrapolate to input maximum temperature, given in [K]. More...
 
const std::vector< Viscosity * > & species_viscosities () const
 
void print (std::ostream &os=std::cout) const
 Formatted print, by default to std::cout. More...
 
const ChemicalMixture
< CoeffType > & 
chemical_mixture () const
 
const TransportMixture
< CoeffType > & 
transport_mixture () const
 
const TransportMixture
< CoeffType > & 
mixture () const
 

Protected Attributes

std::vector
< SpeciesViscosityBase
< Viscosity, CoeffType > * > 
_species_viscosities
 
const TransportMixture
< CoeffType > & 
_transport_mixture
 

Private Member Functions

 MixtureViscosity ()
 

Friends

std::ostream & operator<< (std::ostream &os, const MixtureViscosity &mu)
 Formatted print. More...
 

Detailed Description

template<typename Viscosity, class CoeffType = double>
class Antioch::MixtureViscosity< Viscosity, CoeffType >

Container class for species viscosities.

For the given set of chemical species in the input TransportMixture, this contains all the viscosities for each of those species and provides and interface for computing the species viscosity. Total viscosity is computed by a mixing model, e.g. MixtureAveragedTransportMixture. This class is templated on the viscosity model, so an inherent assumption is that all species viscosities have the same model.

Definition at line 41 of file blottner_parsing.h.

Member Typedef Documentation

template<typename Viscosity, class CoeffType = double>
typedef Viscosity Antioch::MixtureViscosity< Viscosity, CoeffType >::species_viscosity_type

Definition at line 93 of file mixture_viscosity.h.

Constructor & Destructor Documentation

template<typename Viscosity , class CoeffType >
Antioch::MixtureViscosity< Viscosity, CoeffType >::MixtureViscosity ( const TransportMixture< CoeffType > &  transport_mixture)

Definition at line 106 of file mixture_viscosity.h.

107  : MixtureTransportBase<CoeffType>(transport_mixture),
108  _species_viscosities( transport_mixture.n_species(), NULL )
109  {}
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
const TransportMixture< CoeffType > & transport_mixture() const
template<typename Viscosity , class CoeffType >
Antioch::MixtureViscosity< Viscosity, CoeffType >::~MixtureViscosity ( )

Definition at line 112 of file mixture_viscosity.h.

113  {
114  // Need to delete all the species viscosities we allocated
115  for( typename std::vector<SpeciesViscosityBase<Viscosity,CoeffType>*>::iterator it = _species_viscosities.begin();
116  it != _species_viscosities.end(); ++it )
117  {
118  delete (*it);
119  }
120  }
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
template<typename Viscosity, class CoeffType = double>
Antioch::MixtureViscosity< Viscosity, CoeffType >::MixtureViscosity ( )
private

Member Function Documentation

template<typename Viscosity , class CoeffType >
void Antioch::MixtureViscosity< Viscosity, CoeffType >::add ( const std::string &  species_name,
const std::vector< CoeffType > &  coeffs 
)

Add species viscosity.

Definition at line 123 of file mixture_viscosity.h.

References antioch_assert, and antioch_assert_less_equal.

125  {
126  antioch_assert( this->_transport_mixture.species_name_map().find(species_name) !=
127  this->_transport_mixture.species_name_map().end() );
128 
129  unsigned int s = this->_transport_mixture.species_name_map().find(species_name)->second;
130 
133 
134  _species_viscosities[s] = new Viscosity(coeffs);
135  return;
136  }
#define antioch_assert(asserted)
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
const TransportMixture< CoeffType > & _transport_mixture
#define antioch_assert_less_equal(expr1, expr2)
template<class CoeffType >
const ChemicalMixture< CoeffType > & Antioch::MixtureTransportBase< CoeffType >::chemical_mixture ( ) const
inlineinherited

Definition at line 68 of file mixture_transport_base.h.

69  {
70  return _transport_mixture.chemical_mixture();
71  }
const TransportMixture< CoeffType > & _transport_mixture
template<typename Viscosity , class CoeffType >
template<typename StateType >
void Antioch::MixtureViscosity< Viscosity, CoeffType >::extrapolate_max_temp ( const StateType &  Tmax)
inline

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

For certain species viscosity models, interpolation of various quantities may be done based on the temperature. This method will use linear extrapolation to extend the range of temperature for all the species viscosity models.

Definition at line 160 of file mixture_viscosity.h.

161  {
162  for( typename std::vector<SpeciesViscosityBase<Viscosity,CoeffType>*>::iterator it = _species_viscosities.begin();
163  it != _species_viscosities.end(); ++it )
164  {
165  (*it)->extrapolate_max_temp(Tmax);
166  }
167  }
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
template<class CoeffType >
const TransportMixture< CoeffType > & Antioch::MixtureTransportBase< CoeffType >::mixture ( ) const
inlineinherited

Definition at line 82 of file mixture_transport_base.h.

83  {
84  return _transport_mixture;
85  }
const TransportMixture< CoeffType > & _transport_mixture
template<typename Viscosity , class CoeffType >
template<typename StateType >
StateType Antioch::MixtureViscosity< Viscosity, CoeffType >::operator() ( const unsigned int  s,
const StateType &  T 
) const
inline

Evaluate viscosity for species s.

Total viscosity computed by mixing model, e.g. MixtureAveragedTransportEvaluator

Definition at line 148 of file mixture_viscosity.h.

References antioch_assert, and antioch_assert_less_equal.

150  {
153 
154  return (*_species_viscosities[s])(T);
155  }
#define antioch_assert(asserted)
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
#define antioch_assert_less_equal(expr1, expr2)
template<typename Viscosity , class CoeffType >
void Antioch::MixtureViscosity< Viscosity, CoeffType >::print ( std::ostream &  os = std::cout) const

Formatted print, by default to std::cout.

Definition at line 177 of file mixture_viscosity.h.

References antioch_assert_equal_to.

178  {
180 
181  for( unsigned int s = 0; s < this->_transport_mixture.n_species(); s++ )
182  {
183  const Species& species = this->_transport_mixture.species_list()[s];
184  const std::string& name = this->_transport_mixture.species_inverse_name_map().find( species )->second;
185 
186  os << "mu(" << name << ") = " << (*_species_viscosities[s]) << std::endl;
187  }
188 
189  return;
190  }
unsigned int Species
#define antioch_assert_equal_to(expr1, expr2)
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
const TransportMixture< CoeffType > & _transport_mixture
template<typename Viscosity , class CoeffType >
void Antioch::MixtureViscosity< Viscosity, CoeffType >::reset_coeffs ( const unsigned int  s,
const std::vector< CoeffType >  coeffs 
)

Reset model coefficients for viscosity model of species s.

Definition at line 139 of file mixture_viscosity.h.

141  {
142  _species_viscosities[s]->reset_coeffs(coeffs);
143  }
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
template<typename Viscosity , class CoeffType >
const std::vector< Viscosity * > & Antioch::MixtureViscosity< Viscosity, CoeffType >::species_viscosities ( ) const
inline

Definition at line 171 of file mixture_viscosity.h.

172  {
173  return _species_viscosities;
174  }
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
template<class CoeffType >
const TransportMixture< CoeffType > & Antioch::MixtureTransportBase< CoeffType >::transport_mixture ( ) const
inlineinherited

Definition at line 75 of file mixture_transport_base.h.

76  {
77  return _transport_mixture;
78  }
const TransportMixture< CoeffType > & _transport_mixture

Friends And Related Function Documentation

template<typename Viscosity, class CoeffType = double>
std::ostream& operator<< ( std::ostream &  os,
const MixtureViscosity< Viscosity, CoeffType > &  mu 
)
friend

Formatted print.

Definition at line 87 of file mixture_viscosity.h.

88  {
89  mu.print(os);
90  return os;
91  }

Member Data Documentation

template<typename Viscosity, class CoeffType = double>
std::vector<SpeciesViscosityBase<Viscosity,CoeffType>*> Antioch::MixtureViscosity< Viscosity, CoeffType >::_species_viscosities
protected

Definition at line 97 of file mixture_viscosity.h.

template<class CoeffType = double>
const TransportMixture<CoeffType>& Antioch::MixtureTransportBase< CoeffType >::_transport_mixture
protectedinherited

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

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