merged from branch
This commit is contained in:
parent
7f64be6f6c
commit
41a7a55a24
1 changed files with 58 additions and 0 deletions
58
Cantera/cxx/include/PureFluid.h
Normal file
58
Cantera/cxx/include/PureFluid.h
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
#ifndef CXX_PUREFLUID
|
||||
#define CXX_PUREFLUID
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "kernel/PureFluidPhase.h"
|
||||
#include "kernel/importCTML.h"
|
||||
|
||||
namespace Cantera {
|
||||
|
||||
|
||||
class PureFluid : public PureFluidPhase
|
||||
{
|
||||
public:
|
||||
|
||||
PureFluid() : m_ok(false), m_r(0) {}
|
||||
|
||||
PureFluid(string infile, string id="") : m_ok(false), m_r(0) {
|
||||
|
||||
m_r = get_XML_File(infile);
|
||||
if (id == "-") id = "";
|
||||
m_ok = buildSolutionFromXML(*m_r, id, "phase", this, 0);
|
||||
if (!m_ok) throw CanteraError("PureFluid",
|
||||
"buildSolutionFromXML returned false");
|
||||
}
|
||||
|
||||
|
||||
PureFluid(XML_Node& root, string id) : m_ok(false), m_r(0) {
|
||||
m_ok = buildSolutionFromXML(root, id, "phase", this, 0);
|
||||
}
|
||||
|
||||
virtual ~PureFluid() {}
|
||||
|
||||
bool operator!() { return !m_ok;}
|
||||
bool ready() { return m_ok; }
|
||||
friend ostream& operator<<(ostream& s, PureFluid& mix) {
|
||||
string r = report(mix, true);
|
||||
s << r;
|
||||
return s;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool m_ok;
|
||||
XML_Node* m_r;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
class Water : public PureFluid {
|
||||
public:
|
||||
Water() : PureFluid(string("liquidvapor.cti"),string("water")) {}
|
||||
virtual ~Water() {}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Reference in a new issue