clc
clear all
close all
load v1_6d_ss_data.mat;
load OLGAv7_bif_dataTS.mat;
load v1_6d_bif_data;

Z_2 = Z_2*100;


%%
figure(7)
clf
rect = [0, 0, 20, 15];
set(gcf,'Color',[1,1,1],'PaperUnits','centimeters','PaperSize',[20 15],'PaperPosition',rect)
set(gca,'FontSize',10,'FontName','Times')
subplot(3,2,1)

set(gca,'FontSize',10,'OuterPosition',[0  2/3  1/2  1/3],'FontName','Times')
hold on
plot(100*zss,y1ss,'r','Linewidth',1); % Plot Matlab data
plot(Z_2,P_bh_max,'b--',Z_2,P_bh_min,'b--',Z_2,P_bh_ss,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y1min,'r','Linewidth',1);
plot(100*zs,y1max,'r','Linewidth',1);
title('a) Bottom-hole pressure (\itP\rm_{bh})','FontName','Times');
box on
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\itP\rm_{bh} [bar]','FontName','Times')
xlim([0 100])
ylim([270 290])

subplot(3,2,2)
set(gca,'FontSize',10,'OuterPosition',[1/2  2/3  1/2  1/3],'FontName','Times')
hold on
plot(100*zss,y2ss,'r','Linewidth',1);
plot(Z_2,m_in_max,'b--',Z_2,m_in_min,'b--',Z_2,m_in_ss,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y2min,'r','Linewidth',1);
plot(100*zs,y2max,'r','Linewidth',1);
box on
title('b) Inlet mass flow rate (\itw\rm_{in})','FontName','Times');
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\it w\rm _{in}[kg/s]','FontName','Times')
xlim([0 100])
ylim([8 17])

subplot(3,2,3)
set(gca,'FontSize',10,'OuterPosition',[0  1/3  1/2  1/3],'FontName','Times')
hold on
plot(100*zs,y3min,'r','Linewidth',1);
plot(Z_2,P_in_max,'b--',Z_2,P_in_min,'b--',Z_2,P_in_ss,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y3max,'r','Linewidth',1);
plot(100*zss,y3ss,'r','Linewidth',1);
box on
title('c) Pressure at inlet of pipeline (\itP\rm_{in})','FontName','Times');
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\itP\rm_{in} [bar]','FontName','Times')
xlim([0 100])
%ylim([50 62])

subplot(3,2,4)
set(gca,'FontSize',10,'OuterPosition',[1/2  1/3  1/2  1/3],'FontName','Times')
hold on
plot(100*zs,y4min,'r','Linewidth',1);
plot(Z_2,P_t_max,'b--',Z_2,P_t_min,'b--',Z_2,P_t_ss,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y4max,'r','Linewidth',1);
plot(100*zss,y4ss,'r','Linewidth',1);
box on
title('d) Pressure at top of riser (\itP\rm_{rt})','FontName','Times');
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\itP\rm_{rt} [bar]','FontName','Times')
xlim([0 100])
ylim([50 60])

subplot(3,2,5)
set(gca,'FontSize',10,'OuterPosition',[0  0 1/2  1/3],'FontName','Times')
hold on
plot(100*zs,y5min,'r','Linewidth',1);
plot(Z_2,m_out_max,'b--',Z_2,m_out_min,'b--',Z_2,m_out_ss,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y5max,'r','Linewidth',1);
plot(100*zss,y5ss,'r','Linewidth',1);
box on
title('e) Outlet mass flow rate (\itw\rm_{out})','FontName','Times');
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\itw\rm_{out} [kg/s]','FontName','Times')
xlim([0 100])
ylim([0 40])

c = 86.4;
subplot(3,2,6)
set(gca,'FontSize',10,'OuterPosition',[1/2  0  1/2  1/3],'FontName','Times')
hold on
plot(100*zs,y6min,'r','Linewidth',1);

plot(Z_2,Q_out_max/c,'b--',Z_2,Q_out_min/c,'b--',Z_2,Q_out_ss/c,'b--','Linewidth',1); % Plot OLGA 7 data
plot(100*zs,y6max,'r','Linewidth',1);
plot(100*zss,y6ss,'r','Linewidth',1); % Plot Matlab data
xlabel('valve opening, \itZ\rm_1 [%]')
ylabel('\itq\rm_{out} [L/s]','FontName','Times')
box on
title('d) Volumetric flow rate (\itw\rm_{out})','FontName','Times');
xlim([0 100])
ylim([0 70])

print -depsc C:\Users\jahansha\Documents\SPE_Journal\Figures\WPR_BIF
