GRINS-0.8.0
antioch_mixture_builder_base.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 #include "grins_config.h"
26 
27 #ifdef GRINS_HAVE_ANTIOCH
28 
29 // This class
31 
32 // GRINS
34 
35 // Antioch
36 #include "antioch/default_filename.h"
37 #include "antioch/read_reaction_set_data.h"
38 
39 namespace GRINS
40 {
41  libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> >
42  AntiochMixtureBuilderBase::build_chem_mix( const GetPot & input, const std::string & material )
43  {
44  std::vector<std::string> species_list;
45  MaterialsParsing::parse_chemical_species(input,material,species_list);
46 
47  bool verbose_antioch_read = input("Materials/"+material+"/GasMixture/Antioch/verbose_read",false);
48 
49  std::string species_data_filename = input("Materials/"+material+"/GasMixture/Antioch/species_data", "default" );
50  if( species_data_filename == std::string("default") )
51  species_data_filename = Antioch::DefaultInstallFilename::chemical_mixture();
52 
53  std::string vibration_data_filename = input("Materials/"+material+"/GasMixture/Antioch/vibration_data", "default" );
54  if( vibration_data_filename == std::string("default") )
55  vibration_data_filename = Antioch::DefaultInstallFilename::vibrational_data();
56 
57  std::string electronic_data_filename = input("Materials/"+material+"/GasMixture/Antioch/electronic_data", "default" );
58  if( electronic_data_filename == std::string("default") )
59  electronic_data_filename = Antioch::DefaultInstallFilename::electronic_data();
60 
61  // By default, Antioch is using its ASCII parser. We haven't added more options yet.
62  return libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> >
63  ( new Antioch::ChemicalMixture<libMesh::Real>( species_list,
64  verbose_antioch_read,
65  species_data_filename,
66  vibration_data_filename,
67  electronic_data_filename ) );
68  }
69 
70  libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> >
71  AntiochMixtureBuilderBase::build_reaction_set( const GetPot & input, const std::string & material,
72  const Antioch::ChemicalMixture<libMesh::Real> & chem_mix )
73  {
74  libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> >
75  reaction_set( new Antioch::ReactionSet<libMesh::Real>(chem_mix) );
76 
77  std::string kinetics_data_filename = MaterialsParsing::parse_chemical_kinetics_datafile_name( input, material );
78 
79  bool verbose_read = input("screen-options/verbose_kinetics_read", false );
80 
81  Antioch::read_reaction_set_data_xml<libMesh::Real>( kinetics_data_filename, verbose_read, *reaction_set );
82 
83  return reaction_set;
84  }
85 
86 } // end namespace GRINS
87 
88 #endif // GRINS_HAVE_ANTIOCH
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > build_reaction_set(const GetPot &input, const std::string &material, const Antioch::ChemicalMixture< libMesh::Real > &chem_mix)
GRINS namespace.
static void parse_chemical_species(const GetPot &input, const std::string &material, std::vector< std::string > &species_names)
Helper function for parsing the chemical species.
static std::string parse_chemical_kinetics_datafile_name(const GetPot &input, const std::string &material)
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > build_chem_mix(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