GRINS-0.7.0
antioch_mixture_averaged_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-2016 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"
37 
38 // libMesh
39 #include "libmesh/libmesh_common.h"
40 #include "libmesh/getpot.h"
41 
42 // Antioch
43 #include "antioch/vector_utils_decl.h"
44 #include "antioch/vector_utils.h"
45 #include "antioch/cea_evaluator.h"
46 #include "antioch/stat_mech_thermo.h"
47 #include "antioch/mixture_averaged_transport_mixture.h"
48 #include "antioch/mixture_viscosity.h"
49 #include "antioch/mixture_conductivity.h"
50 #include "antioch/mixture_diffusion.h"
51 #include "antioch/sutherland_viscosity.h"
52 #include "antioch/blottner_viscosity.h"
53 #include "antioch/eucken_thermal_conductivity.h"
54 #include "antioch/constant_lewis_diffusivity.h"
55 
56 #include "antioch/sutherland_parsing.h"
57 #include "antioch/blottner_parsing.h"
58 #include "antioch/eucken_thermal_conductivity_building.h"
59 #include "antioch/constant_lewis_diffusivity_building.h"
60 
61 #ifdef ANTIOCH_HAVE_GSL
62 
63 #include "antioch/kinetics_theory_viscosity.h"
64 #include "antioch/kinetics_theory_thermal_conductivity.h"
65 #include "antioch/molecular_binary_diffusion.h"
66 #include "antioch/gsl_spliner.h"
67 #include "antioch/kinetics_theory_viscosity_building.h"
68 #include "antioch/kinetics_theory_thermal_conductivity_building.h"
69 
70 #endif // ANTIOCH_HAVE_GSL
71 
72 namespace GRINS
73 {
75 
82  template<typename Thermo, typename Viscosity, typename Conductivity, typename Diffusivity>
84  {
85  public:
86 
87  AntiochMixtureAveragedTransportMixture( const GetPot& input, const std::string& material );
88 
90 
91  const Antioch::MixtureAveragedTransportMixture<libMesh::Real>& wilke_mixture() const;
92 
93  const Antioch::MixtureViscosity<Viscosity,libMesh::Real>& viscosity() const;
94 
95  const Antioch::MixtureConductivity<Conductivity,libMesh::Real>& conductivity() const;
96 
97  const Antioch::MixtureDiffusion<Diffusivity,libMesh::Real>& diffusivity() const;
98 
100 
101  protected:
102 
103  libMesh::UniquePtr<Antioch::TransportMixture<libMesh::Real> > _trans_mixture;
104 
105  libMesh::UniquePtr<Antioch::MixtureAveragedTransportMixture<libMesh::Real> > _wilke_mixture;
106 
107  libMesh::UniquePtr<Thermo> _thermo;
108 
109  libMesh::UniquePtr<Antioch::MixtureViscosity<Viscosity,libMesh::Real> > _viscosity;
110 
111  libMesh::UniquePtr<Antioch::MixtureConductivity<Conductivity,libMesh::Real> > _conductivity;
112 
113  libMesh::UniquePtr<Antioch::MixtureDiffusion<Diffusivity,libMesh::Real> > _diffusivity;
114 
115  /* Below we will specialize the specialized_build_* functions to the appropriate type.
116  This way, we can control how the cached transport objects get constructed
117  based on the template type. This is achieved by the dummy types forcing operator
118  overloading for each of the specialized types. */
119  void build_thermo( const GetPot& input )
120  { specialized_build_thermo( input, _thermo, thermo_type<Thermo>() ); }
121 
122  void build_viscosity( const GetPot& input, const std::string& material )
123  { specialized_build_viscosity( input, material, _viscosity, viscosity_type<Viscosity>() ); }
124 
125  void build_conductivity( const GetPot& input )
127 
128  void build_diffusivity( const GetPot& input, const std::string& material )
129  { specialized_build_diffusivity( input, material, _diffusivity, diffusivity_type<Diffusivity>() ); }
130 
131  private:
132 
134 
135  void specialized_build_thermo( const GetPot& /*input*/,
136  libMesh::UniquePtr<Antioch::StatMechThermodynamics<libMesh::Real> >& thermo,
137  thermo_type<Antioch::StatMechThermodynamics<libMesh::Real> > )
138  {
139  thermo.reset( new Antioch::StatMechThermodynamics<libMesh::Real>( *(this->_antioch_gas.get()) ) );
140  return;
141  }
142 
143  void specialized_build_thermo( const GetPot& /*input*/,
144  libMesh::UniquePtr<Antioch::CEAEvaluator<libMesh::Real> >& thermo,
145  thermo_type<Antioch::CEAEvaluator<libMesh::Real> > )
146  {
147  thermo.reset( new Antioch::CEAEvaluator<libMesh::Real>( this->cea_mixture() ) );
148  return;
149  }
150 
151  void specialized_build_viscosity( const GetPot& input,
152  const std::string& material,
153  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real>,libMesh::Real> >& viscosity,
154  viscosity_type<Antioch::SutherlandViscosity<libMesh::Real> > )
155  {
156  viscosity.reset( new Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real>,libMesh::Real>(*(_trans_mixture.get())) );
157 
158  std::string sutherland_data = input("Materials/"+material+"/GasMixture/Antioch/sutherland_data", "default");
159  if( sutherland_data == "default" )
160  sutherland_data = Antioch::DefaultInstallFilename::sutherland_data();
161 
162  Antioch::read_sutherland_data_ascii( *(viscosity.get()), sutherland_data );
163  }
164 
165  void specialized_build_viscosity( const GetPot& input,
166  const std::string& material,
167  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real>,libMesh::Real> >& viscosity,
168  viscosity_type<Antioch::BlottnerViscosity<libMesh::Real> > )
169  {
170  viscosity.reset( new Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real>,libMesh::Real>(*(_trans_mixture.get())) );
171 
172  std::string blottner_data = input("Materials/"+material+"/GasMixture/Antioch/blottner_data", "default");
173  if( blottner_data == "default" )
174  blottner_data = Antioch::DefaultInstallFilename::blottner_data();
175 
176  Antioch::read_blottner_data_ascii( *(viscosity.get()), blottner_data );
177  }
178 
179 #ifdef ANTIOCH_HAVE_GSL
180  void specialized_build_viscosity( const GetPot& /*input*/,
181  const std::string& /*material*/,
182  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >& viscosity,
183  viscosity_type<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner> > )
184  {
185  viscosity.reset( new Antioch::MixtureViscosity<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real>(*(_trans_mixture.get())) );
186 
187  Antioch::build_kinetics_theory_viscosity<libMesh::Real,Antioch::GSLSpliner>( *(viscosity.get()) );
188  }
189 #endif // ANTIOCH_HAVE_GSL
190 
191  void specialized_build_conductivity( const GetPot& /*input*/,
192  libMesh::UniquePtr<Antioch::MixtureConductivity<Antioch::EuckenThermalConductivity<Thermo>,libMesh::Real> >& conductivity,
193  conductivity_type<Antioch::EuckenThermalConductivity<Thermo> > )
194  {
195  conductivity.reset( new Antioch::MixtureConductivity<Antioch::EuckenThermalConductivity<Thermo>,libMesh::Real>(*(_trans_mixture.get())) );
196  Antioch::build_eucken_thermal_conductivity<Thermo,libMesh::Real>(*(conductivity.get()),*(_thermo.get()));
197  return;
198  }
199 
200 #ifdef ANTIOCH_HAVE_GSL
201  void specialized_build_conductivity( const GetPot& /*input*/,
202  libMesh::UniquePtr<Antioch::MixtureConductivity<Antioch::KineticsTheoryThermalConductivity<Thermo,libMesh::Real>,libMesh::Real> >& conductivity,
203  conductivity_type<Antioch::KineticsTheoryThermalConductivity<Thermo,libMesh::Real> > )
204  {
205  conductivity.reset( new Antioch::MixtureConductivity<Antioch::KineticsTheoryThermalConductivity<Thermo,libMesh::Real>,libMesh::Real>(*(_trans_mixture.get())) );
206 
207  Antioch::build_kinetics_theory_thermal_conductivity<Thermo,libMesh::Real>( *(conductivity.get()), *(_thermo.get()) );
208  }
209 #endif // ANTIOCH_HAVE_GSL
210 
211  void specialized_build_diffusivity( const GetPot& input,
212  const std::string& material,
213  libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::ConstantLewisDiffusivity<libMesh::Real>,libMesh::Real> >& diffusivity,
214  diffusivity_type<Antioch::ConstantLewisDiffusivity<libMesh::Real> > )
215  {
216  libMesh::Real Le = MaterialsParsing::parse_lewis_number(input,material);
217 
218  diffusivity.reset( new Antioch::MixtureDiffusion<Antioch::ConstantLewisDiffusivity<libMesh::Real>,libMesh::Real>(*(_trans_mixture.get())) );
219 
220  Antioch::build_constant_lewis_diffusivity<libMesh::Real>( *(diffusivity.get()), Le);
221  return;
222  }
223 
224 #ifdef ANTIOCH_HAVE_GSL
225  void specialized_build_diffusivity( const GetPot& /*input*/,
226  const std::string& /*material*/,
227  libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >& diffusivity,
228  diffusivity_type<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> > )
229  {
230  diffusivity.reset( new Antioch::MixtureDiffusion<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real>(*(_trans_mixture.get())) );
231  }
232 #endif // ANTIOCH_HAVE_GSL
233 
234  };
235 
236  /* ------------------------- Inline Functions -------------------------*/
237  template<typename T, typename V, typename C, typename D>
238  inline
239  const Antioch::MixtureAveragedTransportMixture<libMesh::Real>& AntiochMixtureAveragedTransportMixture<T,V,C,D>::wilke_mixture() const
240  {
241  return *(_wilke_mixture.get());
242  }
243 
244  template<typename T, typename Viscosity, typename C, typename D>
245  inline
246  const Antioch::MixtureViscosity<Viscosity,libMesh::Real>& AntiochMixtureAveragedTransportMixture<T,Viscosity,C,D>::viscosity() const
247  {
248  return *_viscosity.get();
249  }
250 
251  template<typename T, typename V, typename Conductivity, typename D>
252  inline
253  const Antioch::MixtureConductivity<Conductivity,libMesh::Real>& AntiochMixtureAveragedTransportMixture<T,V,Conductivity,D>::conductivity() const
254  {
255  return *_conductivity.get();
256  }
257 
258  template<typename T, typename V, typename C, typename Diffusivity>
259  inline
260  const Antioch::MixtureDiffusion<Diffusivity,libMesh::Real>& AntiochMixtureAveragedTransportMixture<T,V,C,Diffusivity>::diffusivity() const
261  {
262  return *_diffusivity.get();
263  }
264 
265 } // end namespace GRINS
266 
267 #endif // GRINS_HAVE_ANTIOCH
268 
269 #endif // GRINS_WILKE_ANTIOCH_TRANSPORT_MIXTURE_H
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
Wrapper class for Antioch::ChemicalMixture.
const Antioch::MixtureAveragedTransportMixture< libMesh::Real > & wilke_mixture() const
Wrapper class for storing state for computing Wilke transport properties using Antioch.
const Antioch::MixtureConductivity< Conductivity, libMesh::Real > & conductivity() const
const Antioch::CEAThermoMixture< libMesh::Real > & cea_mixture() const
void specialized_build_conductivity(const GetPot &, libMesh::UniquePtr< Antioch::MixtureConductivity< Antioch::EuckenThermalConductivity< Thermo >, libMesh::Real > > &conductivity, conductivity_type< Antioch::EuckenThermalConductivity< Thermo > >)
GRINS namespace.
static libMesh::Real parse_lewis_number(const GetPot &input, const std::string &material)
const Antioch::MixtureViscosity< Viscosity, libMesh::Real > & viscosity() const
const Antioch::MixtureDiffusion< Diffusivity, libMesh::Real > & diffusivity() const
void specialized_build_diffusivity(const GetPot &input, const std::string &material, libMesh::UniquePtr< Antioch::MixtureDiffusion< Antioch::ConstantLewisDiffusivity< libMesh::Real >, libMesh::Real > > &diffusivity, diffusivity_type< Antioch::ConstantLewisDiffusivity< libMesh::Real > >)
void specialized_build_thermo(const GetPot &, libMesh::UniquePtr< Antioch::CEAEvaluator< libMesh::Real > > &thermo, thermo_type< Antioch::CEAEvaluator< libMesh::Real > >)
Wrapper class for storing state for Antioch thermo and kinetics.
void build_viscosity(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::TransportMixture< libMesh::Real > > _trans_mixture
void specialized_build_viscosity(const GetPot &input, const std::string &material, libMesh::UniquePtr< Antioch::MixtureViscosity< Antioch::SutherlandViscosity< libMesh::Real >, libMesh::Real > > &viscosity, viscosity_type< Antioch::SutherlandViscosity< libMesh::Real > >)
libMesh::UniquePtr< Antioch::MixtureViscosity< Viscosity, libMesh::Real > > _viscosity
void specialized_build_thermo(const GetPot &, libMesh::UniquePtr< Antioch::StatMechThermodynamics< libMesh::Real > > &thermo, thermo_type< Antioch::StatMechThermodynamics< libMesh::Real > >)
void specialized_build_viscosity(const GetPot &input, const std::string &material, libMesh::UniquePtr< Antioch::MixtureViscosity< Antioch::BlottnerViscosity< libMesh::Real >, libMesh::Real > > &viscosity, viscosity_type< Antioch::BlottnerViscosity< libMesh::Real > >)
libMesh::UniquePtr< Antioch::MixtureAveragedTransportMixture< libMesh::Real > > _wilke_mixture
void build_diffusivity(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::MixtureDiffusion< Diffusivity, libMesh::Real > > _diffusivity
libMesh::UniquePtr< Antioch::MixtureConductivity< Conductivity, libMesh::Real > > _conductivity

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10