GRINS-0.8.0
antioch_mixture.C
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 #include "grins_config.h"
27 
28 #ifdef GRINS_HAVE_ANTIOCH
29 
30 // This class
31 #include "grins/antioch_mixture.h"
33 
34 // GRINS
36 
37 // libMesh
38 #include "libmesh/getpot.h"
39 #include "libmesh/parameter_multiaccessor.h"
40 
41 // Antioch
42 #include "antioch/read_reaction_set_data.h"
43 #include "antioch/nasa_mixture_parsing.h"
44 #include "antioch/stat_mech_thermo.h"
45 
46 namespace GRINS
47 {
48  template <typename KineticsThermoCurveFit>
50  const std::string& material )
51  : AntiochChemistry(input,material),
52  _reaction_set( new Antioch::ReactionSet<libMesh::Real>( (*_antioch_gas.get()) ) ),
53  _nasa_mixture( new Antioch::NASAThermoMixture<libMesh::Real,KineticsThermoCurveFit>( (*_antioch_gas.get()) ) ),
54  _minimum_T( input( "Materials/"+material+"/GasMixture/Antioch/minimum_T", -std::numeric_limits<libMesh::Real>::max() ) ),
55  _clip_negative_rho( input( "Materials/"+material+"/GasMixture/Antioch/clip_negative_rho", false) )
56  {
57  {
58  std::string warning = "==============================================\n";
59  warning += "WARNING: This AntiochMixture constructor is DEPREACTED!\n";
60  warning += " Prefer alternate constructor where parsing\n";
61  warning += " is done outside this class.\n";
62  warning += "==============================================\n";
63 
64  libmesh_warning(warning);
65  }
66 
67  std::string kinetics_data_filename = MaterialsParsing::parse_chemical_kinetics_datafile_name( input, material );
68 
69  bool verbose_read = input("screen-options/verbose_kinetics_read", false );
70 
71  Antioch::read_reaction_set_data_xml<libMesh::Real>( kinetics_data_filename, verbose_read, *_reaction_set.get() );
72 
73  std::string cea_data_filename = input( "Materials/"+material+"/GasMixture/Antioch/cea_data", "default" );
74  if( cea_data_filename == std::string("default") )
75  cea_data_filename = Antioch::DefaultInstallFilename::thermo_data();
76 
77  Antioch::read_nasa_mixture_data( *_nasa_mixture.get(), cea_data_filename, Antioch::ASCII, true );
78 
80  }
81 
82  template <typename KineticsThermoCurveFit>
84  ( libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > & chem_mixture,
85  libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> > & reaction_set,
86  libMesh::UniquePtr<Antioch::NASAThermoMixture<libMesh::Real,KineticsThermoCurveFit> > & nasa_mixture,
87  libMesh::Real min_T,
88  bool clip_negative_rho )
89  : AntiochChemistry(chem_mixture),
90  _minimum_T(min_T),
91  _clip_negative_rho(clip_negative_rho)
92  {
94  _reaction_set.reset( reaction_set.release() );
95  _nasa_mixture.reset( nasa_mixture.release() );
96 
97  this->build_stat_mech_ref_correction();
98  }
99 
100  template <typename KineticsThermoCurveFit>
102  ( const std::string & param_name,
104  {
105  // Use common code for any GRINS parameters
106  AntiochChemistry::register_parameter(param_name, param_pointer);
107 
108  // Create a special setter/getter for any Antioch-only parameters
109  if (param_name.find("Antioch") == 0) // name starts with Antioch
110  param_pointer.push_back
112  (*this->_reaction_set.get(), param_name));
113  }
114 
115  template <typename KineticsThermoCurveFit>
117  {
118  Antioch::StatMechThermodynamics<libMesh::Real> thermo( *(this->_antioch_gas.get()) );
119 
120  _h_stat_mech_ref_correction.resize(this->n_species());
121 
122  for( unsigned int s = 0; s < this->n_species(); s++ )
123  {
124  _h_stat_mech_ref_correction[s] = -thermo.h_tot( s, 298.15 ) + thermo.e_0(s);
125  }
126  }
127 
128 }// end namespace GRINS
129 
130 #endif // GRINS_HAVE_ANTIOCH
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
Wrapper class for Antioch::ChemicalMixture.
GRINS namespace.
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > _nasa_mixture
static std::string parse_chemical_kinetics_datafile_name(const GetPot &input, const std::string &material)
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.

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