diff --git a/src/converters/NASA9Parser.cpp b/src/converters/NASA9Parser.cpp index 159326251..02698f38b 100644 --- a/src/converters/NASA9Parser.cpp +++ b/src/converters/NASA9Parser.cpp @@ -208,39 +208,6 @@ bool CKParser::readNASA9ThermoSection(std::vector& names, // Comment string string comment; - - // if "THERMO ALL" specified, or if optionFlag is set to HasTempRange, - // then the next line must be the default temperatures for the database. - // - // This line will have nreg+2 tokens on it - // The last token is a date. - if (0) { - if (optionFlag == NoThermoDatabase || optionFlag == HasTempRange) { - getCKLine(s, comment); - getTokens(s, static_cast(s.size()), toks); - size_t nreg = toks.size(); - if (nreg >= 1) { - temp.resize(nreg+1); - for (size_t i = 0; i <= nreg; i++) { - temp[i] = de_atof(toks[i]); - } - defaultDate = toks[nreg+1]; - } - - if (verbose) { - log.flags(ios::showpoint | ios::fixed); - log.precision(2); - log << endl << " Default # of temperature regions: " << nreg << endl; - log << " "; - for (size_t i = 0; i <= nreg; i++) { - log << temp[i] << " "; - } - log << endl; - } - checkNASA9Temps(log, temp); - } - } - // Check to see that we expect to be reading a NASA9 formatted file if (!m_nasa9fmt) { throw CK_SyntaxError(log, diff --git a/src/kinetics/solveSP.cpp b/src/kinetics/solveSP.cpp index e741d7fad..1b3a8083a 100644 --- a/src/kinetics/solveSP.cpp +++ b/src/kinetics/solveSP.cpp @@ -31,15 +31,6 @@ namespace Cantera static doublereal calc_damping(doublereal* x, doublereal* dx, size_t dim, int*); static doublereal calcWeightedNorm(const doublereal [], const doublereal dx[], size_t); -/*************************************************************************** - * LAPACK PROTOTYPES - ***************************************************************************/ -//#define FSUB_TYPE void -// extern "C" { -// extern FSUB_TYPE dgetrf_(int *, int *, doublereal *, int *, int [], int *); -// extern FSUB_TYPE dgetrs_(char *, int *, int *, doublereal *, int *, int [], -// doublereal [], int *, int *, unsigned int); -// } /*************************************************************************** * solveSP Class Definitinos @@ -92,25 +83,7 @@ solveSP::solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc) : /* * We rely on ordering to figure things out */ - if (1) { - //m_numBulkPhases = m_kin0->nPhases() - 1 - m_numSurfPhases; - // Disable the capability until we figure out what is going on - m_numBulkPhasesSS = 0; - //if (m_numBulkPhasesSS > 0) { - //m_numBulkSpecies.resize(m_numBulkPhasesSS, 0); - //m_bulkPhasePtrs.resize(m_numBulkPhasesSS, 0); - //m_bulkIndex = 1; - //if (m_bulkIndex == surfPhaseIndex) { - // m_bulkIndex += m_numSurfPhases; - //} - - //for (i = 0; i < m_numBulkPhasesSS; i++) { - // m_bulkPhasePtrs[i] = &(m_kin0->thermo(m_bulkIndex + i)); - // m_numBulkSpecies[i] = m_bulkPhasePtrs[i]->nSpecies(); - // m_numTotBulkSpeciesSS += m_numBulkSpecies[i]; - //} - //} - } + m_numBulkPhasesSS = 0; if (bulkFunc == BULK_DEPOSITION) { m_neq = m_numTotSurfSpecies + m_numTotBulkSpeciesSS; @@ -152,20 +125,6 @@ solveSP::solveSP(ImplicitSurfChem* surfChemPtr, int bulkFunc) : m_kinObjIndex[kindexSP] = isp; } } - if (0) { - //for (isp = 0; isp < m_numBulkPhasesSS; isp++) { - //nt iKinObject = m_bulkKinObjID[isp]; - //InterfaceKinetics *m_kin = m_objects[iKinObject]; - //int bulkIndex = m_bulkKinObjPhaseID[isp]; - //kstart = m_kin->kineticsSpeciesIndex(0, bulkIndex); - //nsp = m_numBulkSpecies[isp]; - //m_eqnIndexStartSolnPhase[isp] = kindexSP; - //for (k = 0; k < nsp; k++, kindexSP++) { - // m_kinSpecIndex[kindexSP] = kstart + k; - // m_kinObjIndex[kindexSP] = m_numSurfPhases + isp; - //} - //} - } // Dimension solution vector size_t dim1 = std::max(1, m_neq); @@ -247,17 +206,6 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, } } - if (m_bulkFunc == BULK_DEPOSITION) { - //for (isp = 0; isp < m_numBulkPhasesSS; isp++) { - //ThermoPhase *bf_ptr = m_bulkPhasePtrs[isp]; - //bf_ptr->getConcentrations(DATA_PTR(m_numEqn1)); - //int nsp = m_numBulkSpecies[isp]; - //for (k = 0; k < nsp; k++, kindex++) { - // m_CSolnSP[loc] = m_numEqn1[k]; - // loc++; - //} - //} - } std::copy(m_CSolnSP.begin(), m_CSolnSP.end(), m_CSolnSPInit.begin()); // Calculate the largest species in each phase @@ -362,8 +310,6 @@ int solveSP::solveSurfProb(int ifunc, doublereal time_scale, doublereal TKelvin, /* * Solve Linear system (with LAPACK). The solution is in resid[] */ - // (void) dgetrf_(&m_neq, &m_neq, m_JacCol[0], &m_neq, - // DATA_PTR(m_ipiv), &info); ct_dgetrf(m_neq, m_neq, m_JacCol[0], m_neq, DATA_PTR(m_ipiv), info); if (info==0) { ct_dgetrs(ctlapack::NoTranspose, m_neq, nrhs, m_JacCol[0], @@ -508,12 +454,6 @@ void solveSP::updateState(const doublereal* CSolnSP) m_ptrsSurfPhase[n]->setConcentrations(CSolnSP + loc); loc += m_nSpeciesSurfPhase[n]; } - //if (m_bulkFunc == BULK_DEPOSITION) { - // for (int n = 0; n < m_numBulkPhasesSS; n++) { - // m_bulkPhasePtrs[n]->setConcentrations(CSolnSP + loc); - // loc += m_numBulkSpecies[n]; - // } - //} } /* @@ -525,12 +465,6 @@ void solveSP::updateMFSolnSP(doublereal* XMolSolnSP) size_t keqnStart = m_eqnIndexStartSolnPhase[isp]; m_ptrsSurfPhase[isp]->getMoleFractions(XMolSolnSP + keqnStart); } - //if (m_bulkFunc == BULK_DEPOSITION) { - // for (int isp = 0; isp < m_numBulkPhasesSS; isp++) { - // int keqnStart = m_eqnIndexStartSolnPhase[isp + m_numSurfPhases]; - // m_bulkPhasePtrs[isp]->getMoleFractions(XMolSolnSP + keqnStart); - // } - //} } /* diff --git a/src/thermo/Elements.cpp b/src/thermo/Elements.cpp index a6ef7e3d3..c0ece8d5c 100644 --- a/src/thermo/Elements.cpp +++ b/src/thermo/Elements.cpp @@ -5,10 +5,6 @@ // Copyright 2003 California Institute of Technology -#ifdef WIN32 -#pragma warning(disable:4786) -#endif - #include "cantera/thermo/Elements.h" #include "cantera/base/xml.h" #include "cantera/base/ctml.h" @@ -18,9 +14,6 @@ using namespace ctml; using namespace std; -#ifdef USE_DGG_CODE -#include -#endif #include namespace Cantera @@ -280,20 +273,6 @@ void Elements::freezeElements() m_elementsFrozen = true; } -#ifdef INCL_DEPRECATED_METHODS -/* - * - * Returns an ElementData struct that contains the parameters - * for element index m. - */ -ElementData Elements::element(int m) const -{ - ElementData e; - e.name = m_elementNames[m]; - e.atomicWeight = m_atomicWeights[m]; - return e; -} -#endif /* * elementIndex(): * @@ -304,17 +283,6 @@ ElementData Elements::element(int m) const * returned. * */ -#ifdef USE_DGG_CODE -int Elements::elementIndex(std::string name) const -{ - map::const_iterator it; - it = m_definedElements.find(name); - if (it != m_definedElements.end()) { - return it->second; - } - return -1; -} -#else int Elements::elementIndex(std::string name) const { for (int i = 0; i < m_mm; i++) { @@ -324,7 +292,6 @@ int Elements::elementIndex(std::string name) const } return -1; } -#endif /* * @@ -413,9 +380,6 @@ addElement(const std::string& symbol, doublereal weight) } m_atomicWeights.push_back(weight); m_elementNames.push_back(symbol); -#ifdef USE_DGG_CODE - m_definedElements[symbol] = nElements() + 1; -#endif if (symbol == "E") { m_elem_type.push_back(CT_ELEM_TYPE_ELECTRONCHARGE); } else { @@ -446,45 +410,6 @@ addElement(const XML_Node& e) * The default weight is a special value, which will cause the * routine to look up the actual weight via a string lookup. */ -#ifdef USE_DGG_CODE -void Elements:: -addUniqueElement(const std::string& symbol, doublereal weight, int atomicNumber, - doublereal entropy298, int elem_type) -{ - if (m_elementsFrozen) { - throw ElementsFrozen("addElement"); - } - - if (weight == -12345.0) { - weight = LookupWtElements(symbol); - } - - /* - * First decide if this element has been previously added. - * If it unique, add it to the list. - */ - - int i = m_definedElements[symbol] - 1; - if (i < 0) { - m_atomicWeights.push_back(weight); - m_elementNames.push_back(symbol); - m_atomicNumbers.push_back(atomicNumber); - m_entropy298.push_back(entropy298); - if (symbol == "E") { - m_elem_type.push_back(CT_ELEM_TYPE_ELECTRONCHARGE); - } else { - m_elem_type.push_back(elem_type); - } - m_mm++; - } else { - if (m_atomicWeights[i] != weight) { - throw CanteraError("AddUniqueElement", - "Duplicate Elements (" + symbol + ") have different weights"); - } - } -} - -#else void Elements:: addUniqueElement(const std::string& symbol, doublereal weight, int atomicNumber, doublereal entropy298, @@ -532,8 +457,6 @@ addUniqueElement(const std::string& symbol, } } } -#endif - /* * @todo call addUniqueElement(symbol, weight) instead of diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index a383766ef..67295dff2 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -1242,7 +1242,6 @@ doublereal RedlichKwongMFTP::hresid() const */ doublereal RedlichKwongMFTP::liquidVolEst(doublereal TKelvin, doublereal& presGuess) const { - double v = m_b_current * 1.1; double atmp; double btmp; @@ -1255,21 +1254,6 @@ doublereal RedlichKwongMFTP::liquidVolEst(doublereal TKelvin, doublereal& presGu } double Vroot[3]; -#ifdef NNN - if (TKelvin == 308.) { - double pVec[100]; - int n = 0; - for (int i = 0; i < 100; i++) { - pVec[n++] = 6.8E6 + 2.0E5 * i; - } - - for (int i = 0; i < 100; i++) { - int nsol = NicholsSolve(TKelvin, pVec[i], atmp, btmp, Vroot); - printf("nsol = %d, p = %g, T = %g, v[0] = %g, v[1] %g, v[2] = %g\n", nsol, pVec[i], TKelvin, Vroot[0], Vroot[1], Vroot[2]); - } - } -#endif - bool foundLiq = false; int m = 0; do { @@ -1291,42 +1275,12 @@ doublereal RedlichKwongMFTP::liquidVolEst(doublereal TKelvin, doublereal& presGu } } while ((m < 100) && (!foundLiq)); -#ifdef DONTUSE - int i; - double c; - double vnew; - double deltav; - double sqt = sqrt(TKelvin); - for (i = 0; i < 200; i++) { - c = bCalc * bCalc + bCalc * GasConstant * TKelvin / pres - atmp / (pres * sqt); - vnew = (1.0/c)*(v*v*v - GasConstant * TKelvin *v*v/pp - atmp * bCalc / (pres * sqt)); - deltav = vnew - v; - if (deltav > v*0.2) { - deltav = v * 0.2; - } else if (deltav < - (v * 0.2)) { - deltav = - v * 0.2; - } - v += deltav; - if (fabs(deltav) < 1.0E-6 * v) { - break; - } - } - if (i > 30) { - printf("liquidVolEst problem solve: T = %g , p = %g, a = %g, b = %g\n", TKelvin, pres, atmp, bCalc); - printf(" v final = %g\n", v); - } - if (fabs(deltav) > 1.0E-5 * v) { - throw CanteraError("RedlichKwongMFTP::liquidVolEst(T = " + fp2str(TKelvin) + ", " + fp2str(pres) + ")", - "failed to converge"); - } -#else if (foundLiq) { v = Vroot[0]; presGuess = pres; } else { v = -1.0; } -#endif //printf (" RedlichKwongMFTP::liquidVolEst %g %g converged in %d its\n", TKelvin, pres, i); return v; }