diff --git a/include/cantera/transport/LiquidTranInteraction.h b/include/cantera/transport/LiquidTranInteraction.h index 210966b83..3b34527a0 100644 --- a/include/cantera/transport/LiquidTranInteraction.h +++ b/include/cantera/transport/LiquidTranInteraction.h @@ -69,9 +69,7 @@ namespace Cantera * * * \endverbatim - * */ - enum LiquidTranMixingModel { LTI_MODEL_NOTSET=-1, LTI_MODEL_NONE, @@ -85,7 +83,6 @@ enum LiquidTranMixingModel { LTI_MODEL_MOLEFRACS_EXPT }; - //! Base class to handle transport property evaluation in a mixture. /*! * In a mixture, the mixture transport properties will generally depend on @@ -100,35 +97,27 @@ enum LiquidTranMixingModel { * obtained through some mixing rule. These are obtained using the * method getMixTransProp(). Viscosity is typical of this. * Second there are properties for which a matrix of properties may - * @param tp_ind * exist. This matrix of properties is obtained from the method * getMatrixTransProp(). Diffusion coefficients are of this type. * Subclasses should implement the appropriate one or both of * these methods. - * */ class LiquidTranInteraction { - 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(TransportPropertyType tp_ind = TP_UNKNOWN); - //! Copy constructor LiquidTranInteraction(const LiquidTranInteraction& right); - - //! Assignment operator LiquidTranInteraction& operator=(const LiquidTranInteraction& right); - - //! destructor virtual ~LiquidTranInteraction(); //! initialize LiquidTranInteraction objects with thermo and XML node /** - * @param compModelNode \verbatim \endverbatim XML node + * @param compModelNode `` XML node * @param thermo Pointer to thermo object */ virtual void init(const XML_Node& compModelNode = 0, @@ -191,7 +180,6 @@ protected: class LTI_Solvent : public LiquidTranInteraction { - public: LTI_Solvent(TransportPropertyType tp_ind = TP_UNKNOWN); @@ -203,9 +191,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point). + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point). */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -216,16 +203,12 @@ public: * and calculates them: Not implemented for this mixing rule. */ void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0); - -protected: - }; //! Simple mole fraction weighting of transport properties /** - * This model weights the transport property by the mole - * fractions. - * The overall formula for the mixture viscosity is + * This model weights the transport property by the mole fractions. The + * overall formula for the mixture viscosity is * * \f[ * \eta_{mix} = \sum_i X_i \eta_i + \sum_i \sum_j X_i X_j A_{i,j} @@ -233,14 +216,12 @@ protected: */ class LTI_MoleFracs : public LiquidTranInteraction { - public: LTI_MoleFracs(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_MOLEFRACS; } - //! Copy constructor // LTI_MoleFracs( const LTI_MoleFracs &right ); @@ -249,9 +230,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -264,17 +244,12 @@ public: void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) { mat = (*m_Aij[0]); } - -protected: - }; - //! Simple mass fraction weighting of transport properties /*! - * This model weights the transport property by the mass - * fractions. - * The overall formula for the mixture viscosity is + * This model weights the transport property by the mass fractions. The + * overall formula for the mixture viscosity is * * \f[ * \eta_{mix} = \sum_i Y_i \eta_i @@ -283,15 +258,12 @@ protected: */ class LTI_MassFracs : public LiquidTranInteraction { - public: - LTI_MassFracs(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_MASSFRACS; } - //! Copy constructor // LTI_MassFracs( const LTI_MassFracs &right ); @@ -300,9 +272,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -315,19 +286,14 @@ public: void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) { mat = (*m_Aij[0]); } - -protected: - }; - //! Mixing rule using logarithms of the mole fractions /** - * This model is based on the idea that liquid molecules are - * generally interacting with some energy and entropy of interaction. - * For transport properties that depend on these energies of - * interaction, the mixture transport property can be written - * in terms of its logarithm + * This model is based on the idea that liquid molecules are generally + * interacting with some energy and entropy of interaction. For transport + * properties that depend on these energies of interaction, the mixture + * transport property can be written in terms of its logarithm * * \f[ \ln \eta_{mix} = \sum_i X_i \ln \eta_i * + \sum_i \sum_j X_i X_j ( S_{i,j} + E_{i,j} / T ) @@ -363,14 +329,12 @@ protected: */ class LTI_Log_MoleFracs : public LiquidTranInteraction { - public: LTI_Log_MoleFracs(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_LOG_MOLEFRACS; } - //! Copy constructor // LTI_Log_MoleFracs( const LTI_Log_MoleFracs &right ); @@ -379,9 +343,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -394,19 +357,14 @@ public: void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) { mat = m_Eij; } - -protected: - }; - //! Transport properties that act like pairwise interactions //! as in binary diffusion coefficients. /** - * This class holds parameters for transport properties expressed - * as a matrix of pairwise interaction parameters. - * Input can be provided for constant or Arrhenius forms of the - * separate parameters. + * This class holds parameters for transport properties expressed as a matrix + * of pairwise interaction parameters. Input can be provided for constant or + * Arrhenius forms of the separate parameters. * * Sample input for this method is * \verbatim @@ -421,18 +379,15 @@ protected: * * * \endverbatim - * */ class LTI_Pairwise_Interaction : public LiquidTranInteraction { - public: LTI_Pairwise_Interaction(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_PAIRWISE_INTERACTION; } - //! Copy constructor // LTI_Pairwise_Interaction( const LTI_Pairwise_Interaction &right ); @@ -443,9 +398,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -530,7 +484,6 @@ protected: * * * \endverbatim - * */ class LTI_StefanMaxwell_PPN : public LiquidTranInteraction { @@ -541,7 +494,6 @@ public: m_model = LTI_MODEL_STEFANMAXWELL_PPN; } - //! Copy constructor // LTI_StefanMaxwell_PPN( const LTI_StefanMaxwell_PPN &right ); @@ -552,9 +504,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -567,7 +518,6 @@ public: void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) ; protected: - doublereal m_ionCondMix; LiquidTranInteraction* m_ionCondMixModel; std::vector m_ionCondSpecies; @@ -584,14 +534,12 @@ protected: class LTI_StokesEinstein : public LiquidTranInteraction { - public: LTI_StokesEinstein(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_STOKES_EINSTEIN; } - //! Copy constructor // LTI_StokesEinstein( const LTI_StokesEinstein &right ); @@ -615,32 +563,28 @@ public: * and calculates them */ void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) ; -protected: +protected: std::vector m_viscosity; std::vector m_hydroRadius; - }; //! Simple mole fraction weighting of transport properties /** - * This model weights the transport property by the mole - * fractions. - * The overall formula for the mixture viscosity is + * This model weights the transport property by the mole fractions. The + * overall formula for the mixture viscosity is * * \f[ \eta_{mix} = \sum_i X_i \eta_i * + \sum_i \sum_j X_i X_j A_{i,j} \f]. */ class LTI_MoleFracs_ExpT : public LiquidTranInteraction { - public: LTI_MoleFracs_ExpT(TransportPropertyType tp_ind = TP_UNKNOWN) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_MOLEFRACS_EXPT; } - //! Copy constructor // LTI_MoleFracs_ExpT( const LTI_MoleFracs_ExpT &right ); @@ -649,9 +593,8 @@ public: //! Return the mixture transport property value. /** - * Takes the separate species transport properties - * as input (this method does not know what - * transport property it is at this point. + * Takes the separate species transport properties as input (this method + * does not know what transport property it is at this point. */ doublereal getMixTransProp(doublereal* valueSpecies, doublereal* weightSpecies = 0); doublereal getMixTransProp(std::vector LTPptrs) ; @@ -664,10 +607,6 @@ public: void getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues = 0) { mat = (*m_Aij[0]); } - //CAL void getMatrixTransProp( DenseMatrix &mat, LiquidTransport* lt, doublereal* speciesValues = 0 ) { mat = (*m_Aij[0]); } - -protected: - }; } diff --git a/src/transport/LiquidTranInteraction.cpp b/src/transport/LiquidTranInteraction.cpp index 1fdecc9ca..890dd8b69 100644 --- a/src/transport/LiquidTranInteraction.cpp +++ b/src/transport/LiquidTranInteraction.cpp @@ -42,11 +42,6 @@ public: + msg + "\n") {} }; - -// Constructor -/* - * @param tp_ind Index indicating transport property type (i.e. viscosity) - */ LiquidTranInteraction::LiquidTranInteraction(TransportPropertyType tp_ind) : m_model(LTI_MODEL_NOTSET), m_property(tp_ind) @@ -73,12 +68,9 @@ LiquidTranInteraction::~LiquidTranInteraction() } } -//==================================================================================================================== - void LiquidTranInteraction::init(const XML_Node& compModelNode, thermo_t* thermo) { - m_thermo = thermo; size_t nsp = thermo->nSpecies(); @@ -209,13 +201,11 @@ void LiquidTranInteraction::init(const XML_Node& compModelNode, } } -// Copy constructor LiquidTranInteraction::LiquidTranInteraction(const LiquidTranInteraction& right) { *this = right; //use assignment operator to do other work } -// Assignment operator LiquidTranInteraction& LiquidTranInteraction::operator=(const LiquidTranInteraction& right) { if (&right != this) { @@ -233,18 +223,14 @@ LiquidTranInteraction& LiquidTranInteraction::operator=(const LiquidTranInteract return *this; } - -//==================================================================================================================== LTI_Solvent::LTI_Solvent(TransportPropertyType tp_ind) : LiquidTranInteraction(tp_ind) { m_model = LTI_MODEL_SOLVENT; } -//==================================================================================================================== doublereal LTI_Solvent::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -289,10 +275,9 @@ doublereal LTI_Solvent::getMixTransProp(doublereal* speciesValues, doublereal* s return value; } -//==================================================================================================================== + doublereal LTI_Solvent::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -320,17 +305,14 @@ doublereal LTI_Solvent::getMixTransProp(std::vector LTPptrs) return value; } -//==================================================================================================================== + void LTI_Solvent::getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues) { mat = (*m_Aij[0]); } -//==================================================================================================================== - doublereal LTI_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -362,10 +344,8 @@ doublereal LTI_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal* return value; } - doublereal LTI_MoleFracs::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -391,10 +371,8 @@ doublereal LTI_MoleFracs::getMixTransProp(std::vector LTPptrs) return value; } - doublereal LTI_MassFracs::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp massfracs(nsp); @@ -426,10 +404,8 @@ doublereal LTI_MassFracs::getMixTransProp(doublereal* speciesValues, doublereal* return value; } - doublereal LTI_MassFracs::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp massfracs(nsp); @@ -456,12 +432,8 @@ doublereal LTI_MassFracs::getMixTransProp(std::vector LTPptrs) return value; } - - - doublereal LTI_Log_MoleFracs::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -497,10 +469,8 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(doublereal* speciesValues, doubler return exp(value); } - doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -538,10 +508,6 @@ doublereal LTI_Log_MoleFracs::getMixTransProp(std::vector LTPptrs) return value; } - - - - void LTI_Pairwise_Interaction::setParameters(LiquidTransportParams& trParam) { size_t nsp = m_thermo->nSpecies(); @@ -557,7 +523,6 @@ void LTI_Pairwise_Interaction::setParameters(LiquidTransportParams& trParam) doublereal LTI_Pairwise_Interaction::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -569,10 +534,8 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(doublereal* speciesValues, return value; } - doublereal LTI_Pairwise_Interaction::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -586,7 +549,6 @@ doublereal LTI_Pairwise_Interaction::getMixTransProp(std::vector LT void LTI_Pairwise_Interaction::getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -604,7 +566,6 @@ void LTI_Pairwise_Interaction::getMatrixTransProp(DenseMatrix& mat, doublereal* } } - void LTI_StefanMaxwell_PPN::setParameters(LiquidTransportParams& trParam) { size_t nsp = m_thermo->nSpecies(); @@ -650,7 +611,6 @@ void LTI_StefanMaxwell_PPN::setParameters(LiquidTransportParams& trParam) doublereal LTI_StefanMaxwell_PPN::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -662,10 +622,8 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(doublereal* speciesValues, dou return value; } - doublereal LTI_StefanMaxwell_PPN::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -679,8 +637,6 @@ doublereal LTI_StefanMaxwell_PPN::getMixTransProp(std::vector LTPpt void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* speciesValues) { - //CAL - IonsFromNeutralVPSSTP* ions_thermo = dynamic_cast(m_thermo); size_t nsp = m_thermo->nSpecies(); if (nsp != 3) { @@ -755,13 +711,10 @@ void LTI_StefanMaxwell_PPN::getMatrixTransProp(DenseMatrix& mat, doublereal* spe mat(cation[0],cation[1]) = mat(cation[1],cation[0]) = (1+vM/vP)*(1+eps*xB)*(1-eps*xA)*inv_vP_vM_MutualDiff-zP*zP*Faraday*Faraday/GasConstant/temp/m_ionCondMix/vol; mat(cation[0],anion[0]) = mat(anion[0],cation[0]) = (1+vP/vM)*(-eps*xB*(1-eps*xA)*inv_vP_vM_MutualDiff)-zP*zM*Faraday*Faraday/GasConstant/temp/m_ionCondMix/vol; mat(cation[1],anion[0]) = mat(anion[0],cation[1]) = (1+vP/vM)*(eps*xA*(1+eps*xB)*inv_vP_vM_MutualDiff)-zP*zM*Faraday*Faraday/GasConstant/temp/m_ionCondMix/vol; - } - doublereal LTI_StokesEinstein::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -773,10 +726,8 @@ doublereal LTI_StokesEinstein::getMixTransProp(doublereal* speciesValues, double return value; } - doublereal LTI_StokesEinstein::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); vector_fp molefracs(nsp); m_thermo->getMoleFractions(&molefracs[0]); @@ -788,8 +739,6 @@ doublereal LTI_StokesEinstein::getMixTransProp(std::vector LTPptrs) return value; } - - void LTI_StokesEinstein::setParameters(LiquidTransportParams& trParam) { size_t nsp = m_thermo->nSpecies(); @@ -824,7 +773,6 @@ void LTI_StokesEinstein::getMatrixTransProp(DenseMatrix& mat, doublereal* specie doublereal LTI_MoleFracs_ExpT::getMixTransProp(doublereal* speciesValues, doublereal* speciesWeight) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -853,10 +801,8 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(doublereal* speciesValues, double return value; } - doublereal LTI_MoleFracs_ExpT::getMixTransProp(std::vector LTPptrs) { - size_t nsp = m_thermo->nSpecies(); doublereal temp = m_thermo->temperature(); vector_fp molefracs(nsp); @@ -879,6 +825,4 @@ doublereal LTI_MoleFracs_ExpT::getMixTransProp(std::vector LTPptrs) return value; } - - } //namespace Cantera