-
Notifications
You must be signed in to change notification settings - Fork 5
/
HGSs.m
38 lines (33 loc) · 1.05 KB
/
HGSs.m
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
function [S] = HGSs(a,T,P,state)
%**************************************************************************
%
% [S] = HGSs(a,T,P,state)
%
%**************************************************************************
%
% HGSh calculates the enthropy of a species using his Burcat coeficients
% and temperature
%
%**************************************************************************
% Inputs:
%--------------------------------------------------------------------------
% a --> Burcat coefficients
% T --> [K] Temperature
% P --> [bar] Pressure
% state --> State of the species
%
% Outputs:
%--------------------------------------------------------------------------
% S --> [kJ/(mol*K)] Entropy
%
%**************************************************************************
% *HGS 2.1
% *By Caleb Fuster, Manel Soria and Arnau Miró
% *ESEIAAT UPC
global R; HGSr
Pref = 1; % [bar]
S = R * (a(7) + a(1)*log(T) + sum(a(2:5).*(T.^(1:4))./(1:4))); % [kJ/mol*K]
if strcmp('G',state) && P ~= 0
S = S-R*log(P/Pref);
end
end