exercise5.m

% Loesung von Aufgabe 5
% gegebene Werte
t1 = 20;  % in C
t2 = 50;
phi1 = 0.4;   % rel. Feuchte
phi2 = 0.8;
q = 2/3;      % Massenverhaeltnis
p = 1.01325e5;  % Normdruck

%% a: Diagramm
x1 = 0.0059;
h1 = 35.5e3;
x2 = 0.0674;
h3 = 225e3;

x3 = (q*x1 + x2)/(1+q)

%% b: Berechnen
% Feuchtegrade x1, x2
ps1 = saturationPressure(celsiusToKelvin(t1))
x1 = 0.6219*phi1*ps1/(p - phi1*ps1)

ps2 = saturationPressure(celsiusToKelvin(t2))
x2 = 0.6219*phi2*ps2/(p - phi2*ps2)

% Bestimmung des Feuchtegrads x3
x3 = (q*x1 + x2)/(1 + q)

% spezifische Enthalpien
cp_luft = 1004;  % in J/(kg K)
cp_dampf = 1860;  % in J/(kg K)
r0 = 2500.9e3;  % in J/kg

h1 = cp_luft*t1 + x1*(r0 + cp_dampf*t1) % in J/kg
h2 = cp_luft*t2 + x2*(r0 + cp_dampf*t2)

h3 = (q*h1 + h2)/(1 + q)

% Mischungstemperatur
t3 = (h3 - x3*r0)/(cp_luft + x3*cp_dampf)

% Berechnung von phi3
ps3 = saturationPressure(celsiusToKelvin(t3))
phi3 = p/ps3 * x3/(x3 + 0.6219)