summaryrefslogtreecommitdiff
path: root/Utilib/src/freesteam_api.c
diff options
context:
space:
mode:
authorstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
committerstainer_t <thomas.stainer@oecd-nea.org>2025-09-08 13:48:49 +0200
commit7dfcc480ba1e19bd3232349fc733caef94034292 (patch)
tree03ee104eb8846d5cc1a981d267687a729185d3f3 /Utilib/src/freesteam_api.c
Initial commit from Polytechnique Montreal
Diffstat (limited to 'Utilib/src/freesteam_api.c')
-rw-r--r--Utilib/src/freesteam_api.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/Utilib/src/freesteam_api.c b/Utilib/src/freesteam_api.c
new file mode 100644
index 0000000..68b14f1
--- /dev/null
+++ b/Utilib/src/freesteam_api.c
@@ -0,0 +1,37 @@
+
+/**********************************/
+/* C API for freesteam support */
+/* author: A. Hebert (27/05/2012) */
+/**********************************/
+
+/*
+ Copyright (C) 2012 Ecole Polytechnique de Montreal
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+ */
+
+#include "steam.h"
+#include "steam_pT.h"
+#include "steam_Tx.h"
+#include "region.h"
+
+void free_pT(double *P, double *T, double *RHO, double *H, double *ZK, double *ZMU, double *CP){
+ SteamState State = freesteam_set_pT((double)*P, (double)*T);
+ *RHO = freesteam_rho(State); /*density*/
+ *H = freesteam_h(State); /*enthalpy*/
+ *ZK = freesteam_k(State); /*thermal conductivity*/
+ *ZMU = freesteam_mu(State); /*dynamic viscosity*/
+ *CP = freesteam_cp(State); /*isobaric heat capacity*/
+}
+
+void free_Tx(double *T, double *X, double *RHO, double *H, double *ZK, double *ZMU, double *CP){
+ SteamState State = freesteam_set_Tx((double)*T, (double)*X);
+ *RHO = freesteam_rho(State); /*density*/
+ *H = freesteam_h(State); /*enthalpy*/
+ *ZK = freesteam_k(State); /*thermal conductivity*/
+ *ZMU = freesteam_mu(State); /*dynamic viscosity*/
+ *CP = freesteam_cp(State); /*isobaric heat capacity*/
+}