Loading [MathJax]/extensions/TeX/AMSsymbols.js
CoolProp
6.7.0
An open-source fluid property and humid air property database
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
r
s
t
u
v
w
x
Variables
Typedefs
Enumerations
Enumerator
b
d
f
g
h
i
n
p
q
r
s
t
v
x
y
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
Enumerations
Enumerator
c
e
i
m
n
o
p
r
s
t
v
z
Related Functions
Files
File List
File Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
p
q
r
s
t
u
v
Variables
Typedefs
b
c
i
m
t
u
v
Enumerations
Enumerator
c
m
t
Macros
_
a
c
d
e
f
i
l
m
n
p
r
t
u
x
z
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
Backends
PCSAFT
PCSAFTFluid.cpp
Go to the documentation of this file.
1
#include <string>
2
#include <vector>
3
#include <map>
4
#include <math.h>
5
6
#include "
PCSAFTFluid.h
"
7
#include "
rapidjson_include.h
"
8
9
namespace
CoolProp
{
10
11
PCSAFTFluid::PCSAFTFluid
(rapidjson::Value::ValueIterator itr) {
12
name
=
cpjson::get_string
(*itr,
"name"
);
13
CAS
=
cpjson::get_string
(*itr,
"CAS"
);
14
params
.
m
=
cpjson::get_double
(*itr,
"m"
);
15
params
.
sigma
=
cpjson::get_double
(*itr,
"sigma"
);
16
params
.
u
=
cpjson::get_double
(*itr,
"u"
);
17
18
if
(itr->HasMember(
"uAB"
) && (*itr)[
"uAB"
].IsNumber()) {
19
params
.
uAB
=
cpjson::get_double
(*itr,
"uAB"
);
20
}
else
{
21
params
.
uAB
= 0.;
22
}
23
24
if
(itr->HasMember(
"volA"
) && (*itr)[
"volA"
].IsNumber()) {
25
params
.
volA
=
cpjson::get_double
(*itr,
"volA"
);
26
}
else
{
27
params
.
volA
= 0.;
28
}
29
30
if
(itr->HasMember(
"assocScheme"
)) {
31
params
.
assocScheme
=
cpjson::get_string_array
(*itr,
"assocScheme"
);
32
}
else
{
33
params
.
assocScheme
= {};
34
}
35
36
if
(itr->HasMember(
"dipm"
) && (*itr)[
"dipm"
].IsNumber()) {
37
params
.
dipm
=
cpjson::get_double
(*itr,
"dipm"
);
38
}
else
{
39
params
.
dipm
= 0.;
40
}
41
42
if
(itr->HasMember(
"dipnum"
) && (*itr)[
"dipnum"
].IsNumber()) {
43
params
.
dipnum
=
cpjson::get_double
(*itr,
"dipnum"
);
44
}
else
{
45
params
.
dipnum
= 0.;
46
}
47
48
if
(itr->HasMember(
"charge"
) && (*itr)[
"charge"
].IsNumber()) {
49
params
.
z
=
cpjson::get_double
(*itr,
"charge"
);
50
}
else
{
51
params
.
z
= 0.;
52
}
53
54
molemass
=
cpjson::get_double
(*itr,
"molemass"
);
55
aliases
=
cpjson::get_string_array
(*itr,
"aliases"
);
56
}
57
58
void
PCSAFTFluid::calc_water_sigma
(
double
t) {
59
if
(t > 473.16) {
60
throw
ValueError
(
"The current function for sigma for water is only valid for temperatures below 473.15 K."
);
61
}
else
if
(t < 273) {
62
throw
ValueError
(
"The current function for sigma for water is only valid for temperatures above 273.15 K."
);
63
}
64
65
params
.
sigma
= 3.8395 + 1.2828 * exp(-0.0074944 * t) - 1.3939 * exp(-0.00056029 * t);
66
}
67
68
}
/* namespace CoolProp */
Generated on Sat Feb 22 2025 01:20:23 for CoolProp by
1.9.1