Small changes that I found improved things
This commit is contained in:
parent
6baf8238b6
commit
367d1f90b0
4 changed files with 17 additions and 6 deletions
|
|
@ -26,7 +26,8 @@ static const double Gamma=5.0E-6; // [??]
|
|||
static const double u0=3.217405E5; // [] internal energy at To
|
||||
static const double s0=2.1396056E3; // [] entropy at To
|
||||
static const double Tp=250; // [K] ??
|
||||
static const double Pc=7.38350E6; // [Pa] critical pressure
|
||||
//static const double Pc=7.38350E6; // [Pa] critical pressure
|
||||
static const double Pc=7.3817589E6; // Adjusted to fit the actual functional form
|
||||
static const double M=44.01; // [kg/kmol] molar density
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ namespace tpx {
|
|||
|
||||
class CarbonDioxide : public Substance{
|
||||
public:
|
||||
CarbonDioxide() {
|
||||
CarbonDioxide() :
|
||||
Substance()
|
||||
{
|
||||
m_name="CarbonDioxide";
|
||||
m_formula="CO2";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -398,6 +398,12 @@ namespace tpx {
|
|||
if (sat >= Pcrit()) return 0;
|
||||
psat = sat;
|
||||
T = Tsat(psat);
|
||||
if (T == Undef) {
|
||||
Err = 0;
|
||||
T = Tsave;
|
||||
Rho = Rhosave;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
throw TPX_Error("Substance::Lever","general error");
|
||||
|
|
|
|||
|
|
@ -90,10 +90,12 @@ namespace tpx {
|
|||
void setStdState(double h0 = 0.0, double s0 = 0.0,
|
||||
double t0 = 298.15, double p0 = 1.01325e5) {
|
||||
Set(TP, t0, p0);
|
||||
double hoff = h0 - h();
|
||||
double soff = s0 - s();
|
||||
m_entropy_offset = soff;
|
||||
m_energy_offset = hoff;
|
||||
double hh = h();
|
||||
double ss = s();
|
||||
double hoff = h0 - hh;
|
||||
double soff = s0 - ss;
|
||||
m_entropy_offset += soff;
|
||||
m_energy_offset += hoff;
|
||||
}
|
||||
|
||||
// information about a substance:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue