Cleanup trailing whitespace
This commit is contained in:
parent
72e0d650b4
commit
cc17716182
37 changed files with 74 additions and 88 deletions
|
|
@ -55,7 +55,7 @@ namespace Cantera
|
|||
* preprocessor symbol is defined, e.g. with the compiler option -DNDEBUG.
|
||||
*/
|
||||
|
||||
//! Enum containing Cantera's behavior for situations where overflow or underflow of real variables
|
||||
//! Enum containing Cantera's behavior for situations where overflow or underflow of real variables
|
||||
//! may occur.
|
||||
/*!
|
||||
* Note this frequently occurs when taking exponentials of delta gibbs energies of reactions
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ namespace VCSnonideal
|
|||
*/
|
||||
#define VCS_SPECIES_DELETED -4
|
||||
|
||||
//! Species refers to an electron in the metal.
|
||||
//! Species refers to an electron in the metal.
|
||||
/*!
|
||||
* The unknown is equal to the electric potential of the phase
|
||||
* in which it exists.
|
||||
|
|
@ -348,7 +348,7 @@ namespace VCSnonideal
|
|||
* Typically, these species are electrons in metals. There is an
|
||||
* infinite supply of them. However, their electrical potential
|
||||
* is sometimes allowed to vary, for example if the open circuit voltage
|
||||
* is sought after.
|
||||
* is sought after.
|
||||
*/
|
||||
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE -5
|
||||
//@}
|
||||
|
|
|
|||
|
|
@ -123,7 +123,7 @@ public:
|
|||
* @param printDetails 1 -> Print intermediate results.
|
||||
* @param maxit Maximum number of iterations for the algorithm
|
||||
*
|
||||
* @return
|
||||
* @return
|
||||
* * 0 = Equilibrium Achieved
|
||||
* * 1 = Range space error encountered. The element abundance criteria
|
||||
* are only partially satisfied. Specifically, the first NC= (number
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ public:
|
|||
return cEdgeKinetics;
|
||||
}
|
||||
|
||||
|
||||
virtual void finalize();
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -788,7 +788,7 @@ public:
|
|||
virtual void finalize();
|
||||
|
||||
/**
|
||||
* Add a single reaction to the mechanism. This routine
|
||||
* Add a single reaction to the mechanism. This routine
|
||||
* must be called after init() and before finalize(). Derived classes
|
||||
* should call the base class method in addition to handling their
|
||||
* own specialized behavior.
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ public:
|
|||
doublereal filmResistivity;
|
||||
|
||||
//! Power of the equilibrium constant within the Affinity representation
|
||||
/*!
|
||||
/*!
|
||||
* Only valid for Affinity representation.
|
||||
* default = 1.0
|
||||
*/
|
||||
|
|
@ -198,7 +198,7 @@ public:
|
|||
bool isReversibleWithFrac;
|
||||
|
||||
//! Forward value of the apparent Electrochemical transfer coefficient
|
||||
doublereal beta;
|
||||
doublereal beta;
|
||||
|
||||
//! Arrhenius parameters for P-log reactions.
|
||||
//! The keys are the pressures corresponding to each Arrhenius expression.
|
||||
|
|
|
|||
|
|
@ -764,10 +764,10 @@ public:
|
|||
void add(size_t rxn, const std::vector<size_t>& k, const vector_fp& order,
|
||||
const vector_fp& stoich) {
|
||||
if (order.size() != k.size()) {
|
||||
throw CanteraError("StoichManagerN::add()", "size of order and species arrays differ");
|
||||
throw CanteraError("StoichManagerN::add()", "size of order and species arrays differ");
|
||||
}
|
||||
if (stoich.size() != k.size()) {
|
||||
throw CanteraError("StoichManagerN::add()", "size of stoich and species arrays differ");
|
||||
throw CanteraError("StoichManagerN::add()", "size of stoich and species arrays differ");
|
||||
}
|
||||
bool frac = false;
|
||||
for (size_t n = 0; n < stoich.size(); n++) {
|
||||
|
|
|
|||
|
|
@ -497,12 +497,12 @@ protected:
|
|||
|
||||
//! Storage for the current derivative values of the
|
||||
//! gradients with respect to logarithm of the mole fraction of the
|
||||
//! log of the activity coefficients of the species
|
||||
//! log of the activity coefficients of the species
|
||||
mutable std::vector<doublereal> dlnActCoeffdlnN_diag_;
|
||||
|
||||
//! Storage for the current derivative values of the
|
||||
//! gradients with respect to logarithm of the mole fraction of the
|
||||
//! log of the activity coefficients of the species
|
||||
//! log of the activity coefficients of the species
|
||||
mutable std::vector<doublereal> dlnActCoeffdlnX_diag_;
|
||||
|
||||
//! Storage for the current derivative values of the gradients with respect to logarithm of the species mole number of the
|
||||
|
|
|
|||
|
|
@ -744,7 +744,7 @@ public:
|
|||
*/
|
||||
doublereal calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
|
||||
doublereal& molarVolLiquid);
|
||||
|
||||
|
||||
public:
|
||||
//! Calculate the saturation pressure at the current mixture content for the given temperature
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -29,9 +29,6 @@ class WaterProps;
|
|||
class PDSS_HKFT : public PDSS_Molar
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
|
||||
//! @name Constructors
|
||||
//! @{
|
||||
|
||||
|
|
@ -429,7 +426,7 @@ private:
|
|||
//! Charge of the ion
|
||||
doublereal m_charge_j;
|
||||
|
||||
//! Static variable determining error exiting
|
||||
//! Static variable determining error exiting
|
||||
/*!
|
||||
* If true, then will error exit if there is an inconsistency in DG0, DH0, and DS0.
|
||||
* If not, then will rewrite DH0 to be consistent with the other two.
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ namespace Cantera
|
|||
* The first two methods of naming may not yield a unique species within
|
||||
* complicated assemblies of %Cantera Phases.
|
||||
*
|
||||
* @todo
|
||||
* @todo
|
||||
* Make the concept of saving state vectors more general, so that it can
|
||||
* handle other cases where there are additional internal state variables, such
|
||||
* as the voltage, a potential energy, or a strain field.
|
||||
|
|
@ -84,7 +84,7 @@ namespace Cantera
|
|||
* Moreover, ynless we do this, the calculation of jacobians will be altered whenever the treatment of non-conforming mole
|
||||
* fractions is changed. Add setState functions corresponding to specifying mole numbers, which is actually what
|
||||
* is being done (well one of the options, there are many) when non-conforming mole fractions are input.
|
||||
* Note, we realize that most numerical jacobian and some analytical jacobians use non-conforming calculations.
|
||||
* Note, we realize that most numerical jacobian and some analytical jacobians use non-conforming calculations.
|
||||
* These can easily be changed to the set mole number setState functions.
|
||||
*
|
||||
* @ingroup phases
|
||||
|
|
@ -121,7 +121,7 @@ public:
|
|||
*
|
||||
* @param xmlPhase Reference to the XML node corresponding to the phase
|
||||
*/
|
||||
void setXMLdata(XML_Node& xmlPhase);
|
||||
void setXMLdata(XML_Node& xmlPhase);
|
||||
|
||||
/*! @name Name and ID
|
||||
* Class Phase contains two strings that identify a phase. The ID is the
|
||||
|
|
@ -802,7 +802,7 @@ public:
|
|||
//! Returns a bool indicating wether the object is ready for use
|
||||
/*!
|
||||
* @return returns true if the object is ready for calculation, false otherwise.
|
||||
*/
|
||||
*/
|
||||
virtual bool ready() const;
|
||||
|
||||
//! Return the State Mole Fraction Number
|
||||
|
|
@ -811,12 +811,11 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
|
||||
//! Cached for saved calculations within each ThermoPhase.
|
||||
/*!
|
||||
* For more information on how to use this, see examples within the source code and documentation
|
||||
* for this within ValueCache class itself.
|
||||
*/
|
||||
*/
|
||||
mutable ValueCache m_cache;
|
||||
|
||||
//! Set the molecular weight of a single species to a given value
|
||||
|
|
|
|||
|
|
@ -368,10 +368,10 @@ public:
|
|||
|
||||
/// Critical pressure (Pa).
|
||||
virtual doublereal critPressure() const;
|
||||
|
||||
|
||||
/// Critical volume (m3/kmol)
|
||||
virtual doublereal critVolume() const;
|
||||
|
||||
|
||||
// Critical compressibility (unitless)
|
||||
virtual doublereal critCompressibility() const;
|
||||
|
||||
|
|
|
|||
|
|
@ -1231,18 +1231,17 @@ public:
|
|||
virtual doublereal critPressure() const {
|
||||
throw NotImplementedError("ThermoPhase::critPressure");
|
||||
}
|
||||
|
||||
|
||||
/// Critical volume (m3/kmol).
|
||||
virtual doublereal critVolume() const {
|
||||
throw NotImplementedError("ThermoPhase::critVolume");
|
||||
}
|
||||
|
||||
|
||||
/// Critical compressibility (unitless).
|
||||
virtual doublereal critCompressibility() const {
|
||||
throw NotImplementedError("ThermoPhase::critCompressibility");
|
||||
}
|
||||
|
||||
|
||||
/// Critical density (kg/m3).
|
||||
virtual doublereal critDensity() const {
|
||||
throw NotImplementedError("ThermoPhase::critDensity");
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ public:
|
|||
virtual void getMixDiffCoeffsMole(doublereal* const d);
|
||||
|
||||
//! Returns the mixture-averaged diffusion coefficients [m^2/s].
|
||||
/*!
|
||||
/*!
|
||||
* These are the coefficients for calculating the diffusive mass fluxes
|
||||
* from the species mass fraction gradients, computed according to
|
||||
* Eq. 12.178 in "Chemically Reacting Flow":
|
||||
|
|
|
|||
|
|
@ -85,9 +85,6 @@ protected:
|
|||
virtual doublereal FQ_i(doublereal Q, doublereal Tr, doublereal MW);
|
||||
|
||||
virtual doublereal setPcorr(doublereal Pr, doublereal Tr);
|
||||
|
||||
public:
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ public:
|
|||
|
||||
//! Returns the vector of standard state species transport property
|
||||
/*!
|
||||
* The standard state species transport property
|
||||
* The standard state species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided by the
|
||||
* subclass object.
|
||||
|
|
@ -233,7 +233,7 @@ public:
|
|||
|
||||
//! Returns the standard state species transport property
|
||||
/*!
|
||||
* The standard species transport property
|
||||
* The standard species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -238,7 +238,7 @@ public:
|
|||
* Length nsp * nsp .This is a symmetric matrix
|
||||
*/
|
||||
DenseMatrix delta;
|
||||
|
||||
|
||||
//! Pitzer acentric factor
|
||||
/*!
|
||||
* Length is the number of species in the phase.
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ static void check_consistency(FILE* fp, const char *fileName, const int nTitleL
|
|||
fprintf(stderr, "check_consistency() error for file %s, Line %d couldn't be read\n",
|
||||
fileName, i);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
if (ncolsFound != (nCol)) {
|
||||
fprintf(stderr, "check_consistency() error for file %s, Line %d of DataLines didn't have correct commas: %d vs %d\n",
|
||||
fileName, i, ncolsFound, nCol);
|
||||
|
|
@ -291,7 +291,6 @@ static void check_consistency(FILE* fp, const char *fileName, const int nTitleL
|
|||
fileName, i, j);
|
||||
fprintf(stderr," %s\n", scanLine);
|
||||
exit(-1);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -396,7 +395,7 @@ static void get_sizes(FILE* fp, int& nTitleLines, int& nColTitleLines,
|
|||
*/
|
||||
rewind(fp);
|
||||
ColIsFloat.assign(ColIsFloat.size(), 0);
|
||||
|
||||
|
||||
for (i = 0; i < nScanLines; i++) {
|
||||
retn = read_line(fp, scanLine, 0);
|
||||
int ncolsFound = breakStrCommas(scanLine, strlets, nCol);
|
||||
|
|
@ -857,7 +856,7 @@ int main(int argc, char* argv[])
|
|||
|
||||
ColIsFloat1.resize(200, 0);
|
||||
ColIsFloat2.resize(200, 0);
|
||||
|
||||
|
||||
/*
|
||||
* Obtain the size of the problem information: Compare between files.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1108,7 +1108,7 @@ XML_Node* findXMLPhase(XML_Node* root,
|
|||
idattrib = root->id();
|
||||
if (idtarget == idattrib) {
|
||||
return root;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const vector<XML_Node*> &vsc = root->children();
|
||||
|
|
|
|||
|
|
@ -791,7 +791,6 @@ extern "C" {
|
|||
return handleAllExceptions(-1, ERR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-------------- Kinetics ------------------//
|
||||
|
||||
|
|
|
|||
|
|
@ -906,7 +906,7 @@ void vcs_VolPhase::setCreationMoleNumbers(const double* const n_k,
|
|||
const std::vector<size_t> &creationGlobalRxnNumbers)
|
||||
{
|
||||
creationMoleNumbers_.assign(n_k, n_k+m_numSpecies);
|
||||
for (size_t k = 0; k < m_numSpecies; k++) {
|
||||
for (size_t k = 0; k < m_numSpecies; k++) {
|
||||
creationGlobalRxnNumbers_[k] = creationGlobalRxnNumbers[k];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
|
|||
/*
|
||||
* Loop through all of the species in the phase. We say the phase
|
||||
* can be popped, if there is one species in the phase that can be
|
||||
* popped. This does not mean that the phase will be popped or that it
|
||||
* popped. This does not mean that the phase will be popped or that it
|
||||
* leads to a lower Gibbs free energy.
|
||||
*/
|
||||
for (size_t k = 0; k < Vphase->nSpecies(); k++) {
|
||||
|
|
@ -39,7 +39,7 @@ bool VCS_SOLVE::vcs_popPhasePossible(const size_t iphasePop) const
|
|||
/*
|
||||
* Note one case is if the component is a member of the popping phase.
|
||||
* This component will be zeroed and the logic here will negate the current
|
||||
* species from causing a positive if this component is consumed.
|
||||
* species from causing a positive if this component is consumed.
|
||||
*/
|
||||
for (size_t j = 0; j < m_numComponents; ++j) {
|
||||
if (m_elType[j] == VCS_ELEM_TYPE_ABSPOS) {
|
||||
|
|
|
|||
|
|
@ -2571,7 +2571,7 @@ int VCS_SOLVE::vcs_basopt(const bool doJustComponents, double aw[], double sa[],
|
|||
/*
|
||||
* Use a temporary work array for the mole numbers, aw[]
|
||||
*/
|
||||
std::copy(m_molNumSpecies_old.begin(),
|
||||
std::copy(m_molNumSpecies_old.begin(),
|
||||
m_molNumSpecies_old.begin() + m_numSpeciesTot, aw);
|
||||
/*
|
||||
* Take out the Voltage unknowns from consideration
|
||||
|
|
@ -4168,7 +4168,7 @@ void VCS_SOLVE::vcs_printDeltaG(const int stateCalc)
|
|||
printf(" %-3s", Cantera::int2str(iphase).c_str());
|
||||
if (m_speciesUnknownType[kspec] == VCS_SPECIES_TYPE_INTERFACIALVOLTAGE) {
|
||||
printf(" NA ");
|
||||
} else {
|
||||
} else {
|
||||
printf(" % -12.4e", molNumSpecies[kspec]);
|
||||
}
|
||||
printf(" % -12.4e", mfValue);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ double VCS_SPECIES_THERMO::GStar_R_calc(size_t kglob, double TKelvin,
|
|||
return fe;
|
||||
}
|
||||
|
||||
double VCS_SPECIES_THERMO::VolStar_calc(size_t kglob, double TKelvin,
|
||||
double VCS_SPECIES_THERMO::VolStar_calc(size_t kglob, double TKelvin,
|
||||
double presPA)
|
||||
{
|
||||
double vol;
|
||||
|
|
|
|||
|
|
@ -411,7 +411,7 @@ void InterfaceKinetics::applyVoltageKfwdCorrection(doublereal* const kf)
|
|||
for (size_t i = 0; i < m_beta.size(); i++) {
|
||||
size_t irxn = m_ctrxn[i];
|
||||
|
||||
// If we calculate the BV form directly, we don't add the voltage correction to the
|
||||
// If we calculate the BV form directly, we don't add the voltage correction to the
|
||||
// forward reaction rate constants.
|
||||
if (m_ctrxn_BVform[i] == 0) {
|
||||
eamod = m_beta[i] * deltaElectricEnergy_[irxn];
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ doublereal FixedChemPotSSTP::logStandardConc(size_t k) const
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
void FixedChemPotSSTP::getUnitsStandardConc(doublereal* uA, int k,
|
||||
void FixedChemPotSSTP::getUnitsStandardConc(doublereal* uA, int k,
|
||||
int sizeUA) const
|
||||
{
|
||||
for (int i = 0; i < 6; i++) {
|
||||
|
|
|
|||
|
|
@ -709,7 +709,7 @@ void MargulesVPSSTP::readXMLBinarySpecies(XML_Node& xmLBinarySpecies)
|
|||
* excessEntropy
|
||||
* excessVolume_Enthalpy
|
||||
* excessVolume_Entropy
|
||||
* Other blocks are currently ignored.
|
||||
* Other blocks are currently ignored.
|
||||
* @TODO determine a policy about ignoring blocks that should or shouldn't be there.
|
||||
*/
|
||||
if (nodeName == "excessenthalpy") {
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@ doublereal MetalSHEelectrons::logStandardConc(size_t k) const
|
|||
return 0.0;
|
||||
}
|
||||
|
||||
void MetalSHEelectrons::getUnitsStandardConc(doublereal* uA, int k,
|
||||
void MetalSHEelectrons::getUnitsStandardConc(doublereal* uA, int k,
|
||||
int sizeUA) const
|
||||
{
|
||||
for (int i = 0; i < 6; i++) {
|
||||
|
|
|
|||
|
|
@ -752,7 +752,7 @@ doublereal MixtureFugacityTP::densSpinodalGas() const
|
|||
{
|
||||
throw CanteraError("", "unimplmented");
|
||||
}
|
||||
|
||||
|
||||
doublereal MixtureFugacityTP::satPressure(doublereal TKelvin)
|
||||
{
|
||||
doublereal molarVolGas;
|
||||
|
|
@ -760,7 +760,6 @@ doublereal MixtureFugacityTP::satPressure(doublereal TKelvin)
|
|||
return calculatePsat(TKelvin, molarVolGas, molarVolLiquid);
|
||||
}
|
||||
|
||||
|
||||
doublereal MixtureFugacityTP::calculatePsat(doublereal TKelvin, doublereal& molarVolGas,
|
||||
doublereal& molarVolLiquid)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ namespace Cantera
|
|||
{
|
||||
/*
|
||||
* Set the default to error exit if there is an input file inconsistency
|
||||
*/
|
||||
*/
|
||||
int PDSS_HKFT::s_InputInconsistencyErrorExit = 1;
|
||||
|
||||
PDSS_HKFT::PDSS_HKFT(VPStandardStateTP* tp, size_t spindex) :
|
||||
|
|
@ -488,7 +488,7 @@ void PDSS_HKFT::initThermo()
|
|||
|
||||
//! Ok, we have mu. Let's check it against the input value
|
||||
// of DH_F to see that we have some internal consistency
|
||||
|
||||
|
||||
doublereal Hcalc = m_Mu0_tr_pr + 298.15 * (m_Entrop_tr_pr * 1.0E3 * 4.184);
|
||||
|
||||
doublereal DHjmol = m_deltaH_formation_tr_pr * 1.0E3 * 4.184;
|
||||
|
|
|
|||
|
|
@ -320,7 +320,7 @@ void PureFluidPhase::setState_SP(doublereal s, doublereal p,
|
|||
setState_TR(m_sub->Temp(), 1.0/m_sub->v());
|
||||
}
|
||||
|
||||
doublereal PureFluidPhase::satPressure(doublereal t)
|
||||
doublereal PureFluidPhase::satPressure(doublereal t)
|
||||
{
|
||||
Set(tpx::PropertyPair::TV, t, m_sub->v());
|
||||
return m_sub->Ps();
|
||||
|
|
|
|||
|
|
@ -613,7 +613,7 @@ doublereal RedlichKwongMFTP::critPressure() const
|
|||
|
||||
return pc;
|
||||
}
|
||||
|
||||
|
||||
doublereal RedlichKwongMFTP::critVolume() const
|
||||
{
|
||||
double pc, tc, vc;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
* Binary diffusion coefficients use the generalized chart described by
|
||||
* Takahashi, et al. and viscosity calcualtions use the Lucas method.
|
||||
* All methods are described in Reid, Prausnitz, and Polling, "The Properties
|
||||
* of Gases and Liquids, 4th ed., 1987 (viscosity in Ch. 9, Thermal
|
||||
* of Gases and Liquids, 4th ed., 1987 (viscosity in Ch. 9, Thermal
|
||||
* conductivity in Ch. 10, and Diffusion coefficients in Ch. 11).
|
||||
*
|
||||
**/
|
||||
|
|
@ -125,7 +125,7 @@ double HighPressureGasTransport::thermalConductivity()
|
|||
doublereal Lstar_m = H_m*(L_1m + L_2m + L_3m);
|
||||
|
||||
return Lprime_m + Lstar_m;
|
||||
|
||||
|
||||
}
|
||||
|
||||
void HighPressureGasTransport::getThermalDiffCoeffs(doublereal* const dt)
|
||||
|
|
@ -239,12 +239,12 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c
|
|||
// zero (this would lead to Pr_ij = Inf):
|
||||
doublereal x_i = std::max(Tiny, molefracs[i]);
|
||||
doublereal x_j = std::max(Tiny, molefracs[j]);
|
||||
|
||||
|
||||
x_i = x_i/(x_i+x_j);
|
||||
x_j = x_j/(x_i+x_j);
|
||||
Tr_ij = m_temp/(x_i*Tcrit_i(i) + x_j*Tcrit_i(j));
|
||||
Pr_ij = m_thermo->pressure()/(x_i*Pcrit_i(i) + x_j*Pcrit_i(j));
|
||||
|
||||
|
||||
if (Pr_ij < 0.1) {
|
||||
P_corr_ij = 1;
|
||||
}else {
|
||||
|
|
@ -253,21 +253,21 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c
|
|||
P_corr_ij = Tiny;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
m_bdiff(i,j) *= P_corr_ij;
|
||||
}
|
||||
}
|
||||
m_bindiff_ok = false; // m_bdiff is overwritten by the above routine.
|
||||
|
||||
|
||||
// Having corrected m_bdiff for pressure and concentration effects, the
|
||||
// routine now procedes the same as in the low-pressure case:
|
||||
|
||||
|
||||
// evaluate L0000 if the temperature or concentrations have
|
||||
// changed since it was last evaluated.
|
||||
if (!m_l0000_ok) {
|
||||
eval_L0000(DATA_PTR(molefracs));
|
||||
}
|
||||
|
||||
|
||||
// invert L00,00
|
||||
int ierr = invert(m_Lmatrix, m_nsp);
|
||||
if (ierr != 0) {
|
||||
|
|
@ -276,12 +276,12 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c
|
|||
}
|
||||
m_l0000_ok = false; // matrix is overwritten by inverse
|
||||
m_lmatrix_soln_ok = false;
|
||||
|
||||
|
||||
doublereal pres = m_thermo->pressure();
|
||||
doublereal prefactor = 16.0 * m_temp
|
||||
*m_thermo->meanMolecularWeight()/(25.0*pres);
|
||||
doublereal c;
|
||||
|
||||
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
for (size_t j = 0; j < m_nsp; j++) {
|
||||
c = prefactor/m_mw[j];
|
||||
|
|
@ -289,11 +289,11 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
doublereal HighPressureGasTransport::viscosity()
|
||||
{
|
||||
// Calculate the high-pressure mixture viscosity, based on the Lucas method.
|
||||
|
||||
|
||||
double Tc_mix = 0.;
|
||||
double Pc_mix_n = 0.;
|
||||
double Pc_mix_d = 0.;
|
||||
|
|
@ -312,7 +312,6 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
|
||||
x_H = molefracs[0];
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
|
||||
// Calculate pure-species critical constants and add their contribution
|
||||
// to the mole-fraction-weighted mixture averages:
|
||||
Tc = Tcrit_i(i);
|
||||
|
|
@ -321,14 +320,14 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
Tc_mix += Tc*molefracs[i];
|
||||
Pc_mix_n += molefracs[i]*Zc; //numerator
|
||||
Pc_mix_d += molefracs[i]*Vcrit_i(i); //denominator
|
||||
|
||||
|
||||
// Need to calculate ratio of heaviest to lightest species:
|
||||
if (m_mw[i] > MW_H) {
|
||||
MW_H = m_mw[i];
|
||||
x_H = molefracs[i];
|
||||
} else if (m_mw[i] < MW_L) {
|
||||
MW_L = m_mw[i]; }
|
||||
|
||||
|
||||
// Calculate reduced dipole moment for polar correction term:
|
||||
doublereal mu_ri = 52.46*100000*m_dipole(i,i)*m_dipole(i,i)
|
||||
*Pcrit_i(i)/(Tc*Tc);
|
||||
|
|
@ -339,7 +338,7 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
} else { FP_mix_o += molefracs[i]*(1. + 30.55*pow(0.292 - Zc, 1.72)
|
||||
*fabs(0.96 + 0.1*(Tr - 0.7)));
|
||||
}
|
||||
|
||||
|
||||
// Calculate contribution to quantum correction term.
|
||||
// SCD Note: This assumes the species of interest (He, H2, and D2) have
|
||||
// been named in this specific way. They are perhaps the most obvious
|
||||
|
|
@ -355,28 +354,27 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
} else {
|
||||
FQ_mix_o += molefracs[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
double Tr_mix = tKelvin/Tc_mix;
|
||||
double Pc_mix = GasConstant*Tc_mix*Pc_mix_n/Pc_mix_d;
|
||||
double Pr_mix = m_thermo->pressure()/Pc_mix;
|
||||
double ratio = MW_H/MW_L;
|
||||
|
||||
|
||||
double ksi = pow(GasConstant*Tc_mix*3.6277*pow(10.0,53.0)/(pow(MW_mix,3)
|
||||
*pow(Pc_mix,4)),1.0/6.0);
|
||||
|
||||
|
||||
if (ratio > 9 && x_H > 0.05 && x_H < 0.7) {
|
||||
Afac = 1 - 0.01*pow(ratio,0.87);
|
||||
} else {
|
||||
Afac = 1;
|
||||
}
|
||||
FQ_mix_o *= Afac;
|
||||
|
||||
|
||||
// Calculate Z1m
|
||||
Z1m = (0.807*pow(Tr_mix,0.618) - 0.357*exp(-0.449*Tr_mix)
|
||||
+ 0.340*exp(-4.058*Tr_mix)+0.018)*FP_mix_o*FQ_mix_o;
|
||||
|
||||
|
||||
// Calculate Z2m:
|
||||
if (Tr_mix <= 1.0){
|
||||
if (Pr_mix < Pvp_mix/Pc_mix) {
|
||||
|
|
@ -395,7 +393,7 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
doublereal c_fac = 0.4489*exp(3.0578*pow(Tr_mix,-37.7332))/Tr_mix;
|
||||
doublereal d_fac = 1.7368*exp(2.2310*pow(Tr_mix,-7.6351))/Tr_mix;
|
||||
doublereal f_fac = 0.9425*exp(-0.1853*pow(Tr_mix,0.4489));
|
||||
|
||||
|
||||
Z2m = Z1m*(1 + a_fac*pow(Pr_mix,1.3088)/(b_fac*pow(Pr_mix,f_fac)
|
||||
+ pow(1+c_fac*pow(Pr_mix,d_fac),-1)));
|
||||
} else {
|
||||
|
|
@ -406,10 +404,10 @@ doublereal HighPressureGasTransport::viscosity()
|
|||
throw CanteraError("HighPressureGasTransport::viscosity",
|
||||
"State is outside the limits of the Lucas model, Tr > 40");
|
||||
}
|
||||
|
||||
|
||||
// Calculate Y:
|
||||
doublereal Y = Z2m/Z1m;
|
||||
|
||||
|
||||
// Return the viscosity:
|
||||
return Z2m*(1 + (FP_mix_o - 1)*pow(Y,-3))*(1 + (FQ_mix_o - 1)
|
||||
*(1/Y - 0.007*pow(log(Y),4)))/(ksi*FP_mix_o*FQ_mix_o);
|
||||
|
|
@ -439,7 +437,7 @@ doublereal HighPressureGasTransport::Pcrit_i(size_t i)
|
|||
m_thermo->setMoleFractions(&molefracs[0]);
|
||||
return pc;
|
||||
}
|
||||
|
||||
|
||||
doublereal HighPressureGasTransport::Vcrit_i(size_t i)
|
||||
{
|
||||
size_t nsp = m_thermo->nSpecies();
|
||||
|
|
@ -451,7 +449,7 @@ doublereal HighPressureGasTransport::Vcrit_i(size_t i)
|
|||
m_thermo->setMoleFractions(&molefracs[0]);
|
||||
return vc;
|
||||
}
|
||||
|
||||
|
||||
doublereal HighPressureGasTransport::Zcrit_i(size_t i)
|
||||
{
|
||||
size_t nsp = m_thermo->nSpecies();
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
|||
m_nsp2 = m_nsp*m_nsp;
|
||||
//
|
||||
// Resize the local storage according to the number of species
|
||||
//
|
||||
//
|
||||
m_mw.resize(m_nsp, 0.0);
|
||||
m_viscSpecies.resize(m_nsp, 0.0);
|
||||
m_viscTempDep_Ns.resize(m_nsp, 0);
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ void MultiTransport::updateThermal_T()
|
|||
*/
|
||||
vector_fp cp(m_thermo->nSpecies());
|
||||
m_thermo->getCp_R_ref(&cp[0]);
|
||||
|
||||
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
m_cinternal[k] = cp[k] - 2.5;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
|||
if (transportModel == "Simple") {
|
||||
|
||||
compositionDepType_ = tr.compositionDepTypeDefault_;
|
||||
|
||||
|
||||
} else {
|
||||
throw CanteraError("SimpleTransport::initLiquid()",
|
||||
"transport model isn't the correct type: " + transportModel);
|
||||
|
|
|
|||
|
|
@ -186,7 +186,7 @@ LiquidTranInteraction* TransportFactory::newLTI(const XML_Node& trNode,
|
|||
break;
|
||||
default:
|
||||
//
|
||||
// @TODO make sure we can throw an error here with existing datasets and tests before changing code
|
||||
// @TODO make sure we can throw an error here with existing datasets and tests before changing code
|
||||
//
|
||||
lti = new LiquidTranInteraction(tp_ind);
|
||||
lti->init(trNode, thermo);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue