diff options
Diffstat (limited to 'Utilib/src/freesteam_api.c')
| -rw-r--r-- | Utilib/src/freesteam_api.c | 37 |
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*/ +} |
