GRINS-0.7.0
antioch_chemistry.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
32 
33 // GRINS
35 
36 // Antioch
37 #include "antioch/default_filename.h"
38 
39 // libMesh
40 #include "libmesh/getpot.h"
41 
42 namespace GRINS
43 {
44  AntiochChemistry::AntiochChemistry( const GetPot& input,
45  const std::string& material )
46  : ParameterUser("AntiochChemistry")
47  {
48  std::vector<std::string> species_list;
49  MaterialsParsing::parse_chemical_species(input,material,species_list);
50 
51  bool verbose_antioch_read = input("Materials/"+material+"/GasMixture/Antioch/verbose_read",false);
52 
53  std::string species_data_filename = input("Materials/"+material+"/GasMixture/Antioch/species_data", "default" );
54  if( species_data_filename == std::string("default") )
55  species_data_filename = Antioch::DefaultInstallFilename::chemical_mixture();
56 
57  std::string vibration_data_filename = input("Materials/"+material+"/GasMixture/Antioch/vibration_data", "default" );
58  if( vibration_data_filename == std::string("default") )
59  vibration_data_filename = Antioch::DefaultInstallFilename::vibrational_data();
60 
61  std::string electronic_data_filename = input("Materials/"+material+"/GasMixture/Antioch/electronic_data", "default" );
62  if( electronic_data_filename == std::string("default") )
63  electronic_data_filename = Antioch::DefaultInstallFilename::electronic_data();
64 
65  // By default, Antioch is using its ASCII parser. We haven't added more options yet.
66  _antioch_gas.reset( new Antioch::ChemicalMixture<libMesh::Real>( species_list,
67  verbose_antioch_read,
68  species_data_filename,
69  vibration_data_filename,
70  electronic_data_filename ) );
71  }
72 
74  {
75  return;
76  }
77 
78  std::string AntiochChemistry::species_name( unsigned int species_index ) const
79  {
80  libmesh_assert_less(species_index, _antioch_gas->n_species());
81 
82  return _antioch_gas->species_inverse_name_map().find(species_index)->second;
83  }
84 
85 }// end namespace GRINS
86 
87 #endif // GRINS_HAVE_ANTIOCH
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
GRINS namespace.
std::string species_name(unsigned int species_index) const
ParameterUser base class. Utility methods for subclasses.
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.

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