GRINS-0.8.0
antioch_mixture_averaged_transport_mixture_builder.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 #ifndef GRINS_ANTIOCH_MIXTURE_AVERAGED_TRANSPORT_MIXTURE_BUILDER_H
26 #define GRINS_ANTIOCH_MIXTURE_AVERAGED_TRANSPORT_MIXTURE_BUILDER_H
27 
28 #include "grins_config.h"
29 
30 #ifdef GRINS_HAVE_ANTIOCH
31 
32 // GRINS
35 
36 namespace GRINS
37 {
38 
40  {
41  public:
44 
45  template<typename KineticsThermoCurveFit, typename Thermo, typename Viscosity, typename Conductivity, typename Diffusivity>
46  libMesh::UniquePtr<AntiochMixtureAveragedTransportMixture<KineticsThermoCurveFit,Thermo,Viscosity,Conductivity,Diffusivity> >
47  build_mixture( const GetPot & input, const std::string & material );
48 
49  private:
50 
51  libMesh::UniquePtr<Antioch::TransportMixture<libMesh::Real> >
52  build_transport_mixture( const GetPot& input, const std::string& material,
53  const Antioch::ChemicalMixture<libMesh::Real> & chem_mix );
54 
55  libMesh::UniquePtr<Antioch::MixtureAveragedTransportMixture<libMesh::Real> >
56  build_mix_avg_trans_mixture( const Antioch::TransportMixture<libMesh::Real> & trans_mix )
57  { return libMesh::UniquePtr<Antioch::MixtureAveragedTransportMixture<libMesh::Real> >
58  ( new Antioch::MixtureAveragedTransportMixture<libMesh::Real>(trans_mix) ); }
59 
60  template<typename Viscosity>
61  libMesh::UniquePtr<Antioch::MixtureViscosity<Viscosity,libMesh::Real> >
62  build_viscosity( const GetPot& input, const std::string& material,
63  const Antioch::TransportMixture<libMesh::Real> & trans_mix )
64  { return specialized_build_viscosity( input, material, trans_mix, viscosity_type<Viscosity>() ); }
65 
66  template<typename Diffusivity>
67  libMesh::UniquePtr<Antioch::MixtureDiffusion<Diffusivity,libMesh::Real> >
68  build_diffusivity( const GetPot& input, const std::string& material,
69  const Antioch::TransportMixture<libMesh::Real> & trans_mix )
70  { return specialized_build_diffusivity( input, material, trans_mix, diffusivity_type<Diffusivity>() ); }
71 
72  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real>,libMesh::Real> >
73  specialized_build_viscosity( const GetPot& input,
74  const std::string& material,
75  const Antioch::TransportMixture<libMesh::Real> & trans_mix,
76  viscosity_type<Antioch::SutherlandViscosity<libMesh::Real> > )
77  {
78  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real>,libMesh::Real> >
79  viscosity( new Antioch::MixtureViscosity<Antioch::SutherlandViscosity<libMesh::Real>,libMesh::Real>(trans_mix) );
80 
81  std::string sutherland_data = input("Materials/"+material+"/GasMixture/Antioch/sutherland_data", "default");
82  if( sutherland_data == "default" )
83  sutherland_data = Antioch::DefaultInstallFilename::sutherland_data();
84 
85  Antioch::read_sutherland_data_ascii( *(viscosity.get()), sutherland_data );
86 
87  return viscosity;
88  }
89 
90  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real>,libMesh::Real> >
91  specialized_build_viscosity( const GetPot& input,
92  const std::string& material,
93  const Antioch::TransportMixture<libMesh::Real> & trans_mix,
94  viscosity_type<Antioch::BlottnerViscosity<libMesh::Real> > )
95  {
96  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real>,libMesh::Real> >
97  viscosity( new Antioch::MixtureViscosity<Antioch::BlottnerViscosity<libMesh::Real>,libMesh::Real>(trans_mix) );
98 
99  std::string blottner_data = input("Materials/"+material+"/GasMixture/Antioch/blottner_data", "default");
100  if( blottner_data == "default" )
101  blottner_data = Antioch::DefaultInstallFilename::blottner_data();
102 
103  Antioch::read_blottner_data_ascii( *(viscosity.get()), blottner_data );
104 
105  return viscosity;
106  }
107 
108 #ifdef ANTIOCH_HAVE_GSL
109  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >
110  specialized_build_viscosity( const GetPot& /*input*/,
111  const std::string& /*material*/,
112  const Antioch::TransportMixture<libMesh::Real> & trans_mix,
113  viscosity_type<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner> > )
114  {
115  libMesh::UniquePtr<Antioch::MixtureViscosity<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >
116  viscosity( new Antioch::MixtureViscosity<Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real>(trans_mix) );
117 
118  Antioch::build_kinetics_theory_viscosity<libMesh::Real,Antioch::GSLSpliner>( *(viscosity.get()) );
119 
120  return viscosity;
121  }
122 #endif // ANTIOCH_HAVE_GSL
123 
124 
125  libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::ConstantLewisDiffusivity<libMesh::Real>,libMesh::Real> >
126  specialized_build_diffusivity( const GetPot& input,
127  const std::string& material,
128  const Antioch::TransportMixture<libMesh::Real> & trans_mix,
129  diffusivity_type<Antioch::ConstantLewisDiffusivity<libMesh::Real> > )
130  {
131  libMesh::Real Le = MaterialsParsing::parse_lewis_number(input,material);
132 
133  libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::ConstantLewisDiffusivity<libMesh::Real>,libMesh::Real> >
134  diffusivity( new Antioch::MixtureDiffusion<Antioch::ConstantLewisDiffusivity<libMesh::Real>,libMesh::Real>(trans_mix) );
135 
136  Antioch::build_constant_lewis_diffusivity<libMesh::Real>( *(diffusivity.get()), Le);
137 
138  return diffusivity;
139  }
140 
141 #ifdef ANTIOCH_HAVE_GSL
142  libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >
143  specialized_build_diffusivity( const GetPot& /*input*/,
144  const std::string& /*material*/,
145  const Antioch::TransportMixture<libMesh::Real> & trans_mix,
146  diffusivity_type<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> > )
147  {
148  return libMesh::UniquePtr<Antioch::MixtureDiffusion<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real> >
149  ( new Antioch::MixtureDiffusion<Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner>,libMesh::Real>(trans_mix) );
150  }
151 #endif // ANTIOCH_HAVE_GSL
152 
153  };
154 
155 
156  template<typename KT, typename T, typename V, typename C, typename D>
157  inline
158  libMesh::UniquePtr<AntiochMixtureAveragedTransportMixture<KT,T,V,C,D> >
160  build_mixture( const GetPot & input, const std::string & material )
161  {
162  libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > chem_mix =
163  this->build_chem_mix(input,material);
164 
165  libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> > reaction_set =
166  this->build_reaction_set(input,material,*chem_mix);
167 
168  libMesh::UniquePtr<Antioch::NASAThermoMixture<libMesh::Real,KT> > kinetics_thermo =
169  this->build_nasa_thermo_mix<KT>(input,material,*chem_mix);
170 
171  libMesh::UniquePtr<Antioch::TransportMixture<libMesh::Real> > trans_mix =
172  this->build_transport_mixture(input,material,*chem_mix);
173 
174  libMesh::UniquePtr<Antioch::MixtureAveragedTransportMixture<libMesh::Real> > wilke_mix =
175  this->build_mix_avg_trans_mixture(*trans_mix);
176 
177  libMesh::UniquePtr<Antioch::MixtureViscosity<V,libMesh::Real> > visc =
178  this->build_viscosity<V>(input,material,*trans_mix);
179 
180  libMesh::UniquePtr<Antioch::MixtureDiffusion<D,libMesh::Real> > diff =
181  this->build_diffusivity<D>(input,material,*trans_mix);
182 
183  libMesh::Real min_T = this->parse_min_T(input,material);
184  bool clip_negative_rho = this->parse_clip_negative_rho(input,material);
185 
186  return libMesh::UniquePtr<AntiochMixtureAveragedTransportMixture<KT,T,V,C,D> >
188  (chem_mix, reaction_set, kinetics_thermo, trans_mix, wilke_mix, visc, diff, min_T, clip_negative_rho) );
189  }
190 
191 } // end namespace GRINS
192 
193 #endif // GRINS_HAVE_ANTIOCH
194 
195 #endif // GRINS_ANTIOCH_MIXTURE_AVERAGED_TRANSPORT_MIXTURE_BUILDER_H
libMesh::UniquePtr< Antioch::MixtureViscosity< Antioch::SutherlandViscosity< libMesh::Real >, libMesh::Real > > specialized_build_viscosity(const GetPot &input, const std::string &material, const Antioch::TransportMixture< libMesh::Real > &trans_mix, viscosity_type< Antioch::SutherlandViscosity< libMesh::Real > >)
bool parse_clip_negative_rho(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::MixtureDiffusion< Antioch::ConstantLewisDiffusivity< libMesh::Real >, libMesh::Real > > specialized_build_diffusivity(const GetPot &input, const std::string &material, const Antioch::TransportMixture< libMesh::Real > &trans_mix, diffusivity_type< Antioch::ConstantLewisDiffusivity< libMesh::Real > >)
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > build_reaction_set(const GetPot &input, const std::string &material, const Antioch::ChemicalMixture< libMesh::Real > &chem_mix)
Base class building Antioch mixture wrappers.
Wrapper class for storing state for computing Wilke transport properties using Antioch.
libMesh::UniquePtr< Antioch::MixtureViscosity< Viscosity, libMesh::Real > > build_viscosity(const GetPot &input, const std::string &material, const Antioch::TransportMixture< libMesh::Real > &trans_mix)
GRINS namespace.
static libMesh::Real parse_lewis_number(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::MixtureDiffusion< Diffusivity, libMesh::Real > > build_diffusivity(const GetPot &input, const std::string &material, const Antioch::TransportMixture< libMesh::Real > &trans_mix)
libMesh::UniquePtr< Antioch::MixtureAveragedTransportMixture< libMesh::Real > > build_mix_avg_trans_mixture(const Antioch::TransportMixture< libMesh::Real > &trans_mix)
libMesh::UniquePtr< Antioch::MixtureViscosity< Antioch::BlottnerViscosity< libMesh::Real >, libMesh::Real > > specialized_build_viscosity(const GetPot &input, const std::string &material, const Antioch::TransportMixture< libMesh::Real > &trans_mix, viscosity_type< Antioch::BlottnerViscosity< libMesh::Real > >)
libMesh::UniquePtr< Antioch::TransportMixture< libMesh::Real > > build_transport_mixture(const GetPot &input, const std::string &material, const Antioch::ChemicalMixture< libMesh::Real > &chem_mix)
libMesh::Real parse_min_T(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > build_chem_mix(const GetPot &input, const std::string &material)
libMesh::UniquePtr< AntiochMixtureAveragedTransportMixture< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity > > build_mixture(const GetPot &input, const std::string &material)

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