antioch-0.4.0
constant_lewis_diffusivity.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_CONSTANT_LEWIS_DIFFUSIVITY_H
33 #define ANTIOCH_CONSTANT_LEWIS_DIFFUSIVITY_H
34 
35 // Antioch
36 #include "antioch/metaprogramming_decl.h" // ANTIOCH_AUTO*
38 
39 namespace Antioch
40 {
41 
43 
46  template<typename CoeffType=double>
47  class ConstantLewisDiffusivity : public SpeciesDiffusionBase<ConstantLewisDiffusivity<CoeffType>,CoeffType>
48  {
49  public:
50 
51  ConstantLewisDiffusivity( const CoeffType Le );
52 
53  ConstantLewisDiffusivity( const std::vector<CoeffType>& coeffs );
54 
56 
58  friend class SpeciesDiffusionBase<ConstantLewisDiffusivity<CoeffType>,CoeffType>;
59 
60  protected:
61  CoeffType _Le;
62 
63  void reset_coeffs_impl( const std::vector<CoeffType>& coeffs );
64 
65  template<typename StateType>
66  ANTIOCH_AUTO(StateType)
67  D_impl( const StateType& rho, const StateType& cp, const StateType& k ) const
68  ANTIOCH_AUTOFUNC(StateType, k/(_Le*rho*cp))
69  };
70 
71  template<typename CoeffType>
72  ConstantLewisDiffusivity<CoeffType>::ConstantLewisDiffusivity( const CoeffType Le )
73  : SpeciesDiffusionBase<ConstantLewisDiffusivity<CoeffType>,CoeffType>(),
74  _Le(Le)
75  {}
76 
77  template<typename CoeffType>
78  ConstantLewisDiffusivity<CoeffType>::ConstantLewisDiffusivity( const std::vector<CoeffType>& coeffs )
79  : SpeciesDiffusionBase<ConstantLewisDiffusivity<CoeffType>,CoeffType>(),
80  _Le(coeffs[0])
81  { antioch_assert_equal_to( coeffs.size(), 1 ); }
82 
83  template<typename CoeffType>
84  void ConstantLewisDiffusivity<CoeffType>::reset_coeffs_impl( const std::vector<CoeffType>& coeffs )
85  {
86  antioch_assert_equal_to( coeffs.size(), 1 );
87  _Le = coeffs[0];
88  }
89 
90 } // end namespace Antioch
91 
92 #endif // ANTIOCH_CONSTANT_LEWIS_DIFFUSIVITY_H
#define antioch_assert_equal_to(expr1, expr2)
Base class for species diffusion models.
Compute species diffusivity based on constant Lewis number.
Scalar cp(Scalar T, Scalar a0, Scalar a1, Scalar a2, Scalar a3, Scalar a4, Scalar a5, Scalar a6)
void reset_coeffs_impl(const std::vector< CoeffType > &coeffs)
#define ANTIOCH_AUTOFUNC(Type, Expr)
const ANTIOCH_AUTO(StateType) KineticsTheoryThermalConductivity< ThermoEvaluator
The parameters are reduced parameters.

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