-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVP.m
24 lines (20 loc) · 3.09 KB
/
VP.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function [ VP_ ] = VP(desiccant, T, C)
%Calculates partial water vapour pressure (VP_) of a desiccant solution
T = T+273.15;
% Converts temperature from Celesius to Kelvin
C = max(C,0.01);
%Set the minimum concentration to 0.01 so that the function does not return 0
if strcmp(desiccant,'LiCl')
%Selects the correlation that is appropriate for selecting
VP_ = (22060 * exp((1.83991 * (1 - (T / 647.096)) ^ 1.5 - 7.85823 * (1 - (T / 647.096)) ^ 1 - 11.7811 * (1 - (T / 647.096)) ^ 3 + 22.6705 * (1 - (T / 647.096)) ^ 3.5 - 15.9393 * (1 - (T / 647.096)) ^ 4 + 1.77516 * (1 - (T / 647.096)) ^ 7.5) / (1 - (1 - (T / 647.096))))) * (1 - (1 + ((C / 100) / 0.362) ^ (-4.75)) ^ (-0.4) - 0.03 * exp(((C / 100) - 0.1) ^ 2 / (-0.005))) * (2 - (1 + ((C / 100) / 0.28) ^ 4.3) ^ 0.6 + ((1 + ((C / 100) / 0.21) ^ 5.1) ^ 0.49 - 1) * T / 647.096);
elseif strcmp(desiccant,'CaCl2')
VP_ = (22060 * exp((1.83991 * (1 - (T / 647.096)) ^ 1.5 - 7.85823 * (1 - (T / 647.096)) ^ 1 - 11.7811 * (1 - (T / 647.096)) ^ 3 + 22.6705 * (1 - (T / 647.096)) ^ 3.5 - 15.9393 * (1 - (T / 647.096)) ^ 4 + 1.77516 * (1 - (T / 647.096)) ^ 7.5) / (1 - (1 - (T / 647.096))))) * (1 - (1 + ((C / 100) / 0.478) ^ (-5.2)) ^ (-0.4) - 0.018 * exp(((C / 100) - 0.1) ^ 2 / (-0.005))) * (2 - (1 + ((C / 100) / 0.31) ^ 3.698) ^ 0.6 + ((1 + ((C / 100) / 0.231) ^ 4.584) ^ 0.49 - 1) * T / 647.096);
elseif strcmp(desiccant,'MgCl2')
VP_ = 10 ^ (0.37678 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) * (((-0.0213) + 3.60591 * 10 ^ -4 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) + 18 / 2303) - ((-5.390915) + 1.382982 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) - 0.031185 * ((1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) ^ 2)) / ((T) - 39.53)) + ((7.192959 - 3.99334 * 10 ^ (-3) * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) - 1.11614 * 10 ^ (-4) * ((1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) ^ 2) + 18 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) * (1 - 1) / 2303) - (1730.286 - 0.138481 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) + 0.027511 * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) ^ 2 - 1.79277 * 10 ^ (-3) * (1 / 2 * (1000 / ((100 / (C) - 1) * 95.21)) * 6) ^ 3) / ((T) - 39.53)));
elseif strcmp(desiccant,'LiBr')
VP_ = 10 ^ (1 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) * (((-0.0213) + 3.60591 * 10 ^ -4 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) + 18 / 2303) - ((-5.390915) + 1.382982 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) - 0.031185 * ((1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) ^ 2)) / ((T) - 39.53)) + ((7.192959 - 3.99334 * 10 ^ (-3) * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) - 1.11614 * 10 ^ (-4) * ((1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) ^ 2) + 18 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) * (1 - 2) / 2303) - (1730.286 - 0.138481 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) + 0.027511 * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) ^ 2 - 1.79277 * 10 ^ (-3) * (1 / 2 * (1000 / ((100 / (C) - 1) * 86.845)) * 2) ^ 3) / ((T) - 39.53)));
else
VP_ = 0;
%if the desiccant passed to the function is not recognized, the function returns 0
end
end