Switched a call in MultiPhase to be public.

switched velocityBasis to a typedef. It seemed the better solution. Note the concept is still basically undeveloped.
Doxygen changes - supporting 1.6.2
This commit is contained in:
Harry Moffat 2009-12-30 17:58:38 +00:00
parent 3b8018e5fb
commit fabfb44b4e
9 changed files with 1634 additions and 144 deletions

View file

@ -183,6 +183,7 @@ namespace Cantera {
updateMoleFractions();
updatePhases();
}

View file

@ -549,8 +549,6 @@ namespace Cantera {
*/
void uploadMoleFractionsFromPhases();
private:
//! Set the states of the phase objects to the locally-stored
//! state within this MultiPhase object.
/*!
@ -567,6 +565,7 @@ namespace Cantera {
*/
void updatePhases() const;
private:
//! Calculate the element abundance vector
void calcElemAbundances() const;

View file

@ -189,7 +189,7 @@ namespace Cantera {
int k;
// constant substance attributes
m_thermo = tr.thermo;
m_velocityBasis = tr.velocityBasis;
m_velocityBasis = tr.velocityBasis_;
m_nsp = m_thermo->nSpecies();
m_tmin = m_thermo->minTemp();
m_tmax = m_thermo->maxTemp();

View file

@ -57,17 +57,35 @@ namespace Cantera {
// forward reference
class XML_Writer;
/** The diffusion velocities can be referenced to a variety of things.
* Most typical is to reference to the mass averaged velocity, but
//! The diffusion fluxes must be referenced to a particular reference
//! fluid velocity.
/*!
* Most typical is to reference the diffusion fluxes to the mass averaged velocity, but
* referencing to the mole averaged velocity is suitable for some
* liquid flows and referencing to a single species is suitable for
* some solvent mixtures. This enum should provide a means to identify
* the reference velocity used for the transport model.
* liquid flows, and referencing to a single species is suitable for
* solid phase transport within a lattice. Currently, the identity of the reference
* velocity is coded into each transport object as a typedef named VelocityBasis, which
* is equated to an integer. Negative values of this variable refer to mass or mole-averaged
* velocities. Zero or positive quantities refers to the reference
* velocity being referenced to a particular species. Below are the predefined constants
* for its value.
*
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
* - VB_SPECIES_1 Diffusion velocities are based on the relative motion wrt species 1
*
*/
enum VelocityBasis {
VB_MOLEAVG = -2,
VB_MASSAVG = -1
};
typedef int VelocityBasis;
//! Diffusion velocities are based on the mass averaged velocity
const VelocityBasis VB_MASSAVG = -1;
//! Diffusion velocities are based on the mole averaged velocities
const VelocityBasis VB_MOLEAVG = -2;
//! Diffusion velocities are based on the relative motion wrt species 0
const VelocityBasis VB_SPECIES_0 = 0;
//! Diffusion velocities are based on the relative motion wrt species 1
const VelocityBasis VB_SPECIES_1 = 1;
//! Base class for transport property managers.
/*!
@ -106,6 +124,33 @@ namespace Cantera {
* also implicitly assumed that the underlying state within the ThermoPhase
* object has not changed its values.
*
*
* <HR>
* <H2> Diffusion Fluxes and their Relationship to Reference Velocities </H2>
* <HR>
*
* The diffusion fluxes must be referenced to a particular reference
* fluid velocity.
* Most typical is to reference the diffusion fluxes to the mass averaged velocity, but
* referencing to the mole averaged velocity is suitable for some
* liquid flows, and referencing to a single species is suitable for
* solid phase transport within a lattice. Currently, the identity of the reference
* velocity is coded into each transport object as a typedef named VelocityBasis, which
* is equated to an integer. Negative values of this variable refer to mass or mole-averaged
* velocities. Zero or positive quantities refers to the reference
* velocity being referenced to a particular species. Below are the predefined constants
* for its value.
*
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
* - VB_SPECIES_1 Diffusion velocities are based on the relative motion wrt species 1
*
* All transport managers specify a default reference velocity in their default constructors.
* All gas phase transport managers by default specify the mass-averaged velocity as their
* reference velocities.
*
*
* @todo Provide a general mechanism to store the gradients of state variables
* within the system.
*
@ -587,7 +632,7 @@ namespace Cantera {
*
* @param ivb Species the velocity basis
*/
void setVelocityBasis(int ivb)
void setVelocityBasis(VelocityBasis ivb)
{
m_velocityBasis = ivb;
}
@ -600,7 +645,7 @@ namespace Cantera {
*
* @return Returns the velocity basis
*/
int getVelocityBasis( ) const {
VelocityBasis getVelocityBasis( ) const {
return m_velocityBasis;
}

View file

@ -1111,15 +1111,15 @@ namespace Cantera {
* <velocityBasis basis="mole"> <!-- mole averaged -->
* <velocityBasis basis="H2O"> <!-- H2O solvent -->
*/
if ( tranTypeNode.hasChild("velocityBasis")) {
if (tranTypeNode.hasChild("velocityBasis")) {
std::string velocityBasis =
tranTypeNode.child("velocityBasis").attrib("basis");
if ( velocityBasis == "mass" )
trParam.velocityBasis = VB_MASSAVG;
else if ( velocityBasis == "mole" )
trParam.velocityBasis = VB_MOLEAVG;
else if ( trParam.thermo->speciesIndex( velocityBasis ) > 0 )
trParam.velocityBasis = trParam.thermo->speciesIndex( velocityBasis ) ;
if (velocityBasis == "mass")
trParam.velocityBasis_ = VB_MASSAVG;
else if (velocityBasis == "mole")
trParam.velocityBasis_ = VB_MOLEAVG;
else if (trParam.thermo->speciesIndex(velocityBasis) > 0)
trParam.velocityBasis_ = trParam.thermo->speciesIndex(velocityBasis) ;
else {
int linenum;
throw TransportDBError( linenum, "Unknown attribute " + velocityBasis + " for <velocityBasis> node. ");

View file

@ -19,11 +19,12 @@ namespace Cantera {
public:
//! Default Constructor
TransportParams() :
nsp_(0),
thermo(0),
mw(0),
velocityBasis(VB_MASSAVG),
velocityBasis_(VB_MASSAVG),
tmax(1000000.),
tmin(10.),
mode_(0),
@ -32,6 +33,7 @@ namespace Cantera {
{
}
//! Destructor
virtual ~TransportParams()
{
#ifdef DEBUG_MODE
@ -39,20 +41,37 @@ namespace Cantera {
#endif
}
//! Local storage of the number of species
int nsp_;
// phase_t* mix;
//! Pointer to the ThermoPhase object
thermo_t* thermo;
//! Local storage of the molecular weights of the species
/*!
* Length is nsp_ and units are kg kmol-1.
*/
vector_fp mw;
//! A basis for the average velocity can be specified.
//! Valid bases include "mole" "mass" and species names.
int velocityBasis;
/*!
* Valid bases include "mole", "mass", and "species" names.
*/
VelocityBasis velocityBasis_;
//minimum and maximum temperatures for parameter fits
//! Maximum temperatures for parameter fits
doublereal tmax;
//! Minimum temperatures for parameter fits
doublereal tmin;
//! Mode parameter
int mode_;
//! Pointer to the xml tree describing the implementation of transport for this object
XML_Writer* xml;
//! Log level
int log_level;
};

View file

@ -31,6 +31,9 @@ export WITH_ELECTROLYTES
WITH_VCSNONIDEAL="y"
export WITH_VCSNONIDEAL
WITH_H298MODIFY_CAPABILITY="y"
export WITH_H298MODIFY_CAPABILITY
BUILD_MATLAB_TOOLBOX="y"
export BUILD_MATLAB_TOOLBOX

View file

@ -29,6 +29,9 @@ export WITH_ELECTROLYTES
WITH_VCSNONIDEAL="y"
export WITH_VCSNONIDEAL
WITH_H298MODIFY_CAPABILITY="y"
export WITH_H298MODIFY_CAPABILITY
BUILD_MATLAB_TOOLBOX="y"
export BUILD_MATLAB_TOOLBOX

File diff suppressed because it is too large Load diff