26 double n[] = {0, -0.15624834164583e1, -0.874703669570960e0, 0.46968858010355e1, 0.97367136204905e-2, -0.49055972708048e-2, 0.24499997808125e2, -0.31443235067567e2, -0.13768156877983e1, 0.14849435860881e1, 0.11374909453775e1, -0.26039791873344e1, -0.30484923493199e-1, 0.53316386834696e1, -0.56733952193640e1, -0.126785566440530e0};
27 double d[] = {0, 1, 1, 2, 2, 6, 3, 3, 3, 4, 4, 5, 5, 5, 5, 2};
28 double t[] = {0, -1.000, 1.375, 1.000, 1.375, 0.750, -0.250, 0.000, 2.250, 0.125, 2.125, 1.250, 2.250, 2.125, 2.375, 14.000};
29 double l[] = {0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 2, 2, 3};
37 params.molemass = 60.05196;
40 params.accentricfactor = 0.48092;
51 double m = 1.01871348, vbarn = 0.444215309e-1,kappabar = 0.109117041e-4 , epsilonbar = 12.2735737;
66 name.assign(
"AceticAcid");
67 aliases.push_back(std::string(
"ACETICACID"));
156 const double t[] = {0, 0.065, 0.367, 1.0, 4.0, 4.166666666666667};
157 const double N[] = {0, 0.03788266794177342, -0.3014667718204638, -7.465403420229625, 51.68803799661326, -61.422675342107055};
158 double summer = 0, theta;
159 theta = 1 - T/
crit.
T;
160 for (
int i=1; i <= 5; i++)
162 summer += N[i]*pow(theta, t[i]);
164 return 5780000*exp(
crit.
T/T*summer);
170 const double t[] = {0, 0.13, 0.3585, 0.361, 0.365, 0.8333333333333334};
171 const double N[] = {0, -8.839463207863323, 73076.09152165553, -118684.81658933076, 45623.75583577903, -3.5208689421322545};
172 double summer=0,theta;
173 theta = 1 - T/
crit.
T;
174 for (
int i=1; i <= 5; i++)
176 summer += N[i]*pow(theta,t[i]);
178 double val =
crit.
rho*(1+summer);
185 const double t[] = {0, 0.14600000000000002, 0.38249999999999995, 0.39349999999999996, 0.39749999999999996, 5.333333333333333};
186 const double N[] = {0, 7.738193007082631, -6937.911692305578, 25918.893876023878, -18994.78347845314, -14.42897045481017};
187 double summer=0,theta;
189 for (
int i=1; i<=5; i++)
191 summer += N[i]*pow(theta,t[i]);
197 #ifndef DISABLE_CATCH
199 TEST_CASE(
"Acetic acid validation from Piazza, FPE, 2011",
"[aceticacid],[validation]")
202 double data[10][9] = {
203 {290,1e-16,1e-16,1.00000,669.46135,0,0.89579,1.03425,215.30848},
204 {290,0.010,0.23586e-3,0.58743,238.11539,1.05462,4.64706,5.35799,158.69275},
205 {290,0.025,0.55619e-3,0.55408,203.44932,0.86742,3.46806,3.91294,154.08504},
206 {290,1060.,9.5458,0.22429,-218.59529,-0.66978,1.66179,1.99658,1221.38239},
207 {290,1070.,22.580,0.52557,-209.68922,-0.68127,1.65651,1.98783,1278.95824},
208 {450,1e-16,1e-16,1.00000,868.66312,0,1.31313,1.45159,262.43829},
209 {450,1.0,0.55569e-1,0.89189,760.34138,1.94165,3.74492,4.41190,244.91797},
210 {450,6.0,0.26514,0.70925,599.36342,1.40868,4.43708,5.53182,212.41678},
211 {450,870.,2.7252,0.05028,152.00058,0.35592,2.48256,2.74525,536.47030},
212 {450,880.,5.6865,0.10372,153.23341,0.35114,2.46536,2.73491,607.71381}};
218 for (
int i = 0; i < N; i++)
220 double T = data[i][0], rho = data[i][1], p = data[i][2]*1e6;
221 double PCP =
PropsSI(
"P",
"T",T,
"D",rho,
"AceticAcid");
222 if (rho < 1e-14){p = 1; PCP = 1;}
226 CHECK(fabs(PCP/p-1) < 1e-4);
231 for (
int i = 0; i < N; i++)
233 double T = data[i][0], rho = data[i][1], h = data[i][4]*1e3;
234 double HCP =
PropsSI(
"H",
"T",T,
"D",rho,
"AceticAcid");
237 CHECK(fabs(HCP-h) < 1);
242 for (
int i = 0; i < N; i++)
244 double T = data[i][0], rho = data[i][1], s = data[i][5]*1e3;
245 double SCP =
PropsSI(
"S",
"T",T,
"D",rho,
"AceticAcid");
246 if (rho < 1e-14){s = 1; SCP = 1;}
249 CHECK(fabs(SCP-s) < 0.01);
254 for (
int i = 0; i < N; i++)
256 double T = data[i][0], rho = data[i][1], cv = data[i][6]*1e3;
257 double OCP =
PropsSI(
"O",
"T",T,
"D",rho,
"AceticAcid");
260 CHECK(fabs(OCP-cv) < 1e-2);
265 for (
int i = 0; i < N; i++)
267 double T = data[i][0], rho = data[i][1], cp = data[i][7]*1e3;
268 double CCP =
PropsSI(
"C",
"T",T,
"D",rho,
"AceticAcid");
271 CHECK(fabs(CCP-cp) < 1e-2);
276 for (
int i = 0; i < N; i++)
278 double T = data[i][0], rho = data[i][1], a = data[i][8];
279 double ACP =
PropsSI(
"A",
"T",T,
"D",rho,
"AceticAcid");
282 CHECK(fabs(ACP-a) < 1e-3);
286 TEST_CASE(
"Check acetic derivatives residual",
"[aceticacid],[helmholtz]")
293 double NUM = (Acetic.
phir(0.5, 0.5+eps) - Acetic.
phir(0.5,0.5-eps))/(2*eps);
299 double NUM = (Acetic.
phir(0.5+eps, 0.5) - Acetic.
phir(0.5-eps,0.5))/(2*eps);
322 TEST_CASE(
"Check acetic derivatives ideal",
"[aceticacid],[helmholtz]")
330 double NUM = (Acetic.
phi0(0.5, 0.5+eps) - Acetic.
phi0(0.5,0.5-eps))/(2*eps);
336 double NUM = (Acetic.
phi0(0.5+eps, 0.5) - Acetic.
phi0(0.5-eps,0.5))/(2*eps);
DensityTpResids(Fluid *pFluid, double T, double p)
std::vector< phi_BC * > phirlist
virtual double d2phi0_dTau2(double tau, double delta)
virtual double d2phir_dDelta_dTau(double tau, double delta)
struct FluidLimits limits
std::string name
A container to hold the cache for residual Helmholtz derivatives.
virtual double phi0(double tau, double delta)
TEST_CASE("Acetic acid validation from Piazza, FPE, 2011","[aceticacid],[validation]")
double pressure_Trho(double T, double rho)
A stub class to do the density(T,p) calculations for near the critical point using Brent solver...
std::vector< std::string > aliases
The REFPROP-compliant name if REFPROP-"name" is not a compatible fluid name. If not included...
virtual double dphi0_dTau(double tau, double delta)
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Fluid is the abstract base class that is employed by all the other fluids.
virtual double dphir_dTau(double tau, double delta)
double PropsSI(std::string Output, std::string Name1, double Prop1, std::string Name2, double Prop2, std::string Ref)
virtual double dphi0_dDelta(double tau, double delta)
std::string REFPROPname
The name of the fluid.
std::string SURFACE_TENSION
virtual double d2phir_dDelta2(double tau, double delta)
struct CriticalStruct crit
BibTeXKeysStruct BibTeXKeys
virtual double phir(double tau, double delta)
REQUIRE(fabs(CPWater.p()-RPWater.p())< 1e-4)
virtual double d2phi0_dDelta2(double tau, double delta)
std::vector< phi_BC * > phi0list
A vector of instances of the phi_BC classes for the residual Helmholtz energy contribution.
virtual double d2phi0_dDelta_dTau(double tau, double delta)
virtual double d2phir_dTau2(double tau, double delta)
#define SECTION(name, description)
virtual double dphir_dDelta(double tau, double delta)