summaryrefslogtreecommitdiff
path: root/Utilib/src/freesteam_api.c
blob: 68b14f1c7e39f9390f5fce180e00688fca1bd3a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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*/
}