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