Variable-size arrays are not part of the C++ standard
This commit is contained in:
parent
2f23080dd3
commit
c31e48cfb3
6 changed files with 76 additions and 64 deletions
|
|
@ -404,8 +404,9 @@ void MargulesVPSSTP::getChemPotentials(doublereal* mu) const
|
|||
doublereal MargulesVPSSTP::enthalpy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double hbar[kk], h = 0;
|
||||
getPartialMolarEnthalpies(hbar);
|
||||
double h = 0;
|
||||
vector_fp hbar(kk);
|
||||
getPartialMolarEnthalpies(&hbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
h += moleFractions_[i]*hbar[i];
|
||||
}
|
||||
|
|
@ -416,8 +417,9 @@ doublereal MargulesVPSSTP::enthalpy_mole() const
|
|||
doublereal MargulesVPSSTP::entropy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double sbar[kk], s = 0;
|
||||
getPartialMolarEntropies(sbar);
|
||||
double s = 0;
|
||||
vector_fp sbar(kk);
|
||||
getPartialMolarEntropies(&sbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
s += moleFractions_[i]*sbar[i];
|
||||
}
|
||||
|
|
@ -428,8 +430,9 @@ doublereal MargulesVPSSTP::entropy_mole() const
|
|||
doublereal MargulesVPSSTP::cp_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double cpbar[kk], cp = 0;
|
||||
getPartialMolarCp(cpbar);
|
||||
double cp = 0;
|
||||
vector_fp cpbar(kk);
|
||||
getPartialMolarCp(&cpbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
cp += moleFractions_[i]*cpbar[i];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -409,8 +409,9 @@ void MixedSolventElectrolyte::getChemPotentials(doublereal* mu) const
|
|||
doublereal MixedSolventElectrolyte::enthalpy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double hbar[kk], h = 0;
|
||||
getPartialMolarEnthalpies(hbar);
|
||||
double h = 0;
|
||||
vector_fp hbar(kk);
|
||||
getPartialMolarEnthalpies(&hbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
h += moleFractions_[i]*hbar[i];
|
||||
}
|
||||
|
|
@ -421,8 +422,9 @@ doublereal MixedSolventElectrolyte::enthalpy_mole() const
|
|||
doublereal MixedSolventElectrolyte::entropy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double sbar[kk], s = 0;
|
||||
getPartialMolarEntropies(sbar);
|
||||
double s = 0;
|
||||
vector_fp sbar(kk);
|
||||
getPartialMolarEntropies(&sbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
s += moleFractions_[i]*sbar[i];
|
||||
}
|
||||
|
|
@ -433,8 +435,9 @@ doublereal MixedSolventElectrolyte::entropy_mole() const
|
|||
doublereal MixedSolventElectrolyte::cp_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double cpbar[kk], cp = 0;
|
||||
getPartialMolarCp(cpbar);
|
||||
double cp = 0;
|
||||
vector_fp cpbar(kk);
|
||||
getPartialMolarCp(&cpbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
cp += moleFractions_[i]*cpbar[i];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -421,8 +421,9 @@ void PhaseCombo_Interaction::getChemPotentials(doublereal* mu) const
|
|||
doublereal PhaseCombo_Interaction::enthalpy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double hbar[kk], h = 0;
|
||||
getPartialMolarEnthalpies(hbar);
|
||||
double h = 0;
|
||||
vector_fp hbar(kk);
|
||||
getPartialMolarEnthalpies(&hbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
h += moleFractions_[i]*hbar[i];
|
||||
}
|
||||
|
|
@ -433,8 +434,9 @@ doublereal PhaseCombo_Interaction::enthalpy_mole() const
|
|||
doublereal PhaseCombo_Interaction::entropy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double sbar[kk], s = 0;
|
||||
getPartialMolarEntropies(sbar);
|
||||
double s = 0;
|
||||
vector_fp sbar(kk);
|
||||
getPartialMolarEntropies(&sbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
s += moleFractions_[i]*sbar[i];
|
||||
}
|
||||
|
|
@ -445,8 +447,9 @@ doublereal PhaseCombo_Interaction::entropy_mole() const
|
|||
doublereal PhaseCombo_Interaction::cp_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double cpbar[kk], cp = 0;
|
||||
getPartialMolarCp(cpbar);
|
||||
double cp = 0;
|
||||
vector_fp cpbar(kk);
|
||||
getPartialMolarCp(&cpbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
cp += moleFractions_[i]*cpbar[i];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -410,8 +410,9 @@ void RedlichKisterVPSSTP::getChemPotentials(doublereal* mu) const
|
|||
doublereal RedlichKisterVPSSTP::enthalpy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double hbar[kk], h = 0;
|
||||
getPartialMolarEnthalpies(hbar);
|
||||
double h = 0;
|
||||
vector_fp hbar(kk);
|
||||
getPartialMolarEnthalpies(&hbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
h += moleFractions_[i]*hbar[i];
|
||||
}
|
||||
|
|
@ -422,8 +423,9 @@ doublereal RedlichKisterVPSSTP::enthalpy_mole() const
|
|||
doublereal RedlichKisterVPSSTP::entropy_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double sbar[kk], s = 0;
|
||||
getPartialMolarEntropies(sbar);
|
||||
double s = 0;
|
||||
vector_fp sbar(kk);
|
||||
getPartialMolarEntropies(&sbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
s += moleFractions_[i]*sbar[i];
|
||||
}
|
||||
|
|
@ -434,8 +436,9 @@ doublereal RedlichKisterVPSSTP::entropy_mole() const
|
|||
doublereal RedlichKisterVPSSTP::cp_mole() const
|
||||
{
|
||||
int kk = nSpecies();
|
||||
double cpbar[kk], cp = 0;
|
||||
getPartialMolarCp(cpbar);
|
||||
double cp = 0;
|
||||
vector_fp cpbar(kk);
|
||||
getPartialMolarCp(&cpbar[0]);
|
||||
for (int i = 0; i < kk; i++) {
|
||||
cp += moleFractions_[i]*cpbar[i];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -259,8 +259,8 @@ doublereal LTI_Solvent::getMixTransProp(doublereal* speciesValues, doublereal* s
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0.0;
|
||||
|
||||
|
|
@ -307,8 +307,8 @@ doublereal LTI_Solvent::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0.0;
|
||||
|
||||
|
|
@ -345,8 +345,8 @@ doublereal LTI_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal*
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -380,8 +380,8 @@ doublereal LTI_MoleFracs::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -409,8 +409,8 @@ doublereal LTI_MassFracs::getMixTransProp(doublereal* speciesValues, doublereal*
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal massfracs[nsp];
|
||||
m_thermo->getMassFractions(massfracs);
|
||||
vector_fp massfracs(nsp);
|
||||
m_thermo->getMassFractions(&massfracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -444,8 +444,8 @@ doublereal LTI_MassFracs::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal massfracs[nsp];
|
||||
m_thermo->getMassFractions(massfracs);
|
||||
vector_fp massfracs(nsp);
|
||||
m_thermo->getMassFractions(&massfracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -476,8 +476,8 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(doublereal* speciesValues, doubler
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
|
||||
|
||||
|
|
@ -516,8 +516,8 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
|
||||
doublereal value = 0;
|
||||
|
|
@ -572,8 +572,8 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(doublereal* speciesValues,
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -587,8 +587,8 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(std::vector<LTPspecies*> LT
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -602,8 +602,8 @@ void LTI_Pairwise_Interaction::getMatrixTransProp(DenseMatrix& mat, doublereal*
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
mat.resize(nsp, nsp, 0.0);
|
||||
for (int i = 0; i < nsp; i++)
|
||||
|
|
@ -665,8 +665,8 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(doublereal* speciesValues, dou
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -680,8 +680,8 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(std::vector<LTPspecies*> LTPpt
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -701,8 +701,8 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe
|
|||
throw CanteraError("LTI_StefanMaxwell_PPN::getMatrixTransProp","Function may only be called with a 3-ion system");
|
||||
}
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
vector_fp neut_molefracs;
|
||||
ions_thermo->getNeutralMolecMoleFractions(neut_molefracs);
|
||||
vector<size_t> cation;
|
||||
|
|
@ -776,8 +776,8 @@ doublereal LTI_StokesEinstein::getMixTransProp(doublereal* speciesValues, double
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -791,8 +791,8 @@ doublereal LTI_StokesEinstein::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
{
|
||||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -843,8 +843,8 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(doublereal* speciesValues, double
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
@ -875,8 +875,8 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(std::vector<LTPspecies*> LTPptrs)
|
|||
|
||||
int nsp = m_thermo->nSpecies();
|
||||
doublereal temp = m_thermo->temperature();
|
||||
doublereal molefracs[nsp];
|
||||
m_thermo->getMoleFractions(molefracs);
|
||||
vector_fp molefracs(nsp);
|
||||
m_thermo->getMoleFractions(&molefracs[0]);
|
||||
|
||||
doublereal value = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -911,8 +911,8 @@ void LiquidTransport::set_Grad_X(const doublereal* const grad_X)
|
|||
doublereal LiquidTransport::getElectricConduct()
|
||||
{
|
||||
doublereal gradT = 0.0;
|
||||
doublereal gradX[m_nDim * m_nsp];
|
||||
doublereal gradV[m_nDim];
|
||||
vector_fp gradX(m_nDim * m_nsp);
|
||||
vector_fp gradV(m_nDim);
|
||||
for (int i = 0; i < m_nDim; i++) {
|
||||
for (int k = 0; k < m_nsp; k++) {
|
||||
gradX[ i*m_nDim + k] = 0.0;
|
||||
|
|
@ -921,8 +921,8 @@ doublereal LiquidTransport::getElectricConduct()
|
|||
}
|
||||
|
||||
set_Grad_T(&gradT);
|
||||
set_Grad_X(gradX);
|
||||
set_Grad_V(gradV);
|
||||
set_Grad_X(&gradX[0]);
|
||||
set_Grad_V(&gradV[0]);
|
||||
|
||||
doublereal* fluxes = new doublereal(m_nsp * m_nDim);
|
||||
doublereal current;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue