I'm trying to plot the grapf of a heat exchanger, I already calculated the values but have struggle in plotting it.
The simple form of my code is this:
clear all
clc
c=[];
Teth_in=195;
Tgas_out=230;
ms_gas=0.342;
ms_eth=0.412;
cp_gas=3600;
cp_eth=2440;
dia=25*(10^-3);
for Tgas_in=230:1:290
Q_in=ms_gas*cp_gas*(Tgas_out-Tgas_in);
Teth_out=-Q_in/(ms_eth*cp_eth)+Teth_in;
Q_out=ms_eth*cp_eth*(Teth_in-Teth_out);
delta_T1 = Tgas_in - Teth_out;
delta_T2 = Tgas_out - Teth_in;
delta_Tm = (delta_T1 - delta_T2) / (log10(delta_T1/delta_T2)/(log10(exp(1))));
U=450;
Lx=-Q_in/(U*pi*dia*delta_Tm);
c=[c; Lx delta_Tm Teth_out Tgas_in];
end
plot(c(:,1),c(:,3))
hold on
plot(c(:,1),c(:,4))
grid on
xlabel('Länge [m]')
ylabel('Temperatur [K]')
title('Wärmetauscher Kühlungsverlauf')
legend('Ethanol','Erdgas','location','northwest')
The grapf should be like this:
the grapf i plotted is this:
The problem is that the Lx value is being taken wrong. For example for the red curve , when Lx is 0 then the y-value should be 290, and when Lx is 75 then the y-value should be 230. At the end should get a grapf like the first grapf i added. I hope someone can help me