GRINS-0.8.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-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
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  {
49  std::string warning = "==============================================\n";
50  warning += "WARNING: This AntiochChemistry constructor is DEPREACTED!\n";
51  warning += " Prefer alternate constructor where parsing\n";
52  warning += " is done outside this class.\n";
53  warning += "==============================================\n";
54 
55  libmesh_warning(warning);
56  }
57  std::vector<std::string> species_list;
58  MaterialsParsing::parse_chemical_species(input,material,species_list);
59 
60  bool verbose_antioch_read = input("Materials/"+material+"/GasMixture/Antioch/verbose_read",false);
61 
62  std::string species_data_filename = input("Materials/"+material+"/GasMixture/Antioch/species_data", "default" );
63  if( species_data_filename == std::string("default") )
64  species_data_filename = Antioch::DefaultInstallFilename::chemical_mixture();
65 
66  std::string vibration_data_filename = input("Materials/"+material+"/GasMixture/Antioch/vibration_data", "default" );
67  if( vibration_data_filename == std::string("default") )
68  vibration_data_filename = Antioch::DefaultInstallFilename::vibrational_data();
69 
70  std::string electronic_data_filename = input("Materials/"+material+"/GasMixture/Antioch/electronic_data", "default" );
71  if( electronic_data_filename == std::string("default") )
72  electronic_data_filename = Antioch::DefaultInstallFilename::electronic_data();
73 
74  // By default, Antioch is using its ASCII parser. We haven't added more options yet.
75  _antioch_gas.reset( new Antioch::ChemicalMixture<libMesh::Real>( species_list,
76  verbose_antioch_read,
77  species_data_filename,
78  vibration_data_filename,
79  electronic_data_filename ) );
80  }
81 
83  ( libMesh::UniquePtr<Antioch::ChemicalMixture<libMesh::Real> > & chem_mixture )
84  : ParameterUser("AntiochChemistry")
85  {
87  _antioch_gas.reset( chem_mixture.release() );
88  }
89 
90  std::string AntiochChemistry::species_name( unsigned int species_index ) const
91  {
92  libmesh_assert_less(species_index, _antioch_gas->n_species());
93 
94  return _antioch_gas->species_inverse_name_map().find(species_index)->second;
95  }
96 
97 }// end namespace GRINS
98 
99 #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 Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1