Changed variable names.

Fixed an error with the print out of the pressure units.
This commit is contained in:
Harry Moffat 2008-04-25 02:38:38 +00:00
parent afd90fb206
commit 6667d79319
7 changed files with 43 additions and 19 deletions

View file

@ -45,7 +45,11 @@ namespace VCSnonideal {
g += TPhInertMoles[iph] *
log(TPhInertMoles[iph] / tPhMoles[iph]);
if (Vphase->GasPhase) {
g += TPhInertMoles[iph] * log(Pres);
if (m_VCS_UnitsFormat == 3) {
g += TPhInertMoles[iph] * log(m_pressure/(Cantera::OneAtm));
} else {
g += TPhInertMoles[iph] * log(m_pressure);
}
}
}
}
@ -82,7 +86,11 @@ namespace VCSnonideal {
g += TPhInertMoles[iphase] * log(TPhInertMoles[iphase] / phaseMols);
vcs_VolPhase *Vphase = VPhaseList[iphase];
if (Vphase->GasPhase == iphase) {
g += TPhInertMoles[iphase] * log(Pres);
if (m_VCS_UnitsFormat == 3) {
g += TPhInertMoles[iphase] * log(m_pressure/(Cantera::OneAtm));
} else {
g += TPhInertMoles[iphase] * log(m_pressure);
}
}
}

View file

@ -55,7 +55,7 @@ namespace VCSnonideal {
* Store the temperature and pressure in the private global variables
*/
m_temperature = T_arg;
Pres = pres_arg;
m_pressure = pres_arg;
/*
* Evaluate the standard state free energies
* at the current temperatures and pressures.
@ -154,7 +154,7 @@ namespace VCSnonideal {
for (int iph = 0; iph < NPhase; iph++) {
vcs_VolPhase* vph = VPhaseList[iph];
vph->setState_TP(m_temperature, Pres);
vph->setState_TP(m_temperature, m_pressure);
vph->sendToVCSGStar(VCS_DATA_PTR(m_SSfeSpecies));
}

View file

@ -191,8 +191,8 @@ int VCS_SOLVE::vcs_prep_oneTime(int printLvl)
}
if (fabs(sum) < 1.0E-6) {
modifiedSoln = true;
if (Pres <= 0.0) pres = 1.0;
else pres = Pres;
if (m_pressure <= 0.0) pres = 1.0;
else pres = m_pressure;
retn = vcs_evalSS_TP(0, 0, m_temperature, pres);
for (kspec = 0; kspec < m_numSpeciesTot; ++kspec) {
if (SpeciesUnknownType[kspec] == VCS_SPECIES_TYPE_MOLNUM) {

View file

@ -105,11 +105,15 @@ int VCS_SOLVE::vcs_report(int iconv)
* Calculate some quantities that may need updating
*/
vcs_tmoles();
Vol = vcs_VolTotal(m_temperature, Pres,
Vol = vcs_VolTotal(m_temperature, m_pressure,
VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
plogf("\t\tTemperature = %15.2g Kelvin\n", m_temperature);
plogf("\t\tPressure = %15.5g Atmos\n", Pres);
std::string punits = "Atm";
if (m_VCS_UnitsFormat == 3) {
punits = "Pa ";
}
plogf("\t\tPressure = %15.5g %3s\n", m_pressure, punits.c_str());
plogf("\t\tVolume = %15.5g cm**3\n", Vol);
/*

View file

@ -44,7 +44,7 @@ namespace VCSnonideal {
iest(0),
TMoles(0.0),
m_temperature(0.0),
Pres(0.0),
m_pressure(0.0),
tolmaj(0.0),
tolmin(0.0),
tolmaj2(0.0),
@ -582,8 +582,8 @@ namespace VCSnonideal {
*/
if (pub->T > 0.0) m_temperature = pub->T;
else m_temperature = 293.15;
if (pub->Pres > 0.0) Pres = pub->Pres;
else Pres = 1.0;
if (pub->Pres > 0.0) m_pressure = pub->Pres;
else m_pressure = 1.0;
/*
* TPhInertMoles[] -> must be copied over here
*/
@ -773,7 +773,7 @@ namespace VCSnonideal {
bool status_change = false;
m_temperature = pub->T;
Pres = pub->Pres;
m_pressure = pub->Pres;
m_VCS_UnitsFormat = pub->m_VCS_UnitsFormat;
iest = pub->iest;
@ -902,7 +902,7 @@ namespace VCSnonideal {
int k1 = 0;
vcs_tmoles();
Vol = vcs_VolTotal(m_temperature, Pres,
Vol = vcs_VolTotal(m_temperature, m_pressure,
VCS_DATA_PTR(m_molNumSpecies_old), VCS_DATA_PTR(VolPM));
for (i = 0; i < m_numSpeciesTot; ++i) {
@ -930,7 +930,7 @@ namespace VCSnonideal {
}
pub->T = m_temperature;
pub->Pres = Pres;
pub->Pres = m_pressure;
pub->Vol = Vol;
int kT = 0;
for (int iph = 0; iph < pub->NPhase; iph++) {

View file

@ -673,8 +673,16 @@ public:
//! Temperature (Kelvin)
double m_temperature;
//! Pressure (units are Pascals)
double Pres;
//! Pressure (units are determined by m_VCS_UnitsFormat
/*!
* Values units
* -1: atm
* 0: atm
* 1: atm
* 2: atm
* 3: Pa
*/
double m_pressure;
//! Total kmoles of inert to add to each phase
/*!

View file

@ -236,9 +236,13 @@ namespace VCSnonideal {
((VPhaseList[0])->NVolSpecies));
plogf("%10d PHASE2 SPECIES%8d SINGLE SPECIES PHASES\n\n",
numSpecliquid,
m_numSpeciesTot - (VPhaseList[0])->NVolSpecies - numSpecliquid);
plogf(" PRESSURE%22.3f ATM\n TEMPERATURE%19.3f K\n",
Pres, m_temperature);
m_numSpeciesTot - (VPhaseList[0])->NVolSpecies - numSpecliquid);
string punits = "atm";
if (m_VCS_UnitsFormat == 3) {
punits = "Pa ";
}
plogf(" PRESSURE%22.8g %3s\n", m_pressure, punits.c_str());
plogf(" TEMPERATURE%19.3f K\n", m_temperature);
Vphase = VPhaseList[0];
if (Vphase->NVolSpecies > 0) {
plogf(" PHASE1 INERTS%17.3f\n", TPhInertMoles[0]);