From be731888a48da4265707723fda7d73d9a1e22b48 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 19 Jan 2010 18:27:34 +0000 Subject: [PATCH] Fixed a UMR error, due to a missing initialization list. --- Cantera/src/transport/LiquidTransport.cpp | 2 +- Cantera/src/transport/LiquidTransportData.cpp | 23 ++- Cantera/src/transport/LiquidTransportData.h | 25 +-- .../src/transport/LiquidTransportParams.cpp | 14 +- Cantera/src/transport/LiquidTransportParams.h | 146 +++++++++--------- 5 files changed, 113 insertions(+), 97 deletions(-) diff --git a/Cantera/src/transport/LiquidTransport.cpp b/Cantera/src/transport/LiquidTransport.cpp index e25a4da36..bce2d57af 100644 --- a/Cantera/src/transport/LiquidTransport.cpp +++ b/Cantera/src/transport/LiquidTransport.cpp @@ -243,7 +243,7 @@ namespace Cantera { //for each species, assign viscosity model and coefficients for (k = 0; k < m_nsp; k++) { Cantera::LiquidTransportData <d = tr.LTData[k]; - if ( ltd.speciesDiffusivity >= 0 ) { + if (ltd.speciesDiffusivity != 0) { cout << "Warning: diffusion coefficient data for " << m_thermo->speciesName(k) << endl diff --git a/Cantera/src/transport/LiquidTransportData.cpp b/Cantera/src/transport/LiquidTransportData.cpp index 17ba9f1e0..25dcd3c82 100644 --- a/Cantera/src/transport/LiquidTransportData.cpp +++ b/Cantera/src/transport/LiquidTransportData.cpp @@ -44,16 +44,31 @@ namespace Cantera { E /= GasConstant; } + LiquidTransportData::LiquidTransportData() : + speciesName("-"), + hydroRadius(0), + viscosity(0), + thermalCond(0), + electCond(0), + speciesDiffusivity(0) + { + } - //! Copy constructor - LiquidTransportData::LiquidTransportData( const LiquidTransportData &right ) + // Copy constructor + LiquidTransportData::LiquidTransportData(const LiquidTransportData &right) : + speciesName("-"), + hydroRadius(0), + viscosity(0), + thermalCond(0), + electCond(0), + speciesDiffusivity(0) { *this = right; //use assignment operator to do other work } - //! Assignment operator - LiquidTransportData& LiquidTransportData::operator=(const LiquidTransportData& right ) + // Assignment operator + LiquidTransportData& LiquidTransportData::operator=(const LiquidTransportData& right) { if (&right != this) { speciesName = right.speciesName; diff --git a/Cantera/src/transport/LiquidTransportData.h b/Cantera/src/transport/LiquidTransportData.h index 29fb0bbc9..89708b92b 100644 --- a/Cantera/src/transport/LiquidTransportData.h +++ b/Cantera/src/transport/LiquidTransportData.h @@ -177,12 +177,11 @@ namespace Cantera { public: - LiquidTransportData() : - speciesName("-") - { - } + //! Default constructor + LiquidTransportData(); + //! Copy constructor - LiquidTransportData( const LiquidTransportData &right ) ; + LiquidTransportData(const LiquidTransportData &right) ; //! Assignment operator LiquidTransportData& operator=(const LiquidTransportData& right ); @@ -213,7 +212,7 @@ namespace Cantera { //! Class LTPspecies_Const holds transport parameters for a //! specific liquid-phase species when the transport property //! is just a constant value. - /** + /*! * As an example of the input required for LTPspecies_Const * consider the following XML fragment * @@ -229,7 +228,7 @@ namespace Cantera { * * \endverbatim */ - class LTPspecies_Const : public LTPspecies{ + class LTPspecies_Const : public LTPspecies { public: @@ -269,7 +268,7 @@ namespace Cantera { //! Class LTPspecies_Arrhenius holds transport parameters for a //! specific liquid-phase species when the transport property //! is expressed in Arrhenius form. - /** + /*! * As an example of the input required for LTPspecies_Arrhenius * consider the following XML fragment * @@ -307,7 +306,7 @@ namespace Cantera { //! Return the pure species value for this transport property evaluated //! from the Arrhenius expression - /** + /*! * In general the Arrhenius expression is * * \f[ @@ -343,7 +342,8 @@ namespace Cantera { doublereal m_logProp; //! Internal model to adjust species-specific properties for composition. - /** Currently just a place holder, but this method could take + /*! + * Currently just a place holder, but this method could take * the composition from the thermo object and adjust coefficients * accoding to some unspecified model. */ @@ -355,7 +355,7 @@ namespace Cantera { //! Class LTPspecies_Poly holds transport parameters for a //! specific liquid-phase species when the transport property //! is expressed as a polynomial in temperature. - /** + /*! * As an example of the input required for LTPspecies_Poly * consider the following XML fragment * @@ -405,7 +405,8 @@ namespace Cantera { doublereal m_prop; //! Internal model to adjust species-specific properties for composition. - /** Currently just a place holder, but this method could take + /*! + * Currently just a place holder, but this method could take * the composition from the thermo object and adjust coefficients * accoding to some unspecified model. */ diff --git a/Cantera/src/transport/LiquidTransportParams.cpp b/Cantera/src/transport/LiquidTransportParams.cpp index 49613778b..f7e5466ee 100644 --- a/Cantera/src/transport/LiquidTransportParams.cpp +++ b/Cantera/src/transport/LiquidTransportParams.cpp @@ -321,7 +321,7 @@ namespace Cantera { } - doublereal LTI_Log_MoleFracs::getMixTransProp( std::vector LTPptrs ) { + doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) { int nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); @@ -331,7 +331,7 @@ namespace Cantera { doublereal value = 0; for ( int k = 0; k < nsp; k++) { - value += log( LTPptrs[k]->getSpeciesTransProp() ) * LTPptrs[k]->getMixWeight( ) * molefracs[k]; + value += log( LTPptrs[k]->getSpeciesTransProp() ) * LTPptrs[k]->getMixWeight() * molefracs[k]; } for ( int i = 0; i < nsp; i++ ) @@ -348,18 +348,18 @@ namespace Cantera { - void LTI_Pairwise_Interaction::setParameters( LiquidTransportParams& trParam ) { + void LTI_Pairwise_Interaction::setParameters(LiquidTransportParams& trParam) { int nsp = m_thermo->nSpecies(); m_diagonals.resize(nsp, 0); for (int k = 0; k < nsp; k++) { Cantera::LiquidTransportData <d = trParam.LTData[k]; - if ( ltd.speciesDiffusivity ) + if (ltd.speciesDiffusivity) m_diagonals[k] = ltd.speciesDiffusivity; } } - doublereal LTI_Pairwise_Interaction::getMixTransProp( doublereal *speciesValues, doublereal *speciesWeight ) { + doublereal LTI_Pairwise_Interaction::getMixTransProp(doublereal *speciesValues, doublereal *speciesWeight) { int nsp = m_thermo->nSpecies(); doublereal molefracs[nsp]; @@ -373,7 +373,7 @@ namespace Cantera { } - doublereal LTI_Pairwise_Interaction::getMixTransProp( std::vector LTPptrs ) { + doublereal LTI_Pairwise_Interaction::getMixTransProp(std::vector LTPptrs) { int nsp = m_thermo->nSpecies(); doublereal molefracs[nsp]; @@ -386,7 +386,7 @@ namespace Cantera { return value; } - void LTI_Pairwise_Interaction::getMatrixTransProp( DenseMatrix &mat, doublereal *speciesValues ) { + void LTI_Pairwise_Interaction::getMatrixTransProp(DenseMatrix &mat, doublereal *speciesValues) { int nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); diff --git a/Cantera/src/transport/LiquidTransportParams.h b/Cantera/src/transport/LiquidTransportParams.h index 1805f1560..e1c10e6fe 100644 --- a/Cantera/src/transport/LiquidTransportParams.h +++ b/Cantera/src/transport/LiquidTransportParams.h @@ -33,57 +33,57 @@ namespace Cantera { }; - //! Composition dependence type for liquid mixture transport properties - /*! - * Types of temperature dependencies: - * - 0 - Mixture calculations with this property are not allowed - * - 1 - Use solvent (species 0) properties - * - 2 - Properties weighted linearly by mole fractions - * - 3 - Properties weighted linearly by mass fractions - * - 4 - Properties weighted logarithmically by mole fractions (interaction energy weighting) - * - 5 - Interactions given pairwise between each possible species (i.e. D_ij) - * - * \verbatim - * - * - * - * - * LiCl(L) - * KCl(L) - * -1.0 - * 1.0E-1 - * - * - * - * - * - * - * Li+ - * K+ - * 1.5 - * - * - * K+ - * Cl- - * 1.0 - * - * - * Li+ - * Cl- - * 1.2 - * - * - * - * - * - * - * - * - * - * - * \endverbatim - * - */ + //! Composition dependence type for liquid mixture transport properties + /*! + * Types of temperature dependencies: + * - 0 - Mixture calculations with this property are not allowed + * - 1 - Use solvent (species 0) properties + * - 2 - Properties weighted linearly by mole fractions + * - 3 - Properties weighted linearly by mass fractions + * - 4 - Properties weighted logarithmically by mole fractions (interaction energy weighting) + * - 5 - Interactions given pairwise between each possible species (i.e. D_ij) + * + * \verbatim + * + * + * + * + * LiCl(L) + * KCl(L) + * -1.0 + * 1.0E-1 + * + * + * + * + * + * + * Li+ + * K+ + * 1.5 + * + * + * K+ + * Cl- + * 1.0 + * + * + * Li+ + * Cl- + * 1.2 + * + * + * + * + * + * + * + * + * + * + * \endverbatim + * + */ enum LiquidTranMixingModel { LTI_MODEL_NOTSET=-1, LTI_MODEL_NONE, @@ -120,9 +120,9 @@ namespace Cantera { public: //! Constructor - /** - * @param tp_ind Index indicating transport property type (i.e. viscosity) - */ + /** + * @param tp_ind Index indicating transport property type (i.e. viscosity) + */ LiquidTranInteraction( TransportPropertyList tp_ind = TP_UNKNOWN ); //! Copy constructor @@ -140,7 +140,7 @@ namespace Cantera { * @param thermo Pointer to thermo object */ virtual void init( const XML_Node &compModelNode = 0, - thermo_t* thermo = 0 ); + thermo_t* thermo = 0 ); virtual void setParameters( LiquidTransportParams& trParam ) { ; } @@ -260,9 +260,9 @@ namespace Cantera { public: LTI_Solvent( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_SOLVENT; - } + { + m_model = LTI_MODEL_SOLVENT; + } //! Copy constructor // LTI_Solvent( const LTI_Solvent &right ); @@ -301,9 +301,9 @@ namespace Cantera { public: LTI_MoleFracs( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_MOLEFRACS; - } + { + m_model = LTI_MODEL_MOLEFRACS; + } //! Copy constructor @@ -344,9 +344,9 @@ namespace Cantera { public: LTI_MassFracs( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_MASSFRACS; - } + { + m_model = LTI_MODEL_MASSFRACS; + } //! Copy constructor @@ -418,9 +418,9 @@ namespace Cantera { public: LTI_Log_MoleFracs( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_LOG_MOLEFRACS; - } + { + m_model = LTI_MODEL_LOG_MOLEFRACS; + } //! Copy constructor @@ -475,9 +475,9 @@ namespace Cantera { public: LTI_Pairwise_Interaction( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_PAIRWISE_INTERACTION; - } + { + m_model = LTI_MODEL_PAIRWISE_INTERACTION; + } //! Copy constructor @@ -512,9 +512,9 @@ namespace Cantera { public: LTI_StokesEinstein( TransportPropertyList tp_ind = TP_UNKNOWN ) : LiquidTranInteraction( tp_ind ) - { - m_model = LTI_MODEL_STOKES_EINSTEIN; - } + { + m_model = LTI_MODEL_STOKES_EINSTEIN; + } //! Copy constructor