GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions
GRINS::AntiochMixture< KineticsThermoCurveFit > Class Template Reference

Wrapper class for storing state for Antioch thermo and kinetics. More...

#include <antioch_kinetics.h>

Inheritance diagram for GRINS::AntiochMixture< KineticsThermoCurveFit >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::AntiochMixture< KineticsThermoCurveFit >:
Collaboration graph
[legend]

Public Member Functions

 AntiochMixture (const GetPot &input, const std::string &material)
 Deprecated Constructor. More...
 
 AntiochMixture (libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > &chem_mixture, libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > &reaction_set, libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > &nasa_mixture, libMesh::Real min_T=-std::numeric_limits< libMesh::Real >::max(), bool clip_negative_rho=false)
 Constructor with user-built objects. More...
 
virtual ~AntiochMixture ()
 
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. More...
 
const Antioch::ReactionSet< libMesh::Real > & reaction_set () const
 
const Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > & nasa_mixture () const
 
libMesh::Real h_stat_mech_ref_correction (unsigned int species) const
 
libMesh::Real minimum_T () const
 
bool clip_negative_rho () const
 
- Public Member Functions inherited from GRINS::AntiochChemistry
 AntiochChemistry (const GetPot &input, const std::string &material)
 Deprecated Constructor. More...
 
 AntiochChemistry (libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > &chem_mixture)
 User passes in built ChemicalMixture and this class takes ownership. More...
 
virtual ~AntiochChemistry ()
 
libMesh::Real M (unsigned int species) const
 Species molar mass (molecular weight), [kg/mol]. More...
 
libMesh::Real M_mix (const std::vector< libMesh::Real > &mass_fractions) const
 Mixture molar mass (molecular weight), [kg/mol]. More...
 
libMesh::Real R (unsigned int species) const
 Species gas constant, [J/kg-K]. More...
 
libMesh::Real R_mix (const std::vector< libMesh::Real > &mass_fractions) const
 Mixture gas constant, [J/kg-K]. More...
 
libMesh::Real X (unsigned int species, libMesh::Real M, libMesh::Real mass_fraction) const
 Species mole fraction, unitless. More...
 
void X (libMesh::Real M, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &mole_fractions) const
 Mole fraction for all species, unitless. More...
 
libMesh::Real molar_density (const unsigned int species, const libMesh::Real rho, const libMesh::Real mass_fraction) const
 Species molar density, [mol/m^3]. More...
 
void molar_densities (const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &molar_densities) const
 Molar density for all species, [mol/m^3]. More...
 
unsigned int n_species () const
 
unsigned int species_index (const std::string &species_name) const
 
std::string species_name (unsigned int species_index) const
 
const Antioch::ChemicalMixture< libMesh::Real > & chemical_mixture () const
 Accessor to underlying Antioch object. More...
 
const AntiochChemistrychemistry () const
 Accessor for this class. More...
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 

Protected Member Functions

void build_stat_mech_ref_correction ()
 

Protected Attributes

libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
 
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > _nasa_mixture
 
std::vector< libMesh::Real > _h_stat_mech_ref_correction
 
libMesh::Real _minimum_T
 
bool _clip_negative_rho
 
- Protected Attributes inherited from GRINS::AntiochChemistry
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
 

Private Member Functions

 AntiochMixture ()
 

Additional Inherited Members

- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 

Detailed Description

template<typename KineticsThermoCurveFit>
class GRINS::AntiochMixture< KineticsThermoCurveFit >

Wrapper class for storing state for Antioch thermo and kinetics.

This class handles caching needed state for Antioch kinetics, and the thermodynamics required for the kinetics evaluation. Currently, we only support NASA type curve fits for required thermodynamic evaluations, but we template on the curve fit type.

This class is expected to be constructed before threads have been forked and will live during the whole program. By default, Antioch is working in SI units. Note that this documentation will always be built regardless if Antioch is included in the GRINS build or not. Check configure output to confirm that Antioch was included in the build.

Definition at line 48 of file antioch_kinetics.h.

Constructor & Destructor Documentation

template<typename KineticsThermoCurveFit >
GRINS::AntiochMixture< KineticsThermoCurveFit >::AntiochMixture ( const GetPot &  input,
const std::string &  material 
)

Deprecated Constructor.

Definition at line 49 of file antioch_mixture.C.

References GRINS::AntiochMixture< KineticsThermoCurveFit >::_nasa_mixture, GRINS::AntiochMixture< KineticsThermoCurveFit >::_reaction_set, GRINS::AntiochMixture< KineticsThermoCurveFit >::build_stat_mech_ref_correction(), and GRINS::MaterialsParsing::parse_chemical_kinetics_datafile_name().

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  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > _nasa_mixture
static std::string parse_chemical_kinetics_datafile_name(const GetPot &input, const std::string &material)
libMesh::Real _minimum_T
template<typename KineticsThermoCurveFit>
GRINS::AntiochMixture< KineticsThermoCurveFit >::AntiochMixture ( libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > &  chem_mixture,
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > &  reaction_set,
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > &  nasa_mixture,
libMesh::Real  min_T = -std::numeric_limits<libMesh::Real>::max(),
bool  clip_negative_rho = false 
)

