-
Notifications
You must be signed in to change notification settings - Fork 0
/
steam.h
98 lines (76 loc) · 2.79 KB
/
steam.h
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*
freesteam - IAPWS-IF97 steam tables library
Copyright (C) 2004-2005 John Pye
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef FREESTEAM_STEAM_H
#define FREESTEAM_STEAM_H
#include "common.h"
#include <stdio.h>
typedef struct SteamState_R1_struct{
MyDouble p, T;
} SteamState_R1;
typedef struct SteamState_R2_struct{
MyDouble p, T;
} SteamState_R2;
typedef struct SteamState_R3_struct{
MyDouble rho, T;
} SteamState_R3;
typedef struct SteamState_R4_struct{
MyDouble T, x;
} SteamState_R4;
typedef struct SteamState_struct{
char region;
union U {
SteamState_R1 R1;
SteamState_R2 R2;
SteamState_R3 R3;
SteamState_R4 R4;
#if HAVE_CADNA_H && defined(__cplusplus)
U() {
new( &R1 ) SteamState_R1();
new( &R2 ) SteamState_R2();
new( &R3 ) SteamState_R3();
new( &R4 ) SteamState_R4();
}
#endif
} SteamState_U ;
} SteamState;
FREESTEAM_DLL int freesteam_region(SteamState S);
FREESTEAM_DLL SteamState freesteam_region1_set_pT(MyDouble p, MyDouble T);
FREESTEAM_DLL SteamState freesteam_region2_set_pT(MyDouble p, MyDouble T);
FREESTEAM_DLL SteamState freesteam_region3_set_rhoT(MyDouble rho, MyDouble T);
FREESTEAM_DLL SteamState freesteam_region4_set_Tx(MyDouble T, MyDouble x);
FREESTEAM_DLL int freesteam_fprint(FILE *f, SteamState S);
#if 0
# define FREESTEAM_DEBUG(NAME,STATE)\
fprintf(stderr,"%s (%s:%d): %s ",__func__,__FILE__,__LINE__,NAME);\
freesteam_fprint(stderr,S);
#else
# define FREESTEAM_DEBUG(NAME,STATE)
#endif
typedef MyDouble SteamPropertyFunction(SteamState S);
FREESTEAM_DLL MyDouble freesteam_p(SteamState S);
FREESTEAM_DLL MyDouble freesteam_T(SteamState S);
FREESTEAM_DLL MyDouble freesteam_rho(SteamState S);
FREESTEAM_DLL MyDouble freesteam_v(SteamState S);
FREESTEAM_DLL MyDouble freesteam_u(SteamState S);
FREESTEAM_DLL MyDouble freesteam_h(SteamState S);
FREESTEAM_DLL MyDouble freesteam_s(SteamState S);
FREESTEAM_DLL MyDouble freesteam_cp(SteamState S);
FREESTEAM_DLL MyDouble freesteam_cv(SteamState S);
FREESTEAM_DLL MyDouble freesteam_w(SteamState S);
FREESTEAM_DLL MyDouble freesteam_x(SteamState S);
FREESTEAM_DLL MyDouble freesteam_mu(SteamState S);
FREESTEAM_DLL MyDouble freesteam_k(SteamState S);
#endif