Combined CanteraZeroD and CanteraSpectra namespaces with Cantera
This commit is contained in:
parent
d832f32625
commit
ffec1b052a
39 changed files with 37 additions and 77 deletions
|
|
@ -40,8 +40,5 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace Cantera {}
|
namespace Cantera {}
|
||||||
//using namespace Cantera;
|
|
||||||
namespace std {}
|
|
||||||
//using namespace std;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
#include "Cabinet.h"
|
#include "Cabinet.h"
|
||||||
#include "Storage.h"
|
#include "Storage.h"
|
||||||
|
|
||||||
using namespace CanteraZeroD;
|
using namespace Cantera;
|
||||||
|
|
||||||
typedef ReactorBase reactor_t;
|
typedef ReactorBase reactor_t;
|
||||||
typedef ReactorNet reactornet_t;
|
typedef ReactorNet reactornet_t;
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include <cantera/zerodim.h>
|
#include <cantera/zerodim.h>
|
||||||
#include <cantera/IdealGasMix.h>
|
#include <cantera/IdealGasMix.h>
|
||||||
|
|
||||||
using namespace CanteraZeroD;
|
using namespace Cantera;
|
||||||
|
|
||||||
void runexample() {
|
void runexample() {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,12 +4,8 @@
|
||||||
#include <cantera/kernel/Array.h>
|
#include <cantera/kernel/Array.h>
|
||||||
#include <cantera/kernel/plots.h>
|
#include <cantera/kernel/plots.h>
|
||||||
|
|
||||||
namespace Cantera{}
|
|
||||||
using namespace Cantera;
|
using namespace Cantera;
|
||||||
namespace std{}
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
namespace CanteraZeroD{}
|
|
||||||
using namespace CanteraZeroD;
|
|
||||||
|
|
||||||
// Save the temperature, density, pressure, and mole fractions at one
|
// Save the temperature, density, pressure, and mole fractions at one
|
||||||
// time
|
// time
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,5 @@ typedef integer status_t;
|
||||||
|
|
||||||
namespace Cantera {}
|
namespace Cantera {}
|
||||||
using namespace Cantera;
|
using namespace Cantera;
|
||||||
namespace std{}
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,6 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
#include "Nuclei.h"
|
#include "Nuclei.h"
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
class DiatomicMolecule {
|
class DiatomicMolecule {
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ using boost::math::erf;
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
Lorentzian::Lorentzian(doublereal gamma) {
|
Lorentzian::Lorentzian(doublereal gamma) {
|
||||||
m_hwhm = gamma;
|
m_hwhm = gamma;
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
#include "ct_defs.h"
|
#include "ct_defs.h"
|
||||||
#include "ctexceptions.h"
|
#include "ctexceptions.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
namespace Cantera {
|
||||||
namespace CanteraSpectra {
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for classes implementing line shapes of
|
* Base class for classes implementing line shapes of
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include "ct_defs.h"
|
#include "ct_defs.h"
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents atomic nuclei. These classes only provide minimal
|
* Represents atomic nuclei. These classes only provide minimal
|
||||||
|
|
@ -90,6 +90,6 @@ namespace CanteraSpectra {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
} // CanteraSpectra
|
} // Cantera
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
|
|
|
||||||
|
|
@ -14,12 +14,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ct_defs.h"
|
#include "ct_defs.h"
|
||||||
using namespace Cantera;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Namespace for spectroscopic functions and classes.
|
* Namespace for spectroscopic functions and classes.
|
||||||
*/
|
*/
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Rotor represents a non-rigid quantum-mechanical rotor.
|
* Class Rotor represents a non-rigid quantum-mechanical rotor.
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "spectralUtilities.h"
|
#include "spectralUtilities.h"
|
||||||
#include "Nuclei.h"
|
#include "Nuclei.h"
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
namespace Cantera {
|
||||||
|
|
||||||
//Nucleus_syms = {"H":1, "D":2, "T":3, "He3":4, "He4":5,
|
//Nucleus_syms = {"H":1, "D":2, "T":3, "He3":4, "He4":5,
|
||||||
// "C12":6, "C13":7, "N14":8, "N15":9,
|
// "C12":6, "C13":7, "N14":8, "N15":9,
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,4 @@
|
||||||
|
|
||||||
#include "Nuclei.h"
|
#include "Nuclei.h"
|
||||||
|
|
||||||
namespace CanteraSpectra {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,9 @@
|
||||||
#include "InterfaceKinetics.h"
|
#include "InterfaceKinetics.h"
|
||||||
#include "SurfPhase.h"
|
#include "SurfPhase.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
ConstPressureReactor::ConstPressureReactor() : Reactor() {}
|
ConstPressureReactor::ConstPressureReactor() : Reactor() {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "Reactor.h"
|
#include "Reactor.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ConstPressureReactor is a class for constant-pressure
|
* Class ConstPressureReactor is a class for constant-pressure
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
bool FlowDevice::install(ReactorBase& in, ReactorBase& out) {
|
bool FlowDevice::install(ReactorBase& in, ReactorBase& out) {
|
||||||
if (m_in || m_out) return false;
|
if (m_in || m_out) return false;
|
||||||
|
|
|
||||||
|
|
@ -13,14 +13,8 @@
|
||||||
|
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
class Func1;
|
class Func1;
|
||||||
}
|
|
||||||
using namespace Cantera;
|
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
|
||||||
|
|
||||||
class ReactorBase; // forward reference
|
class ReactorBase; // forward reference
|
||||||
|
|
||||||
|
|
||||||
const int MFC_Type = 1;
|
const int MFC_Type = 1;
|
||||||
const int PressureController_Type = 2;
|
const int PressureController_Type = 2;
|
||||||
const int Valve_Type = 3;
|
const int Valve_Type = 3;
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,9 @@
|
||||||
|
|
||||||
#include "FlowReactor.h"
|
#include "FlowReactor.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
FlowReactor::FlowReactor() : Reactor(), m_fctr(1.0e10),
|
FlowReactor::FlowReactor() : Reactor(), m_fctr(1.0e10),
|
||||||
m_speed0(0.0) {}
|
m_speed0(0.0) {}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
#include "Reactor.h"
|
#include "Reactor.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adiabatic, reversible flow in a constant-area duct.
|
* Adiabatic, reversible flow in a constant-area duct.
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#ifndef CT_PID_H
|
#ifndef CT_PID_H
|
||||||
#define CT_PID_H
|
#define CT_PID_H
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
class PID_Controller {
|
class PID_Controller {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,9 @@
|
||||||
#include "InterfaceKinetics.h"
|
#include "InterfaceKinetics.h"
|
||||||
#include "SurfPhase.h"
|
#include "SurfPhase.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
doublereal quadInterp(doublereal x0, doublereal* x, doublereal* y);
|
doublereal quadInterp(doublereal x0, doublereal* x, doublereal* y);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#include "ReactorBase.h"
|
#include "ReactorBase.h"
|
||||||
#include "Kinetics.h"
|
#include "Kinetics.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class Reactor is a general-purpose class for stirred
|
* Class Reactor is a general-purpose class for stirred
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include "Wall.h"
|
#include "Wall.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
ReactorBase::ReactorBase(string name) : m_nsp(0),
|
ReactorBase::ReactorBase(string name) : m_nsp(0),
|
||||||
m_thermo(0),
|
m_thermo(0),
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,8 @@
|
||||||
|
|
||||||
#include "ThermoPhase.h"
|
#include "ThermoPhase.h"
|
||||||
|
|
||||||
using namespace Cantera;
|
|
||||||
|
|
||||||
/// Namespace for classes implementing zero-dimensional reactor networks.
|
/// Namespace for classes implementing zero-dimensional reactor networks.
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
// typedef Thermo thermo_t;
|
// typedef Thermo thermo_t;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include "ConstPressureReactor.h"
|
#include "ConstPressureReactor.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
ReactorFactory* ReactorFactory::s_factory = 0;
|
ReactorFactory* ReactorFactory::s_factory = 0;
|
||||||
#ifdef THREAD_SAFE_CANTERA
|
#ifdef THREAD_SAFE_CANTERA
|
||||||
|
|
|
||||||
|
|
@ -14,8 +14,7 @@
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
class ReactorFactory : FactoryBase {
|
class ReactorFactory : FactoryBase {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
ReactorNet::ReactorNet() : Cantera::FuncEval(), m_nr(0), m_nreactors(0),
|
ReactorNet::ReactorNet() : Cantera::FuncEval(), m_nr(0), m_nreactors(0),
|
||||||
m_integ(0), m_time(0.0), m_init(false),
|
m_integ(0), m_time(0.0), m_init(false),
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
#include "Integrator.h"
|
#include "Integrator.h"
|
||||||
#include "Array.h"
|
#include "Array.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
class ReactorNet : public Cantera::FuncEval {
|
class ReactorNet : public Cantera::FuncEval {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include "ReactorBase.h"
|
#include "ReactorBase.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
class Reservoir : public ReactorBase {
|
class Reservoir : public ReactorBase {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,9 @@
|
||||||
#include "InterfaceKinetics.h"
|
#include "InterfaceKinetics.h"
|
||||||
#include "SurfPhase.h"
|
#include "SurfPhase.h"
|
||||||
|
|
||||||
using Cantera::Func1;
|
|
||||||
using Cantera::Kinetics;
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
|
|
||||||
|
|
||||||
Wall::Wall() : m_left(0), m_right(0),
|
Wall::Wall() : m_left(0), m_right(0),
|
||||||
m_area(0.0), m_k(0.0), m_rrth(0.0), m_emiss(0.0),
|
m_area(0.0), m_k(0.0), m_rrth(0.0), m_emiss(0.0),
|
||||||
|
|
|
||||||
|
|
@ -12,16 +12,12 @@
|
||||||
#include "Func1.h"
|
#include "Func1.h"
|
||||||
|
|
||||||
namespace Cantera {
|
namespace Cantera {
|
||||||
class Kinetics;
|
|
||||||
class Func1;
|
|
||||||
class SurfPhase;
|
|
||||||
}
|
|
||||||
//using namespace Cantera;
|
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
|
||||||
|
|
||||||
// forward references
|
// forward references
|
||||||
class ReactorBase;
|
class ReactorBase;
|
||||||
|
class Kinetics;
|
||||||
|
class Func1;
|
||||||
|
class SurfPhase;
|
||||||
|
|
||||||
class Wall {
|
class Wall {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
//#include "PID_Controller.h"
|
//#include "PID_Controller.h"
|
||||||
#include "Func1.h"
|
#include "Func1.h"
|
||||||
|
|
||||||
namespace CanteraZeroD {
|
namespace Cantera {
|
||||||
/**
|
/**
|
||||||
* A class for mass flow controllers. The mass flow rate is constant,
|
* A class for mass flow controllers. The mass flow rate is constant,
|
||||||
* independent of any other parameters.
|
* independent of any other parameters.
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,6 @@
|
||||||
|
|
||||||
using namespace Cantera;
|
using namespace Cantera;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
namespace CanteraZeroD{}
|
|
||||||
using namespace CanteraZeroD;
|
|
||||||
|
|
||||||
// Save the temperature, density, pressure, and mole fractions at one
|
// Save the temperature, density, pressure, and mole fractions at one
|
||||||
// time
|
// time
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,6 @@
|
||||||
#include <cantera/IdealGasMix.h>
|
#include <cantera/IdealGasMix.h>
|
||||||
#include "example_utils.h"
|
#include "example_utils.h"
|
||||||
using namespace Cantera;
|
using namespace Cantera;
|
||||||
using namespace CanteraZeroD;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
// Kinetics example. This is written as a function so that one
|
// Kinetics example. This is written as a function so that one
|
||||||
|
|
@ -73,7 +72,7 @@ int kinetics_example1(int job) {
|
||||||
|
|
||||||
// create a container object to run the simulation
|
// create a container object to run the simulation
|
||||||
// and add the reactor to it
|
// and add the reactor to it
|
||||||
CanteraZeroD::ReactorNet *sim_ptr = new CanteraZeroD::ReactorNet();
|
ReactorNet* sim_ptr = new ReactorNet();
|
||||||
sim_ptr->addReactor(&r);
|
sim_ptr->addReactor(&r);
|
||||||
|
|
||||||
double tm;
|
double tm;
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ int kinetics_example2(int job) {
|
||||||
|
|
||||||
// create a container object to run the simulation
|
// create a container object to run the simulation
|
||||||
// and add the reactor to it
|
// and add the reactor to it
|
||||||
CanteraZeroD::ReactorNet * sim_ptr = new ReactorNet ();
|
ReactorNet* sim_ptr = new ReactorNet();
|
||||||
CanteraZeroD::ReactorNet &sim = *sim_ptr;
|
ReactorNet& sim = *sim_ptr;
|
||||||
sim.addReactor(&r);
|
sim.addReactor(&r);
|
||||||
|
|
||||||
double tm;
|
double tm;
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ int kinetics_example3(int job) {
|
||||||
|
|
||||||
// create a container object to run the simulation
|
// create a container object to run the simulation
|
||||||
// and add the reactor to it
|
// and add the reactor to it
|
||||||
CanteraZeroD::ReactorNet& sim = *(new ReactorNet());
|
ReactorNet& sim = *(new ReactorNet());
|
||||||
sim.addReactor(&r);
|
sim.addReactor(&r);
|
||||||
|
|
||||||
double tm;
|
double tm;
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ int rxnpath_example1(int job) {
|
||||||
|
|
||||||
// create a container object to run the simulation
|
// create a container object to run the simulation
|
||||||
// and add the reactor to it
|
// and add the reactor to it
|
||||||
CanteraZeroD::ReactorNet& sim = *(new ReactorNet ());
|
ReactorNet& sim = *(new ReactorNet());
|
||||||
sim.addReactor(&r);
|
sim.addReactor(&r);
|
||||||
|
|
||||||
// create a reaction path diagram builder
|
// create a reaction path diagram builder
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@
|
||||||
#include "kernel/Nuclei.h"
|
#include "kernel/Nuclei.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace CanteraSpectra;
|
using namespace Cantera;
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
|
|
||||||
Nucleus* a = CanteraSpectra::HydrogenNucleus();
|
Nucleus* a = HydrogenNucleus();
|
||||||
Nucleus* b = HydrogenNucleus();
|
Nucleus* b = HydrogenNucleus();
|
||||||
if (*a == *b) {
|
if (*a == *b) {
|
||||||
cout << "a and b and indistinguishable" << endl;
|
cout << "a and b and indistinguishable" << endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue