39 if (infile ==
"MetalSHEelectrons_default.xml") {
50 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
51 "Couldn't find phase name in file:" + id_);
55 std::string model = th[
"model"];
56 if (model !=
"MetalSHEelectrons") {
57 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
58 "thermo model attribute must be MetalSHEelectrons");
68 std::string idxml = xmlphase[
"id"];
70 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
75 std::string model = th[
"model"];
76 if (model !=
"MetalSHEelectrons") {
77 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
78 "thermo model attribute must be MetalSHEelectrons");
122 return cMetalSHEelectrons;
172 for (
int i = 0; i < 6; i++) {
242 if (!phaseNode.
hasChild(
"thermo")) {
244 "no thermo XML node");
247 doublereal dens = 2.65E3;
258 XML_Node& xv = xtop->addChild(
"validate");
262 XML_Node& xp = xtop->addChild(
"phase");
265 XML_Node& xe = xp.addChild(
"elementArray",
"E");
267 XML_Node& xs = xp.addChild(
"speciesArray",
"she_electron");
268 xs.
addAttribute(
"datasrc",
"#species_Metal_SHEelectrons");
269 XML_Node& xt = xp.addChild(
"thermo");
271 XML_Node& xtr = xp.addChild(
"transport");
273 XML_Node& xk = xp.addChild(
"kinetics");
276 XML_Node& xsd = xtop->addChild(
"speciesData");
279 XML_Node& xsp = xsd.addChild(
"species");
281 xsp.addChild(
"atomArray",
"E:1");
282 xsp.addChild(
"charge",
"-1");
283 XML_Node& xspt = xsp.addChild(
"thermo");
285 XML_Node& xN1 = xspt.addChild(
"NASA");
289 XML_Node& xF1 = xsd.addChild(
"floatArray",
290 "1.172165560E+00, 3.990260375E-03, -9.739075500E-06, "
291 "1.007860470E-08, -3.688058805E-12, -4.589675865E+02, 3.415051190E-01");
295 XML_Node& xN2 = xspt.addChild(
"NASA");
299 XML_Node& xF2 = xsd.addChild(
"floatArray",
300 "1.466432895E+00, 4.133039835E-04, -7.320116750E-08, 7.705017950E-12,"
301 "-3.444022160E-16, -4.065327985E+02, -5.121644350E-01");
311 doublereal rho = c[0];
325 std::string model = eosdata[
"model"];
326 if (model !=
"MetalSHEelectrons") {
327 throw CanteraError(
"MetalSHEelectrons::setParametersFromXML",
328 "thermo model attribute must be MetalSHEelectrons");
330 doublereal rho = 2.65E3;
virtual doublereal density() const
Density (kg/m^3).
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Class XML_Node is a tree-based representation of the contents of an XML file.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
doublereal getFloat(const Cantera::XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual void getEntropy_R_ref(doublereal *er) const
doublereal molarDensity() const
Molar density (kmol/m^3).
void _updateThermo() const
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
Base class for a phase with thermodynamic properties.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
virtual void getGibbs_RT_ref(doublereal *grt) const
SingleSpeciesTP & operator=(const SingleSpeciesTP &right)
Assignment operator.
Base class for exceptions thrown by Cantera classes.
vector_fp m_h0_RT
Dimensionless enthalpy at the (mtlast, m_p0)
Header for the SingleSpeciesTP class, which is a filter class for ThermoPhase, that eases the constru...
vector_fp m_cp0_R
Dimensionless heat capacity at the (mtlast, m_p0)
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void initThermo()
void addAttribute(const std::string &attrib, const std::string &value)
Add or modify an attribute of the current node.
doublereal temperature() const
Temperature (K).
doublereal getFloatDefaultUnits(const Cantera::XML_Node &parent, const std::string &name, const std::string &defaultUnits, const std::string &type)
Get a floating-point value from a child element with a defined units field.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal m_press
The current pressure of the solution (Pa)
XML_Node * get_XML_NameID(const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
The SingleSpeciesTP class is a filter class for ThermoPhase.
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...