CoolProp  4.2.5
An open-source fluid property and humid air property database
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
R407F.cpp
Go to the documentation of this file.
1 
2 #if defined(_MSC_VER)
3 #define _CRTDBG_MAP_ALLOC
4 #define _CRT_SECURE_NO_WARNINGS
5 #include <stdlib.h>
6 #include <crtdbg.h>
7 #else
8 #include <stdlib.h>
9 #endif
10 
11 #include "math.h"
12 #include "stdio.h"
13 #include <string.h>
14 #include "CoolProp.h"
15 #include "FluidClass.h"
16 #include "R407F.h"
17 
19 {
20  // Constants for the ideal-gas contribution
21  static double a[]={0, 1.440000, 2.000227, 5.359371, 3.496132};
22  static double b[]={0, 0.256551293851, 696.9434/355.804, 1723.0916/355.804, 3874.9951/355.804};
23 
24  // Constants for the residual contribution
25  static double N[]={0.5, 0.919875, -1.82678, -0.352996, 0.0588362, 0.000129927, 0.259443, 0.708701, 0.0179878, -0.305208, -0.0510867, -0.0910294, -0.0300902};
26  static double t[]={0, 0.25, 1.25, 1.5, 0.25, 0.875, 2.375, 2, 2.125, 3.5, 6.5, 4.75, 12.5};
27  static double d[]={0, 1, 1, 1, 3, 7, 1, 2, 5, 1, 1, 4, 2};
28  static double l[]={0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3};
29 
30  // Other fluid parameters
31  params.molemass = 82.0583; //[kg/kmol]
32  params.Ttriple = 200; //[K]
33  params.accentricfactor = 0.360036864771; //[-]
34  params.R_u = 8.314472;
35  isPure = false;
36 
37  // Critical parameters
38  crit.rho = 477.285;
39  crit.p = PressureUnit(4754.61,UNIT_KPA);
40  crit.T = 355.804;
41  crit.v = 1.0/crit.rho;
42 
43  phirlist.push_back(new phir_power(N,d,t,l,1,13-1,13));
44 
45  phi0list.push_back(new phi0_lead(0, 0));
46  phi0list.push_back(new phi0_logtau(-1.0));
47  phi0list.push_back(new phi0_cp0_poly(a[1],b[1],crit.T,298.15));
48  phi0list.push_back(new phi0_Planck_Einstein(a,b,2,4,4+1));
49 
50  // Adjust to the IIR reference state (h=200 kJ/kg, s = 1 kJ/kg for sat. liq at 0C)
51  params.HSReferenceState = "IIR";
52 
53  // Limits of EOS
54  limits.Tmin = params.Ttriple;
55 
56  name.assign("R407F");
57  REFPROPname = "N/A";
58 
59 }
60 
61 double R407FClass::psatL(double T)
62 {
63  // Maximum absolute error is 0.238386 % between 149.496265 K and 355.803836 K
64  const double t[]={0, 1, 2, 3, 5, 9};
65  const double N[]={0, 0.18082710436189095, -7.7983091066218071, 2.0533745861071391, -2.1140573561077987, -2.3513695979484255};
66  double summer=0,theta;
67  theta=1-T/reduce.T;
68  for (int i=1;i<=5;i++)
69  {
70  summer += N[i]*pow(theta,t[i]/2);
71  }
72  return reduce.p.Pa*exp(reduce.T/T*summer);
73 }
74 
75 
76 double R407FClass::psatV(double T)
77 {
78  // Maximum absolute error is 0.465542 % between 149.496265 K and 355.803836 K
79  const double t[]={0, 1, 2, 4, 8};
80  const double N[]={0, -0.25845953186204634, -6.7270062079395379, 0.13564366673540645, -5.5138739927573255};
81  double summer=0,theta;
82  theta=1-T/reduce.T;
83  for (int i=1;i<=4;i++)
84  {
85  summer += N[i]*pow(theta,t[i]/2);
86  }
87  return reduce.p.Pa*exp(reduce.T/T*summer);
88 }
89 
90 
91 double R407FClass::rhosatL(double T)
92 {
93  // Maximum absolute error is 0.110596 % between 149.496265 K and 354.803846 K
94  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.5};
95  const double N[] = {0, -25.016336368491949, 275.16509661941035, -1282.9862444814557, 3317.3858644879506, -5014.0917140512256, 4290.9626091919372, -1709.960437659249, 151.99307236915118};
96  double summer=0,theta;
97  theta=1-T/reduce.T;
98 
99 for (int i=1; i<=8; i++)
100 {
101  summer += N[i]*pow(theta,t[i]);
102 }
103 return reduce.rho*(summer+1);
104 
105 }
106 
107 
108 double R407FClass::rhosatV(double T)
109 {
110  // Maximum absolute error is 0.079941 % between 149.496265 K and 354.803846 K
111  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.5, 1.8333333333333333, 2.1666666666666665};
112  const double N[] = {0, 181.82633126699102, -2600.9978883137055, 15966.622688274818, -54675.956461439942, 112349.32219323577, -136062.35313491867, 81475.183272830909, -23041.320486947832, 7912.2244219331069, -1517.1758761518065};
113  double summer=0,theta;
114  theta=1-T/reduce.T;
115 
116 for (int i=1; i<=10; i++)
117 {
118  summer += N[i]*pow(theta,t[i]);
119 }
120 return reduce.rho*exp(reduce.T/T*summer);
121 
122 }
123 
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
struct FluidLimits limits
Definition: FluidClass.h:219
PressureUnit p
Definition: FluidClass.h:50
std::string name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
double rhosatL(double)
Definition: R407F.cpp:91
double Pa
Definition: Units.h:22
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
double psatV(double)
Definition: R407F.cpp:76
double rhosatV(double)
Definition: R407F.cpp:108
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
bool isPure
A std::string that contains a reference for the transport properties of the fluid.
Definition: FluidClass.h:159
params
struct CriticalStruct crit
Definition: FluidClass.h:218
Term in the ideal-gas specific heat equation that is polynomial term.
Definition: Helmholtz.h:881
std::vector< phi_BC * > phi0list
A vector of instances of the phi_BC classes for the residual Helmholtz energy contribution.
Definition: FluidClass.h:179
double psatL(double)
Definition: R407F.cpp:61
R407FClass()
Definition: R407F.cpp:18
double Tmin
Definition: FluidClass.h:54