aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/if97
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/if97
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/if97')
-rw-r--r--vcpkg/ports/if97/portfile.cmake13
-rw-r--r--vcpkg/ports/if97/relax-encoding.diff48
-rw-r--r--vcpkg/ports/if97/vcpkg.json8
3 files changed, 69 insertions, 0 deletions
diff --git a/vcpkg/ports/if97/portfile.cmake b/vcpkg/ports/if97/portfile.cmake
new file mode 100644
index 0000000..da7f113
--- /dev/null
+++ b/vcpkg/ports/if97/portfile.cmake
@@ -0,0 +1,13 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO CoolProp/IF97
+ REF v2.1.3
+ SHA512 b29a74f134d69b72ba4bb825b25f0631f2fb335500da5d9016c4e6e417d8c93a5b309e95770eb6a7b723948dd82a7b46d873a1fe4e3f3047a881603442d73eff
+ HEAD_REF master
+ PATCHES
+ relax-encoding.diff
+)
+
+file(INSTALL "${SOURCE_PATH}/IF97.h" DESTINATION "${CURRENT_PACKAGES_DIR}/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/if97/relax-encoding.diff b/vcpkg/ports/if97/relax-encoding.diff
new file mode 100644
index 0000000..e48ae2b
--- /dev/null
+++ b/vcpkg/ports/if97/relax-encoding.diff
@@ -0,0 +1,48 @@
+diff --git a/IF97.h b/IF97.h
+index 864f3a0..4e6cab5 100644
+--- a/IF97.h
++++ b/IF97.h
+@@ -52,7 +52,7 @@ namespace IF97
+ // IF97 Constants
+ const double Tcrit = 647.096; // K
+ const double Pcrit = 22.064*p_fact; // MPa*
+- const double Rhocrit = 322.0; // kg/m³
++ const double Rhocrit = 322.0; // kg/m^3
+ const double Scrit = 4.41202148223476*R_fact; // kJ*/kg-K (needed for backward eqn. in Region 3(a)(b)
+ const double Ttrip = 273.16; // K
+ const double Ptrip = 0.000611656*p_fact; // MPa*
+@@ -2394,7 +2394,7 @@ namespace IF97
+ // The equation is rearranged to solve for rho and turned
+ // into functions f(T,P,rho0) and f'(T,P,rho0) for the
+ // Newton-Raphson technique. Functions for
+- // dphi/ddelta and d²phi/ddelta² were also required. These
++ // dphi/ddelta and d^2phi/ddelta^2 were also required. These
+ // additional Taylor functions are defined above.
+ //
+ double f(double T, double p, double rho0) const{
+@@ -4172,7 +4172,7 @@ namespace IF97
+ return RegionOutput( IF97_HMASS,RegionOutputBackward(Pmax,s,IF97_SMASS),Pmax, NONE);
+ else {
+ // Determining H(s) along Tmax is difficult because there is no direct p(T,s) formulation.
+- // This linear combination fit h(s)=a*ln(s)+b/s+c/s²+d is not perfect, but it's close
++ // This linear combination fit h(s)=a*ln(s)+b/s+c/s^2+d is not perfect, but it's close
+ // and can serve as a limit along that Tmax boundary. Coefficients in HTmaxdata above.
+ // There is a better way to do this using Newton-Raphson on Tmax = T(p,s), but it is iterative and slow.
+ double ETA = Hmax_n[0]*log(sigma) + Hmax_n[1]/sigma + Hmax_n[2]/pow(sigma,2) +Hmax_n[3];
+@@ -4323,14 +4323,14 @@ namespace IF97
+ inline double cvmass_Tp(double T, double p){ return RegionOutput( IF97_CVMASS, T, p, NONE); };
+ /// Get the speed of sound [m/s] as a function of T [K] and p [Pa]
+ inline double speed_sound_Tp(double T, double p){ return RegionOutput( IF97_W, T, p, NONE); };
+- /// Get the [d(rho)/d(p)]T [kg/m³/Pa] as a function of T [K] and p [Pa]
++ /// Get the [d(rho)/d(p)]T [kg/m^3/Pa] as a function of T [K] and p [Pa]
+ inline double drhodp_Tp(double T, double p){ return RegionOutput( IF97_DRHODP, T, p, NONE); };
+
+ // ******************************************************************************** //
+ // Transport Properties //
+ // ******************************************************************************** //
+
+- /// Get the viscosity [Pa-s] as a function of T [K] and Rho [kg/m³]
++ /// Get the viscosity [Pa-s] as a function of T [K] and Rho [kg/m^3]
+ inline double visc_TRho(double T, double rho) {
+ // Since we have density, we don't need to determine the region for viscosity.
+ static Region1 R1; // All regions use base region equations for visc(T,rho).
diff --git a/vcpkg/ports/if97/vcpkg.json b/vcpkg/ports/if97/vcpkg.json
new file mode 100644
index 0000000..deeb734
--- /dev/null
+++ b/vcpkg/ports/if97/vcpkg.json
@@ -0,0 +1,8 @@
+{
+ "name": "if97",
+ "version": "2.1.3",
+ "port-version": 1,
+ "description": "This repository implements the IF97 formulation for the properties of pure water substance.",
+ "homepage": "https://github.com/CoolProp/IF97",
+ "license": "MIT"
+}