GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes | Private Member Functions
GRINS::CanteraKinetics Class Reference

#include <cantera_kinetics.h>

Public Member Functions

 CanteraKinetics (CanteraMixture &mixture)
 
 ~CanteraKinetics ()
 
void omega_dot (const libMesh::Real &T, const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &omega_dot) const
 

Protected Attributes

Cantera::IdealGasMix & _cantera_gas
 

Private Member Functions

 CanteraKinetics ()
 

Detailed Description

Definition at line 54 of file cantera_kinetics.h.

Constructor & Destructor Documentation

GRINS::CanteraKinetics::CanteraKinetics ( CanteraMixture mixture)

Definition at line 48 of file cantera_kinetics.C.

49  : _cantera_gas( mixture.get_chemistry() )
50  {}
Cantera::IdealGasMix & _cantera_gas
GRINS::CanteraKinetics::~CanteraKinetics ( )
inline

Definition at line 59 of file cantera_kinetics.h.

59 {};
GRINS::CanteraKinetics::CanteraKinetics ( )
private

Member Function Documentation

void GRINS::CanteraKinetics::omega_dot ( const libMesh::Real &  T,
const libMesh::Real  rho,
const std::vector< libMesh::Real > &  mass_fractions,
std::vector< libMesh::Real > &  omega_dot 
) const
Todo:
Need to make sure this will work in a threaded environment. Not sure if we will get thread lock here or not.

Definition at line 52 of file cantera_kinetics.C.

References _cantera_gas.

Referenced by main(), and GRINS::CanteraEvaluator::omega_dot().

55  {
56  libmesh_assert_equal_to( mass_fractions.size(), omega_dot.size() );
57  libmesh_assert_equal_to( mass_fractions.size(), _cantera_gas.nSpecies() );
58  libmesh_assert_greater(T,0.0);
59  libmesh_assert_greater(rho,0.0);
60 
61  {
64  libMesh::Threads::spin_mutex::scoped_lock lock(cantera_mutex);
65 
66  try
67  {
68  _cantera_gas.setState_TRY(T, rho, &mass_fractions[0]);
69  _cantera_gas.getNetProductionRates(&omega_dot[0]);
70  }
71  catch(Cantera::CanteraError)
72  {
73  Cantera::showErrors(std::cerr);
74  libmesh_error();
75  }
76  }
77 
78  for( unsigned int s = 0; s < omega_dot.size(); s++ )
79  {
80  // convert [kmol/m^3-s] to [kg/m^3-s]
81  omega_dot[s] *= this->_cantera_gas.molecularWeight(s);
82  }
83 
84  return;
85  }
void omega_dot(const libMesh::Real &T, const libMesh::Real rho, const std::vector< libMesh::Real > &mass_fractions, std::vector< libMesh::Real > &omega_dot) const
Cantera::IdealGasMix & _cantera_gas

Member Data Documentation

Cantera::IdealGasMix& GRINS::CanteraKinetics::_cantera_gas
protected

Definition at line 67 of file cantera_kinetics.h.

Referenced by omega_dot().


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

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