27 CanteraError(
"LTPspecies",
"error parsing transport data: " + msg +
"\n") {
44 doublereal& A, doublereal& b, doublereal& E)
52 LTPspecies::LTPspecies() :
54 m_model(LTP_TD_NOTSET),
55 m_property(TP_UNKNOWN),
67 doublereal LTPspecies::getSpeciesTransProp()
72 bool LTPspecies::checkPositive()
const 74 return (m_coeffs[0] > 0);
77 doublereal LTPspecies::getMixWeight()
const 82 void LTPspecies::adjustCoeffsForComposition()
86 LTPspecies_Const::LTPspecies_Const()
88 m_model = LTP_TD_CONSTANT;
91 void LTPspecies_Const::setupFromXML(
const XML_Node& propNode)
101 void LTPspecies_Const::setCoeff(
double C)
111 doublereal LTPspecies_Const::getSpeciesTransProp()
116 LTPspecies_Arrhenius::LTPspecies_Arrhenius()
118 m_model = LTP_TD_ARRHENIUS;
123 LTPspecies* LTPspecies_Arrhenius::duplMyselfAsLTPspecies()
const 128 void LTPspecies_Arrhenius::setupFromXML(
const XML_Node& propNode)
130 doublereal A_k, n_k, Tact_k;
135 setCoeffs(A_k, n_k, Tact_k);
138 void LTPspecies_Arrhenius::setCoeffs(
double A,
double n,
double Tact)
140 m_coeffs = {A, n, Tact, log(A)};
143 doublereal LTPspecies_Arrhenius::getSpeciesTransProp()
145 doublereal t = m_thermo->temperature();
154 m_logt = log(m_temp);
156 if (m_property == TP_VISCOSITY) {
157 m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt + m_coeffs[2] / m_temp;
159 m_logProp = m_coeffs[3] + m_coeffs[1] * m_logt - m_coeffs[2] / m_temp;
161 m_prop = exp(m_logProp);
166 LTPspecies_Poly::LTPspecies_Poly() :
182 setCoeffs(coeffs.size(), coeffs.data());
185 void LTPspecies_Poly::setCoeffs(
size_t N,
const double* coeffs)
197 for (
int i = 0; i < (int)
m_coeffs.size() ; i++) {
205 LTPspecies_ExpT::LTPspecies_ExpT() :
221 setCoeffs(coeffs.size(), coeffs.data());
224 void LTPspecies_ExpT::setCoeffs(
size_t N,
const double* coeffs)
235 doublereal tempN = 1.0;
236 doublereal tmp = 0.0;
237 for (
int i = 1; i < (int)
m_coeffs.size() ; i++) {
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
std::string name() const
Returns the name of the XML node.
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
doublereal temperature() const
Temperature (K).
size_t getFloatArray(const XML_Node &node, vector_fp &v, const bool convert, const std::string &unitsString, const std::string &nodeName)
This function reads the current node or a child node of the current node with the default name...
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
doublereal getSpeciesTransProp()
Returns the vector of standard state species transport property.
Class XML_Node is a tree-based representation of the contents of an XML file.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Header file defining class LTPspecies and its child classes.
Class LTPspecies_Arrhenius holds transport parameters for a specific liquid- phase species (LTPspecie...
virtual LTPspecies * duplMyselfAsLTPspecies() const
Duplication routine.
const thermo_t * m_thermo
Pointer to a const thermo object to get current temperature.
doublereal getFloatCurrent(const XML_Node &node, const std::string &type)
Get a floating-point value from the current XML element.
LTPTemperatureDependenceType m_model
Model type for the temperature dependence.
Base class for exceptions thrown by Cantera classes.
vector_fp m_coeffs
Model temperature-dependence ceofficients.
virtual void setupFromXML(const XML_Node &propNode)
Set up the species transport property from the XML node, <propNode> that is a child of the <transport...
doublereal getSpeciesTransProp()
Returns the vector of standard state species transport property.
Class LTPspecies_Const holds transport parameters for a specific liquid- phase species (LTPspecies) w...
Class LTPspecies holds transport parameterizations for a specific liquid- phase species.
Class LTPspecies_ExpT holds transport parameters for a specific liquid- phase species (LTPspecies) wh...
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
doublereal m_prop
most recent evaluation of transport property
doublereal m_temp
temperature from thermo object
doublereal m_temp
temperature from thermo object
LTPError(const std::string &msg)
Constructor is a wrapper around CanteraError.
Namespace for the Cantera kernel.
doublereal m_prop
most recent evaluation of the transport property
Class LTPspecies_Poly holds transport parameters for a specific liquid-phase species (LTPspecies) whe...
static void getArrhenius(const XML_Node &node, doublereal &A, doublereal &b, doublereal &E)
Parses the XML element called Arrhenius.
Exception thrown if an error is encountered while reading the transport database. ...