-
Notifications
You must be signed in to change notification settings - Fork 3
/
intercooler2.m
24 lines (24 loc) · 941 Bytes
/
intercooler2.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
function [tOUT,tOUTdash,sOUT,sOUTdash,nic]=intercooler2(def_nic,m,cpc,tIN,tINdash,tAMB,sIN,sINdash,resln)
%this calculates the parameters related to intercooler
nic=def_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));
%entropy change is only due to friction and other irreversible process here
%according to purdue epub paper. Hence, neglecting entropy changes.