Removed unused variables identified by compiler warnings
This commit is contained in:
parent
310dec47f0
commit
de7d58805e
25 changed files with 44 additions and 166 deletions
|
|
@ -147,8 +147,6 @@ namespace Cantera {
|
|||
if (Ndec < -301 || Ndec > 301) {
|
||||
return d;
|
||||
}
|
||||
double sgn = 1.0;
|
||||
if (d < 0.0) sgn = -1.0;
|
||||
double dfabs = fabs(d);
|
||||
double pdec = pow(10.0, (double) Ndec);
|
||||
if (dfabs < pdec) {
|
||||
|
|
|
|||
|
|
@ -23,6 +23,12 @@
|
|||
// This just compiles in the code.
|
||||
%(DEBUG_MODE)s
|
||||
|
||||
#ifdef DEBUG_MODE
|
||||
#define DEBUG_MODE_ENABLED 1
|
||||
#else
|
||||
#define DEBUG_MODE_ENABLED 0
|
||||
#endif
|
||||
|
||||
//------------------------ Fortran settings -------------------//
|
||||
|
||||
// define types doublereal, integer, and ftnlen to match the
|
||||
|
|
|
|||
|
|
@ -482,7 +482,7 @@ namespace ctml {
|
|||
std::vector<XML_Node*> f;
|
||||
node.getChildren("integer",f);
|
||||
int n = static_cast<int>(f.size());
|
||||
integer x, x0, x1;
|
||||
integer x;
|
||||
std::string typ, title, vmin, vmax;
|
||||
for (int i = 0; i < n; i++) {
|
||||
const XML_Node& fi = *(f[i]);
|
||||
|
|
@ -491,9 +491,7 @@ namespace ctml {
|
|||
vmin = fi["min"];
|
||||
vmax = fi["max"];
|
||||
if (vmin != "")
|
||||
x0 = atoi(vmin.c_str());
|
||||
if (fi["max"] != "")
|
||||
x1 = atoi(vmax.c_str());
|
||||
v[title] = x;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,8 +192,6 @@ namespace ckr {
|
|||
string s;
|
||||
vector<string> toks;
|
||||
string defaultDate="";
|
||||
size_t nreg = 2;
|
||||
|
||||
int nsp = static_cast<int>(names.size());
|
||||
|
||||
// Comment string
|
||||
|
|
|
|||
|
|
@ -256,7 +256,6 @@ namespace pip {
|
|||
int nel = static_cast<int>(sp.elements.size());
|
||||
int m, num;
|
||||
string nm, str="";
|
||||
doublereal charge = 0.0;
|
||||
for (m = 0; m < nel; m++) {
|
||||
/*
|
||||
* Copy the element name into the string, nm. Lower case the
|
||||
|
|
@ -276,10 +275,6 @@ namespace pip {
|
|||
*/
|
||||
str += " "+nm+":"+int2str(num)+" ";
|
||||
|
||||
/* if the species contains the special element E (electron),
|
||||
* then set the charge.
|
||||
*/
|
||||
if (nm == "E") charge = -sp.elements[m].number;
|
||||
}
|
||||
|
||||
fprintf(f," atoms = \"%s\",\n", str.c_str());
|
||||
|
|
|
|||
|
|
@ -1494,13 +1494,11 @@ namespace Cantera {
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_MODE
|
||||
if (ChemEquil_print_lvl > 0) {
|
||||
if (DEBUG_MODE_ENABLED && ChemEquil_print_lvl > 0) {
|
||||
if (!normalStep) {
|
||||
writelogf(" NOTE: iter(%d) Doing an abnormal step due to row %d\n", iter, iM);
|
||||
writelogf(" NOTE: iter(%d) Doing an abnormal step due to row %d\n", iter, iM);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (!normalStep) {
|
||||
beta = 1.0;
|
||||
resid[m_mm] = 0.0;
|
||||
|
|
@ -1798,21 +1796,19 @@ namespace Cantera {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MODE
|
||||
if (ChemEquil_print_lvl > 0 && modifiedMatrix) {
|
||||
if (DEBUG_MODE_ENABLED && ChemEquil_print_lvl > 0 && modifiedMatrix) {
|
||||
writelog("Row Summed, MODIFIED Matrix:\n");
|
||||
for (m = 0; m <= m_mm; m++) {
|
||||
writelog(" [");
|
||||
for (n = 0; n <= m_mm; n++) {
|
||||
writelogf(" %10.5g", a1(m,n));
|
||||
writelogf(" %10.5g", a1(m,n));
|
||||
}
|
||||
writelogf("] = %10.5g\n", resid[m]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
try {
|
||||
int info = solve(a1, DATA_PTR(resid));
|
||||
solve(a1, DATA_PTR(resid));
|
||||
}
|
||||
catch (CanteraError) {
|
||||
addLogEntry("estimateEP_Brinkley:Jacobian is singular.");
|
||||
|
|
|
|||
|
|
@ -531,13 +531,11 @@ namespace Cantera {
|
|||
|
||||
doublereal MultiPhase::equilibrate(int XY, doublereal err,
|
||||
int maxsteps, int maxiter, int loglevel) {
|
||||
doublereal error;
|
||||
bool strt = false;
|
||||
doublereal dt;
|
||||
doublereal h0;
|
||||
int n;
|
||||
bool start;
|
||||
doublereal ferr, hnow, herr = 1.0;
|
||||
doublereal hnow, herr = 1.0;
|
||||
doublereal snow, serr = 1.0, s0;
|
||||
doublereal Tlow = -1.0, Thigh = -1.0;
|
||||
doublereal Hlow = Undef, Hhigh = Undef, tnew;
|
||||
|
|
@ -558,7 +556,7 @@ namespace Cantera {
|
|||
// create an equilibrium manager
|
||||
e = new MultiPhaseEquil(this);
|
||||
try {
|
||||
error = e->equilibrate(XY, err, maxsteps, loglevel);
|
||||
e->equilibrate(XY, err, maxsteps, loglevel);
|
||||
}
|
||||
catch (CanteraError &err) {
|
||||
if (loglevel > 0)
|
||||
|
|
@ -593,7 +591,7 @@ namespace Cantera {
|
|||
beginLogGroup("iteration "+int2str(n));
|
||||
|
||||
try {
|
||||
error = e->equilibrate(TP, err, maxsteps, loglevel);
|
||||
e->equilibrate(TP, err, maxsteps, loglevel);
|
||||
hnow = enthalpy();
|
||||
// the equilibrium enthalpy monotonically increases with T;
|
||||
// if the current value is below the target, the we know the
|
||||
|
|
@ -685,7 +683,6 @@ namespace Cantera {
|
|||
}
|
||||
else if (XY == SP) {
|
||||
s0 = entropy();
|
||||
start = true;
|
||||
Tlow = 1.0; // m_Tmin; // lower bound on T
|
||||
Thigh = 1.0e6; // m_Tmax; // upper bound on T
|
||||
if (loglevel > 0) {
|
||||
|
|
@ -697,14 +694,11 @@ namespace Cantera {
|
|||
for (n = 0; n < maxiter; n++) {
|
||||
if (e) delete e;
|
||||
e = new MultiPhaseEquil(this, strt);
|
||||
ferr = 0.1;
|
||||
if (fabs(dt) < 1.0) ferr = err;
|
||||
//start = false;
|
||||
if (loglevel > 0)
|
||||
beginLogGroup("iteration "+int2str(n));
|
||||
|
||||
try {
|
||||
error = e->equilibrate(TP, err, maxsteps, loglevel);
|
||||
e->equilibrate(TP, err, maxsteps, loglevel);
|
||||
snow = entropy();
|
||||
if (snow < s0) {
|
||||
if (m_temp > Tlow) Tlow = m_temp;
|
||||
|
|
@ -776,14 +770,14 @@ namespace Cantera {
|
|||
doublereal dVdP;
|
||||
int n;
|
||||
bool start = true;
|
||||
doublereal error, vnow, pnow, verr;
|
||||
doublereal vnow, pnow, verr;
|
||||
for (n = 0; n < maxiter; n++) {
|
||||
pnow = pressure();
|
||||
MultiPhaseEquil e(this, start);
|
||||
start = false;
|
||||
beginLogGroup("iteration "+int2str(n));
|
||||
|
||||
error = e.equilibrate(TP, err, maxsteps, loglevel);
|
||||
e.equilibrate(TP, err, maxsteps, loglevel);
|
||||
vnow = volume();
|
||||
verr = fabs((v0 - vnow)/v0);
|
||||
addLogEntry("P",fp2str(pressure()));
|
||||
|
|
|
|||
|
|
@ -839,13 +839,11 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
doublereal MultiPhaseEquil::error() {
|
||||
index_t j, ik, k;
|
||||
doublereal err, maxerr = 0.0;
|
||||
|
||||
// examine every reaction
|
||||
for (j = 0; j < m_nsp - m_nel; j++) {
|
||||
ik = j + m_nel;
|
||||
k = m_order[ik];
|
||||
for (size_t j = 0; j < m_nsp - m_nel; j++) {
|
||||
size_t ik = j + m_nel;
|
||||
|
||||
// don't require formation reactions for solution species
|
||||
// present in trace amounts to be equilibrated
|
||||
|
|
|
|||
|
|
@ -926,7 +926,6 @@ namespace VCSnonideal {
|
|||
|
||||
Cantera::ThermoPhase *tPhase = 0;
|
||||
|
||||
int iSurPhase = -1;
|
||||
bool gasPhase;
|
||||
int printLvl = vprob->m_printLvl;
|
||||
|
||||
|
|
@ -939,7 +938,6 @@ namespace VCSnonideal {
|
|||
/*
|
||||
* Get the thermophase object - assume volume phase
|
||||
*/
|
||||
iSurPhase = -1;
|
||||
tPhase = &(mphase->phase(iphase));
|
||||
size_t nelem = tPhase->nElements();
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ namespace VCSnonideal {
|
|||
int finished;
|
||||
size_t nspecies = m_numSpeciesTot;
|
||||
size_t nrxn = m_numRxnTot;
|
||||
vcs_VolPhase *Vphase = 0;
|
||||
|
||||
// double *molNum = VCS_DATA_PTR(m_molNumSpecies_old);
|
||||
double TMolesMultiphase;
|
||||
|
|
@ -130,7 +129,6 @@ namespace VCSnonideal {
|
|||
vcs_dzero(VCS_DATA_PTR(m_deltaMolNumSpecies), nspecies);
|
||||
for (kspec = 0; kspec < nspecies; ++kspec) {
|
||||
iph = m_phaseID[kspec];
|
||||
Vphase = m_VolPhaseList[iph];
|
||||
if (m_speciesUnknownType[kspec] != VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
|
||||
if (m_molNumSpecies_old[kspec] <= 0.0) {
|
||||
/*
|
||||
|
|
@ -458,13 +456,11 @@ namespace VCSnonideal {
|
|||
*/
|
||||
int rangeCheck = vcs_elabcheck(1);
|
||||
if (!vcs_elabcheck(0)) {
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 2) {
|
||||
if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) {
|
||||
plogf("%sInitial guess failed element abundances\n", pprefix);
|
||||
plogf("%sCall vcs_elcorr to attempt fix", pprefix);
|
||||
plogendl();
|
||||
}
|
||||
#endif
|
||||
vcs_elcorr(VCS_DATA_PTR(sm), VCS_DATA_PTR(aw));
|
||||
rangeCheck = vcs_elabcheck(1);
|
||||
if (!vcs_elabcheck(0)) {
|
||||
|
|
@ -475,8 +471,7 @@ namespace VCSnonideal {
|
|||
plogendl();
|
||||
retn = -1;
|
||||
} else {
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 2) {
|
||||
if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) {
|
||||
if (rangeCheck) {
|
||||
plogf("%sInitial guess now satisfies element abundances", pprefix);
|
||||
plogendl();
|
||||
|
|
@ -488,12 +483,10 @@ namespace VCSnonideal {
|
|||
plogendl();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else {
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 2) {
|
||||
if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) {
|
||||
if (rangeCheck) {
|
||||
plogf("%sInitial guess satisfies element abundances", pprefix);
|
||||
plogendl();
|
||||
|
|
@ -505,7 +498,6 @@ namespace VCSnonideal {
|
|||
plogendl();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef DEBUG_MODE
|
||||
|
|
|
|||
|
|
@ -441,15 +441,12 @@ namespace VCSnonideal {
|
|||
// Get the storred estimate for the composition of the phase if
|
||||
// it gets created
|
||||
fracDelta_new = Vphase->fractionCreationDeltas();
|
||||
|
||||
|
||||
bool oneIsComponent = false;
|
||||
std::vector<size_t> componentList;
|
||||
|
||||
for (k = 0; k < Vphase->nSpecies(); k++) {
|
||||
kspec = Vphase->spGlobalIndexVCS(k);
|
||||
if (kspec < m_numComponents) {
|
||||
oneIsComponent = true;
|
||||
componentList.push_back(k);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -98,12 +98,11 @@ namespace VCSnonideal {
|
|||
bool allMinorZeroedSpecies = false, forced;
|
||||
size_t iph;
|
||||
double dx, xx, par;
|
||||
size_t dofast, ll = 0, it1 = 0;
|
||||
size_t dofast, it1 = 0;
|
||||
size_t lec, npb, iti, lnospec;
|
||||
int rangeErrorFound = 0;
|
||||
bool giveUpOnElemAbund = false;
|
||||
int finalElemAbundAttempts = 0;
|
||||
bool MajorSpeciesHaveConverged = false;
|
||||
bool uptodate_minors = true;
|
||||
bool justDeletedMultiPhase = false;
|
||||
size_t usedZeroedSpecies; /* return flag from basopt indicating that
|
||||
|
|
@ -282,7 +281,6 @@ namespace VCSnonideal {
|
|||
goto L_RETURN_BLOCK;
|
||||
}
|
||||
it1 = 1;
|
||||
MajorSpeciesHaveConverged = false;
|
||||
|
||||
/*************************************************************************/
|
||||
/************** EVALUATE INITIAL SPECIES STATUS VECTOR *******************/
|
||||
|
|
@ -583,7 +581,6 @@ namespace VCSnonideal {
|
|||
}
|
||||
#endif
|
||||
m_speciesStatus[kspec] = VCS_SPECIES_MAJOR;
|
||||
MajorSpeciesHaveConverged = false;
|
||||
allMinorZeroedSpecies = false;
|
||||
} else {
|
||||
#ifdef DEBUG_MODE
|
||||
|
|
@ -939,14 +936,12 @@ namespace VCSnonideal {
|
|||
L_MAIN_LOOP_END_NO_PRINT: ;
|
||||
#endif
|
||||
if (doPhaseDeleteIph != -1) {
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 2) {
|
||||
if (DEBUG_MODE_ENABLED && m_debug_print_lvl >= 2) {
|
||||
plogf(" --- ");
|
||||
plogf("%-12.12s Main Loop Special Case deleting phase with species: ",
|
||||
m_speciesName[doPhaseDeleteKspec].c_str());
|
||||
plogendl();
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
} /**************** END OF MAIN LOOP OVER FORMATION REACTIONS ************/
|
||||
|
|
@ -1578,12 +1573,6 @@ namespace VCSnonideal {
|
|||
plogf("%s failed\n", m_speciesName[m_indexRxnToSpecies[irxn]].c_str());
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Set MajorSpeciesHaveConverged to false to indicate that
|
||||
* convergence amongst
|
||||
* major species has not been achieved
|
||||
*/
|
||||
MajorSpeciesHaveConverged = false;
|
||||
/*
|
||||
* Go back and do another iteration with variable ITI
|
||||
*/
|
||||
|
|
@ -1607,11 +1596,6 @@ namespace VCSnonideal {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Set MajorSpeciesHaveConverged to true to indicate
|
||||
* that convergence amongst major species has been achieved
|
||||
*/
|
||||
MajorSpeciesHaveConverged = true;
|
||||
/*************************************************************************/
|
||||
/*************** EQUILIBRIUM CHECK FOR MINOR SPECIES *********************/
|
||||
/*************************************************************************/
|
||||
|
|
@ -1823,7 +1807,6 @@ namespace VCSnonideal {
|
|||
* If we have found something to add, recalculate everything
|
||||
* for minor species and go back to do a full iteration
|
||||
*/
|
||||
MajorSpeciesHaveConverged = true;
|
||||
vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD);
|
||||
vcs_dfe(VCS_STATECALC_OLD, 1, 0, m_numSpeciesRdc);
|
||||
vcs_deltag(0, false, VCS_STATECALC_OLD);
|
||||
|
|
@ -1843,7 +1826,6 @@ namespace VCSnonideal {
|
|||
* If we have found something to add, recalculate everything
|
||||
* for minor species and go back to do a full iteration
|
||||
*/
|
||||
MajorSpeciesHaveConverged = true;
|
||||
vcs_setFlagsVolPhases(false, VCS_STATECALC_OLD);
|
||||
vcs_dfe(VCS_STATECALC_OLD, 1, 0, m_numSpeciesRdc);
|
||||
vcs_deltag(0, false, VCS_STATECALC_OLD);
|
||||
|
|
@ -1859,7 +1841,6 @@ namespace VCSnonideal {
|
|||
*/
|
||||
npb = vcs_add_all_deleted();
|
||||
if (npb > 0) {
|
||||
MajorSpeciesHaveConverged = true;
|
||||
iti = 0;
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debug_print_lvl >= 1) {
|
||||
|
|
@ -2207,13 +2188,11 @@ namespace VCSnonideal {
|
|||
* -> This zeroes w[kspec] and modifies m_tPhaseMoles_old[]
|
||||
*/
|
||||
const int retn = vcs_zero_species(kspec);
|
||||
#ifdef DEBUG_MODE
|
||||
if (! retn) {
|
||||
if (DEBUG_MODE_ENABLED && !retn) {
|
||||
plogf("Failed to delete a species!");
|
||||
plogendl();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
* Decrement the minor species counter if the current species is
|
||||
* a minor species
|
||||
|
|
@ -2293,7 +2272,7 @@ namespace VCSnonideal {
|
|||
* This routine is responsible for the global data manipulation only.
|
||||
*/
|
||||
void VCS_SOLVE::vcs_reinsert_deleted(size_t kspec) {
|
||||
size_t i, k;
|
||||
size_t k;
|
||||
// int irxn = kspec - m_numComponents;
|
||||
size_t iph = m_phaseID[kspec];
|
||||
double dx;
|
||||
|
|
@ -2334,7 +2313,6 @@ namespace VCSnonideal {
|
|||
Vphase->setExistence(VCS_PHASE_EXIST_YES);
|
||||
for (k = 0; k < m_numSpeciesTot; k++) {
|
||||
if (m_phaseID[k] == iph) {
|
||||
i = k - m_numComponents;
|
||||
if (m_speciesStatus[k] != VCS_SPECIES_DELETED) {
|
||||
m_speciesStatus[k] = VCS_SPECIES_MINOR;
|
||||
}
|
||||
|
|
@ -2432,7 +2410,7 @@ namespace VCSnonideal {
|
|||
}
|
||||
}
|
||||
|
||||
double deltaLarge, dj, dxWant, dxPerm = 0.0, dxPerm2 = 0.0;
|
||||
double dj, dxWant, dxPerm = 0.0, dxPerm2 = 0.0;
|
||||
for (size_t kcomp = 0; kcomp < m_numComponents; ++kcomp) {
|
||||
if (m_phaseID[kcomp] == iph) {
|
||||
#ifdef DEBUG_MODE
|
||||
|
|
@ -2442,7 +2420,6 @@ namespace VCSnonideal {
|
|||
}
|
||||
#endif
|
||||
if (m_molNumSpecies_old[kcomp] != 0.0) {
|
||||
deltaLarge = 0.0;
|
||||
for (kspec = m_numComponents; kspec < m_numSpeciesRdc; ++kspec) {
|
||||
irxn = kspec - m_numComponents;
|
||||
if (m_phaseID[kspec] != iph) {
|
||||
|
|
|
|||
|
|
@ -945,8 +945,6 @@ namespace Cantera {
|
|||
doublereal sden, tmp;
|
||||
size_t kindexSP = 0;
|
||||
*label = 0;
|
||||
size_t ispSpecial = 0;
|
||||
size_t kspSpecial = 0;
|
||||
updateMFSolnSP(XMolSolnSP);
|
||||
for (isp = 0; isp < m_numSurfPhases; isp++) {
|
||||
nsp = m_nSpeciesSurfPhase[isp];
|
||||
|
|
@ -977,8 +975,6 @@ namespace Cantera {
|
|||
if (tmp > inv_timeScale) {
|
||||
inv_timeScale = tmp;
|
||||
*label = int(kindexSP);
|
||||
ispSpecial = isp;
|
||||
kspSpecial = k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ namespace Cantera {
|
|||
*/
|
||||
double NonlinearSolver::boundStep(const double* const y,
|
||||
const double* const step0, const int loglevel) {
|
||||
int i, i_lower = -1, i_fbounds, ifbd = 0, i_fbd = 0;
|
||||
int i, i_lower = -1, ifbd = 0, i_fbd = 0;
|
||||
double fbound = 1.0, f_bounds = 1.0, f_delta_bounds = 1.0;
|
||||
double ff, y_new, ff_alt;
|
||||
|
||||
|
|
@ -552,7 +552,6 @@ namespace Cantera {
|
|||
}
|
||||
if (ff < f_delta_bounds) {
|
||||
f_delta_bounds = ff;
|
||||
i_fbounds = i;
|
||||
i_fbd = ifbd;
|
||||
}
|
||||
f_delta_bounds = MIN(f_delta_bounds, ff);
|
||||
|
|
@ -741,7 +740,6 @@ namespace Cantera {
|
|||
{
|
||||
clockWC wc;
|
||||
|
||||
bool m_residCurrent = false;
|
||||
int m = 0;
|
||||
bool forceNewJac = false;
|
||||
double s1=1.e30;
|
||||
|
|
@ -791,12 +789,10 @@ namespace Cantera {
|
|||
}
|
||||
beuler_jac(jac, DATA_PTR(m_resid), time_curr, CJ, DATA_PTR(y_curr), DATA_PTR(ydot_curr),
|
||||
num_newt_its);
|
||||
m_residCurrent = true;
|
||||
} else {
|
||||
if (loglevel > 1) {
|
||||
printf("\t\t\tSolving system with old jacobian\n");
|
||||
}
|
||||
m_residCurrent = false;
|
||||
}
|
||||
/*
|
||||
* Go get new scales
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
vector<XML_Node*> xd;
|
||||
size_t sz = 0, np, nv, m;
|
||||
size_t sz = 0, np, m;
|
||||
for (m = 0; m < m_nd; m++) {
|
||||
XML_Node* d = f->findID(domain(m).id());
|
||||
if (!d) {
|
||||
|
|
@ -167,7 +167,6 @@ namespace Cantera {
|
|||
const XML_Node& node = *d;
|
||||
xd.push_back(d);
|
||||
np = intValue(node["points"]);
|
||||
nv = intValue(node["components"]);
|
||||
sz += np*domain(m).nComponents();
|
||||
}
|
||||
}
|
||||
|
|
@ -429,14 +428,13 @@ namespace Cantera {
|
|||
doublereal xmid;
|
||||
doublereal zfixed,interp_factor;
|
||||
doublereal z1 = 0.0, z2 = 0.0, t1,t2;
|
||||
size_t strt, n, m, i;
|
||||
size_t n, m, i;
|
||||
size_t m1 = 0;
|
||||
std::vector<size_t> dsize;
|
||||
|
||||
|
||||
for (n = 0; n < m_nd; n++) {
|
||||
bool addnewpt=false;
|
||||
strt = znew.size();
|
||||
Domain1D& d = domain(n);
|
||||
|
||||
size_t comp = d.nComponents();
|
||||
|
|
|
|||
|
|
@ -814,14 +814,12 @@ namespace Cantera {
|
|||
|
||||
if (m_enabled) {
|
||||
doublereal maxx = -1.0;
|
||||
size_t imx = -1;
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
r[k+1] = m_work[k + ioffset] * m_sphase->size(k) * rs0;
|
||||
r[k+1] -= rdt*(x[k+1] - prevSoln(k+1,0));
|
||||
diag[k+1] = 1;
|
||||
if (x[k+1] > maxx) {
|
||||
maxx = x[k+1];
|
||||
imx = k+1;
|
||||
}
|
||||
}
|
||||
r[1] = 1.0 - sum;
|
||||
|
|
|
|||
|
|
@ -674,11 +674,9 @@ namespace Cantera {
|
|||
return L;
|
||||
}
|
||||
double xuse = xcation;
|
||||
int kuse = kcation;
|
||||
double factor = 1;
|
||||
if (xanion < xcation) {
|
||||
xuse = xanion;
|
||||
kuse = kanion;
|
||||
if (charge[kcation] != 1.0) {
|
||||
factor = charge[kcation];
|
||||
}
|
||||
|
|
@ -2377,7 +2375,6 @@ namespace Cantera {
|
|||
printE = 0;
|
||||
}
|
||||
#endif
|
||||
double wateract;
|
||||
std::string sni, snj, snk;
|
||||
|
||||
/*
|
||||
|
|
@ -3376,7 +3373,6 @@ namespace Cantera {
|
|||
}
|
||||
#endif
|
||||
lnwateract = -(m_weightSolvent/1000.0) * molalitysumUncropped * osmotic_coef;
|
||||
wateract = exp(lnwateract);
|
||||
|
||||
/*
|
||||
* In Cantera, we define the activity coefficient of the solvent as
|
||||
|
|
@ -3391,6 +3387,7 @@ namespace Cantera {
|
|||
m_lnActCoeffMolal_Unscaled[0] = lnwateract - log(xx);
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debugCalc) {
|
||||
double wateract = exp(lnwateract);
|
||||
printf(" Weight of Solvent = %16.7g\n", m_weightSolvent);
|
||||
printf(" molalitySumUncropped = %16.7g\n", molalitysumUncropped);
|
||||
printf(" ln_a_water=%10.6f a_water=%10.6f\n\n",
|
||||
|
|
@ -3470,7 +3467,6 @@ namespace Cantera {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
double d_wateract_dT;
|
||||
std::string sni, snj, snk;
|
||||
|
||||
const double *molality = DATA_PTR(m_molalitiesCropped);
|
||||
|
|
@ -3516,7 +3512,7 @@ namespace Cantera {
|
|||
double *CMX_L = DATA_PTR(m_CMX_IJ_L);
|
||||
|
||||
double x1, x2;
|
||||
double Aphi, dFdT, zsqdFdT;
|
||||
double dFdT, zsqdFdT;
|
||||
double sum1, sum2, sum3, sum4, sum5, term1;
|
||||
double sum_m_phi_minus_1, d_osmotic_coef_dT, d_lnwateract_dT;
|
||||
|
||||
|
|
@ -3813,7 +3809,6 @@ namespace Cantera {
|
|||
// A_Debye_Huckel = 0.5107; <- This value is used to match GWB data
|
||||
// ( A * ln(10) = 1.17593)
|
||||
// Aphi = A_Debye_Huckel * 2.30258509 / 3.0;
|
||||
Aphi = m_A_Debye / 3.0;
|
||||
|
||||
double dA_DebyedT = dA_DebyedT_TP();
|
||||
double dAphidT = dA_DebyedT /3.0;
|
||||
|
|
@ -4253,7 +4248,6 @@ namespace Cantera {
|
|||
}
|
||||
#endif
|
||||
d_lnwateract_dT = -(m_weightSolvent/1000.0) * molalitysum * d_osmotic_coef_dT;
|
||||
d_wateract_dT = exp(d_lnwateract_dT);
|
||||
|
||||
/*
|
||||
* In Cantera, we define the activity coefficient of the solvent as
|
||||
|
|
@ -4267,6 +4261,7 @@ namespace Cantera {
|
|||
m_dlnActCoeffMolaldT_Unscaled[0] = d_lnwateract_dT;
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debugCalc) {
|
||||
double d_wateract_dT = exp(d_lnwateract_dT);
|
||||
printf(" d_ln_a_water_dT = %10.6f d_a_water_dT=%10.6f\n\n",
|
||||
d_lnwateract_dT, d_wateract_dT);
|
||||
}
|
||||
|
|
@ -5224,7 +5219,6 @@ namespace Cantera {
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
double d_wateract_dP;
|
||||
std::string sni, snj, snk;
|
||||
|
||||
const double *molality = DATA_PTR(m_molalitiesCropped);
|
||||
|
|
@ -5270,7 +5264,7 @@ namespace Cantera {
|
|||
double *CMX_P = DATA_PTR(m_CMX_IJ_P);
|
||||
|
||||
double x1, x2;
|
||||
double Aphi, dFdP, zsqdFdP;
|
||||
double dFdP, zsqdFdP;
|
||||
double sum1, sum2, sum3, sum4, sum5, term1;
|
||||
double sum_m_phi_minus_1, d_osmotic_coef_dP, d_lnwateract_dP;
|
||||
|
||||
|
|
@ -5571,7 +5565,6 @@ namespace Cantera {
|
|||
// A_Debye_Huckel = 0.5107; <- This value is used to match GWB data
|
||||
// ( A * ln(10) = 1.17593)
|
||||
// Aphi = A_Debye_Huckel * 2.30258509 / 3.0;
|
||||
Aphi = m_A_Debye / 3.0;
|
||||
|
||||
double dA_DebyedP = dA_DebyedP_TP(currTemp, currPres);
|
||||
double dAphidP = dA_DebyedP /3.0;
|
||||
|
|
@ -6018,7 +6011,7 @@ namespace Cantera {
|
|||
}
|
||||
#endif
|
||||
d_lnwateract_dP = -(m_weightSolvent/1000.0) * molalitysum * d_osmotic_coef_dP;
|
||||
d_wateract_dP = exp(d_lnwateract_dP);
|
||||
|
||||
|
||||
/*
|
||||
* In Cantera, we define the activity coefficient of the solvent as
|
||||
|
|
@ -6032,6 +6025,7 @@ namespace Cantera {
|
|||
m_dlnActCoeffMolaldP_Unscaled[0] = d_lnwateract_dP;
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_debugCalc) {
|
||||
double d_wateract_dP = exp(d_lnwateract_dP);
|
||||
printf(" d_ln_a_water_dP = %10.6f d_a_water_dP=%10.6f\n\n",
|
||||
d_lnwateract_dP, d_wateract_dP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -735,8 +735,6 @@ namespace Cantera {
|
|||
*/
|
||||
void IonsFromNeutralVPSSTP::calcNeutralMoleculeMoleFractions() const {
|
||||
size_t icat, jNeut;
|
||||
doublereal sumCat;
|
||||
doublereal sumAnion;
|
||||
doublereal fmij;
|
||||
doublereal sum = 0.0;
|
||||
|
||||
|
|
@ -760,16 +758,12 @@ namespace Cantera {
|
|||
switch (ionSolnType_) {
|
||||
|
||||
case cIonSolnType_PASSTHROUGH:
|
||||
|
||||
for (size_t k = 0; k < m_kk; k++) {
|
||||
NeutralMolecMoleFractions_[k] = moleFractions_[k];
|
||||
}
|
||||
break;
|
||||
|
||||
case cIonSolnType_SINGLEANION:
|
||||
|
||||
sumCat = 0.0;
|
||||
sumAnion = 0.0;
|
||||
for (size_t k = 0; k < numNeutralMoleculeSpecies_; k++) {
|
||||
NeutralMolecMoleFractions_[k] = 0.0;
|
||||
}
|
||||
|
|
@ -863,8 +857,6 @@ namespace Cantera {
|
|||
*/
|
||||
void IonsFromNeutralVPSSTP::getNeutralMoleculeMoleGrads(const doublereal * const dx, doublereal *dy) const {
|
||||
size_t icat, jNeut;
|
||||
doublereal sumCat;
|
||||
doublereal sumAnion;
|
||||
doublereal fmij;
|
||||
vector_fp y;
|
||||
y.resize(numNeutralMoleculeSpecies_,0.0);
|
||||
|
|
@ -883,17 +875,12 @@ namespace Cantera {
|
|||
switch (ionSolnType_) {
|
||||
|
||||
case cIonSolnType_PASSTHROUGH:
|
||||
|
||||
for (size_t k = 0; k < m_kk; k++) {
|
||||
dy[k] = dx[k];
|
||||
}
|
||||
break;
|
||||
|
||||
case cIonSolnType_SINGLEANION:
|
||||
|
||||
sumCat = 0.0;
|
||||
sumAnion = 0.0;
|
||||
|
||||
for (size_t k = 0; k < (int) cationList_.size(); k++) {
|
||||
//! Get the id for the next cation
|
||||
icat = cationList_[k];
|
||||
|
|
|
|||
|
|
@ -499,7 +499,7 @@ namespace Cantera {
|
|||
void MargulesVPSSTP::getPartialMolarVolumes(doublereal* vbar) const {
|
||||
|
||||
size_t iA, iB, delAK, delBK;
|
||||
double XA, XB, XK, g0 , g1;
|
||||
double XA, XB, g0 , g1;
|
||||
double T = temperature();
|
||||
|
||||
/*
|
||||
|
|
@ -513,7 +513,6 @@ namespace Cantera {
|
|||
for (size_t iK = 0; iK < m_kk; iK++) {
|
||||
delAK = 0;
|
||||
delBK = 0;
|
||||
XK = moleFractions_[iK];
|
||||
for (size_t i = 0; i < numBinaryInteractions_; i++) {
|
||||
|
||||
iA = m_pSpecies_A_ij[i];
|
||||
|
|
@ -652,16 +651,13 @@ namespace Cantera {
|
|||
*/
|
||||
void MargulesVPSSTP::s_update_lnActCoeff() const {
|
||||
size_t iA, iB, iK, delAK, delBK;
|
||||
double XA, XB, XK, g0 , g1;
|
||||
double XA, XB, g0 , g1;
|
||||
double T = temperature();
|
||||
double RT = GasConstant*T;
|
||||
|
||||
fvo_zero_dbl_1(lnActCoeff_Scaled_, m_kk);
|
||||
|
||||
for ( iK = 0; iK < m_kk; iK++ ){
|
||||
|
||||
XK = moleFractions_[iK];
|
||||
|
||||
for (size_t i = 0; i < numBinaryInteractions_; i++) {
|
||||
|
||||
iA = m_pSpecies_A_ij[i];
|
||||
|
|
@ -722,18 +718,14 @@ namespace Cantera {
|
|||
*/
|
||||
void MargulesVPSSTP::s_update_dlnActCoeff_dT() const {
|
||||
size_t iA, iB, iK, delAK, delBK;
|
||||
double XA, XB, XK, g0 , g1;
|
||||
double XA, XB, g0 , g1;
|
||||
double T = temperature();
|
||||
double RTT = GasConstant*T*T;
|
||||
|
||||
fvo_zero_dbl_1(dlnActCoeffdT_Scaled_, m_kk);
|
||||
|
||||
for ( iK = 0; iK < m_kk; iK++ ){
|
||||
|
||||
XK = moleFractions_[iK];
|
||||
|
||||
for (size_t i = 0; i < numBinaryInteractions_; i++) {
|
||||
|
||||
iA = m_pSpecies_A_ij[i];
|
||||
iB = m_pSpecies_B_ij[i];
|
||||
|
||||
|
|
@ -796,7 +788,7 @@ namespace Cantera {
|
|||
*/
|
||||
void MargulesVPSSTP::getdlnActCoeff(const doublereal dT, const doublereal * const dX, doublereal* dlnActCoeff) const {
|
||||
size_t iA, iB, iK, delAK, delBK;
|
||||
double XA, XB, XK, g0 , g1, dXA, dXB;
|
||||
double XA, XB, g0 , g1, dXA, dXB;
|
||||
double T = temperature();
|
||||
double RT = GasConstant*T;
|
||||
|
||||
|
|
@ -804,10 +796,7 @@ namespace Cantera {
|
|||
s_update_dlnActCoeff_dT();
|
||||
|
||||
for ( iK = 0; iK < m_kk; iK++ ){
|
||||
|
||||
XK = moleFractions_[iK];
|
||||
dlnActCoeff[iK] = 0.0;
|
||||
|
||||
for (size_t i = 0; i < numBinaryInteractions_; i++) {
|
||||
|
||||
iA = m_pSpecies_A_ij[i];
|
||||
|
|
|
|||
|
|
@ -268,15 +268,6 @@ namespace Cantera {
|
|||
vpss = newVPSSMgr(type, vp_ptr);
|
||||
return vpss;
|
||||
}
|
||||
|
||||
|
||||
// If it comes back as general, then there may be some unknown
|
||||
// parameterizations to the SpeciesThermo factory routine.
|
||||
bool haveSomeUnknowns = true;
|
||||
GeneralSpeciesThermo *ttmp = dynamic_cast<GeneralSpeciesThermo *>(spth);
|
||||
if (ttmp == 0) {
|
||||
haveSomeUnknowns = false;
|
||||
}
|
||||
|
||||
// Handle special cases based on the VPStandardState types
|
||||
if (vp_ptr->eosType() == cVPSS_IdealGas) {
|
||||
|
|
|
|||
|
|
@ -528,7 +528,6 @@ doublereal WaterPropsIAPWS::psat(doublereal temperature, int waterState) {
|
|||
return P_c;
|
||||
}
|
||||
doublereal p = psat_est(temperature);
|
||||
bool conv = false;
|
||||
for (int i = 0; i < 30; i++) {
|
||||
if (method == 1) {
|
||||
corr(temperature, p, densLiq, densGas, delGRT);
|
||||
|
|
@ -541,11 +540,9 @@ doublereal WaterPropsIAPWS::psat(doublereal temperature, int waterState) {
|
|||
p += dp;
|
||||
|
||||
if ((method == 1) && delGRT < 1.0E-8) {
|
||||
conv = true;
|
||||
break;
|
||||
} else {
|
||||
if (fabs(dp/p) < 1.0E-9) {
|
||||
conv = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -456,14 +456,12 @@ namespace Cantera {
|
|||
w[0]= -1.0;
|
||||
rmserr = polyfit(n, logT, DATA_PTR(values),
|
||||
DATA_PTR(w), degree, ndeg, 0.0, o22);
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_loglevel > 0 && rmserr > 0.01) {
|
||||
if (DEBUG_MODE_ENABLED && m_loglevel > 0 && rmserr > 0.01) {
|
||||
char p[100];
|
||||
sprintf(p, "Warning: RMS error = %12.6g in omega_22 fit"
|
||||
"with delta* = %12.6g\n", rmserr, deltastar);
|
||||
m_xml->XML_comment(logfile, p);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void MMCollisionInt::fit(ostream& logfile, int degree,
|
||||
|
|
@ -500,8 +498,7 @@ namespace Cantera {
|
|||
w[0]= -1.0;
|
||||
rmserr = polyfit(n, logT, DATA_PTR(values),
|
||||
DATA_PTR(w), degree, ndeg, 0.0, c);
|
||||
#ifdef DEBUG_MODE
|
||||
if (m_loglevel > 2) {
|
||||
if (DEBUG_MODE_ENABLED && m_loglevel > 2) {
|
||||
char p[100];
|
||||
sprintf(p, " dstar=\"%12.6g\"", deltastar);
|
||||
m_xml->XML_open(logfile, "tstar_fit", p);
|
||||
|
|
@ -526,7 +523,6 @@ namespace Cantera {
|
|||
}
|
||||
m_xml->XML_close(logfile, "tstar_fit");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ namespace Cantera {
|
|||
|
||||
doublereal w1, w2, wsum, sig1, sig2, sig12, sigratio, sigratio2,
|
||||
sigratio3, tstar1, tstar2, tstar12,
|
||||
om22_1, om22_2, om22_12, om11_12, astar_12, bstar_12, cstar_12,
|
||||
om22_1, om22_2, om11_12, astar_12, bstar_12, cstar_12,
|
||||
cnst, wmwp, sqw12, p1, p2, p12, q1, q2, q12;
|
||||
|
||||
w1 = tr.mw[k];
|
||||
|
|
@ -157,7 +157,6 @@ namespace Cantera {
|
|||
|
||||
om22_1 = m_integrals->omega22(tstar1, tr.delta(k,k));
|
||||
om22_2 = m_integrals->omega22(tstar2, tr.delta(j,j));
|
||||
om22_12 = m_integrals->omega22(tstar12, tr.delta(k,j));
|
||||
om11_12 = m_integrals->omega11(tstar12, tr.delta(k,j));
|
||||
astar_12 = m_integrals->astar(tstar12, tr.delta(k,j));
|
||||
bstar_12 = m_integrals->bstar(tstar12, tr.delta(k,j));
|
||||
|
|
@ -1147,7 +1146,6 @@ namespace Cantera {
|
|||
"*** polynomial coefficients not printed (log_level < 2) ***");
|
||||
}
|
||||
#endif
|
||||
int ipoly;
|
||||
doublereal sqrt_T, visc, err, relerr,
|
||||
mxerr = 0.0, mxrelerr = 0.0, mxerr_cond = 0.0, mxrelerr_cond = 0.0;
|
||||
|
||||
|
|
@ -1339,8 +1337,6 @@ namespace Cantera {
|
|||
for (size_t k = 0; k < tr.nsp_; k++)
|
||||
{
|
||||
for (size_t j = k; j < tr.nsp_; j++) {
|
||||
|
||||
ipoly = tr.poly[k][j];
|
||||
for (size_t n = 0; n < np; n++) {
|
||||
|
||||
t = tr.tmin + dt*n;
|
||||
|
|
|
|||
|
|
@ -213,7 +213,6 @@ double Heptane::up() {
|
|||
* see Reynolds eqn (16) section 2
|
||||
*/
|
||||
double Heptane::sp() {
|
||||
double Tinverse = 1.0/T;
|
||||
double T2inverse = pow(T, -2);
|
||||
double T3inverse = pow(T, -3);
|
||||
double T4inverse = pow(T, -4);
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ static void get_sizes(FILE *fp, int &nTitleLines, int &nColTitleLines,
|
|||
int nScanLinesMAX = 100;
|
||||
int nScanLines = nScanLinesMAX;
|
||||
int retn, i, j;
|
||||
int nLines = 0;
|
||||
int maxCommas = 0;
|
||||
TOKEN fieldToken;
|
||||
char *scanLine = mdp_alloc_char_1(MAX_INPUT_STR_LN+1, '\0');
|
||||
|
|
@ -392,7 +391,6 @@ static void get_sizes(FILE *fp, int &nTitleLines, int &nColTitleLines,
|
|||
for (i = nColTitleLines + nTitleLines; ; i++) {
|
||||
retn = read_line(fp, scanLine, 0);
|
||||
if (retn == -1) {
|
||||
nLines = i+1;
|
||||
nDataRows = i - nColTitleLines - nTitleLines + 1;
|
||||
break;
|
||||
}
|
||||
|
|
@ -634,7 +632,6 @@ int main(int argc, char *argv[])
|
|||
int *ColIsFloat1 = NULL, *ColIsFloat2 = NULL;
|
||||
double *curVarValues1 = NULL, *curVarValues2 = NULL;
|
||||
char ** curStringValues1 = NULL, **curStringValues2 = NULL;
|
||||
int mixed_var = 0;
|
||||
int i, j, ndiff, jmax, i1, i2, k, found;
|
||||
double max_diff, rel_diff;
|
||||
int testPassed = RT_PASSED;
|
||||
|
|
@ -828,11 +825,9 @@ int main(int argc, char *argv[])
|
|||
* Get the number of column variables in each file
|
||||
*/
|
||||
|
||||
mixed_var = FALSE;
|
||||
if (nCol1 != nCol2) {
|
||||
printf("Number of column variables differ:, %d %d\n",
|
||||
nCol1, nCol2);
|
||||
mixed_var = TRUE;
|
||||
testPassed = RT_FAILED_OTHER;
|
||||
} else if (Debug_Flag) {
|
||||
printf("Number of column variables in both files = %d\n",
|
||||
|
|
@ -863,7 +858,6 @@ int main(int argc, char *argv[])
|
|||
compColList[nColcomparisons][1] = j;
|
||||
nColcomparisons++;
|
||||
found = TRUE;
|
||||
if (i != j) mixed_var = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue