antioch-0.4.0
wilke_evaluator.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 // $Id$
28 //
29 //--------------------------------------------------------------------------
30 //--------------------------------------------------------------------------
31 
32 #ifndef ANTIOCH_WILKE_EVALUATOR_H
33 #define ANTIOCH_WILKE_EVALUATOR_H
34 
35 // Antioch
37 #include "antioch/wilke_mixture.h"
42 
43 namespace Antioch
44 {
46  template<class MixtureViscosity, class ThermalConductivity, class CoeffType=double>
48  {
49  public:
50 
52  const MixtureViscosity& viscosity,
53  const ThermalConductivity& conductivity );
54 
56 
57 
58  template <typename StateType, typename VectorStateType>
59  StateType mu( const StateType& T,
60  const VectorStateType& mass_fractions ) const {return _wilke_eval->mu(T,mass_fractions);}
61 
62  template <typename StateType, typename VectorStateType>
63  StateType k( const StateType& T,
64  const VectorStateType& mass_fractions ) const {return _wilke_eval->k(T,mass_fractions);}
65 
66  template <typename StateType, typename VectorStateType>
67  void mu_and_k( const StateType& T,
68  const VectorStateType& mass_fractions,
69  StateType& mu, StateType& k ) const {_wilke_eval->mu_and_k(T,mass_fractions,mu,k);}
70 
72 
74  template <typename StateType, typename VectorStateType>
75  void compute_mu_chi( const StateType& T,
76  const VectorStateType& mass_fractions,
77  VectorStateType& mu,
78  VectorStateType& chi ) const {_wilke_eval->compute_mu_chi(T,mass_fractions,mu,chi);}
79 
81 
82  template <typename VectorStateType>
83  typename
85  compute_phi( const VectorStateType& mu,
86  const VectorStateType& chi,
87  const unsigned int s ) const;
88 
89 
90  private:
91 
93 
95 
97 
99 
103 
105 
106  typename ThermalConductivity::micro_thermo_type* _micro_thermo;
107 
110  ThermalConductivity,
111  CoeffType> Evaluator;
112 
113  Evaluator* _wilke_eval;
114 
115  };
116 
117  template<class Viscosity, class ThermalConductivity, class CoeffType>
119  const Viscosity& viscosity,
120  const ThermalConductivity& /*conductivity*/ )
121  : _transport_mixture( new TransportMixture<CoeffType>(mixture.chem_mixture()) ),
122  _wilke_mixture( new MixtureAveragedTransportMixture<CoeffType>(*_transport_mixture) ),
123  _diffusion( new MixtureDiffusion<ConstantLewisDiffusivity<CoeffType>,CoeffType>(*_transport_mixture) ),
124  _conductivity( new MixtureConductivity<ThermalConductivity,CoeffType>(*_transport_mixture) ),
125  _micro_thermo( new typename ThermalConductivity::micro_thermo_type(mixture.chem_mixture()) ),
126  _wilke_eval(new Evaluator(*_wilke_mixture,*_diffusion,viscosity,*_conductivity))
127  {
129  Antioch::build_eucken_thermal_conductivity<typename ThermalConductivity::micro_thermo_type,CoeffType>(*_conductivity, *_micro_thermo );
130  }
131 
132  template<class Viscosity, class ThermalConductivity, class CoeffType>
134  {
135  delete _wilke_eval;
136  delete _micro_thermo;
137  delete _conductivity;
138  delete _diffusion;
139  delete _wilke_mixture;
140  delete _transport_mixture;
141 
142  return;
143  }
144 
145  template<class Viscosity, class ThermalConductivity, class CoeffType>
146  template <typename VectorStateType>
147  typename
150  const VectorStateType& chi,
151  const unsigned int s ) const
152  {
153 
154  typename Antioch::rebind<VectorStateType,VectorStateType>::type mu_mu_sqrt(mu.size());
155  Antioch::init_constant(mu_mu_sqrt,mu);
156 
157  _wilke_eval->compute_mu_mu_sqrt( mu, mu_mu_sqrt);
158 
159  return _wilke_eval->compute_phi( mu_mu_sqrt, chi, s );
160  }
161 
162 } // end namespace Antioch
163 
164 #endif // ANTIOCH_WILKE_EVALUATOR_H
ThermalConductivity::micro_thermo_type * _micro_thermo
Deprecated. Use MixtureAveragedTransportEvaluator instead.
Container class for species viscosities.
value_type< VectorStateType >::type k(const StateType &T, const VectorStateType &mass_fractions) const
Mixture conducivity, in [W/m-K].
Compute transport properties using ``mixture averaged" model.
void compute_mu_chi(const StateType &T, const VectorStateType &mass_fractions, VectorStateType &mu, VectorStateType &chi) const
Helper function to reduce code duplication.
StateType k(const StateType &T, const VectorStateType &mass_fractions) const
MixtureDiffusion< ConstantLewisDiffusivity< CoeffType >, CoeffType > * _diffusion
This is dummy.
Compute species diffusivity based on constant Lewis number.
Container class for species binary diffusion models.
value_type< VectorStateType >::type mu(const StateType &T, const VectorStateType &mass_fractions) const
Mixture viscosity, in [Pa-s].
Class storing chemical mixture properties.
Definition: ascii_parser.h:55
void mu_and_k(const StateType &T, const VectorStateType &mass_fractions, StateType &mu, StateType &k) const
MixtureConductivity< ThermalConductivity, CoeffType > * _conductivity
#define antioch_deprecated()
MixtureAveragedTransportEvaluator< ConstantLewisDiffusivity< CoeffType >, typename MixtureViscosity::species_viscosity_type, ThermalConductivity, CoeffType > Evaluator
StateType mu(const StateType &T, const VectorStateType &mass_fractions) const
MixtureAveragedTransportMixture< CoeffType > * _wilke_mixture
TransportMixture< CoeffType > * _transport_mixture
void init_constant(Vector &output, const Scalar &example)
The parameters are reduced parameters.
Antioch::value_type< VectorStateType >::type compute_phi(const VectorStateType &mu, const VectorStateType &chi, const unsigned int s) const
Helper function to reduce code duplication.
Mixture object for MixtureAveragedTransport model.
void compute_mu_chi(const StateType &T, const VectorStateType &mass_fractions, VectorStateType &mu, VectorStateType &chi) const
Helper function to reduce code duplication.
void mu_and_k(const StateType &T, const VectorStateType &mass_fractions, StateType &mu, StateType &k) const
Mixture viscosity and thermal conductivity, in [Pa-s], [W/m-K] respectively.

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