32 #ifndef ANTIOCH_MIXTURE_VISCOSITY_H
33 #define ANTIOCH_MIXTURE_VISCOSITY_H
51 template<
typename Viscosity,
class CoeffType=
double>
52 class MixtureViscosity :
public MixtureTransportBase<CoeffType>
61 template <
typename StateType>
62 StateType
operator()(
const unsigned int s,
const StateType& T )
const;
65 void add(
const std::string& species_name,
66 const std::vector<CoeffType>& coeffs );
70 const std::vector<CoeffType> coeffs );
78 template <
typename StateType>
84 void print(std::ostream& os = std::cout)
const;
105 template<
typename Viscosity,
class CoeffType>
108 _species_viscosities( transport_mixture.n_species(), NULL )
111 template<
typename Viscosity,
class CoeffType>
116 it != _species_viscosities.end(); ++it )
122 template<
typename Viscosity,
class CoeffType>
124 const std::vector<CoeffType>& coeffs )
126 antioch_assert( this->_transport_mixture.species_name_map().find(species_name) !=
127 this->_transport_mixture.species_name_map().end() );
129 unsigned int s = this->_transport_mixture.species_name_map().find(species_name)->second;
134 _species_viscosities[s] =
new Viscosity(coeffs);
138 template<
typename Viscosity,
class CoeffType>
140 const std::vector<CoeffType> coeffs )
142 _species_viscosities[s]->reset_coeffs(coeffs);
145 template<
typename Viscosity,
class CoeffType>
146 template<
typename StateType>
149 const StateType& T )
const
154 return (*_species_viscosities[s])(T);
157 template<
typename Viscosity,
class CoeffType>
158 template <
typename StateType>
163 it != _species_viscosities.end(); ++it )
165 (*it)->extrapolate_max_temp(Tmax);
169 template<
typename Viscosity,
class CoeffType>
173 return _species_viscosities;
176 template<
typename Viscosity,
class CoeffType>
181 for(
unsigned int s = 0; s < this->_transport_mixture.n_species(); s++ )
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;
186 os <<
"mu(" << name <<
") = " << (*_species_viscosities[s]) << std::endl;
194 #endif // ANTIOCH_MIXTURE_VISCOSITY_H
Viscosity species_viscosity_type
#define antioch_assert(asserted)
Base class for species viscosity models.
friend std::ostream & operator<<(std::ostream &os, const MixtureViscosity &mu)
Formatted print.
const std::vector< Viscosity * > & species_viscosities() const
Container class for species viscosities.
#define antioch_assert_equal_to(expr1, expr2)
std::vector< SpeciesViscosityBase< Viscosity, CoeffType > * > _species_viscosities
void add(const std::string &species_name, const std::vector< CoeffType > &coeffs)
Add species viscosity.
#define antioch_assert_less_equal(expr1, expr2)
void extrapolate_max_temp(const StateType &Tmax)
Extrapolate to input maximum temperature, given in [K].
Base class for MixtureViscosity, MixtureConductivity, etc.
Class storing chemical mixture properties.
void print(std::ostream &os=std::cout) const
Formatted print, by default to std::cout.
StateType operator()(const unsigned int s, const StateType &T) const
Evaluate viscosity for species s.
The parameters are reduced parameters.
void reset_coeffs(const unsigned int s, const std::vector< CoeffType > coeffs)
Reset model coefficients for viscosity model of species s.
const TransportMixture< CoeffType > & transport_mixture() const