36 if (infile ==
"MetalSHEelectrons_default.xml") {
47 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
48 "Couldn't find phase name in file:" + id_);
51 if (xphase->
child(
"thermo")[
"model"] !=
"MetalSHEelectrons") {
52 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
53 "thermo model attribute must be MetalSHEelectrons");
62 if (id_ != xmlphase[
"id"]) {
63 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
67 if (xmlphase.
child(
"thermo")[
"model"] !=
"MetalSHEelectrons") {
68 throw CanteraError(
"MetalSHEelectrons::MetalSHEelectrons",
69 "thermo model attribute must be MetalSHEelectrons");
112 return cMetalSHEelectrons;
163 "To be removed after Cantera 2.2.");
165 for (
int i = 0; i < 6; i++) {
226 if (!phaseNode.
hasChild(
"thermo")) {
228 "no thermo XML node");
231 doublereal dens = 2.65E3;
242 XML_Node& xv = xtop->addChild(
"validate");
246 XML_Node& xp = xtop->addChild(
"phase");
249 XML_Node& xe = xp.addChild(
"elementArray",
"E");
251 XML_Node& xs = xp.addChild(
"speciesArray",
"she_electron");
252 xs.
addAttribute(
"datasrc",
"#species_Metal_SHEelectrons");
253 XML_Node& xt = xp.addChild(
"thermo");
255 XML_Node& xtr = xp.addChild(
"transport");
257 XML_Node& xk = xp.addChild(
"kinetics");
260 XML_Node& xsd = xtop->addChild(
"speciesData");
263 XML_Node& xsp = xsd.addChild(
"species");
265 xsp.addChild(
"atomArray",
"E:1");
266 xsp.addChild(
"charge",
"-1");
267 XML_Node& xspt = xsp.addChild(
"thermo");
269 XML_Node& xN1 = xspt.addChild(
"NASA");
273 XML_Node& xF1 = xsd.addChild(
"floatArray",
274 "1.172165560E+00, 3.990260375E-03, -9.739075500E-06, "
275 "1.007860470E-08, -3.688058805E-12, -4.589675865E+02, 3.415051190E-01");
279 XML_Node& xN2 = xspt.addChild(
"NASA");
283 XML_Node& xF2 = xsd.addChild(
"floatArray",
284 "1.466432895E+00, 4.133039835E-04, -7.320116750E-08, 7.705017950E-12,"
285 "-3.444022160E-16, -4.065327985E+02, -5.121644350E-01");
305 if ( eosdata[
"model"] !=
"MetalSHEelectrons") {
306 throw CanteraError(
"MetalSHEelectrons::setParametersFromXML",
307 "thermo model attribute must be MetalSHEelectrons");
309 doublereal rho = 2.65E3;
311 rho =
getFloat(eosdata,
"density",
"toSI");
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.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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)
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.
void addAttribute(const std::string &attrib, const std::string &value)
Add or modify an attribute of the current node.
doublereal temperature() const
Temperature (K).
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 getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
doublereal m_press
The current pressure of the solution (Pa)
doublereal getFloatDefaultUnits(const 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.
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 ...
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...