The species-specific transport properties are now held in
vector<LTPspecies*> m_viscTempDep_Ns;
Previously they were held in two objects, the first identifying the
model type
vector<LiquidTR_Model> m_viscTempDepType_Ns;
and the second holding the model coefficients
std::vector<Coeff_T_> m_coeffVisc_Ns;
This greatly simplifies the assignment of coefficients from
LiquidTransportParams in initLiquid()
This also greatly simplifies the methods
void LiquidTransport::updateCond_T()
void LiquidTransport::updateViscosity_T()
void LiquidTransport::updateHydrodynamicRadius_T()
Since the pointed-to-LTPspecies classes (subclasses actually) are
created with new in TransportFactory::newLTP, these are deleted in
~LiquidTransport()
Similar changes made to SimpleTransport.h SimpleTransport.cpp
This commit is contained in:
parent
c14ec7268a
commit
5806bc13e7
4 changed files with 103 additions and 290 deletions
|
|
@ -48,6 +48,7 @@ namespace Cantera {
|
|||
m_visc_mix_ok(false),
|
||||
m_visc_temp_ok(false),
|
||||
m_visc_conc_ok(false),
|
||||
m_radi_mix_ok(false),
|
||||
m_radi_temp_ok(false),
|
||||
m_radi_conc_ok(false),
|
||||
m_diff_mix_ok(false),
|
||||
|
|
@ -75,6 +76,7 @@ namespace Cantera {
|
|||
m_visc_mix_ok(false),
|
||||
m_visc_temp_ok(false),
|
||||
m_visc_conc_ok(false),
|
||||
m_radi_mix_ok(false),
|
||||
m_radi_temp_ok(false),
|
||||
m_radi_conc_ok(false),
|
||||
m_diff_mix_ok(false),
|
||||
|
|
@ -93,7 +95,7 @@ namespace Cantera {
|
|||
}
|
||||
|
||||
LiquidTransport& LiquidTransport::operator=(const LiquidTransport& right) {
|
||||
if (&right != this) {
|
||||
if (&right == this) {
|
||||
return *this;
|
||||
}
|
||||
Transport::operator=(right);
|
||||
|
|
@ -101,14 +103,10 @@ namespace Cantera {
|
|||
m_tmin = right.m_tmin;
|
||||
m_tmax = right.m_tmax;
|
||||
m_mw = right.m_mw;
|
||||
m_viscTempDepType_Ns = right.m_viscTempDepType_Ns;
|
||||
m_lambdaTempDepType_Ns = right.m_lambdaTempDepType_Ns;
|
||||
m_diffTempDepType_Ns = right.m_diffTempDepType_Ns;
|
||||
m_radiusTempDepType_Ns = right.m_radiusTempDepType_Ns;
|
||||
m_coeffVisc_Ns = right.m_coeffVisc_Ns;
|
||||
m_coeffLambda_Ns = right.m_coeffLambda_Ns;
|
||||
m_coeffDiff_Ns = right.m_coeffDiff_Ns;
|
||||
m_coeffRadius_Ns = right.m_coeffRadius_Ns;
|
||||
m_viscTempDep_Ns = right.m_viscTempDep_Ns;
|
||||
m_lambdaTempDep_Ns = right.m_lambdaTempDep_Ns;
|
||||
m_diffTempDep_Ns = right.m_diffTempDep_Ns;
|
||||
m_radiusTempDep_Ns = right.m_radiusTempDep_Ns;
|
||||
m_visc_Eij = right.m_visc_Eij;
|
||||
m_visc_Sij = right.m_visc_Sij;
|
||||
m_hydrodynamic_radius = right.m_hydrodynamic_radius;
|
||||
|
|
@ -146,6 +144,7 @@ namespace Cantera {
|
|||
m_visc_mix_ok = false;
|
||||
m_visc_temp_ok = false;
|
||||
m_visc_conc_ok = false;
|
||||
m_radi_mix_ok = false;
|
||||
m_radi_temp_ok = false;
|
||||
m_radi_conc_ok = false;
|
||||
m_diff_mix_ok = false;
|
||||
|
|
@ -165,6 +164,17 @@ namespace Cantera {
|
|||
return (dynamic_cast<Transport *>(tr));
|
||||
}
|
||||
|
||||
LiquidTransport::~LiquidTransport() {
|
||||
|
||||
//These are constructed in TransportFactory::newLTP
|
||||
for ( int k = 0; k < m_nsp; k++) {
|
||||
delete m_viscTempDep_Ns[k];
|
||||
delete m_lambdaTempDep_Ns[k];
|
||||
delete m_radiusTempDep_Ns[k];
|
||||
delete m_diffTempDep_Ns[k];
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the object
|
||||
/*
|
||||
* This is where we dimension everything.
|
||||
|
|
@ -187,117 +197,36 @@ namespace Cantera {
|
|||
* Get the input Viscosities
|
||||
*/
|
||||
m_viscSpecies.resize(m_nsp);
|
||||
m_coeffVisc_Ns.clear();
|
||||
m_coeffVisc_Ns.resize(m_nsp);
|
||||
m_viscTempDepType_Ns.resize(m_nsp);
|
||||
m_viscTempDep_Ns.resize(m_nsp);
|
||||
|
||||
//for each species, assign viscosity model and coefficients
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
//specify temperature dependence
|
||||
m_viscTempDepType_Ns[k] = ltd.model_viscosity;
|
||||
//vector kentry corresponds to the k-th entry of m_coeffVisc_Ns
|
||||
vector_fp &kentry = m_coeffVisc_Ns[k];
|
||||
|
||||
if ( m_viscTempDepType_Ns[k] == LTR_MODEL_CONSTANT
|
||||
|| m_viscTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
kentry = ltd.viscCoeffs;
|
||||
|
||||
} else if ( m_viscTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
kentry = ltd.viscCoeffs;
|
||||
//for Arrhenius form, also carry the logarithm of the pre-exponential
|
||||
kentry.push_back( log( kentry[0] ) ); //should be entry [3]
|
||||
|
||||
} else if ( m_viscTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
//we might be OK with viscosity not being set so
|
||||
// this error is repeated in updateViscosity_T()
|
||||
// and can be deleted from here if appropriate
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Viscosity Model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Viscosity Model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_viscTempDep_Ns[k] = ltd.viscosity;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the input Thermal Conductivities
|
||||
*/
|
||||
m_lambdaSpecies.resize(m_nsp);
|
||||
m_coeffLambda_Ns.clear();
|
||||
m_coeffLambda_Ns.resize(m_nsp);
|
||||
m_lambdaTempDepType_Ns.resize(m_nsp);
|
||||
m_lambdaTempDep_Ns.resize(m_nsp);
|
||||
|
||||
//for each species, assign viscosity model and coefficients
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
//specify temperature dependence
|
||||
m_lambdaTempDepType_Ns[k] = ltd.model_thermalCond;
|
||||
//vector kentry corresponds to the k-th entry of m_coeffLambda_Ns
|
||||
vector_fp &kentry = m_coeffLambda_Ns[k];
|
||||
|
||||
if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_CONSTANT
|
||||
|| m_lambdaTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
kentry = ltd.thermalCondCoeffs;
|
||||
|
||||
} else if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
kentry = ltd.thermalCondCoeffs;
|
||||
//for Arrhenius form, also carry the logarithm of the pre-exponential
|
||||
kentry.push_back( log( kentry[0] ) );//should be entry [3]
|
||||
|
||||
} else if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Thermal conductivity model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Thermal conductivity model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_lambdaTempDep_Ns[k] = ltd.thermalCond;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the input Hydrodynamic Radii
|
||||
*/
|
||||
m_hydrodynamic_radius.resize(m_nsp);
|
||||
m_coeffRadius_Ns.clear();
|
||||
m_coeffRadius_Ns.resize(m_nsp);
|
||||
m_radiusTempDepType_Ns.resize(m_nsp);
|
||||
m_radiusTempDep_Ns.resize(m_nsp);
|
||||
|
||||
//for each species, assign viscosity model and coefficients
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
//specify temperature dependence
|
||||
m_radiusTempDepType_Ns[k] = ltd.model_hydroradius;
|
||||
//vector kentry corresponds to the k-th entry of m_coeffRadius_Ns
|
||||
vector_fp &kentry = m_coeffRadius_Ns[k];
|
||||
|
||||
if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_CONSTANT
|
||||
|| m_radiusTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
kentry = ltd.hydroRadiusCoeffs;
|
||||
|
||||
} else if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
kentry = ltd.hydroRadiusCoeffs;
|
||||
//for Arrhenius form, also carry the logarithm of the pre-exponential
|
||||
kentry.push_back( log( kentry[0] ) );//should be entry [3]
|
||||
|
||||
} else if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Hydrodynamic radius model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::initLiquid",
|
||||
"Hydrodynamic radius model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_radiusTempDep_Ns[k] = ltd.hydroradius;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -308,24 +237,20 @@ namespace Cantera {
|
|||
* be extraneous.
|
||||
*/
|
||||
// m_viscSpecies.resize(m_nsp);
|
||||
m_coeffDiff_Ns.clear();
|
||||
m_coeffDiff_Ns.resize(m_nsp);
|
||||
m_diffTempDepType_Ns.resize(m_nsp);
|
||||
m_diffTempDep_Ns.resize(m_nsp);
|
||||
|
||||
//for each species, assign viscosity model and coefficients
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
//specify temperature dependence
|
||||
if ( ltd.model_speciesDiffusivity >= 0
|
||||
|| ltd.speciesDiffusivityCoeffs.size() > 0 ) {
|
||||
if ( ltd.speciesDiffusivity >= 0 ) {
|
||||
cout << "Warning: diffusion coefficient data for "
|
||||
<< m_thermo->speciesName(k)
|
||||
<< endl
|
||||
<< "in the input file is not used for LiquidTransport model."
|
||||
<< endl
|
||||
<< "LiquidTransport model uses hydrodynamicRadius, viscosity "
|
||||
<< "LiquidTransport model uses Stefan-Maxwell interaction "
|
||||
<< endl
|
||||
<< "and the Stokes-Einstein equation or Interaction Model."
|
||||
<< "parameters defined in the <transport> input block."
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
|
@ -957,7 +882,7 @@ namespace Cantera {
|
|||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
m_Grad_lnAC[k] = grad_lnAC[k];
|
||||
std::cout << k << " m_Grad_lnAC = " << m_Grad_lnAC[k] << std::endl;
|
||||
// std::cout << k << " m_Grad_lnAC = " << m_Grad_lnAC[k] << std::endl;
|
||||
}
|
||||
|
||||
return;
|
||||
|
|
@ -978,36 +903,7 @@ namespace Cantera {
|
|||
int k;
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
vector_fp &coeffk = m_coeffLambda_Ns[k];
|
||||
|
||||
if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_CONSTANT ) {
|
||||
m_lambdaSpecies[k] = coeffk[0] ;
|
||||
|
||||
} else if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
//m_coeffLambda_Ns[k][0] holds A
|
||||
//m_coeffLambda_Ns[k][1] holds n
|
||||
//m_coeffLambda_Ns[k][2] holds Tact
|
||||
//m_coeffLambda_Ns[k][3] holds log(A)
|
||||
m_lambdaSpecies[k] = coeffk[0] * exp( coeffk[1] * m_logt
|
||||
- coeffk[2] / m_temp );
|
||||
|
||||
} else if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
double tempN = 1.0;
|
||||
for ( int i = 0; i < coeffk.size() ; i++ ) {
|
||||
m_lambdaSpecies[k] += coeffk[i] * tempN;
|
||||
tempN *= m_temp;
|
||||
}
|
||||
} else if ( m_lambdaTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
throw CanteraError("LiquidTransport::updateCond_T",
|
||||
"Conductivity Model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::updateCond_T",
|
||||
"Conductivity Model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_lambdaSpecies[k] = m_lambdaTempDep_Ns[k]->getSpeciesTransProp() ;
|
||||
}
|
||||
m_cond_temp_ok = true;
|
||||
m_cond_mix_ok = false;
|
||||
|
|
@ -1031,10 +927,12 @@ namespace Cantera {
|
|||
for (j = 0; j < m_nsp; j++) {
|
||||
m_DiffCoeff_StefMax(i,j) = m_bdiff(i,j) = GasConstant * m_temp
|
||||
/ ( 6.0 * Pi * radiusSpec[i] * viscSpec[j] ) ;
|
||||
cout << " D_ij = " << m_bdiff(i,j) << " for "
|
||||
cout << "unused D_ij = " << m_bdiff(i,j) << " for "
|
||||
<< m_thermo->speciesName(i) << ", "
|
||||
<< m_thermo->speciesName(j) << endl;
|
||||
}
|
||||
delete radiusSpec;
|
||||
delete viscSpec;
|
||||
m_diff_temp_ok = true;
|
||||
m_diff_mix_ok = false;
|
||||
}
|
||||
|
|
@ -1064,48 +962,17 @@ namespace Cantera {
|
|||
int k;
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
vector_fp &coeffk = m_coeffVisc_Ns[k];
|
||||
|
||||
if ( m_viscTempDepType_Ns[k] == LTR_MODEL_CONSTANT ) {
|
||||
m_logViscSpecies[k] = log( coeffk[0] );
|
||||
m_viscSpecies[k] = coeffk[0] ;
|
||||
|
||||
} else if ( m_viscTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
//m_coeffVisc_Ns[k][0] holds A
|
||||
//m_coeffVisc_Ns[k][1] holds n
|
||||
//m_coeffVisc_Ns[k][2] holds Tact
|
||||
//m_coeffVisc_Ns[k][3] holds log(A)
|
||||
m_logViscSpecies[k] = coeffk[3] + coeffk[1] * m_logt
|
||||
+ coeffk[2] / m_temp ;
|
||||
m_viscSpecies[k] = exp( m_logViscSpecies[k] );
|
||||
|
||||
} else if ( m_viscTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
double tempN = 1.0;
|
||||
for ( int i = 0; i < coeffk.size() ; i++ ) {
|
||||
m_viscSpecies[k] += coeffk[i] * tempN;
|
||||
tempN *= m_temp;
|
||||
}
|
||||
|
||||
} else if ( m_viscTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
throw CanteraError("LiquidTransport::updateViscosity_T",
|
||||
"Viscosity Model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::updateViscosity_T",
|
||||
"Viscosity Model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_visc_temp_ok = true;
|
||||
m_visc_mix_ok = false;
|
||||
m_viscSpecies[k] = m_viscTempDep_Ns[k]->getSpeciesTransProp() ;
|
||||
m_logViscSpecies[k] = log( m_viscSpecies[k] );
|
||||
}
|
||||
m_visc_temp_ok = true;
|
||||
m_visc_mix_ok = false;
|
||||
}
|
||||
|
||||
|
||||
//! Update the pure-species viscosities functional dependence on concentration.
|
||||
void LiquidTransport::updateHydrodynamicRadius_C() {
|
||||
m_visc_conc_ok = true;
|
||||
m_radi_conc_ok = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1119,39 +986,10 @@ namespace Cantera {
|
|||
int k;
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
vector_fp &coeffk = m_coeffRadius_Ns[k];
|
||||
|
||||
if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_CONSTANT ) {
|
||||
m_hydrodynamic_radius[k] = coeffk[0] ;
|
||||
|
||||
} else if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_ARRHENIUS ) {
|
||||
//m_coeffRadius_Ns[k][0] holds A
|
||||
//m_coeffRadius_Ns[k][1] holds n
|
||||
//m_coeffRadius_Ns[k][2] holds Tact
|
||||
//m_coeffRadius_Ns[k][3] holds log(A)
|
||||
m_hydrodynamic_radius[k] = coeffk[0] * exp( coeffk[1] * m_logt
|
||||
- coeffk[2] / m_temp );
|
||||
|
||||
} else if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_POLY ) {
|
||||
double tempN = 1.0;
|
||||
for ( int i = 0; i < coeffk.size() ; i++ ) {
|
||||
m_hydrodynamic_radius[k] += coeffk[i] * tempN;
|
||||
tempN *= m_temp;
|
||||
}
|
||||
} else if ( m_radiusTempDepType_Ns[k] == LTR_MODEL_NOTSET ) {
|
||||
throw CanteraError("LiquidTransport::updateHydrodynamicRadius_T",
|
||||
"Hydrodynamic Radius Model is not set for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " in the input file");
|
||||
} else {
|
||||
throw CanteraError("LiquidTransport::updateHydrodynamicRadius_T",
|
||||
"Hydrodynamic Radius Model for species "
|
||||
+ m_thermo->speciesName(k)
|
||||
+ " is not handled by this object");
|
||||
}
|
||||
m_radi_temp_ok = true;
|
||||
m_diff_mix_ok = false;
|
||||
}
|
||||
m_hydrodynamic_radius[k] = m_radiusTempDep_Ns[k]->getSpeciesTransProp() ;
|
||||
}
|
||||
m_radi_temp_ok = true;
|
||||
m_radi_mix_ok = false;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,16 +30,6 @@ using namespace std;
|
|||
|
||||
namespace Cantera {
|
||||
|
||||
const int LVISC_CONSTANT = 0;
|
||||
const int LVISC_INTERACTION = 1;
|
||||
const int LVISC_AVG_ENERGIES = 2;
|
||||
|
||||
const int LDIFF_CONSTANT = 0;
|
||||
const int LDIFF_ARHENNIUS = 1;
|
||||
const int LDIFF_STOKES_EINSTEIN = 2;
|
||||
|
||||
|
||||
|
||||
class LiquidTransportParams;
|
||||
|
||||
|
||||
|
|
@ -180,7 +170,7 @@ namespace Cantera {
|
|||
|
||||
|
||||
//! virtual destructor
|
||||
virtual ~LiquidTransport() {}
|
||||
virtual ~LiquidTransport();
|
||||
|
||||
//! Initialize the transport object
|
||||
/*!
|
||||
|
|
@ -540,10 +530,7 @@ namespace Cantera {
|
|||
* 1 - extended arrhenius form
|
||||
* 2 - polynomial in temperature form
|
||||
*/
|
||||
vector<LiquidTR_Model> m_viscTempDepType_Ns;
|
||||
|
||||
//! Pure species viscosities in temperature-dependent form.
|
||||
std::vector<Coeff_T_> m_coeffVisc_Ns;
|
||||
std::vector<LTPspecies*> m_viscTempDep_Ns;
|
||||
|
||||
//! Viscosity mixing model type
|
||||
/*!
|
||||
|
|
@ -575,10 +562,7 @@ namespace Cantera {
|
|||
* 1 - extended arrhenius form
|
||||
* 2 - polynomial in temperature form
|
||||
*/
|
||||
vector<LiquidTR_Model> m_lambdaTempDepType_Ns;
|
||||
|
||||
//! Pure species thermal conductivities in temperature-dependent form.
|
||||
std::vector<Coeff_T_> m_coeffLambda_Ns;
|
||||
std::vector<LTPspecies*> m_lambdaTempDep_Ns;
|
||||
|
||||
//! Thermal conductivity mixing model type
|
||||
/*!
|
||||
|
|
@ -602,11 +586,7 @@ namespace Cantera {
|
|||
* 1 - extended arrhenius form
|
||||
* 2 - polynomial in temperature form
|
||||
*/
|
||||
vector<LiquidTR_Model> m_diffTempDepType_Ns;
|
||||
|
||||
//! Pure species diffusvities in temperature-dependent form.
|
||||
//! Not currently used since we get diffusivity from hydrodynamic radius.
|
||||
std::vector<Coeff_T_> m_coeffDiff_Ns;
|
||||
std::vector<LTPspecies*> m_diffTempDep_Ns;
|
||||
|
||||
//! Species diffusivity mixing model type
|
||||
/*!
|
||||
|
|
@ -619,7 +599,7 @@ namespace Cantera {
|
|||
DenseMatrix m_diff_Dij;
|
||||
|
||||
|
||||
vector<bool> useHydroRadius_;
|
||||
std::vector<bool> useHydroRadius_;
|
||||
|
||||
//!Hydrodynamic radius temperature dependence type
|
||||
/*!
|
||||
|
|
@ -628,10 +608,7 @@ namespace Cantera {
|
|||
* 1 - extended arrhenius form
|
||||
* 2 - polynomial in temperature form
|
||||
*/
|
||||
vector<LiquidTR_Model> m_radiusTempDepType_Ns;
|
||||
|
||||
//! Pure hydrodynamic radius in temperature-dependent form.
|
||||
std::vector<Coeff_T_> m_coeffRadius_Ns;
|
||||
std::vector<LTPspecies*> m_radiusTempDep_Ns;
|
||||
|
||||
//! Species hydrodynamic radius
|
||||
vector_fp m_hydrodynamic_radius;
|
||||
|
|
@ -654,7 +631,7 @@ namespace Cantera {
|
|||
* added.
|
||||
*/
|
||||
/*
|
||||
vector<vector_fp> m_diffcoeffs;
|
||||
std::vector<vector_fp> m_diffcoeffs;
|
||||
*/
|
||||
|
||||
|
||||
|
|
@ -922,6 +899,9 @@ namespace Cantera {
|
|||
//! are current wrt the concentration
|
||||
bool m_visc_conc_ok;
|
||||
|
||||
//! Boolean indicating that mixture diffusion coeffs are current
|
||||
bool m_radi_mix_ok;
|
||||
|
||||
//! Boolean indicating that temperature dependence of
|
||||
//! hydrodynamic radius is current
|
||||
bool m_radi_temp_ok;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ namespace Cantera {
|
|||
}
|
||||
//================================================================================================
|
||||
SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) {
|
||||
if (&right != this) {
|
||||
if (&right == this) {
|
||||
return *this;
|
||||
}
|
||||
Transport::operator=(right);
|
||||
|
|
@ -196,10 +196,11 @@ namespace Cantera {
|
|||
m_coeffVisc_Ns.clear();
|
||||
m_coeffVisc_Ns.resize(m_nsp);
|
||||
|
||||
Cantera::LiquidTransportData <d0 = tr.LTData[0];
|
||||
//Cantera::LiquidTransportData <d0 = tr.LTData[0];
|
||||
std::string spName = m_thermo->speciesName(0);
|
||||
/*
|
||||
LiquidTR_Model vm0 = ltd0.model_viscosity;
|
||||
std::string spName0 = m_thermo->speciesName(0);
|
||||
std::string spName = m_thermo->speciesName(0);
|
||||
if (vm0 == LTR_MODEL_CONSTANT) {
|
||||
tempDepType_ = 0;
|
||||
} else if (vm0 == LTR_MODEL_ARRHENIUS) {
|
||||
|
|
@ -211,12 +212,14 @@ namespace Cantera {
|
|||
throw CanteraError("SimpleTransport::initLiquid",
|
||||
"Viscosity Model for species " + spName0 + " is not handled by this object");
|
||||
}
|
||||
*/
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
spName = m_thermo->speciesName(k);
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
LiquidTR_Model vm = ltd.model_viscosity;
|
||||
vector_fp &kentry = m_coeffVisc_Ns[k];
|
||||
//LiquidTR_Model vm = ltd.model_viscosity;
|
||||
//vector_fp &kentry = m_coeffVisc_Ns[k];
|
||||
/*
|
||||
if (vm != vm0) {
|
||||
if (compositionDepType_ != 0) {
|
||||
throw CanteraError(" SimpleTransport::initLiquid",
|
||||
|
|
@ -225,7 +228,8 @@ namespace Cantera {
|
|||
kentry = m_coeffVisc_Ns[0];
|
||||
}
|
||||
}
|
||||
kentry = ltd.viscCoeffs;
|
||||
*/
|
||||
m_coeffVisc_Ns[k] = ltd.viscosity;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -234,17 +238,18 @@ namespace Cantera {
|
|||
m_condSpecies.resize(m_nsp);
|
||||
m_coeffLambda_Ns.clear();
|
||||
m_coeffLambda_Ns.resize(m_nsp);
|
||||
LiquidTR_Model cm0 = ltd0.model_thermalCond;
|
||||
if (cm0 != vm0) {
|
||||
throw CanteraError("SimpleTransport::initLiquid",
|
||||
"Conductivity model is not the same as the viscosity model for species " + spName0);
|
||||
}
|
||||
//LiquidTR_Model cm0 = ltd0.model_thermalCond;
|
||||
//if (cm0 != vm0) {
|
||||
// throw CanteraError("SimpleTransport::initLiquid",
|
||||
// "Conductivity model is not the same as the viscosity model for species " + spName0);
|
||||
// }
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
spName = m_thermo->speciesName(k);
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
LiquidTR_Model cm = ltd.model_thermalCond;
|
||||
vector_fp &kentry = m_coeffLambda_Ns[k];
|
||||
//LiquidTR_Model cm = ltd.model_thermalCond;
|
||||
//vector_fp &kentry = m_coeffLambda_Ns[k];
|
||||
/*
|
||||
if (cm != cm0) {
|
||||
if (compositionDepType_ != 0) {
|
||||
throw CanteraError(" SimpleTransport::initLiquid",
|
||||
|
|
@ -253,7 +258,8 @@ namespace Cantera {
|
|||
kentry = m_coeffLambda_Ns[0];
|
||||
}
|
||||
}
|
||||
kentry = ltd.thermalCondCoeffs;
|
||||
*/
|
||||
m_coeffLambda_Ns[k] = ltd.thermalCond;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -264,7 +270,8 @@ namespace Cantera {
|
|||
m_diffSpecies.resize(m_nsp);
|
||||
m_coeffDiff_Ns.clear();
|
||||
m_coeffDiff_Ns.resize(m_nsp);
|
||||
LiquidTR_Model dm0 = ltd0.model_speciesDiffusivity;
|
||||
//LiquidTR_Model dm0 = ltd0.model_speciesDiffusivity;
|
||||
/*
|
||||
if (dm0 != vm0) {
|
||||
if (dm0 == LTR_MODEL_NOTSET) {
|
||||
LiquidTR_Model rm0 = ltd0.model_hydroradius;
|
||||
|
|
@ -276,10 +283,12 @@ namespace Cantera {
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
spName = m_thermo->speciesName(k);
|
||||
Cantera::LiquidTransportData <d = tr.LTData[k];
|
||||
/*
|
||||
LiquidTR_Model dm = ltd.model_speciesDiffusivity;
|
||||
if (dm == LTR_MODEL_NOTSET) {
|
||||
LiquidTR_Model rm = ltd.model_hydroradius;
|
||||
|
|
@ -296,17 +305,28 @@ namespace Cantera {
|
|||
"hydroradius model is not constant for species " + spName0);
|
||||
}
|
||||
vector_fp &kentry = m_coeffHydroRadius_Ns[k];
|
||||
kentry = ltd.hydroRadiusCoeffs;
|
||||
kentry = ltd.hydroradius;
|
||||
} else {
|
||||
if (dm != dm0) {
|
||||
throw CanteraError(" SimpleTransport::initLiquid",
|
||||
"different diffusivity models for species " + spName + " and " + spName0 );
|
||||
}
|
||||
vector_fp &kentry = m_coeffDiff_Ns[k];
|
||||
kentry = ltd.speciesDiffusivityCoeffs;
|
||||
kentry = ltd.speciesDiffusivity;
|
||||
}
|
||||
*/
|
||||
|
||||
m_coeffDiff_Ns[k] = ltd.speciesDiffusivity;
|
||||
|
||||
if ( !(m_coeffDiff_Ns[k]) ) {
|
||||
m_coeffHydroRadius_Ns[k] = ltd.hydroradius;
|
||||
if ( !(m_coeffHydroRadius_Ns[k]) ) {
|
||||
throw CanteraError("SimpleTransport::initLiquid",
|
||||
"Neither diffusivity nor hydroradius is set for species " + spName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -690,16 +710,9 @@ namespace Cantera {
|
|||
*/
|
||||
void SimpleTransport::updateCond_T() {
|
||||
int k;
|
||||
if (tempDepType_ == 0) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffLambda_Ns[k];
|
||||
m_condSpecies[k] = coeff[0];
|
||||
}
|
||||
} else if (tempDepType_ == 1) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffLambda_Ns[k];
|
||||
m_condSpecies[k] = coeff[0] * pow(m_temp,coeff[1]) * exp(-coeff[2]/m_temp);
|
||||
}
|
||||
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
m_condSpecies[k] = m_coeffLambda_Ns[k]->getSpeciesTransProp() ;
|
||||
}
|
||||
m_cond_temp_ok = true;
|
||||
m_cond_mix_ok = false;
|
||||
|
|
@ -714,24 +727,14 @@ namespace Cantera {
|
|||
double visc = viscosity();
|
||||
double RT = GasConstant * m_temp;
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffHydroRadius_Ns[k];
|
||||
double rad = coeff[0];
|
||||
double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp() ;
|
||||
m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad);
|
||||
}
|
||||
} else {
|
||||
if (tempDepType_ == 0) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffDiff_Ns[k];
|
||||
m_diffSpecies[k] = coeff[0];
|
||||
}
|
||||
} else if (tempDepType_ == 1) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffDiff_Ns[k];
|
||||
m_diffSpecies[k] = coeff[0] * pow(m_temp,coeff[1]) * exp(-coeff[2]/m_temp);
|
||||
}
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
m_diffSpecies[k] = m_coeffDiff_Ns[k]->getSpeciesTransProp();
|
||||
}
|
||||
}
|
||||
|
||||
m_diff_temp_ok = true;
|
||||
m_diff_mix_ok = false;
|
||||
}
|
||||
|
|
@ -751,16 +754,8 @@ namespace Cantera {
|
|||
*/
|
||||
void SimpleTransport::updateViscosity_T() {
|
||||
int k;
|
||||
if (tempDepType_ == 0) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffVisc_Ns[k];
|
||||
m_viscSpecies[k] = coeff[0];
|
||||
}
|
||||
} else if (tempDepType_ == 1) {
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
Coeff_T_ &coeff = m_coeffVisc_Ns[k];
|
||||
m_viscSpecies[k] = coeff[0] * pow(m_temp,coeff[1]) * exp(-coeff[2]/m_temp);
|
||||
}
|
||||
for (k = 0; k < m_nsp; k++) {
|
||||
m_viscSpecies[k] = m_coeffVisc_Ns[k]->getSpeciesTransProp();
|
||||
}
|
||||
m_visc_temp_ok = true;
|
||||
m_visc_mix_ok = false;
|
||||
|
|
|
|||
|
|
@ -490,20 +490,20 @@ namespace Cantera {
|
|||
vector_fp m_mw;
|
||||
|
||||
//! Pure species viscosities in Arrhenius temperature-dependent form.
|
||||
std::vector<Coeff_T_> m_coeffVisc_Ns;
|
||||
std::vector<LTPspecies*> m_coeffVisc_Ns;
|
||||
|
||||
//! Pure species thermal conductivities in Arrhenius temperature-dependent form.
|
||||
/*!
|
||||
*
|
||||
*/
|
||||
std::vector<Coeff_T_> m_coeffLambda_Ns;
|
||||
std::vector<LTPspecies*> m_coeffLambda_Ns;
|
||||
|
||||
|
||||
//! Pure species viscosities in Arrhenius temperature-dependent form.
|
||||
std::vector<Coeff_T_> m_coeffDiff_Ns;
|
||||
std::vector<LTPspecies*> m_coeffDiff_Ns;
|
||||
|
||||
|
||||
std::vector<Coeff_T_> m_coeffHydroRadius_Ns;
|
||||
std::vector<LTPspecies*> m_coeffHydroRadius_Ns;
|
||||
|
||||
|
||||
//! Internal value of the gradient of the mole fraction vector
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue