% matlab postprocessing script for output file h2cc.out

load h2cc.out
load h2eq.out
cc = h2cc;
eq = h2eq;
ncc = size(cc,2);
neq = size(eq,2);

figure(1)  % linear plot of species over full range
plot( cc(:,1), cc(:,2:5), 'o', 'LineWidth',2 )

xlabel('\xi', 'FontSize',18)
ylabel('Y_k', 'FontSize',18)
title('Mass fractions vs. mixture fraction', 'FontSize',18)
set(gca, 'FontSize', 16 );

hold on
plot( eq(:,1), eq(:,2:neq-2), 'LineWidth', 2 )
legend( 'H_2', 'O_2', 'N_2', 'H_2O', -1 )
hold off

figure(2)  % semilog plot of species around stoichiometric
semilogy( cc(:,1), cc(:,2:5), 'o', 'LineWidth',2 )

xlabel('\xi', 'FontSize',18)
ylabel('Y_k', 'FontSize',18)
title('Mass fractions vs. mixture fraction', 'FontSize',18)
set(gca, 'FontSize', 16 );

hold on
semilogy( eq(:,1), eq(:,2:neq-2), 'LineWidth', 2 )
legend( 'H_2', 'O_2', 'N_2', 'H_2O', -1 )

hold off
axis([0 .1 1.e-9 1.])

figure(3)
plot( cc(:,1), cc(:,6), 'o', 'LineWidth',2 )
hold on
plot( eq(:,1), eq(:,neq-1), 'LineWidth',2 )
hold off

xlabel('\xi', 'FontSize',18)
ylabel('T (K)', 'FontSize',18)
title('Temperature vs. mixture fraction', 'FontSize',18)
set(gca, 'FontSize', 16 );

disp(['complete combustion max(T) = ' num2str(max(cc(:,6))) ])
disp(['equilibrium max(T)         = ' num2str(max(eq(:,neq-1))) ])


