GRINS-0.7.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-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 #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/cea_mixture_ascii_parsing.h"
44 #include "antioch/stat_mech_thermo.h"
45 
46 namespace GRINS
47 {
48  AntiochMixture::AntiochMixture( const GetPot& input,
49  const std::string& material )
50  : AntiochChemistry(input,material),
51  _reaction_set( new Antioch::ReactionSet<libMesh::Real>( (*_antioch_gas.get()) ) ),
52  _cea_mixture( new Antioch::CEAThermoMixture<libMesh::Real>( (*_antioch_gas.get()) ) )
53  {
54  std::string kinetics_data_filename = MaterialsParsing::parse_chemical_kinetics_datafile_name( input, material );
55 
56  bool verbose_read = input("screen-options/verbose_kinetics_read", false );
57 
58  Antioch::read_reaction_set_data_xml<libMesh::Real>( kinetics_data_filename, verbose_read, *_reaction_set.get() );
59 
60  std::string cea_data_filename = input( "Materials/"+material+"/GasMixture/Antioch/cea_data", "default" );
61  if( cea_data_filename == std::string("default") )
62  cea_data_filename = Antioch::DefaultInstallFilename::thermo_data();
63 
64  Antioch::read_cea_mixture_data_ascii( *_cea_mixture.get(), cea_data_filename );
65 
67  }
68 
70  ( const std::string & param_name,
72  const
73  {
74  // Use common code for any GRINS parameters
75  AntiochChemistry::register_parameter(param_name, param_pointer);
76 
77  // Create a special setter/getter for any Antioch-only parameters
78  if (param_name.find("Antioch") == 0) // name starts with Antioch
79  param_pointer.push_back
81  (*this->_reaction_set.get(), param_name));
82  }
83 
84 
86  {
87  Antioch::StatMechThermodynamics<libMesh::Real> thermo( *(this->_antioch_gas.get()) );
88 
89  _h_stat_mech_ref_correction.resize(this->n_species());
90 
91  for( unsigned int s = 0; s < this->n_species(); s++ )
92  {
93  _h_stat_mech_ref_correction[s] = -thermo.h_tot( s, 298.15 ) + thermo.e_0(s);
94  }
95  }
96 
97 }// end namespace GRINS
98 
99 #endif // GRINS_HAVE_ANTIOCH
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int n_species() const
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
Wrapper class for Antioch::ChemicalMixture.
GRINS namespace.
void build_stat_mech_ref_correction()
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.
libMesh::UniquePtr< Antioch::CEAThermoMixture< libMesh::Real > > _cea_mixture
std::vector< libMesh::Real > _h_stat_mech_ref_correction
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.

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