GRINS-0.6.0
antioch_wilke_transport_mixture.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 
26 #ifndef GRINS_WILKE_ANTIOCH_TRANSPORT_MIXTURE_H
27 #define GRINS_WILKE_ANTIOCH_TRANSPORT_MIXTURE_H
28 
29 #include "grins_config.h"
30 
31 #ifdef GRINS_HAVE_ANTIOCH
32 
33 // GRINS
34 #include "grins/antioch_mixture.h"
35 #include "grins/property_types.h"
36 
37 // libMesh
38 #include "libmesh/libmesh_common.h"
39 #include "libmesh/getpot.h"
40 
41 // Antioch
42 #include "antioch/vector_utils_decl.h"
43 #include "antioch/vector_utils.h"
44 #include "antioch/cea_evaluator.h"
45 #include "antioch/stat_mech_thermo.h"
46 #include "antioch/wilke_mixture.h"
47 #include "antioch/mixture_viscosity.h"
48 #include "antioch/sutherland_viscosity.h"
49 #include "antioch/blottner_viscosity.h"
50 #include "antioch/sutherland_parsing.h"
51 #include "antioch/blottner_parsing.h"
52 #include "antioch/eucken_thermal_conductivity.h"
53 #include "antioch/constant_lewis_diffusivity.h"
54 
55 // These are "dummy" types to help force operator overloading
56 namespace GRINS
57 {
58 
59 }
60 
61 namespace GRINS
62 {
64 
71  template<typename Thermo, typename Viscosity, typename Conductivity, typename Diffusivity>
73  {
74  public:
75 
76  AntiochWilkeTransportMixture( const GetPot& input );
77 
79 
80  const Antioch::WilkeMixture<libMesh::Real>& wilke_mixture() const;
81 
82  const Viscosity& viscosity() const;
83 
84  const Conductivity& conductivity() const;
85 
86  const Diffusivity& diffusivity() const;
87 
89 
90  protected:
91 
92  Antioch::WilkeMixture<libMesh::Real> _wilke_mixture;
93 
94  boost::scoped_ptr<Thermo> _thermo;
95 
96  boost::scoped_ptr<Viscosity> _viscosity;
97 
98  boost::scoped_ptr<Conductivity> _conductivity;
99 
100  boost::scoped_ptr<Diffusivity> _diffusivity;
101 
102  /* Below we will specialize the specialized_build_* functions to the appropriate type.
103  This way, we can control how the cached transport objects get constructed
104  based on the template type. This is achieved by the dummy types forcing operator
105  overloading for each of the specialized types. */
106  void build_thermo( const GetPot& input )
107  { specialized_build_thermo( input, _thermo, thermo_type<Thermo>() ); }
108 
109  void build_viscosity( const GetPot& input )
110  { specialized_build_viscosity( input, _viscosity, viscosity_type<Viscosity>() ); }
111 
112  void build_conductivity( const GetPot& input )
114 
115  void build_diffusivity( const GetPot& input )
116  { specialized_build_diffusivity( input, _diffusivity, diffusivity_type<Diffusivity>() ); }
117 
118  private:
119 
121 
122  void specialized_build_thermo( const GetPot& /*input*/,
123  boost::scoped_ptr<Antioch::StatMechThermodynamics<libMesh::Real> >& thermo,
124  thermo_type<Antioch::StatMechThermodynamics<libMesh::Real> > )
125  {
126  thermo.reset( new Antioch::StatMechThermodynamics<libMesh::Real>( *(this->_antioch_gas.get()) ) );
127  return;
128  }
129 
130  void specialized_build_thermo( const GetPot& /*input*/,
131  boost::scoped_ptr<Antioch::CEAEvaluator<libMesh::Real> >& thermo,
132  thermo_type<Antioch::CEAEvaluator<libMesh::Real> > )
133  {
134  thermo.reset( new Antioch::CEAEvaluator<libMesh::Real>( this->cea_mixture() ) );
135  return;
136  }
137 
138  void specialized_build_viscosity( const GetPot& /*input*/,
139  boost::scoped_ptr<Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real> > >& viscosity,
140  viscosity_type<Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real> > > )
141  {
142  viscosity.reset( new Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real> >( *(this->_antioch_gas.get()) ) );
143 
144  Antioch::read_sutherland_data_ascii_default( *(viscosity.get()) );
145  return;
146  }
147 
148  void specialized_build_viscosity( const GetPot& /*input*/,
149  boost::scoped_ptr<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> > >& viscosity,
150  viscosity_type<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> > > )
151  {
152  viscosity.reset( new Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real> >( *(this->_antioch_gas.get()) ) );
153 
154  Antioch::read_blottner_data_ascii_default( *(viscosity.get()) );
155  return;
156  }
157 
158  void specialized_build_conductivity( const GetPot& /*input*/,
159  boost::scoped_ptr<Antioch::EuckenThermalConductivity<Thermo> >& conductivity,
160  conductivity_type<Antioch::EuckenThermalConductivity<Thermo> > )
161  {
162  conductivity.reset( new Antioch::EuckenThermalConductivity<Thermo>( *_thermo.get() ) );
163  return;
164  }
165 
166  void specialized_build_diffusivity( const GetPot& input,
167  boost::scoped_ptr<Antioch::ConstantLewisDiffusivity<libMesh::Real> >& diffusivity,
168  diffusivity_type<Antioch::ConstantLewisDiffusivity<libMesh::Real> > )
169  {
170  if( !input.have_variable( "Physics/Antioch/Le" ) )
171  {
172  std::cerr << "Error: Must provide Lewis number for constant_lewis diffusivity model."
173  << std::endl;
174 
175  libmesh_error();
176  }
177 
178  const libMesh::Real Le = input( "Physics/Antioch/Le", 0.0 );
179 
180  diffusivity.reset( new Antioch::ConstantLewisDiffusivity<libMesh::Real>( Le ) );
181 
182  return;
183  }
184 
185  };
186 
187  /* ------------------------- Inline Functions -------------------------*/
188  template<typename T, typename V, typename C, typename D>
189  inline
190  const Antioch::WilkeMixture<libMesh::Real>& AntiochWilkeTransportMixture<T,V,C,D>::wilke_mixture() const
191  {
192  return _wilke_mixture;
193  }
194 
195  template<typename T, typename Viscosity, typename C, typename D>
196  inline
198  {
199  return *_viscosity.get();
200  }
201 
202  template<typename T, typename V, typename Conductivity, typename D>
203  inline
205  {
206  return *_conductivity.get();
207  }
208 
209  template<typename T, typename V, typename C, typename Diffusivity>
210  inline
212  {
213  return *_diffusivity.get();
214  }
215 
216 } // end namespace GRINS
217 
218 #endif // GRINS_HAVE_ANTIOCH
219 
220 #endif // GRINS_WILKE_ANTIOCH_TRANSPORT_MIXTURE_H
void specialized_build_thermo(const GetPot &, boost::scoped_ptr< Antioch::CEAEvaluator< libMesh::Real > > &thermo, thermo_type< Antioch::CEAEvaluator< libMesh::Real > >)
Wrapper class for Antioch::ChemicalMixture.
void specialized_build_viscosity(const GetPot &, boost::scoped_ptr< Antioch::MixtureViscosity< Antioch::SutherlandViscosity< libMesh::Real > > > &viscosity, viscosity_type< Antioch::MixtureViscosity< Antioch::SutherlandViscosity< libMesh::Real > > >)
const Antioch::CEAThermoMixture< libMesh::Real > & cea_mixture() const
GRINS namespace.
void specialized_build_viscosity(const GetPot &, boost::scoped_ptr< Antioch::MixtureViscosity< Antioch::BlottnerViscosity< libMesh::Real > > > &viscosity, viscosity_type< Antioch::MixtureViscosity< Antioch::BlottnerViscosity< libMesh::Real > > >)
void specialized_build_diffusivity(const GetPot &input, boost::scoped_ptr< Antioch::ConstantLewisDiffusivity< libMesh::Real > > &diffusivity, diffusivity_type< Antioch::ConstantLewisDiffusivity< libMesh::Real > >)
Wrapper class for storing state for Antioch thermo and kinetics.
void specialized_build_thermo(const GetPot &, boost::scoped_ptr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
boost::scoped_ptr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
boost::scoped_ptr< Conductivity > _conductivity
Antioch::WilkeMixture< libMesh::Real > _wilke_mixture
void specialized_build_conductivity(const GetPot &, boost::scoped_ptr< Antioch::EuckenThermalConductivity< Thermo > > &conductivity, conductivity_type< Antioch::EuckenThermalConductivity< Thermo > >)
Wrapper class for storing state for computing Wilke transport properties using Antioch.
const Antioch::WilkeMixture< libMesh::Real > & wilke_mixture() const

Generated on Mon Jun 22 2015 21:32:20 for GRINS-0.6.0 by  doxygen 1.8.9.1