%% graphical out of simulation results %%

clear

load prof1.dat
S_time1=prof1(:,1);
C_w_time1=prof1(:,2);
NaCl_w_time1=prof1(:,3);
x1=prof1(:,4);

load prof2.dat
S_time2=prof2(:,1);
C_w_time2=prof2(:,2);
NaCl_w_time2=prof2(:,3);

load prof3.dat
S_time3=prof3(:,1);
C_w_time3=prof3(:,2);
NaCl_w_time3=prof3(:,3);

load prof4.dat
TIME_HIS=prof4(:,1);
f_g_HIS=prof4(:,2);
f_surf_HIS=prof4(:,3);
f_NaCl_HIS=prof4(:,4);
p_drop_HIS=prof4(:,5);
VIS_FOAM=prof4(:,6);

load prof5.dat
pot_time1=prof5(:,1);
pot_time2=prof5(:,2);
pot_time3=prof5(:,3);

load prof6.dat
pwd_time1=prof6(:,1);
pwd_time2=prof6(:,2);
pwd_time3=prof6(:,3);

figure(1)
set(gca,'FontSize',25);
plot(x1,S_time1,'r^-',x1,C_w_time1,'bo-',x1,NaCl_w_time1,'ks-')  
xlabel('DIMENSIONLESS DISTANCE')
ylabel('COMPOSITION')
title('COMPOSITION PROFILE at t_D=0.5')
legend('gas saturation','surfactant concentration in aqueous phase (g/L)','NaCl concentration in aqueous phase')

figure(2)
set(gca,'FontSize',25);
plot(x1,S_time2,'r^-',x1,C_w_time2,'bo-',x1,NaCl_w_time2,'ks-')
xlabel('DIMENSIONLESS DISTANCE')
ylabel('COMPOSITION')
title('COMPOSITION PROFILE at t_D=1.0')
legend('gas saturation','surfactant concentration in aqueous phase (g/L)','NaCl concentration in aqueous phase')

figure(3)
set(gca,'FontSize',25);
plot(x1,S_time3,'r^-',x1,C_w_time3,'bo-',x1,NaCl_w_time3,'ks-')
xlabel('DIMENSIONLESS DISTANCE')
ylabel('COMPOSITION')
title('COMPOSITION PROFILE at t_D=5.0')
legend('gas saturation','surfactant concentration in aqueous phase (g/L)','NaCl concentration in aqueous phase')

figure(4)
set(gca,'FontSize',25);
plot(TIME_HIS,f_g_HIS,'r-',TIME_HIS,f_surf_HIS,'b-.',TIME_HIS,f_NaCl_HIS,'k--')
xlabel('Dimensionless time (TPV)')
ylabel('Dimensionless effluent history')
title('EFFLUENT HISTORY')
legend('gas cut','surfactant concentration in aqueous phase','NaCl concentration in aqueous phase')

figure(5)
set(gca,'FontSize',25);
plot(x1,pot_time1,'ro-',x1,pot_time2,'b*-',x1,pot_time3,'gs-')
xlabel('DIMENSIONLESS DISTANCE')
ylabel('DIMENSIONLESS PRESSURE')
title('DIMENSIONLESS GAS PRESSURE PROFILE')
legend('t_D=0.5','t_D=1.0','t_D=5.0')

figure(6)
set(gca,'FontSize',25);
plot(x1,pwd_time1,'ro-',x1,pwd_time2,'b*-',x1,pwd_time3,'gs-')
xlabel('DIMENSIONLESS DISTANCE')
ylabel('DIMENSIONLESS PRESSURE')
title('DIMENSIONLESS LIQUID PRESSURE PROFILE')
legend('t_D=0.5','t_D=1.0','t_D=5.0')

figure(7)
set(gca,'FontSize',25);
plot(TIME_HIS,p_drop_HIS,'b-+')
xlim([0 5])
xlabel('DIMENSIONLESS TIME')
ylabel('DIMENSIONLESS PRESSURE DROP')
title(['GAS PHASE PRESSURE DROP HISTORY'])

figure(8)
set(gca,'FontSize',25);
plot(TIME_HIS,VIS_FOAM,'b-+')
xlim([0 5])
xlabel('Dimensionless time (TPV)')
ylabel('Foam apparent viscosity(cp)')
title(['FOAM APPARENT VISCOSITY HISTORY'])

