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
Neon.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 <vector>
16 #include <iostream>
17 #include <list>
18 #include "Helmholtz.h"
19 #include "FluidClass.h"
20 #include "Neon.h"
21 #include "Nitrogen.h"
22 
24 {
25  double n[] = {0, 3.532653449, -4.513954384, -0.1524027959, 2.188568609, -7.44299997, 7.755627402, -3.122553128, 1.014206899, -0.05289214086, 0.1566849239, -0.2228527050, -0.01410150942, 0.07036229719, -0.05882048367, 0.01571172741, 0.001292202769, 0.0007902035603, -0.0003794403616, 0.04652799333, 0.04524001818, -0.2383421991, 0.00629359013, -0.001272313644, -1.75235256E-07, 0.007188419232, -0.05403006914, 0.07578222187, -0.03808588254, 0.006034022431};
26  double d[] = {0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 4, 4, 4, 4, 6, 6, 6, 1, 2, 2, 2, 2, 2, 4, 8, 8, 8, 8};
27  double t[] = {0, 0.5, 0.75, 3.5, 0.5, 0.75, 1, 1.5, 2.5, 0.25, 0.5, 2.5, 1, 3, 4, 5, 1, 5, 6, 4, 1, 5, 8, 12, 32, 10, 6, 7, 8, 9};
28  double c[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 2, 2, 4, 6, 6, 2, 2, 2, 2, 2};
29 
30  phirlist.push_back(new phir_power(n,d,t,c,1,29,30));
31 
32  // Critical parameters
33  crit.rho = 23.882*20.179;
34  crit.p = PressureUnit(2680.0, UNIT_KPA);
35  crit.T = 44.4918;
36  crit.v = 1.0/crit.rho;
37 
38  // Other fluid parameters
39  params.molemass = 20.179;
40  params.Ttriple = 24.56;
41  params.ptriple = 43.432339578188873;
42  params.accentricfactor = -0.038449299273685900;
43  params.R_u = 8.31434;
44 
45  // Limits of EOS
46  limits.Tmin = params.Ttriple;
47  limits.Tmax = 2000.0;
48  limits.pmax = 1000000.0;
49  limits.rhomax = 50.65*params.molemass;
50 
51  //Constants for ideal gas expression
52  phi0list.push_back(new phi0_lead(0,0));
53  phi0list.push_back(new phi0_logtau(1.5));
54 
55  name.assign("Neon");
56  aliases.push_back("neon");
57  aliases.push_back(std::string("NEON"));
58  REFPROPname.assign("Neon");
59 
60  ECSReferenceFluid = "Nitrogen";
61 
62  BibTeXKeys.EOS = "Katti-ACE-1986";
63  BibTeXKeys.ECS_LENNARD_JONES = "Poling-BOOK-2001";
64  BibTeXKeys.SURFACE_TENSION = "Mulero-JPCRD-2012";
65 }
66 double NeonClass::psat(double T)
67 {
68  // Max error is 0.0338668363766 % between 24.56 and 44.491799 K
69  const double t[]={0, 0.373, 0.39149999999999996, 0.39199999999999996, 0.39699999999999996, 0.8333333333333334, 4.333333333333333};
70  const double N[]={0, -607.32379162883592, 125090.01843013773, -134770.7106365099, 10289.950413284598, -6.6808869319498001, -0.71410047975147495};
71  double summer=0,theta;
72  theta=1-T/reduce.T;
73  for (int i=1; i<=6; i++)
74  {
75  summer += N[i]*pow(theta,t[i]);
76  }
77  return reduce.p.Pa*exp(reduce.T/T*summer);
78 }
79 
80 double NeonClass::rhosatL(double T)
81 {
82  // Maximum absolute error is 0.184674 % between 24.556001 K and 44.491790 K
83  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333, 1.5, 1.8333333333333333};
84  const double N[] = {0, -7.2369686484173252, 211.94763997778651, -2354.4170363141825, 13773.297638494711, -47566.671061179397, 101604.99338894009, -134063.9401911686, 103055.345207873, -37489.598569658992, 2840.9862970955251};
85  double summer=0,theta;
86 
87  theta=1-T/reduce.T;
88  for (int i=1; i<=10; i++)
89  {
90  summer += N[i]*pow(theta,t[i]);
91  }
92  return reduce.rho*(summer+1);
93 }
94 
95 double NeonClass::rhosatV(double T)
96 {
97  // Maximum absolute error is 0.152314 % between 24.556001 K and 44.491790 K
98  const double t[] = {0, 0.16666666666666666, 0.3333333333333333, 0.5, 0.6666666666666666, 0.8333333333333334, 1.0, 1.1666666666666667, 1.3333333333333333};
99  const double N[] = {0, -0.42110191619014642, 9.2190373809956672, -72.08994032423108, 243.69954118084271, -458.84607430631803, 462.45011147675018, -229.64665885151433, 41.165593531034638};
100  double summer=0,theta;
101 
102  theta=1-T/reduce.T;
103  for (int i=1; i<=8; i++)
104  {
105  summer += N[i]*pow(theta,t[i]);
106  }
107  return reduce.rho*exp(reduce.T/T*summer);
108 }
std::vector< phi_BC * > phirlist
Definition: FluidClass.h:178
double rhosatV(double)
Definition: Neon.cpp:95
struct FluidLimits limits
Definition: FluidClass.h:219
std::string EOS
Definition: FluidClass.h:120
PressureUnit p
Definition: FluidClass.h:50
std::string ECSReferenceFluid
A list of aliases of names for the Fluid, each element is a std::string instance. ...
Definition: FluidClass.h:154
std::string name
A container to hold the cache for residual Helmholtz derivatives.
Definition: FluidClass.h:151
double Pa
Definition: Units.h:22
std::vector< std::string > aliases
The REFPROP-compliant name if REFPROP-"name" is not a compatible fluid name. If not included...
Definition: FluidClass.h:153
struct CriticalStruct reduce
A pointer to the point that is used to reduce the T and rho for EOS.
Definition: FluidClass.h:222
double Tmax
Definition: FluidClass.h:54
std::string REFPROPname
The name of the fluid.
Definition: FluidClass.h:152
std::string ECS_LENNARD_JONES
Definition: FluidClass.h:124
NeonClass()
Definition: Neon.cpp:23
std::string SURFACE_TENSION
Definition: FluidClass.h:126
double rhosatL(double)
Definition: Neon.cpp:80
double pmax
Definition: FluidClass.h:54
params
struct CriticalStruct crit
Definition: FluidClass.h:218
BibTeXKeysStruct BibTeXKeys
Definition: FluidClass.h:175
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 Tmin
Definition: FluidClass.h:54
double rhomax
Definition: FluidClass.h:54
double psat(double)
Definition: Neon.cpp:66