MCPcopy Create free account
hub / github.com/CoolProp/CoolProp / g_Ice

Function g_Ice

src/Ice.cpp:51–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51double g_Ice(double T, double p) {
52#ifndef __powerpc__
53 std::complex<double> r2, term1, term2;
54 double g0 = NAN, theta = NAN, pi = NAN, pi_0 = NAN;
55 theta = T / T_t;
56 pi = p / p_t;
57 pi_0 = p_0 / p_t;
58 g0 = g00 * pow(pi - pi_0, 0.0) + g01 * pow(pi - pi_0, 1.0) + g02 * pow(pi - pi_0, 2.0) + g03 * pow(pi - pi_0, 3.0) + g04 * pow(pi - pi_0, 4.0);
59 r2 = r20 * pow(pi - pi_0, 0.0) + r21 * pow(pi - pi_0, 1.0) + r22 * pow(pi - pi_0, 2.0);
60 // The two terms of the summation
61 term1 = r1 * ((t1 - theta) * log(t1 - theta) + (t1 + theta) * log(t1 + theta) - 2.0 * t1 * log(t1) - theta * theta / t1);
62 term2 = r2 * ((t2 - theta) * log(t2 - theta) + (t2 + theta) * log(t2 + theta) - 2.0 * t2 * log(t2) - theta * theta / t2);
63 return g0 - s0 * T_t * theta + T_t * real(term1 + term2);
64#else
65 return 1e99;
66#endif
67}
68
69double dg_dp_Ice(double T, double p) {
70#ifndef __powerpc__

Callers 2

h_IceFunction · 0.85
HAProps_AuxFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected