-
Notifications
You must be signed in to change notification settings - Fork 3
/
intercooler.m
28 lines (28 loc) · 1.03 KB
/
intercooler.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
function [def_nic,tOUT,tOUTdash,sOUT,sOUTdash,nic]=intercooler(m,cpc,tIN,tINdash,tAMB,sIN,sINdash,resln)
%this calculates the parameters related to intercooler
nic = str2num(char(inputdlg('InterCooler Efficiency:')));
def_nic= nic;
tOUT = tIN-nic*(tIN-tAMB);
tOUTdash = tINdash-nic*(tINdash-tAMB);
tICdash = linspace(tINdash,tOUTdash,resln);
%pressure doesnot fall inside intercooler so we will take Xsteam to
%determine the entropy inside intercooler
tIC = linspace(tIN,tOUT,resln);
q = m*cpc*(tIN-tOUT);
qIC = linspace(0,q,resln);
for loop = 1:length(qIC)
if loop==1
sIC(loop) = sIN;
sICdash(loop) = sINdash;
else
sIC(loop) = qIC(loop)/tIC(loop)+ sIN; %ds = dq/t where s3 = (q-0)/t+sIN
sICdash(loop) = qIC(loop)/tICdash(loop)+ sICdash(1);
end
end
sOUT = sIC(length(sIC));
sOUTdash = sICdash(length(sICdash));
plot(sIC,tIC,'--b');
plot(sICdash,tICdash,':b');
%%drawnow;
%entropy change is only due to friction and other irreversible process here
%according to purdue epub paper. Hence, neglecting entropy changes.