*** empty log message ***
This commit is contained in:
parent
b91fc880ea
commit
e6a0ba740c
22 changed files with 130 additions and 24 deletions
|
|
@ -1,3 +1,9 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
|
||||
// Cantera includes
|
||||
#include "oneD/Sim1D.h"
|
||||
|
|
|
|||
|
|
@ -1,3 +1,8 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
// Cantera includes
|
||||
#include "SurfPhase.h"
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
|
||||
// Cantera includes
|
||||
#include "ctml.h"
|
||||
#include "importCTML.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
// Build as a DLL under Windows
|
||||
#ifdef WIN32
|
||||
#define DLL_EXPORT __declspec(dllexport)
|
||||
|
|
@ -15,6 +7,14 @@
|
|||
#define DLL_EXPORT
|
||||
#endif
|
||||
|
||||
// Cantera includes
|
||||
#include "ctml.h"
|
||||
#include "importCTML.h"
|
||||
|
||||
#include "Cabinet.h"
|
||||
#include "Storage.h"
|
||||
|
||||
|
||||
// Values returned for error conditions
|
||||
#define ERR -999
|
||||
#define DERR -999.999
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "ThermoPhase.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
|
||||
#include "ReactionStoichMgr.h"
|
||||
#include "StoichManager.h"
|
||||
|
|
|
|||
|
|
@ -8,6 +8,12 @@
|
|||
|
||||
// Copyright 2001 California Institute of Technology
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "ct_defs.h"
|
||||
#include "ctexceptions.h"
|
||||
#include <fstream>
|
||||
|
|
|
|||
|
|
@ -49,8 +49,9 @@ namespace Cantera {
|
|||
virtual ~Application() {
|
||||
map<string, XML_Node*>::iterator pos;
|
||||
for (pos = xmlfiles.begin(); pos != xmlfiles.end(); ++pos) {
|
||||
delete pos->second;
|
||||
pos->second = 0;
|
||||
pos->second->unlock();
|
||||
delete pos->second;
|
||||
pos->second = 0;
|
||||
}
|
||||
}
|
||||
vector<string> inputDirs;
|
||||
|
|
@ -152,6 +153,7 @@ namespace Cantera {
|
|||
XML_Node* x = new XML_Node("doc");
|
||||
if (s) {
|
||||
x->build(s);
|
||||
x->lock();
|
||||
__app->xmlfiles[ff] = x;
|
||||
}
|
||||
else {
|
||||
|
|
@ -171,12 +173,14 @@ namespace Cantera {
|
|||
map<string, XML_Node*>::iterator
|
||||
b = app()->xmlfiles.begin(), e = app()->xmlfiles.end();
|
||||
for(; b != e; ++b) {
|
||||
b->second->unlock();
|
||||
delete b->second;
|
||||
__app->xmlfiles.erase(b->first);
|
||||
}
|
||||
}
|
||||
else if (app()->xmlfiles.find(file)
|
||||
!= app()->xmlfiles.end()) {
|
||||
__app->xmlfiles[file]->unlock();
|
||||
delete __app->xmlfiles[file];
|
||||
__app->xmlfiles.erase(file);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @file Sim1D.cpp
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -11,7 +11,11 @@
|
|||
// Copyright 2002-3 California Institute of Technology
|
||||
|
||||
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Inlet1D.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,9 @@
|
|||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
|
|
|||
|
|
@ -1,3 +1,10 @@
|
|||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "ThermoPhase.h"
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -277,13 +277,16 @@ namespace Cantera {
|
|||
|
||||
XML_Node::XML_Node(string nm, XML_Node* p, int n)
|
||||
: m_name(nm), m_parent(p), m_nchildren(0),
|
||||
m_n(n), m_iscomment(false) {
|
||||
m_n(n), m_iscomment(false), m_locked(false) {
|
||||
if (!p) m_root = this;
|
||||
else m_root = &p->root();
|
||||
}
|
||||
|
||||
|
||||
XML_Node::~XML_Node() {
|
||||
if (m_locked)
|
||||
throw CanteraError("XML_Node::~XML_Node",
|
||||
"attempt to delete locked XML_Node "+name());
|
||||
int n = m_children.size();
|
||||
for (int i = 0; i < n; i++) {
|
||||
if (m_children[i]) {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,10 @@ namespace Cantera {
|
|||
//return (m_childindex[ch] != 0);
|
||||
}
|
||||
bool hasAttrib(string a) const {
|
||||
//cout << m_attribs.size() << endl;
|
||||
// if (m_attribs.size() == 0) {
|
||||
// cout << name() << " has zero length attribs " << endl;
|
||||
// }
|
||||
return (m_attribs.find(a) != m_attribs.end());
|
||||
}
|
||||
|
||||
|
|
@ -157,6 +161,8 @@ namespace Cantera {
|
|||
void setRoot(XML_Node& root) { m_root = &root; }
|
||||
void copyUnion(XML_Node *node_dest);
|
||||
void copy(XML_Node *node_dest);
|
||||
void lock() {m_locked = true;}
|
||||
void unlock() {m_locked = false; }
|
||||
|
||||
private:
|
||||
void write_int(ostream& s, int level = 0) const;
|
||||
|
|
@ -169,6 +175,7 @@ namespace Cantera {
|
|||
map<string, string> m_attribs;
|
||||
XML_Node* m_parent;
|
||||
XML_Node* m_root;
|
||||
bool m_locked;
|
||||
vector<XML_Node*> m_children;
|
||||
int m_nchildren;
|
||||
int m_n;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Cantera.h"
|
||||
#include <time.h>
|
||||
|
|
@ -65,7 +70,7 @@ int equil_example1(int job) {
|
|||
|
||||
// create a gas mixture, and set its state
|
||||
|
||||
IdealGasMix gas("silane.xml", "silane");
|
||||
IdealGasMix gas("silane.cti", "silane");
|
||||
int nsp = gas.nSpecies();
|
||||
|
||||
int ntemps = 50; // number of temperatures
|
||||
|
|
@ -114,6 +119,7 @@ int equil_example1(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
#include "Cantera.h"
|
||||
//#include "ctexceptions.h"
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#define NUM_EXAMPLES 6
|
||||
|
||||
int kinetics_example1(int job);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ main() {
|
|||
|
||||
// create the gas object
|
||||
|
||||
IdealGasMix gas("gri30.xml");
|
||||
IdealGasMix gas("gri30.cti");
|
||||
doublereal temp = 500.0;
|
||||
doublereal pres = 2.0*OneAtm;
|
||||
gas.setState_TPX(temp, pres, "CH4:1.0, O2:2.0, N2:7.52");
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "zerodim.h"
|
||||
#include "IdealGasMix.h"
|
||||
|
|
@ -29,7 +34,7 @@ int kinetics_example1(int job) {
|
|||
try {
|
||||
|
||||
cout << "Ignition simulation using class IdealGasMix "
|
||||
<< "with file gri30.inp."
|
||||
<< "with file gri30.cti."
|
||||
<< endl;
|
||||
|
||||
if (job >= 1) {
|
||||
|
|
@ -44,7 +49,7 @@ int kinetics_example1(int job) {
|
|||
|
||||
// create an ideal gas mixture that corresponds to GRI-Mech
|
||||
// 3.0
|
||||
IdealGasMix* gg = new IdealGasMix("gri30.xml", "gri30");
|
||||
IdealGasMix* gg = new IdealGasMix("gri30.cti", "gri30");
|
||||
IdealGasMix& gas = *gg;
|
||||
|
||||
// set the state
|
||||
|
|
@ -121,6 +126,7 @@ int kinetics_example1(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Cantera.h"
|
||||
#include "GRI30.h"
|
||||
|
|
@ -109,6 +114,7 @@ int kinetics_example2(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Cantera.h"
|
||||
#include "zerodim.h"
|
||||
|
|
@ -80,7 +85,7 @@ int rxnpath_example1(int job) {
|
|||
|
||||
try {
|
||||
|
||||
cout << "Reaction path diagram movies with file gri30mod.inp." << endl;
|
||||
cout << "Reaction path diagram movies with file gri30.cti." << endl;
|
||||
if (job >= 1) {
|
||||
cout << "Generate reaction path diagrams following nitrogen\n"
|
||||
<< "as a function of time for constant-pressure ignition of a\n"
|
||||
|
|
@ -94,10 +99,10 @@ int rxnpath_example1(int job) {
|
|||
|
||||
// create an ideal gas mixture that corresponds to GRI-Mech
|
||||
// 3.0
|
||||
IdealGasMix gas("gri30.xml", "gri30");
|
||||
IdealGasMix gas("gri30.cti", "gri30");
|
||||
gas.setState_TPX(1001.0, OneAtm, "H2:2.0, O2:1.0, N2:4.0");
|
||||
int nsp = gas.nSpecies();
|
||||
cout << "number of species = " << nsp << endl;
|
||||
|
||||
// create a reactor
|
||||
Reactor r;
|
||||
|
||||
|
|
@ -156,6 +161,7 @@ int rxnpath_example1(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Cantera.h"
|
||||
#include "transport.h"
|
||||
|
|
@ -55,7 +60,7 @@ int transport_example1(int job) {
|
|||
|
||||
// create a gas mixture, and set its state
|
||||
|
||||
IdealGasMix gas("gri30.xml", "gri30");
|
||||
IdealGasMix gas("gri30.cti", "gri30");
|
||||
doublereal temp = 500.0;
|
||||
doublereal pres = 2.0*OneAtm;
|
||||
gas.setState_TPX(temp, pres, "H2:1.0, CH4:0.1");
|
||||
|
|
@ -105,6 +110,7 @@ int transport_example1(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,11 @@
|
|||
//
|
||||
/////////////////////////////////////////////////////////////
|
||||
|
||||
// turn off warnings under Windows
|
||||
#ifdef WIN32
|
||||
#pragma warning(disable:4786)
|
||||
#pragma warning(disable:4503)
|
||||
#endif
|
||||
|
||||
#include "Cantera.h"
|
||||
#include "transport.h"
|
||||
|
|
@ -56,7 +61,7 @@ int transport_example2(int job) {
|
|||
|
||||
// create a gas mixture, and set its state
|
||||
|
||||
IdealGasMix gas("gri30.xml", "gri30");
|
||||
IdealGasMix gas("gri30.cti", "gri30");
|
||||
doublereal temp = 2000.0;
|
||||
doublereal pres = 2.0*OneAtm;
|
||||
gas.setState_TPX(temp, pres, "H2:1.0, O2:0.5, CH4:0.1, N2:0.2");
|
||||
|
|
@ -107,6 +112,7 @@ int transport_example2(int job) {
|
|||
catch (CanteraError) {
|
||||
showErrors(cout);
|
||||
cout << " terminating... " << endl;
|
||||
appdelete();
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ namespace Cantera {
|
|||
m_ok = buildSolutionFromXML(root, id, "phase", this, this);
|
||||
}
|
||||
|
||||
virtual ~IdealGasMix() {
|
||||
delete m_r;
|
||||
}
|
||||
virtual ~IdealGasMix() {}
|
||||
|
||||
bool operator!() { return !m_ok;}
|
||||
bool ready() { return m_ok; }
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue