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

Generated on Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1