Constructor with user-built objects.

This constructor expects the user to pass in a ChemicalMixture, ReactionSet, and NASAThermoMixture object already built; this class will take ownership of the pointer.

Todo:
Use std::move when we have C++11

Definition at line 84 of file antioch_mixture.C.

89  : AntiochChemistry(chem_mixture),
90  _minimum_T(min_T),
92  {
94  _reaction_set.reset( reaction_set.release() );
95  _nasa_mixture.reset( nasa_mixture.release() );
96 
98  }
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
bool clip_negative_rho() const
const Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > & nasa_mixture() const
const Antioch::ReactionSet< libMesh::Real > & reaction_set() const
libMesh::UniquePtr< Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > > _nasa_mixture
libMesh::Real _minimum_T
template<typename KineticsThermoCurveFit>
virtual GRINS::AntiochMixture< KineticsThermoCurveFit >::~AntiochMixture ( )
inlinevirtual

Definition at line 83 of file antioch_mixture.h.

83 {};
template<typename KineticsThermoCurveFit>
GRINS::AntiochMixture< KineticsThermoCurveFit >::AntiochMixture ( )
private

Member Function Documentation

template<typename KineticsThermoCurveFit >
void GRINS::AntiochMixture< KineticsThermoCurveFit >::build_stat_mech_ref_correction ( )
protected

Definition at line 116 of file antioch_mixture.C.

Referenced by GRINS::AntiochMixture< KineticsThermoCurveFit >::AntiochMixture().

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  }
libMesh::UniquePtr< Antioch::ChemicalMixture< libMesh::Real > > _antioch_gas
unsigned int n_species() const
std::vector< libMesh::Real > _h_stat_mech_ref_correction
template<typename KineticsThermoCurveFit >
bool GRINS::AntiochMixture< KineticsThermoCurveFit >::clip_negative_rho ( ) const
inline

Definition at line 174 of file antioch_mixture.h.

175  {
176  return _clip_negative_rho;
177  }
template<typename KineticsThermoCurveFit >
libMesh::Real GRINS::AntiochMixture< KineticsThermoCurveFit >::h_stat_mech_ref_correction ( unsigned int  species) const
inline

Definition at line 160 of file antioch_mixture.h.

161  {
162  return _h_stat_mech_ref_correction[species];
163  }
std::vector< libMesh::Real > _h_stat_mech_ref_correction
template<typename KineticsThermoCurveFit >
libMesh::Real GRINS::AntiochMixture< KineticsThermoCurveFit >::minimum_T ( ) const
inline

Definition at line 167 of file antioch_mixture.h.

168  {
169  return _minimum_T;
170  }
libMesh::Real _minimum_T
template<typename KineticsThermoCurveFit >
const Antioch::NASAThermoMixture< libMesh::Real, KineticsThermoCurveFit > & GRINS::AntiochMixture< KineticsThermoCurveFit >::nasa_mixture ( ) const
inline
template<typename KineticsThermoCurveFit >
const Antioch::ReactionSet< libMesh::Real > & GRINS::AntiochMixture< KineticsThermoCurveFit >::reaction_set ( ) const
inline

Definition at line 144 of file antioch_mixture.h.

145  {
146  return *_reaction_set.get();
147  }
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
template<typename KineticsThermoCurveFit >
void GRINS::AntiochMixture< KineticsThermoCurveFit >::register_parameter ( const std::string &  param_name,
libMesh::ParameterMultiAccessor< libMesh::Number > &  param_pointer 
) const
virtual

Each subclass will register its copy of an independent.

Reimplemented from GRINS::ParameterUser.

Definition at line 102 of file antioch_mixture.C.

References GRINS::ParameterUser::register_parameter().

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
111  (ParameterAntiochReset
112  (*this->_reaction_set.get(), param_name));
113  }
libMesh::UniquePtr< Antioch::ReactionSet< libMesh::Real > > _reaction_set
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.

Member Data Documentation

template<typename KineticsThermoCurveFit>
bool GRINS::AntiochMixture< KineticsThermoCurveFit >::_clip_negative_rho
protected

Definition at line 132 of file antioch_mixture.h.

template<typename KineticsThermoCurveFit>
std::vector<libMesh::Real> GRINS::AntiochMixture< KineticsThermoCurveFit >::_h_stat_mech_ref_correction
protected

Definition at line 112 of file antioch_mixture.h.

template<typename KineticsThermoCurveFit>
libMesh::Real GRINS::AntiochMixture< KineticsThermoCurveFit >::_minimum_T
protected

Definition at line 123 of file antioch_mixture.h.

template<typename KineticsThermoCurveFit>
libMesh::UniquePtr<Antioch::NASAThermoMixture<libMesh::Real,KineticsThermoCurveFit> > GRINS::AntiochMixture< KineticsThermoCurveFit >::_nasa_mixture
protected
template<typename KineticsThermoCurveFit>
libMesh::UniquePtr<Antioch::ReactionSet<libMesh::Real> > GRINS::AntiochMixture< KineticsThermoCurveFit >::_reaction_set
protected

The documentation for this class was generated from the following files:

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