From badc82daf382117379bbd2d9f9ca7937d408b5d4 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 12 Jun 2007 19:39:50 +0000 Subject: [PATCH] Doxygen update Added function documentation. Added error checking on input --- Cantera/src/thermo/HMWSoln.h | 63 ++++++++++++++++++++++++++++ Cantera/src/thermo/HMWSoln_input.cpp | 33 ++++++++++++++- 2 files changed, 95 insertions(+), 1 deletion(-) diff --git a/Cantera/src/thermo/HMWSoln.h b/Cantera/src/thermo/HMWSoln.h index b045bb623..e6ef2210b 100644 --- a/Cantera/src/thermo/HMWSoln.h +++ b/Cantera/src/thermo/HMWSoln.h @@ -2095,11 +2095,74 @@ namespace Cantera { void counterIJ_setup(void) const; + + //! Process an XML node called "binarySaltParameters" + /*! + * This node contains all of the parameters necessary to describe + * the Pitzer model for that particular binary salt. + * This function reads the XML file and writes the coefficients + * it finds to an internal data structures. + * + * @param BinSalt reference to the XML_Node named binarySaltParameters + * containing the + * anion - cation interaction + */ void readXMLBinarySalt(XML_Node &BinSalt); + + //! Process an XML node called "thetaAnion" + /*! + * This node contains all of the parameters necessary to describe + * the binary interactions between two anions. + * + * @param BinSalt reference to the XML_Node named thetaAnion + * containing the + * anion - anion interaction + */ void readXMLThetaAnion(XML_Node &BinSalt); + + //! Process an XML node called "thetaCation" + /*! + * This node contains all of the parameters necessary to describe + * the binary interactions between two cations. + * + * @param BinSalt reference to the XML_Node named thetaCation + * containing the + * cation - cation interaction + */ void readXMLThetaCation(XML_Node &BinSalt); + + //! Process an XML node called "psiCommonAnion" + /*! + * This node contains all of the parameters necessary to describe + * the ternary interactions between one anion and two cations. + * + * @param BinSalt reference to the XML_Node named psiCommonAnion + * containing the + * anion - cation1 - cation2 interaction + */ void readXMLPsiCommonAnion(XML_Node &BinSalt); + + //! Process an XML node called "psiCommonCation" + /*! + * This node contains all of the parameters necessary to describe + * the ternary interactions between one cation and two anions. + * + * @param BinSalt reference to the XML_Node named psiCommonCation + * containing the + * cation - anion1 - anion2 interaction + */ void readXMLPsiCommonCation(XML_Node &BinSalt); + + //! Process an XML node called "lambdaNeutral" + /*! + * This node contains all of the parameters necessary to describe + * the binary interactions between one neutral species and + * any other species (neutral or otherwise) in the mechanism. + * + * @param BinSalt reference to the XML_Node named lambdaNeutral + * containing multiple + * Neutral - species interactions + */ void readXMLLambdaNeutral(XML_Node &BinSalt); diff --git a/Cantera/src/thermo/HMWSoln_input.cpp b/Cantera/src/thermo/HMWSoln_input.cpp index e2e9b042d..277acd2eb 100644 --- a/Cantera/src/thermo/HMWSoln_input.cpp +++ b/Cantera/src/thermo/HMWSoln_input.cpp @@ -58,6 +58,11 @@ namespace Cantera { * it finds to an internal data structures. */ void HMWSoln::readXMLBinarySalt(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "binarySaltParameters") { + throw CanteraError("HMWSoln::readXMLBinarySalt", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; int nParamsFound, i; @@ -226,6 +231,11 @@ namespace Cantera { * the binary interactions between two anions. */ void HMWSoln::readXMLThetaAnion(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "thetaAnion") { + throw CanteraError("HMWSoln::readXMLThetaAnion", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; string iName = BinSalt.attrib("anion1"); @@ -281,6 +291,11 @@ namespace Cantera { * the binary interactions between two cation. */ void HMWSoln::readXMLThetaCation(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "thetaCation") { + throw CanteraError("HMWSoln::readXMLThetaCation", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; string iName = BinSalt.attrib("cation1"); @@ -336,6 +351,11 @@ namespace Cantera { * the binary interactions between two anions and one common cation. */ void HMWSoln::readXMLPsiCommonCation(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "psiCommonCation") { + throw CanteraError("HMWSoln::readXMLPsiCommonCation", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; string kName = BinSalt.attrib("cation"); @@ -424,6 +444,11 @@ namespace Cantera { * the binary interactions between two cations and one common anion. */ void HMWSoln::readXMLPsiCommonAnion(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "psiCommonAnion") { + throw CanteraError("HMWSoln::readXMLPsiCommonAnion", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; string kName = BinSalt.attrib("anion"); @@ -510,6 +535,11 @@ namespace Cantera { * any other species (neutral or otherwise) in the mechanism. */ void HMWSoln::readXMLLambdaNeutral(XML_Node &BinSalt) { + string xname = BinSalt.name(); + if (xname != "lambdaNeutral") { + throw CanteraError("HMWSoln::readXMLLanbdaNeutral", + "Incorrect name for processing this routine: " + xname); + } double *charge = DATA_PTR(m_speciesCharge); string stemp; string iName = BinSalt.attrib("neutral"); @@ -547,7 +577,8 @@ namespace Cantera { m_Lambda_ij(iSpecies,jSpecies) = atofCheck(stemp.c_str()); if (old != 0.0) { if (old != m_Lambda_ij(iSpecies,jSpecies)) { - throw CanteraError("HMWSoln::readXMLLambdaNeutral", "conflicting values"); + throw CanteraError("HMWSoln::readXMLLambdaNeutral", + "conflicting values"); } } }