Remove unnecessary explicit specification of namespace Cantera
This commit is contained in:
parent
079ef0caf9
commit
d373e0751e
37 changed files with 130 additions and 134 deletions
|
|
@ -12,11 +12,10 @@ namespace Cantera
|
||||||
{
|
{
|
||||||
//! An interface between multiple bulk phases.
|
//! An interface between multiple bulk phases.
|
||||||
/*!
|
/*!
|
||||||
* This class is defined mostly for convenience. It inherits both from
|
* This class is defined mostly for convenience. It inherits both from SurfPhase
|
||||||
* Cantera::SurfPhase and Cantera::InterfaceKinetics. It therefore
|
* and InterfaceKinetics. It therefore represents a surface phase, and also acts
|
||||||
* represents a surface phase, and also acts as the kinetics
|
* as the kinetics manager to manage reactions occurring on the surface,
|
||||||
* manager to manage reactions occurring on the surface, possibly
|
* possibly involving species from other phases.
|
||||||
* involving species from other phases.
|
|
||||||
*/
|
*/
|
||||||
class Interface :
|
class Interface :
|
||||||
public SurfPhase,
|
public SurfPhase,
|
||||||
|
|
@ -35,21 +34,21 @@ public:
|
||||||
* surface phase
|
* surface phase
|
||||||
*/
|
*/
|
||||||
Interface(const std::string& infile, std::string id,
|
Interface(const std::string& infile, std::string id,
|
||||||
std::vector<Cantera::ThermoPhase*> otherPhases) :
|
std::vector<ThermoPhase*> otherPhases) :
|
||||||
m_ok(false),
|
m_ok(false),
|
||||||
m_r(0) {
|
m_r(0) {
|
||||||
m_r = Cantera::get_XML_File(infile);
|
m_r = get_XML_File(infile);
|
||||||
if (id == "-") {
|
if (id == "-") {
|
||||||
id = "";
|
id = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
Cantera::XML_Node* x = Cantera::get_XML_Node("#"+id, m_r);
|
XML_Node* x = get_XML_Node("#"+id, m_r);
|
||||||
if (!x) {
|
if (!x) {
|
||||||
throw Cantera::CanteraError("Interface","error in get_XML_Node");
|
throw CanteraError("Interface","error in get_XML_Node");
|
||||||
}
|
}
|
||||||
Cantera::importPhase(*x, this);
|
importPhase(*x, this);
|
||||||
otherPhases.push_back(this);
|
otherPhases.push_back(this);
|
||||||
Cantera::importKinetics(*x, otherPhases, this);
|
importKinetics(*x, otherPhases, this);
|
||||||
m_ok = true;
|
m_ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,8 +57,8 @@ public:
|
||||||
* @param ii Interface object to be copied.
|
* @param ii Interface object to be copied.
|
||||||
*/
|
*/
|
||||||
Interface(const Interface& ii) :
|
Interface(const Interface& ii) :
|
||||||
Cantera::SurfPhase(ii),
|
SurfPhase(ii),
|
||||||
Cantera::InterfaceKinetics(ii),
|
InterfaceKinetics(ii),
|
||||||
m_ok(ii.m_ok),
|
m_ok(ii.m_ok),
|
||||||
m_r(ii.m_r) {
|
m_r(ii.m_r) {
|
||||||
}
|
}
|
||||||
|
|
@ -72,8 +71,8 @@ public:
|
||||||
if (this == &right) {
|
if (this == &right) {
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
Cantera::SurfPhase::operator=(right);
|
SurfPhase::operator=(right);
|
||||||
Cantera::InterfaceKinetics::operator=(right);
|
InterfaceKinetics::operator=(right);
|
||||||
m_ok = right.m_ok;
|
m_ok = right.m_ok;
|
||||||
m_r = right.m_r;
|
m_r = right.m_r;
|
||||||
return *this;
|
return *this;
|
||||||
|
|
@ -98,7 +97,7 @@ protected:
|
||||||
|
|
||||||
//! XML_Node pointer to the XML File object that contains the Surface and the Interfacial Reaction object
|
//! XML_Node pointer to the XML File object that contains the Surface and the Interfacial Reaction object
|
||||||
//! description
|
//! description
|
||||||
Cantera::XML_Node* m_r;
|
XML_Node* m_r;
|
||||||
};
|
};
|
||||||
|
|
||||||
//! Import an instance of class Interface from a specification in an input file.
|
//! Import an instance of class Interface from a specification in an input file.
|
||||||
|
|
@ -107,7 +106,7 @@ protected:
|
||||||
*/
|
*/
|
||||||
inline Interface* importInterface(const std::string& infile,
|
inline Interface* importInterface(const std::string& infile,
|
||||||
const std::string& id,
|
const std::string& id,
|
||||||
std::vector<Cantera::ThermoPhase*> phases)
|
std::vector<ThermoPhase*> phases)
|
||||||
{
|
{
|
||||||
return new Interface(infile, id, phases);
|
return new Interface(infile, id, phases);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ void clear_FENV();
|
||||||
* @ingroup errorhandling
|
* @ingroup errorhandling
|
||||||
*/
|
*/
|
||||||
#ifndef AssertTrace
|
#ifndef AssertTrace
|
||||||
# define AssertTrace(expr) ((expr) ? (void) 0 : throw Cantera::CanteraError(STR_TRACE, std::string("failed assert: ") + #expr))
|
# define AssertTrace(expr) ((expr) ? (void) 0 : throw CanteraError(STR_TRACE, std::string("failed assert: ") + #expr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Assertion must be true or an error is thrown
|
//! Assertion must be true or an error is thrown
|
||||||
|
|
@ -280,7 +280,7 @@ void clear_FENV();
|
||||||
* @ingroup errorhandling
|
* @ingroup errorhandling
|
||||||
*/
|
*/
|
||||||
#ifndef AssertThrow
|
#ifndef AssertThrow
|
||||||
# define AssertThrow(expr, procedure) ((expr) ? (void) 0 : throw Cantera::CanteraError(procedure, std::string("failed assert: ") + #expr))
|
# define AssertThrow(expr, procedure) ((expr) ? (void) 0 : throw CanteraError(procedure, std::string("failed assert: ") + #expr))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//! Assertion must be true or an error is thrown
|
//! Assertion must be true or an error is thrown
|
||||||
|
|
@ -298,7 +298,7 @@ void clear_FENV();
|
||||||
* @ingroup errorhandling
|
* @ingroup errorhandling
|
||||||
*/
|
*/
|
||||||
#ifndef AssertThrowMsg
|
#ifndef AssertThrowMsg
|
||||||
# define AssertThrowMsg(expr, procedure, message) ((expr) ? (void) 0 : throw Cantera::CanteraError(procedure + std::string(": at failed assert: \"") + std::string(#expr) + std::string("\""), message))
|
# define AssertThrowMsg(expr, procedure, message) ((expr) ? (void) 0 : throw CanteraError(procedure + std::string(": at failed assert: \"") + std::string(#expr) + std::string("\""), message))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -709,7 +709,7 @@ private:
|
||||||
* @param x Reference to a MultiPhase
|
* @param x Reference to a MultiPhase
|
||||||
* @return returns a reference to the ostream
|
* @return returns a reference to the ostream
|
||||||
*/
|
*/
|
||||||
inline std::ostream& operator<<(std::ostream& s, Cantera::MultiPhase& x)
|
inline std::ostream& operator<<(std::ostream& s, MultiPhase& x)
|
||||||
{
|
{
|
||||||
size_t ip;
|
size_t ip;
|
||||||
for (ip = 0; ip < x.nPhases(); ip++) {
|
for (ip = 0; ip < x.nPhases(); ip++) {
|
||||||
|
|
|
||||||
|
|
@ -69,14 +69,14 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* Kinetics object pointer
|
* Kinetics object pointer
|
||||||
*/
|
*/
|
||||||
Cantera::Kinetics* m_kinetics;
|
Kinetics* m_kinetics;
|
||||||
|
|
||||||
//! This kinetics operator is associated with multiple
|
//! This kinetics operator is associated with multiple
|
||||||
//! homogeneous and surface phases.
|
//! homogeneous and surface phases.
|
||||||
/*!
|
/*!
|
||||||
* This object owns the Kinetics object
|
* This object owns the Kinetics object
|
||||||
*/
|
*/
|
||||||
Cantera::InterfaceKinetics* m_InterfaceKinetics;
|
InterfaceKinetics* m_InterfaceKinetics;
|
||||||
|
|
||||||
int m_nKinSpecies;
|
int m_nKinSpecies;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ public:
|
||||||
* @param kinPtr Pointer to the kinetics base class
|
* @param kinPtr Pointer to the kinetics base class
|
||||||
* @param irxn Specific reaction index.
|
* @param irxn Specific reaction index.
|
||||||
*/
|
*/
|
||||||
RxnMolChange(Cantera::Kinetics* kinPtr, int irxn);
|
RxnMolChange(Kinetics* kinPtr, int irxn);
|
||||||
|
|
||||||
//! Destructor
|
//! Destructor
|
||||||
~RxnMolChange() {}
|
~RxnMolChange() {}
|
||||||
|
|
@ -44,7 +44,7 @@ public:
|
||||||
* @param kinPtr Pointer to the kinetics base class
|
* @param kinPtr Pointer to the kinetics base class
|
||||||
* @param egr Specific reaction index.
|
* @param egr Specific reaction index.
|
||||||
*/
|
*/
|
||||||
RxnMolChange(Cantera::Kinetics* kinPtr, Cantera::ExtraGlobalRxn* egr);
|
RxnMolChange(Kinetics* kinPtr, ExtraGlobalRxn* egr);
|
||||||
|
|
||||||
//! Vector of mole changes for each phase in the Kinetics object due to the current reaction
|
//! Vector of mole changes for each phase in the Kinetics object due to the current reaction
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -92,7 +92,7 @@ public:
|
||||||
int m_nPhases;
|
int m_nPhases;
|
||||||
|
|
||||||
//! Shallow pointer pointing to the kinetics object
|
//! Shallow pointer pointing to the kinetics object
|
||||||
Cantera::Kinetics* m_kinBase;
|
Kinetics* m_kinBase;
|
||||||
|
|
||||||
//! Reaction number within the kinetics object
|
//! Reaction number within the kinetics object
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -111,7 +111,7 @@ public:
|
||||||
/*!
|
/*!
|
||||||
* This is 0, if the class refers to a single reaction in the kinetics object
|
* This is 0, if the class refers to a single reaction in the kinetics object
|
||||||
*/
|
*/
|
||||||
Cantera::ExtraGlobalRxn* m_egr;
|
ExtraGlobalRxn* m_egr;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1127,10 +1127,10 @@ private:
|
||||||
/*!
|
/*!
|
||||||
* The Jacobian stored here is the raw matrix, before any row or column scaling is carried out
|
* The Jacobian stored here is the raw matrix, before any row or column scaling is carried out
|
||||||
*/
|
*/
|
||||||
Cantera::GeneralMatrix* jacCopyPtr_;
|
GeneralMatrix* jacCopyPtr_;
|
||||||
|
|
||||||
//! Hessian
|
//! Hessian
|
||||||
Cantera::GeneralMatrix* HessianPtr_;
|
GeneralMatrix* HessianPtr_;
|
||||||
|
|
||||||
/*********************************************************************************************
|
/*********************************************************************************************
|
||||||
* VARIABLES ASSOCIATED WITH STEPS AND ASSOCIATED DOUBLE DOGLEG PARAMETERS
|
* VARIABLES ASSOCIATED WITH STEPS AND ASSOCIATED DOUBLE DOGLEG PARAMETERS
|
||||||
|
|
|
||||||
|
|
@ -593,7 +593,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param phaseNode XML_Node for the current phase
|
* @param phaseNode XML_Node for the current phase
|
||||||
*/
|
*/
|
||||||
virtual void installSlavePhases(Cantera::XML_Node* phaseNode);
|
virtual void installSlavePhases(XML_Node* phaseNode);
|
||||||
|
|
||||||
//! Set equation of state parameter values from XML entries.
|
//! Set equation of state parameter values from XML entries.
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -782,7 +782,7 @@ protected:
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
class spinodalFunc : public Cantera::ResidEval
|
class spinodalFunc : public ResidEval
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
spinodalFunc(MixtureFugacityTP* tp);
|
spinodalFunc(MixtureFugacityTP* tp);
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ public:
|
||||||
* Note, after the constructor, we will own the underlying
|
* Note, after the constructor, we will own the underlying
|
||||||
* Nasa9Poly1 objects and be responsible for owning them.
|
* Nasa9Poly1 objects and be responsible for owning them.
|
||||||
*/
|
*/
|
||||||
Nasa9PolyMultiTempRegion(std::vector<Cantera::Nasa9Poly1*> ®ionPts);
|
Nasa9PolyMultiTempRegion(std::vector<Nasa9Poly1*> ®ionPts);
|
||||||
|
|
||||||
//! Copy constructor
|
//! Copy constructor
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -1518,7 +1518,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param phaseNode XML Element for the phase
|
* @param phaseNode XML Element for the phase
|
||||||
*/
|
*/
|
||||||
virtual void installSlavePhases(Cantera::XML_Node* phaseNode);
|
virtual void installSlavePhases(XML_Node* phaseNode);
|
||||||
|
|
||||||
//! Set the equation of state parameters
|
//! Set the equation of state parameters
|
||||||
/*!
|
/*!
|
||||||
|
|
|
||||||
|
|
@ -53,19 +53,18 @@ class PDSS_Water;
|
||||||
*
|
*
|
||||||
* Whether charge neutrality is necessary for a phase is also specified within
|
* Whether charge neutrality is necessary for a phase is also specified within
|
||||||
* the ThermoPhase object, by the function call
|
* the ThermoPhase object, by the function call
|
||||||
* ThermoPhase::chargeNeutralityNecessary(). Note, that it is not necessary
|
* ThermoPhase::chargeNeutralityNecessary(). Note, that it is not necessary for
|
||||||
* for the IdealGas phase, currently. However, it is necessary for liquid
|
* the IdealGas phase, currently. However, it is necessary for liquid phases
|
||||||
* phases such as Cantera::DebyeHuckel and Cantera::HMWSoln for the proper
|
* such as DebyeHuckel and HMWSoln for the proper specification of the chemical
|
||||||
* specification of the chemical potentials.
|
* potentials.
|
||||||
*
|
*
|
||||||
* This equation, when applied to the \f$ \zeta_k \f$ equation described
|
* This equation, when applied to the \f$ \zeta_k \f$ equation described
|
||||||
* above, results in a zero net change in the effective Gibbs free energy of
|
* above, results in a zero net change in the effective Gibbs free energy of
|
||||||
* the phase. However, specific charged species in the phase may increase or
|
* the phase. However, specific charged species in the phase may increase or
|
||||||
* decrease their electrochemical potentials, which will have an effect on
|
* decrease their electrochemical potentials, which will have an effect on
|
||||||
* interfacial reactions involving charged species, when there is a potential
|
* interfacial reactions involving charged species, when there is a potential
|
||||||
* drop between phases. This effect is used within the
|
* drop between phases. This effect is used within the InterfaceKinetics and
|
||||||
* Cantera::InterfaceKinetics and Cantera::EdgeKinetics kinetics objects
|
* EdgeKinetics kinetics objects classes.
|
||||||
* classes.
|
|
||||||
*
|
*
|
||||||
* <H3> Electrothermochemical Properties of Phases of Matter. </H3>
|
* <H3> Electrothermochemical Properties of Phases of Matter. </H3>
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public:
|
||||||
LiquidTransportParams& operator=(const LiquidTransportParams& right);
|
LiquidTransportParams& operator=(const LiquidTransportParams& right);
|
||||||
|
|
||||||
//! Species transport parameters
|
//! Species transport parameters
|
||||||
std::vector<Cantera::LiquidTransportData> LTData;
|
std::vector<LiquidTransportData> LTData;
|
||||||
|
|
||||||
//! Object that specifies the viscosity interaction for the mixture
|
//! Object that specifies the viscosity interaction for the mixture
|
||||||
LiquidTranInteraction* viscosity;
|
LiquidTranInteraction* viscosity;
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ public:
|
||||||
//! Set a function of a single variable that is used in determining the
|
//! Set a function of a single variable that is used in determining the
|
||||||
//! mass flow rate through the device. The meaning of this function
|
//! mass flow rate through the device. The meaning of this function
|
||||||
//! depends on the parameterization of the derived type.
|
//! depends on the parameterization of the derived type.
|
||||||
void setFunction(Cantera::Func1* f);
|
void setFunction(Func1* f);
|
||||||
|
|
||||||
//! Set the fixed mass flow rate (kg/s) through the flow device.
|
//! Set the fixed mass flow rate (kg/s) through the flow device.
|
||||||
void setMassFlowRate(doublereal mdot) {
|
void setMassFlowRate(doublereal mdot) {
|
||||||
|
|
@ -101,7 +101,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
doublereal m_mdot;
|
doublereal m_mdot;
|
||||||
Cantera::Func1* m_func;
|
Func1* m_func;
|
||||||
vector_fp m_coeffs;
|
vector_fp m_coeffs;
|
||||||
int m_type;
|
int m_type;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
namespace Cantera
|
namespace Cantera
|
||||||
{
|
{
|
||||||
|
|
||||||
class ReactorFactory : Cantera::FactoryBase
|
class ReactorFactory : FactoryBase
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace Cantera
|
||||||
* a network of reactors (Reactor, ConstPressureReactor) connected by various
|
* a network of reactors (Reactor, ConstPressureReactor) connected by various
|
||||||
* means, e.g. Wall, MassFlowController, Valve, PressureController.
|
* means, e.g. Wall, MassFlowController, Valve, PressureController.
|
||||||
*/
|
*/
|
||||||
class ReactorNet : public Cantera::FuncEval
|
class ReactorNet : public FuncEval
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ReactorNet();
|
ReactorNet();
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ public:
|
||||||
}
|
}
|
||||||
virtual void initialize(doublereal t0 = 0.0) {}
|
virtual void initialize(doublereal t0 = 0.0) {}
|
||||||
|
|
||||||
void insert(Cantera::ThermoPhase& contents) {
|
void insert(ThermoPhase& contents) {
|
||||||
setThermoMgr(contents);
|
setThermoMgr(contents);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -83,8 +83,8 @@ public:
|
||||||
//! Set the emissivity.
|
//! Set the emissivity.
|
||||||
void setEmissivity(doublereal epsilon) {
|
void setEmissivity(doublereal epsilon) {
|
||||||
if (epsilon > 1.0 || epsilon < 0.0)
|
if (epsilon > 1.0 || epsilon < 0.0)
|
||||||
throw Cantera::CanteraError("Wall::setEmissivity",
|
throw CanteraError("Wall::setEmissivity",
|
||||||
"emissivity must be between 0.0 and 1.0");
|
"emissivity must be between 0.0 and 1.0");
|
||||||
m_emiss = epsilon;
|
m_emiss = epsilon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -93,7 +93,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Set the wall velocity to a specified function of time
|
//! Set the wall velocity to a specified function of time
|
||||||
void setVelocity(Cantera::Func1* f=0) {
|
void setVelocity(Func1* f=0) {
|
||||||
if (f) {
|
if (f) {
|
||||||
m_vf = f;
|
m_vf = f;
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +110,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Specify the heat flux function \f$ q_0(t) \f$.
|
//! Specify the heat flux function \f$ q_0(t) \f$.
|
||||||
void setHeatFlux(Cantera::Func1* q) {
|
void setHeatFlux(Func1* q) {
|
||||||
m_qf = q;
|
m_qf = q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,18 +140,18 @@ public:
|
||||||
//! Specify the heterogeneous reaction mechanisms for each side of the
|
//! Specify the heterogeneous reaction mechanisms for each side of the
|
||||||
//! wall. Passing a null pointer indicates that there is no reaction
|
//! wall. Passing a null pointer indicates that there is no reaction
|
||||||
//! mechanism for the corresponding wall surface.
|
//! mechanism for the corresponding wall surface.
|
||||||
void setKinetics(Cantera::Kinetics* leftMechanism,
|
void setKinetics(Kinetics* leftMechanism,
|
||||||
Cantera::Kinetics* rightMechanism);
|
Kinetics* rightMechanism);
|
||||||
|
|
||||||
//! Return a pointer to the surface phase object for the left
|
//! Return a pointer to the surface phase object for the left
|
||||||
//! (`leftright=0`) or right (`leftright=1`) wall surface.
|
//! (`leftright=0`) or right (`leftright=1`) wall surface.
|
||||||
Cantera::SurfPhase* surface(int leftright) {
|
SurfPhase* surface(int leftright) {
|
||||||
return m_surf[leftright];
|
return m_surf[leftright];
|
||||||
}
|
}
|
||||||
|
|
||||||
//! Return a pointer to the surface kinetics object for the left
|
//! Return a pointer to the surface kinetics object for the left
|
||||||
//! (`leftright=0`) or right (`leftright=1`) wall surface.
|
//! (`leftright=0`) or right (`leftright=1`) wall surface.
|
||||||
Cantera::Kinetics* kinetics(int leftright) {
|
Kinetics* kinetics(int leftright) {
|
||||||
return m_chem[leftright];
|
return m_chem[leftright];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -190,17 +190,17 @@ public:
|
||||||
protected:
|
protected:
|
||||||
ReactorBase* m_left;
|
ReactorBase* m_left;
|
||||||
ReactorBase* m_right;
|
ReactorBase* m_right;
|
||||||
Cantera::Kinetics* m_chem[2];
|
Kinetics* m_chem[2];
|
||||||
Cantera::SurfPhase* m_surf[2];
|
SurfPhase* m_surf[2];
|
||||||
size_t m_nsp[2];
|
size_t m_nsp[2];
|
||||||
doublereal m_area, m_k, m_rrth;
|
doublereal m_area, m_k, m_rrth;
|
||||||
doublereal m_emiss;
|
doublereal m_emiss;
|
||||||
Cantera::Func1* m_vf;
|
Func1* m_vf;
|
||||||
Cantera::Func1* m_qf;
|
Func1* m_qf;
|
||||||
Cantera::vector_fp m_leftcov, m_rightcov;
|
vector_fp m_leftcov, m_rightcov;
|
||||||
|
|
||||||
std::vector<size_t> m_pleft, m_pright;
|
std::vector<size_t> m_pleft, m_pright;
|
||||||
Cantera::vector_fp m_leftmult_save, m_rightmult_save;
|
vector_fp m_leftmult_save, m_rightmult_save;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
return FuncCabinet::add(r);
|
return FuncCabinet::add(r);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return Cantera::handleAllExceptions(-1, ERR);
|
return handleAllExceptions(-1, ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -168,7 +168,7 @@ extern "C" {
|
||||||
copyString(FuncCabinet::item(i).write(arg), nm, lennm);
|
copyString(FuncCabinet::item(i).write(arg), nm, lennm);
|
||||||
return 0;
|
return 0;
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
return Cantera::handleAllExceptions(-1, ERR);
|
return handleAllExceptions(-1, ERR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,11 @@
|
||||||
#include "cantera/equil/MultiPhase.h"
|
#include "cantera/equil/MultiPhase.h"
|
||||||
#include "cantera/numerics/ctlapack.h"
|
#include "cantera/numerics/ctlapack.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace Cantera
|
namespace Cantera
|
||||||
{
|
{
|
||||||
int BasisOptimize_print_lvl = 0;
|
int BasisOptimize_print_lvl = 0;
|
||||||
}
|
|
||||||
|
|
||||||
//! Print a string within a given space limit.
|
//! Print a string within a given space limit.
|
||||||
/*!
|
/*!
|
||||||
|
|
@ -25,10 +23,10 @@ int BasisOptimize_print_lvl = 0;
|
||||||
*/
|
*/
|
||||||
static void print_stringTrunc(const char* str, int space, int alignment);
|
static void print_stringTrunc(const char* str, int space, int alignment);
|
||||||
|
|
||||||
size_t Cantera::BasisOptimize(int* usedZeroedSpecies, bool doFormRxn,
|
size_t BasisOptimize(int* usedZeroedSpecies, bool doFormRxn, MultiPhase* mphase,
|
||||||
MultiPhase* mphase, std::vector<size_t>& orderVectorSpecies,
|
std::vector<size_t>& orderVectorSpecies,
|
||||||
std::vector<size_t>& orderVectorElements,
|
std::vector<size_t>& orderVectorElements,
|
||||||
vector_fp& formRxnMatrix)
|
vector_fp& formRxnMatrix)
|
||||||
{
|
{
|
||||||
size_t j, jj, k=0, kk, l, i, jl, ml;
|
size_t j, jj, k=0, kk, l, i, jl, ml;
|
||||||
bool lindep;
|
bool lindep;
|
||||||
|
|
@ -329,7 +327,7 @@ size_t Cantera::BasisOptimize(int* usedZeroedSpecies, bool doFormRxn,
|
||||||
ct_dgetrs(ctlapack::NoTranspose, nComponents, nNonComponents, &sm[0], ne,
|
ct_dgetrs(ctlapack::NoTranspose, nComponents, nNonComponents, &sm[0], ne,
|
||||||
&ipiv[0], &formRxnMatrix[0], ne, info);
|
&ipiv[0], &formRxnMatrix[0], ne, info);
|
||||||
|
|
||||||
if (DEBUG_MODE_ENABLED && Cantera::BasisOptimize_print_lvl >= 1) {
|
if (DEBUG_MODE_ENABLED && BasisOptimize_print_lvl >= 1) {
|
||||||
writelog(" ---\n");
|
writelog(" ---\n");
|
||||||
writelogf(" --- Number of Components = %d\n", nComponents);
|
writelogf(" --- Number of Components = %d\n", nComponents);
|
||||||
writelog(" --- Formula Matrix:\n");
|
writelog(" --- Formula Matrix:\n");
|
||||||
|
|
@ -421,10 +419,10 @@ static void print_stringTrunc(const char* str, int space, int alignment)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t Cantera::ElemRearrange(size_t nComponents, const vector_fp& elementAbundances,
|
size_t ElemRearrange(size_t nComponents, const vector_fp& elementAbundances,
|
||||||
MultiPhase* mphase,
|
MultiPhase* mphase,
|
||||||
std::vector<size_t>& orderVectorSpecies,
|
std::vector<size_t>& orderVectorSpecies,
|
||||||
std::vector<size_t>& orderVectorElements)
|
std::vector<size_t>& orderVectorElements)
|
||||||
{
|
{
|
||||||
size_t j, k, l, i, jl, ml, jr, ielem, jj, kk=0;
|
size_t j, k, l, i, jl, ml, jr, ielem, jj, kk=0;
|
||||||
|
|
||||||
|
|
@ -631,3 +629,5 @@ size_t Cantera::ElemRearrange(size_t nComponents, const vector_fp& elementAbunda
|
||||||
} while (jr < (nComponents-1));
|
} while (jr < (nComponents-1));
|
||||||
return nComponents;
|
return nComponents;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@ using namespace std;
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
int Cantera::ChemEquil_print_lvl = 0;
|
|
||||||
|
|
||||||
namespace Cantera
|
namespace Cantera
|
||||||
{
|
{
|
||||||
|
int ChemEquil_print_lvl = 0;
|
||||||
|
|
||||||
int _equilflag(const char* xy)
|
int _equilflag(const char* xy)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace Cantera;
|
|
||||||
|
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ std::ostream& Group::fmt(std::ostream& s,
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::ostream& operator<<(std::ostream& s, const Cantera::Group& g)
|
std::ostream& operator<<(std::ostream& s, const Group& g)
|
||||||
{
|
{
|
||||||
if (g.valid()) {
|
if (g.valid()) {
|
||||||
s << g.m_comp;
|
s << g.m_comp;
|
||||||
|
|
|
||||||
|
|
@ -23,12 +23,11 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <new>
|
#include <new>
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
|
|
||||||
RxnMolChange::RxnMolChange(Cantera::Kinetics* kinPtr, int irxn) :
|
RxnMolChange::RxnMolChange(Kinetics* kinPtr, int irxn) :
|
||||||
m_nPhases(0),
|
m_nPhases(0),
|
||||||
m_kinBase(kinPtr),
|
m_kinBase(kinPtr),
|
||||||
m_iRxn(irxn),
|
m_iRxn(irxn),
|
||||||
|
|
@ -55,7 +54,7 @@ RxnMolChange::RxnMolChange(Cantera::Kinetics* kinPtr, int irxn) :
|
||||||
|
|
||||||
for (int kKin = 0; kKin < m_kk; kKin++) {
|
for (int kKin = 0; kKin < m_kk; kKin++) {
|
||||||
iph = static_cast<int>(m_kinBase->speciesPhaseIndex(kKin));
|
iph = static_cast<int>(m_kinBase->speciesPhaseIndex(kKin));
|
||||||
Cantera::ThermoPhase& tpRef = m_kinBase->thermo(iph);
|
ThermoPhase& tpRef = m_kinBase->thermo(iph);
|
||||||
int kLoc = kKin - static_cast<int>(m_kinBase->kineticsSpeciesIndex(0, iph));
|
int kLoc = kKin - static_cast<int>(m_kinBase->kineticsSpeciesIndex(0, iph));
|
||||||
double rsc = m_kinBase->reactantStoichCoeff(kKin, irxn);
|
double rsc = m_kinBase->reactantStoichCoeff(kKin, irxn);
|
||||||
double psc = m_kinBase->productStoichCoeff(kKin, irxn);
|
double psc = m_kinBase->productStoichCoeff(kKin, irxn);
|
||||||
|
|
@ -70,7 +69,7 @@ RxnMolChange::RxnMolChange(Cantera::Kinetics* kinPtr, int irxn) :
|
||||||
}
|
}
|
||||||
|
|
||||||
for (iph = 0; iph < m_nPhases; iph++) {
|
for (iph = 0; iph < m_nPhases; iph++) {
|
||||||
Cantera::ThermoPhase& tpRef = m_kinBase->thermo(iph);
|
ThermoPhase& tpRef = m_kinBase->thermo(iph);
|
||||||
m_phaseDims[iph] = static_cast<int>(tpRef.nDim());
|
m_phaseDims[iph] = static_cast<int>(tpRef.nDim());
|
||||||
m_phaseTypes[iph] = tpRef.eosType();
|
m_phaseTypes[iph] = tpRef.eosType();
|
||||||
if (m_phaseChargeChange[iph] != 0.0) {
|
if (m_phaseChargeChange[iph] != 0.0) {
|
||||||
|
|
@ -82,17 +81,17 @@ RxnMolChange::RxnMolChange(Cantera::Kinetics* kinPtr, int irxn) :
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ChargeTransferInRxn) {
|
if (m_ChargeTransferInRxn) {
|
||||||
Cantera::InterfaceKinetics* iK = dynamic_cast<Cantera::InterfaceKinetics*>(kinPtr);
|
InterfaceKinetics* iK = dynamic_cast<InterfaceKinetics*>(kinPtr);
|
||||||
if (iK) {
|
if (iK) {
|
||||||
m_beta = iK->electrochem_beta(irxn);
|
m_beta = iK->electrochem_beta(irxn);
|
||||||
} else {
|
} else {
|
||||||
throw Cantera::CanteraError("RxnMolChange", "unknown condition on charge");
|
throw CanteraError("RxnMolChange", "unknown condition on charge");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RxnMolChange::RxnMolChange(Cantera::Kinetics* kinPtr, Cantera::ExtraGlobalRxn* egr) :
|
RxnMolChange::RxnMolChange(Kinetics* kinPtr, ExtraGlobalRxn* egr) :
|
||||||
m_nPhases(0),
|
m_nPhases(0),
|
||||||
m_kinBase(kinPtr),
|
m_kinBase(kinPtr),
|
||||||
m_iRxn(-1),
|
m_iRxn(-1),
|
||||||
|
|
|
||||||
|
|
@ -67,14 +67,14 @@ extern "C" {
|
||||||
try {
|
try {
|
||||||
double* ydata = NV_DATA_S(y); //N_VDATA(y);
|
double* ydata = NV_DATA_S(y); //N_VDATA(y);
|
||||||
double* ydotdata = NV_DATA_S(ydot); //N_VDATA(ydot);
|
double* ydotdata = NV_DATA_S(ydot); //N_VDATA(ydot);
|
||||||
Cantera::FuncData* d = (Cantera::FuncData*)f_data;
|
FuncData* d = (FuncData*)f_data;
|
||||||
Cantera::FuncEval* f = d->m_func;
|
FuncEval* f = d->m_func;
|
||||||
if (d->m_pars.size() == 0) {
|
if (d->m_pars.size() == 0) {
|
||||||
f->eval(t, ydata, ydotdata, NULL);
|
f->eval(t, ydata, ydotdata, NULL);
|
||||||
} else {
|
} else {
|
||||||
f->eval(t, ydata, ydotdata, DATA_PTR(d->m_pars));
|
f->eval(t, ydata, ydotdata, DATA_PTR(d->m_pars));
|
||||||
}
|
}
|
||||||
} catch (Cantera::CanteraError& err) {
|
} catch (CanteraError& err) {
|
||||||
std::cerr << err.what() << std::endl;
|
std::cerr << err.what() << std::endl;
|
||||||
return 1; // possibly recoverable error
|
return 1; // possibly recoverable error
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ int solveProb::solve(int ifunc, doublereal time_scale,
|
||||||
|
|
||||||
#ifdef DEBUG_SOLVEPROB
|
#ifdef DEBUG_SOLVEPROB
|
||||||
#ifdef DEBUG_SOLVEPROB_TIME
|
#ifdef DEBUG_SOLVEPROB_TIME
|
||||||
Cantera::clockWC wc;
|
clockWC wc;
|
||||||
if (m_ioflag) {
|
if (m_ioflag) {
|
||||||
t1 = wc.secondsWC();
|
t1 = wc.secondsWC();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -325,7 +325,7 @@ void LatticeSolidPhase::getGibbs_ref(doublereal* g) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void LatticeSolidPhase::installSlavePhases(Cantera::XML_Node* phaseNode)
|
void LatticeSolidPhase::installSlavePhases(XML_Node* phaseNode)
|
||||||
{
|
{
|
||||||
size_t kk = 0;
|
size_t kk = 0;
|
||||||
size_t kstart = 0;
|
size_t kstart = 0;
|
||||||
|
|
|
||||||
|
|
@ -688,9 +688,9 @@ int MixtureFugacityTP::corr0(doublereal TKelvin, doublereal pres, doublereal& de
|
||||||
doublereal densGas = densityCalc(TKelvin, pres, FLUID_GAS, densGasGuess);
|
doublereal densGas = densityCalc(TKelvin, pres, FLUID_GAS, densGasGuess);
|
||||||
if (densGas <= 0.0) {
|
if (densGas <= 0.0) {
|
||||||
if (retn == -1) {
|
if (retn == -1) {
|
||||||
throw Cantera::CanteraError("MixtureFugacityTP::corr0",
|
throw CanteraError("MixtureFugacityTP::corr0",
|
||||||
"Error occurred trying to find gas density at (T,P) = "
|
"Error occurred trying to find gas density at (T,P) = "
|
||||||
+ Cantera::fp2str(TKelvin) + " " + Cantera::fp2str(pres));
|
+ fp2str(TKelvin) + " " + fp2str(pres));
|
||||||
}
|
}
|
||||||
retn = -2;
|
retn = -2;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -1420,7 +1420,7 @@ int RedlichKwongMFTP::NicholsSolve(double TKelvin, double pres, doublereal a, do
|
||||||
doublereal val = acos(tmp);
|
doublereal val = acos(tmp);
|
||||||
doublereal theta = val / 3.0;
|
doublereal theta = val / 3.0;
|
||||||
|
|
||||||
doublereal oo = 2. * Cantera::Pi / 3.;
|
doublereal oo = 2. * Pi / 3.;
|
||||||
doublereal alpha = xN + 2. * delta * cos(theta);
|
doublereal alpha = xN + 2. * delta * cos(theta);
|
||||||
|
|
||||||
doublereal beta = xN + 2. * delta * cos(theta + oo);
|
doublereal beta = xN + 2. * delta * cos(theta + oo);
|
||||||
|
|
|
||||||
|
|
@ -725,7 +725,7 @@ void ThermoPhase::initThermo()
|
||||||
}
|
}
|
||||||
xMol_Ref.resize(m_kk, 0.0);
|
xMol_Ref.resize(m_kk, 0.0);
|
||||||
}
|
}
|
||||||
void ThermoPhase::installSlavePhases(Cantera::XML_Node* phaseNode)
|
void ThermoPhase::installSlavePhases(XML_Node* phaseNode)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -126,11 +126,11 @@ doublereal WaterPropsIAPWS::density(doublereal temperature, doublereal pressure,
|
||||||
*/
|
*/
|
||||||
rhoguess = 1000.;
|
rhoguess = 1000.;
|
||||||
} else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
|
} else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::density",
|
throw CanteraError("WaterPropsIAPWS::density",
|
||||||
"Unstable Branch finder is untested");
|
"Unstable Branch finder is untested");
|
||||||
} else {
|
} else {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::density",
|
throw CanteraError("WaterPropsIAPWS::density",
|
||||||
"unknown state: " + Cantera::int2str(phase));
|
"unknown state: " + int2str(phase));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -187,11 +187,11 @@ doublereal WaterPropsIAPWS::density_const(doublereal pressure,
|
||||||
*/
|
*/
|
||||||
rhoguess = 1000.;
|
rhoguess = 1000.;
|
||||||
} else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
|
} else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::density",
|
throw CanteraError("WaterPropsIAPWS::density",
|
||||||
"Unstable Branch finder is untested");
|
"Unstable Branch finder is untested");
|
||||||
} else {
|
} else {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::density",
|
throw CanteraError("WaterPropsIAPWS::density",
|
||||||
"unknown state: " + Cantera::int2str(phase));
|
"unknown state: " + int2str(phase));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -314,18 +314,18 @@ void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure,
|
||||||
|
|
||||||
densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
|
densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
|
||||||
if (densLiq <= 0.0) {
|
if (densLiq <= 0.0) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::corr",
|
throw CanteraError("WaterPropsIAPWS::corr",
|
||||||
"Error occurred trying to find liquid density at (T,P) = "
|
"Error occurred trying to find liquid density at (T,P) = "
|
||||||
+ Cantera::fp2str(temperature) + " " + Cantera::fp2str(pressure));
|
+ fp2str(temperature) + " " + fp2str(pressure));
|
||||||
}
|
}
|
||||||
setState_TR(temperature, densLiq);
|
setState_TR(temperature, densLiq);
|
||||||
doublereal gibbsLiqRT = m_phi->gibbs_RT();
|
doublereal gibbsLiqRT = m_phi->gibbs_RT();
|
||||||
|
|
||||||
densGas = density(temperature, pressure, WATER_GAS, densGas);
|
densGas = density(temperature, pressure, WATER_GAS, densGas);
|
||||||
if (densGas <= 0.0) {
|
if (densGas <= 0.0) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::corr",
|
throw CanteraError("WaterPropsIAPWS::corr",
|
||||||
"Error occurred trying to find gas density at (T,P) = "
|
"Error occurred trying to find gas density at (T,P) = "
|
||||||
+ Cantera::fp2str(temperature) + " " + Cantera::fp2str(pressure));
|
+ fp2str(temperature) + " " + fp2str(pressure));
|
||||||
}
|
}
|
||||||
setState_TR(temperature, densGas);
|
setState_TR(temperature, densGas);
|
||||||
doublereal gibbsGasRT = m_phi->gibbs_RT();
|
doublereal gibbsGasRT = m_phi->gibbs_RT();
|
||||||
|
|
@ -339,18 +339,18 @@ void WaterPropsIAPWS::corr1(doublereal temperature, doublereal pressure,
|
||||||
|
|
||||||
densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
|
densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
|
||||||
if (densLiq <= 0.0) {
|
if (densLiq <= 0.0) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::corr1",
|
throw CanteraError("WaterPropsIAPWS::corr1",
|
||||||
"Error occurred trying to find liquid density at (T,P) = "
|
"Error occurred trying to find liquid density at (T,P) = "
|
||||||
+ Cantera::fp2str(temperature) + " " + Cantera::fp2str(pressure));
|
+ fp2str(temperature) + " " + fp2str(pressure));
|
||||||
}
|
}
|
||||||
setState_TR(temperature, densLiq);
|
setState_TR(temperature, densLiq);
|
||||||
doublereal prL = m_phi->phiR();
|
doublereal prL = m_phi->phiR();
|
||||||
|
|
||||||
densGas = density(temperature, pressure, WATER_GAS, densGas);
|
densGas = density(temperature, pressure, WATER_GAS, densGas);
|
||||||
if (densGas <= 0.0) {
|
if (densGas <= 0.0) {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::corr1",
|
throw CanteraError("WaterPropsIAPWS::corr1",
|
||||||
"Error occurred trying to find gas density at (T,P) = "
|
"Error occurred trying to find gas density at (T,P) = "
|
||||||
+ Cantera::fp2str(temperature) + " " + Cantera::fp2str(pressure));
|
+ fp2str(temperature) + " " + fp2str(pressure));
|
||||||
}
|
}
|
||||||
setState_TR(temperature, densGas);
|
setState_TR(temperature, densGas);
|
||||||
doublereal prG = m_phi->phiR();
|
doublereal prG = m_phi->phiR();
|
||||||
|
|
@ -397,8 +397,8 @@ doublereal WaterPropsIAPWS::psat(doublereal temperature, int waterState)
|
||||||
} else if (waterState == WATER_GAS) {
|
} else if (waterState == WATER_GAS) {
|
||||||
setState_TR(temperature, densGas);
|
setState_TR(temperature, densGas);
|
||||||
} else {
|
} else {
|
||||||
throw Cantera::CanteraError("WaterPropsIAPWS::psat",
|
throw CanteraError("WaterPropsIAPWS::psat",
|
||||||
"unknown water state input: " + Cantera::int2str(waterState));
|
"unknown water state input: " + int2str(waterState));
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
@ -525,8 +525,8 @@ doublereal WaterPropsIAPWS::densSpinodalWater() const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conv) {
|
if (!conv) {
|
||||||
throw Cantera::CanteraError(" WaterPropsIAPWS::densSpinodalWater()",
|
throw CanteraError("WaterPropsIAPWS::densSpinodalWater()",
|
||||||
" convergence failure");
|
"convergence failure");
|
||||||
}
|
}
|
||||||
// Restore the original delta
|
// Restore the original delta
|
||||||
delta = delta_save;
|
delta = delta_save;
|
||||||
|
|
@ -617,8 +617,8 @@ doublereal WaterPropsIAPWS::densSpinodalSteam() const
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!conv) {
|
if (!conv) {
|
||||||
throw Cantera::CanteraError(" WaterPropsIAPWS::densSpinodalSteam()",
|
throw CanteraError("WaterPropsIAPWS::densSpinodalSteam()",
|
||||||
" convergence failure");
|
"convergence failure");
|
||||||
}
|
}
|
||||||
// Restore the original delta
|
// Restore the original delta
|
||||||
delta = delta_save;
|
delta = delta_save;
|
||||||
|
|
|
||||||
|
|
@ -460,7 +460,7 @@ void LTI_Pairwise_Interaction::setParameters(LiquidTransportParams& trParam)
|
||||||
m_diagonals.resize(nsp, 0);
|
m_diagonals.resize(nsp, 0);
|
||||||
|
|
||||||
for (size_t k = 0; k < nsp; k++) {
|
for (size_t k = 0; k < nsp; k++) {
|
||||||
Cantera::LiquidTransportData& ltd = trParam.LTData[k];
|
LiquidTransportData& ltd = trParam.LTData[k];
|
||||||
if (ltd.speciesDiffusivity) {
|
if (ltd.speciesDiffusivity) {
|
||||||
m_diagonals[k] = ltd.speciesDiffusivity;
|
m_diagonals[k] = ltd.speciesDiffusivity;
|
||||||
}
|
}
|
||||||
|
|
@ -537,7 +537,7 @@ void LTI_StefanMaxwell_PPN::setParameters(LiquidTransportParams& trParam)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (size_t k = 0; k < nsp; k++) {
|
for (size_t k = 0; k < nsp; k++) {
|
||||||
Cantera::LiquidTransportData& ltd = trParam.LTData[k];
|
LiquidTransportData& ltd = trParam.LTData[k];
|
||||||
m_ionCondSpecies[k] = ltd.ionConductivity;
|
m_ionCondSpecies[k] = ltd.ionConductivity;
|
||||||
for (size_t j = 0; j < nsp2; j++) {
|
for (size_t j = 0; j < nsp2; j++) {
|
||||||
m_mobRatSpecies[j][k] = ltd.mobilityRatio[j];
|
m_mobRatSpecies[j][k] = ltd.mobilityRatio[j];
|
||||||
|
|
@ -683,7 +683,7 @@ void LTI_StokesEinstein::setParameters(LiquidTransportParams& trParam)
|
||||||
m_viscosity.resize(nsp, 0);
|
m_viscosity.resize(nsp, 0);
|
||||||
m_hydroRadius.resize(nsp, 0);
|
m_hydroRadius.resize(nsp, 0);
|
||||||
for (size_t k = 0; k < nsp; k++) {
|
for (size_t k = 0; k < nsp; k++) {
|
||||||
Cantera::LiquidTransportData& ltd = trParam.LTData[k];
|
LiquidTransportData& ltd = trParam.LTData[k];
|
||||||
m_viscosity[k] = ltd.viscosity;
|
m_viscosity[k] = ltd.viscosity;
|
||||||
m_hydroRadius[k] = ltd.hydroRadius;
|
m_hydroRadius[k] = ltd.hydroRadius;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -267,7 +267,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
||||||
|
|
||||||
//for each species, assign viscosity model and coefficients
|
//for each species, assign viscosity model and coefficients
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
Cantera::LiquidTransportData& ltd = tr.LTData[k];
|
LiquidTransportData& ltd = tr.LTData[k];
|
||||||
m_viscTempDep_Ns[k] = ltd.viscosity;
|
m_viscTempDep_Ns[k] = ltd.viscosity;
|
||||||
ltd.viscosity = 0;
|
ltd.viscosity = 0;
|
||||||
m_ionCondTempDep_Ns[k] = ltd.ionConductivity;
|
m_ionCondTempDep_Ns[k] = ltd.ionConductivity;
|
||||||
|
|
@ -297,7 +297,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
||||||
m_diffTempDep_Ns.resize(m_nsp, 0);
|
m_diffTempDep_Ns.resize(m_nsp, 0);
|
||||||
//for each species, assign viscosity model and coefficients
|
//for each species, assign viscosity model and coefficients
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
Cantera::LiquidTransportData& ltd = tr.LTData[k];
|
LiquidTransportData& ltd = tr.LTData[k];
|
||||||
if (ltd.speciesDiffusivity != 0) {
|
if (ltd.speciesDiffusivity != 0) {
|
||||||
cout << "Warning: diffusion coefficient data for "
|
cout << "Warning: diffusion coefficient data for "
|
||||||
<< m_thermo->speciesName(k)
|
<< m_thermo->speciesName(k)
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
||||||
|
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
spName = m_thermo->speciesName(k);
|
spName = m_thermo->speciesName(k);
|
||||||
Cantera::LiquidTransportData& ltd = tr.LTData[k];
|
LiquidTransportData& ltd = tr.LTData[k];
|
||||||
m_coeffVisc_Ns[k] = ltd.viscosity;
|
m_coeffVisc_Ns[k] = ltd.viscosity;
|
||||||
ltd.viscosity = 0;
|
ltd.viscosity = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -206,7 +206,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
||||||
|
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
spName = m_thermo->speciesName(k);
|
spName = m_thermo->speciesName(k);
|
||||||
Cantera::LiquidTransportData& ltd = tr.LTData[k];
|
LiquidTransportData& ltd = tr.LTData[k];
|
||||||
m_coeffLambda_Ns[k] = ltd.thermalCond;
|
m_coeffLambda_Ns[k] = ltd.thermalCond;
|
||||||
ltd.thermalCond = 0;
|
ltd.thermalCond = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -222,7 +222,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
||||||
|
|
||||||
for (size_t k = 0; k < m_nsp; k++) {
|
for (size_t k = 0; k < m_nsp; k++) {
|
||||||
spName = m_thermo->speciesName(k);
|
spName = m_thermo->speciesName(k);
|
||||||
Cantera::LiquidTransportData& ltd = tr.LTData[k];
|
LiquidTransportData& ltd = tr.LTData[k];
|
||||||
m_coeffDiff_Ns[k] = ltd.speciesDiffusivity;
|
m_coeffDiff_Ns[k] = ltd.speciesDiffusivity;
|
||||||
ltd.speciesDiffusivity = 0;
|
ltd.speciesDiffusivity = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ ReactorBase* ReactorFactory::newReactor(int ir)
|
||||||
case IdealGasConstPressureReactorType:
|
case IdealGasConstPressureReactorType:
|
||||||
return new IdealGasConstPressureReactor();
|
return new IdealGasConstPressureReactor();
|
||||||
default:
|
default:
|
||||||
throw Cantera::CanteraError("ReactorFactory::newReactor",
|
throw CanteraError("ReactorFactory::newReactor",
|
||||||
"unknown reactor type!");
|
"unknown reactor type!");
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ int main(int argc, char** argv)
|
||||||
_set_output_format(_TWO_DIGIT_EXPONENT);
|
_set_output_format(_TWO_DIGIT_EXPONENT);
|
||||||
#endif
|
#endif
|
||||||
try {
|
try {
|
||||||
Cantera::IdealSolnGasVPSS gg("silane.xml", "silane");
|
IdealSolnGasVPSS gg("silane.xml", "silane");
|
||||||
ThermoPhase* g = ≫
|
ThermoPhase* g = ≫
|
||||||
//ThermoPhase *g = newPhase("silane.xml", "silane");
|
//ThermoPhase *g = newPhase("silane.xml", "silane");
|
||||||
cout.precision(4);
|
cout.precision(4);
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ int main(int argc, char** argv)
|
||||||
/*
|
/*
|
||||||
* This delete the file logger amongst other things.
|
* This delete the file logger amongst other things.
|
||||||
*/
|
*/
|
||||||
Cantera::appdelete();
|
appdelete();
|
||||||
|
|
||||||
return retn;
|
return retn;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int main(int argc, char** argv)
|
||||||
/*
|
/*
|
||||||
* Load in and initialize the
|
* Load in and initialize the
|
||||||
*/
|
*/
|
||||||
Cantera::ThermoPhase* solid = newPhase("NaCl_Solid.xml","NaCl(S)");
|
ThermoPhase* solid = newPhase("NaCl_Solid.xml","NaCl(S)");
|
||||||
|
|
||||||
|
|
||||||
size_t nsp = HMW->nSpecies();
|
size_t nsp = HMW->nSpecies();
|
||||||
|
|
@ -274,14 +274,14 @@ int main(int argc, char** argv)
|
||||||
hmwtbDupl = 0;
|
hmwtbDupl = 0;
|
||||||
delete solid;
|
delete solid;
|
||||||
solid = 0;
|
solid = 0;
|
||||||
Cantera::appdelete();
|
appdelete();
|
||||||
|
|
||||||
|
|
||||||
return retn;
|
return retn;
|
||||||
|
|
||||||
} catch (CanteraError& err) {
|
} catch (CanteraError& err) {
|
||||||
std::cout << err.what() << std::endl;
|
std::cout << err.what() << std::endl;
|
||||||
Cantera::appdelete();
|
appdelete();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue