10 #include "cantera/base/config.h"
12 #include "cantera/thermo/mix_defs.h"
32 m_speciesMolarVolume(0),
48 m_speciesMolarVolume(0),
130 std::string idattrib = phaseNode.
id();
131 if (idTarget != idattrib) {
132 throw CanteraError(
"LatticePhase::constructPhaseXML",
"ids don't match");
142 throw CanteraError(
"LatticePhase::constructPhaseXML",
"importPhase failed ");
163 if (inputFile.size() == 0) {
165 "input file is null");
168 std::ifstream fin(path.c_str());
170 throw CanteraError(
"LatticePhase::constructPhaseFile",
"could not open "
171 +path+
" for reading.");
183 "ERROR: Can not find phase named " +
184 id +
" in file named " + inputFile);
186 fxml_phase->
copy(&phaseNode_XML);
292 for (
size_t k = 0; k <
m_kk; k++) {
313 for (
size_t k = 0; k <
m_kk; k++) {
315 mu[k] = RT * (g_RT[k] + log(xx))
325 scale(_h.begin(), _h.end(), hbar, rt);
333 for (
size_t k = 0; k <
m_kk; k++) {
335 sbar[k] = r * (_s[k] - log(xx));
342 for (
size_t k = 0; k <
m_kk; k++) {
355 scale(gibbsrt.begin(), gibbsrt.end(), mu0,
_RT());
363 for (
size_t k = 0; k <
m_kk; k++) {
372 for (
size_t k = 0; k <
m_kk; k++) {
380 std::copy(_s.begin(), _s.end(), sr);
386 doublereal RT =
_RT();
388 for (
size_t k = 0; k <
m_kk; k++) {
396 for (
size_t k = 0; k <
m_kk; k++) {
405 std::copy(_cpr.begin(), _cpr.end(), cpr);
439 for (
size_t k = 0; k <
m_kk; k++) {
506 std::string subname =
"LatticePhase::initThermoXML";
513 std::string mStringa = thNode.
attrib(
"model");
514 std::string mString =
lowercase(mStringa);
515 if (mString !=
"lattice") {
517 "Unknown thermo model: " + mStringa);
521 "Unspecified thermo model");
530 for (
size_t k = 0; k <
m_kk; k++) {
534 throw CanteraError(
" LatticePhase::initThermoXML",
"database problems");
562 for (
size_t k = 0; k <
m_kk; k++) {
584 eosdata.
_require(
"model",
"Lattice");