removed old unused files
This commit is contained in:
parent
9fbb9b5a96
commit
c20ccb4023
7 changed files with 0 additions and 360 deletions
|
|
@ -1,6 +0,0 @@
|
|||
//
|
||||
#include "CFluid.h"
|
||||
|
||||
double CFluid::u_ni() {
|
||||
return 1.0;
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
#ifndef CFLUID_H
|
||||
#define CFLUID_H
|
||||
|
||||
#include "sub.h"
|
||||
#include "ck_gas.h"
|
||||
|
||||
#include <fstream.h>
|
||||
#include <string.h>
|
||||
|
||||
// custom fluid base class
|
||||
|
||||
class CFluid : public Substance {
|
||||
|
||||
public:
|
||||
|
||||
CFluid(char *name, double MWt, int kmx, double *xmoles)
|
||||
{
|
||||
ig = new ck_gas(kmx, xmoles);
|
||||
T = Undef;
|
||||
Rho = Undef;
|
||||
Mw = MWt;
|
||||
CName = new char(strlen(name)+1);
|
||||
strcpy(CName,name);
|
||||
}
|
||||
|
||||
|
||||
~CFluid() {
|
||||
delete ig;
|
||||
}
|
||||
|
||||
double R(){
|
||||
return 8314.3/Mw;
|
||||
}
|
||||
|
||||
double MolWt() {
|
||||
return Mw;
|
||||
}
|
||||
|
||||
double Tmin() {
|
||||
return ig->Tmin();
|
||||
}
|
||||
|
||||
double Tmax() {
|
||||
return ig->Tmax();
|
||||
}
|
||||
|
||||
char * name() {
|
||||
return CName;
|
||||
}
|
||||
|
||||
char * formula() {
|
||||
return "doda";
|
||||
}
|
||||
|
||||
//protected:
|
||||
|
||||
double Mw;
|
||||
ck_gas* ig;
|
||||
char* CName;
|
||||
|
||||
virtual double u_ni()=0;
|
||||
virtual double s_ni()=0;
|
||||
|
||||
double up(){
|
||||
ig->Set(TP,T,101325.0);
|
||||
return ig->u() + u_ni();
|
||||
}
|
||||
|
||||
double sp(){
|
||||
ig->Set(TP,T,101325.0);
|
||||
return ig->s() + s_ni();
|
||||
}
|
||||
|
||||
};
|
||||
#endif // ! CFLUID
|
||||
117
ext/tpx/CLK.cpp
117
ext/tpx/CLK.cpp
|
|
@ -1,117 +0,0 @@
|
|||
// Lee-Kesler equation of state for use with custom fluids
|
||||
|
||||
#include "CLK.h"
|
||||
#include <math.h>
|
||||
|
||||
const double b[2][4] = {{0.1181193, 0.265728, 0.154790, 0.030323},
|
||||
{0.2026579, 0.331511, 0.027655, 0.203488}};
|
||||
const double c[2][4] = {{0.0236744, 0.0186984, 0.0, 0.042724},
|
||||
{0.0313385, 0.0503618, 0.016901, 0.041577}};
|
||||
const double d[2][2] = {{1.55488e-5, 6.23689e-5},{4.8736e-5, 0.740336e-5}};
|
||||
const double beta[2] = {0.65392, 1.226};
|
||||
const double gamma[2] = {0.060167, 0.03754};
|
||||
|
||||
//--------------------------- member functions ------------------
|
||||
|
||||
double CLK::W(int n, double egrho, double Gamma) {
|
||||
return (n == 0 ? (1.0 - egrho)/(2.0*Gamma) :
|
||||
(n*W(n-1, egrho, Gamma) - 0.5*pow(Rho,2*n)*egrho)/Gamma);
|
||||
}
|
||||
|
||||
double CLK::u_ni(){
|
||||
return -R()*T*T*I()/Tcr; // + u_0(T)
|
||||
}
|
||||
|
||||
double CLK::s_ni() {
|
||||
const double Pref = 101325.0;
|
||||
double rgas = R();
|
||||
return rgas*(log(Pref/(Rho*rgas*T)) - (T/Tcr)*I() - J()); // + s^0(T,p_0)
|
||||
}
|
||||
|
||||
double CLK::I() { // \int_0^\rho_r (1/\rho_r)(dZ/dT_r) d\rho_r
|
||||
double Bp, Cp, Dp;
|
||||
double rtr = Tcr/T;
|
||||
double rtr2 = rtr*rtr;
|
||||
double rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime
|
||||
double rvr2 = rvr*rvr;
|
||||
double egrho;
|
||||
|
||||
egrho = exp(-gamma[Isr]*rvr2);
|
||||
Bp = rtr2*b[Isr][1] + 2.0*rtr*rtr2*b[Isr][2] + 3.0*rtr2*rtr2*b[Isr][3];
|
||||
Cp = rtr2*c[Isr][1] - 3.0*c[Isr][2]*rtr2*rtr2;
|
||||
Dp = -d[Isr][1]*rtr2;
|
||||
double r = Bp*rvr + 0.5*rvr2*Cp + 0.2*pow(rvr,5)*Dp
|
||||
- 3.0*c[Isr][3]*rtr2*rtr2*(beta[Isr]*W(0,egrho,gamma[Isr])
|
||||
+ gamma[Isr]*W(1,egrho,gamma[Isr]));
|
||||
return r;
|
||||
}
|
||||
|
||||
double CLK::J() { // \int_0^\rho_r (1/\rho_r)(Z - 1) d\rho_r
|
||||
double BB, CC, DD;
|
||||
double rtr = Tcr/T;
|
||||
double rtr2 = rtr*rtr;
|
||||
double rvr = 8314.3*Tcr*Rho/(Pcr*Mw); // 1/v_r^\prime
|
||||
double rvr2 = rvr*rvr;
|
||||
double egrho;
|
||||
|
||||
egrho = exp(-gamma[Isr]*rvr2);
|
||||
BB = b[Isr][0] - rtr*(b[Isr][1]
|
||||
+ rtr*(b[Isr][2] + rtr*b[Isr][3]));
|
||||
CC = c[Isr][0] - rtr*(c[Isr][1] - c[Isr][2]*rtr*rtr);
|
||||
DD = d[Isr][0] + d[Isr][1]*rtr;
|
||||
double r = BB*rvr + 0.5*rvr2*CC + 0.2*pow(rvr,5)*DD
|
||||
+ c[Isr][3]*rtr2*rtr*(beta[Isr]*W(0,egrho,gamma[Isr])
|
||||
+ gamma[Isr]*W(1,egrho,gamma[Isr]));
|
||||
return r;
|
||||
}
|
||||
|
||||
double CLK::z() {
|
||||
double zz, rvr2, BB, CC, DD, EE;
|
||||
double rtr = Tcr/T; // 1/T_r
|
||||
double rvr = Rho*8314.3*Tcr/(Pcr*Mw);
|
||||
rvr2 = rvr*rvr;
|
||||
BB = b[Isr][0] - rtr*(b[Isr][1]
|
||||
+ rtr*(b[Isr][2] + rtr*b[Isr][3]));
|
||||
CC = c[Isr][0] - rtr*(c[Isr][1] - c[Isr][2]*rtr*rtr);
|
||||
DD = d[Isr][0] + d[Isr][1]*rtr;
|
||||
EE = exp(-gamma[Isr]*rvr2);
|
||||
|
||||
zz = 1.0 + BB*rvr + CC*rvr2 + DD*pow(rvr,5)
|
||||
+ c[Isr][3]*pow(rtr,3)*rvr2*
|
||||
(beta[Isr] + gamma[Isr]*rvr2)*EE;
|
||||
return zz;
|
||||
}
|
||||
|
||||
|
||||
double CLK::Pp() {
|
||||
return 8314.3*z()*Rho*T/Mw;
|
||||
}
|
||||
|
||||
double CLK::Psat(){
|
||||
double tr = 1.0 - Tcr/T;
|
||||
double lpr;
|
||||
|
||||
if (Isr == 0)
|
||||
lpr = 5.395743797*tr + 0.05524287*tr*tr + 0.06853005*tr*tr*tr;
|
||||
else
|
||||
lpr = 7.259961465*tr - 0.549206092*tr*tr + 0.177581752*tr*tr*tr;
|
||||
return Pcr*exp(lpr);
|
||||
}
|
||||
|
||||
double CLK::ldens(){
|
||||
double x = 1.0 - T/Tcr;
|
||||
|
||||
double rho_r;
|
||||
if (Isr == 0)
|
||||
rho_r = 5.2307 + 15.16*x - 21.9778*x*x + 18.767*x*x*x;
|
||||
else {
|
||||
rho_r = 6.166930606 + 17.42866964*x - 18.62589833*x*x + 11.73957224*x*x*x;
|
||||
rho_r *= 1.0;
|
||||
}
|
||||
return Pcr*rho_r*Mw/(8314.3*Tcr);
|
||||
}
|
||||
|
||||
double CLK::Tcrit() {return Tcr;}
|
||||
double CLK::Pcrit() {return Pcr;}
|
||||
double CLK::Vcrit() {return 0.2901*R()*Tcr/Pcr;}
|
||||
char * CLK::formula() {return "---";}
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
#ifndef CLK_H
|
||||
#define CLK_H
|
||||
|
||||
#include "CFluid.h"
|
||||
|
||||
#include <fstream.h>
|
||||
|
||||
// custom Lee-Kesler fluid class
|
||||
|
||||
class CLK : public CFluid {
|
||||
|
||||
public:
|
||||
|
||||
CLK(char* name, double tcrit, double pcrit, int itype, double MWt, int kmx, double *xmoles) :
|
||||
CFluid(name, MWt, kmx, xmoles)
|
||||
{
|
||||
Tcr = tcrit;
|
||||
Pcr = pcrit;
|
||||
Isr = itype;
|
||||
}
|
||||
|
||||
~CLK(){}
|
||||
|
||||
double Tcrit();
|
||||
double Pcrit();
|
||||
double Vcrit();
|
||||
char * formula();
|
||||
|
||||
//protected:
|
||||
|
||||
double Tcr;
|
||||
double Pcr;
|
||||
int Isr;
|
||||
|
||||
double u_ni();
|
||||
double s_ni();
|
||||
double Pp();
|
||||
double z();
|
||||
|
||||
double Psat();
|
||||
double ldens();
|
||||
|
||||
private:
|
||||
double W(int n, double egrho, double gamma);
|
||||
double I();
|
||||
double J();
|
||||
|
||||
};
|
||||
#endif // ! CLK
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
// Chemkin ideal gas mixture
|
||||
|
||||
#include "ck_gas.h"
|
||||
#include <math.h>
|
||||
|
||||
double ck_gas::up(){
|
||||
return ckprop(2, T, Rho, xm); // + h_0(T)
|
||||
}
|
||||
|
||||
double ck_gas::sp() {return ckprop(3, T, Rho, xm);}
|
||||
|
||||
|
||||
double ck_gas::Pp() {
|
||||
return ckprop(1, T, Rho, xm);
|
||||
}
|
||||
|
||||
double ck_gas::MolWt() {return ckprop(0, T, Rho, xm);}
|
||||
|
||||
double ck_gas::Cdot(int ks) {return chem(T, Rho, ks, xm, 1);}
|
||||
|
||||
double ck_gas::Ddot(int ks) {return chem(T, Rho, ks, xm, 2);}
|
||||
|
||||
double ck_gas::Wdot(int ks) {return chem(T, Rho, ks, xm, 3);}
|
||||
|
||||
double ck_gas::Tchem(int ks) {return chem(T, Rho, ks, xm, 4);}
|
||||
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
#ifndef CK_GAS_H
|
||||
#define CK_GAS_H
|
||||
|
||||
#include "Sub.h"
|
||||
|
||||
//#include <fstream.h>
|
||||
|
||||
extern "C" {
|
||||
__declspec(dllimport) double __stdcall
|
||||
ckprop(int ijob, double temp, double dens, double *xmole);
|
||||
|
||||
__declspec(dllimport) int __stdcall ckspecies();
|
||||
|
||||
__declspec(dllimport) double __stdcall
|
||||
chem(double temp, double dens, int ks, double *xmole, int ijob);
|
||||
}
|
||||
|
||||
namespace tpx {
|
||||
class ck_gas : public Substance {
|
||||
public:
|
||||
|
||||
ck_gas() {
|
||||
kk = ckspecies();
|
||||
if (kk > 0) {
|
||||
T = 300.;
|
||||
Rho = 0.001;
|
||||
xm = new double[kk];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ck_gas(int ki, double *xmoles)
|
||||
{
|
||||
kk = ckspecies();
|
||||
if (kk > 0 && kk == ki) {
|
||||
T = 300.;
|
||||
Rho = 1.;
|
||||
xm = new double[kk];
|
||||
double sum=0.0;
|
||||
for (int i = 0; i<kk; i++) {
|
||||
xm[i] = xmoles[i];
|
||||
sum += xm[i];
|
||||
}
|
||||
for (i = 0; i<kk; i++) {
|
||||
xm[i] = xm[i]/sum;
|
||||
}
|
||||
}
|
||||
else {
|
||||
T = 300.;
|
||||
Rho = 1.;
|
||||
xm = new double[1];
|
||||
Err = CKError;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
~ck_gas() {
|
||||
delete xm;
|
||||
}
|
||||
|
||||
double MolWt();
|
||||
double Tcrit() {return 1.0;}
|
||||
double Pcrit() {return 2.0;}
|
||||
double Vcrit() {return 1.0/300.0;}
|
||||
double Tmin() {return 200.0;}
|
||||
double Tmax() {return 5000.0;}
|
||||
char * name() {return "Gas mixture";}
|
||||
char * formula() {return "Chemkin";}
|
||||
double Pp();
|
||||
double up();
|
||||
double sp();
|
||||
|
||||
double Psat() { return 0.0; }
|
||||
double ldens() { return 1.e6; }
|
||||
|
||||
double Cdot(int ks);
|
||||
double Ddot(int ks);
|
||||
double Wdot(int ks);
|
||||
double Tchem(int ks);
|
||||
|
||||
protected:
|
||||
int kk;
|
||||
double *xm;
|
||||
|
||||
};
|
||||
}
|
||||
#endif // ! CK_GAS
|
||||
Loading…
Add table
Reference in a new issue