antioch-0.4.0
mixture_conductivity.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_MIXTURE_CONDUCTIVITY_H
28 #define ANTIOCH_MIXTURE_CONDUCTIVITY_H
29 
32 
33 namespace Antioch
34 {
36 
41  template<typename Conductivity, class CoeffType=double>
42  class MixtureConductivity : public MixtureTransportBase<CoeffType>
43  {
44  public:
45 
47 
48  virtual ~MixtureConductivity();
49 
51  template<class MicroThermo>
52  void add( unsigned int s,
53  const std::vector<CoeffType>& coeffs,
54  const MicroThermo& thermo );
55 
57  void reset_coeffs( const unsigned int s,
58  const std::vector<CoeffType> coeffs );
59 
60  template<typename StateType>
61  StateType conductivity_with_diffusion( unsigned int s,
62  const StateType& T,
63  const StateType& rho,
64  const StateType& mu_s,
65  const StateType& D_ss ) const;
66 
67  template <typename StateType>
68  StateType conductivity_without_diffusion( unsigned int s,
69  const StateType& T,
70  const StateType& mu_s ) const;
71 
72  protected:
73 
74  std::vector<SpeciesConductivityBase<Conductivity>*> _species_conductivities;
75 
76  private:
77 
79 
80  };
81 
82  template<typename Conductivity, class CoeffType>
84  : MixtureTransportBase<CoeffType>(transport_mixture),
85  _species_conductivities( transport_mixture.n_species(), NULL )
86  {}
87 
88  template<typename Conductivity, class CoeffType>
90  {
91  // Need to delete all the species viscosities we allocated
92  for( typename std::vector<SpeciesConductivityBase<Conductivity>*>::iterator it = _species_conductivities.begin();
93  it != _species_conductivities.end(); ++it )
94  {
95  delete (*it);
96  }
97  }
98 
99  template<typename Conductivity, class CoeffType>
100  template<class MicroThermo>
102  const std::vector<CoeffType>& coeffs,
103  const MicroThermo& thermo )
104  {
105  antioch_assert_less_equal( s, _species_conductivities.size() );
106  antioch_assert( !_species_conductivities[s] );
107 
108  _species_conductivities[s] = new Conductivity(thermo, coeffs);
109  }
110 
111  template<typename Conductivity, class CoeffType>
113  const std::vector<CoeffType> coeffs )
114  {
115  _species_conductivities[s]->reset_coeffs(coeffs);
116  }
117 
118  template<typename Conductivity, class CoeffType>
119  template<typename StateType>
121  const StateType& T,
122  const StateType& rho,
123  const StateType& mu_s,
124  const StateType& D_ss ) const
125  {
126  return (*this->_species_conductivities[s])(s,mu_s,T,rho,D_ss);
127  }
128 
129  template<typename Conductivity, class CoeffType>
130  template<typename StateType>
132  const StateType& T,
133  const StateType& mu_s ) const
134  {
135  return (*this->_species_conductivities[s])(s,mu_s,T);
136  }
137 
138 } // end namespace Antioch
139 
140 #endif // ANTIOCH_MIXTURE_CONDUCTIVITY_H
#define antioch_assert(asserted)
StateType conductivity_without_diffusion(unsigned int s, const StateType &T, const StateType &mu_s) const
std::vector< SpeciesConductivityBase< Conductivity > * > _species_conductivities
void add(unsigned int s, const std::vector< CoeffType > &coeffs, const MicroThermo &thermo)
Add species viscosity.
#define antioch_assert_less_equal(expr1, expr2)
StateType conductivity_with_diffusion(unsigned int s, const StateType &T, const StateType &rho, const StateType &mu_s, const StateType &D_ss) const
Base class for MixtureViscosity, MixtureConductivity, etc.
Class storing chemical mixture properties.
Definition: ascii_parser.h:55
void reset_coeffs(const unsigned int s, const std::vector< CoeffType > coeffs)
Reset model coefficients for viscosity model of species s.
Base class for species conducitivity models.
Container class for species thermal conductivities.
The parameters are reduced parameters.
const TransportMixture< CoeffType > & transport_mixture() const

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