hold on
contour(fmdry_range,fmmob_range,VISFOAM,[527 527],'b','LineWidth',2)

hold on

n=150;
fmmob_range=linspace(28000,38000,n);
fmdry_range=linspace(0.07,0.08,n);

global S_wc S_gr krw0 krg0 nw ng visw visg epdry  

for I=1:n     
    fmmob=fmmob_range(I); %fmmob as x1 (x coordinate)
    for J=1:n
        fmdry=fmdry_range(J); %fmdry as x2 (y coordinate)
global fmmob fmdry

Sw_t=fminbnd('findSw_t',S_wc,1);
krg=krg0*(1-(Sw_t-S_wc)/(1-S_gr-S_wc))^ng;
krw=krw0*((Sw_t-S_wc)/(1-S_gr-S_wc))^nw;
Fwater=0.5+(atan(epdry*(Sw_t-fmdry)))/pi;

FM=1./(1+fmmob.*Fwater);

fstar(I,J)=1-(1+krg*FM*visw/(krw*visg))^-1;
    end
end

h = gca; 
set(h,'FontSize',30);
[AA,BB]=contour(fmdry_range,fmmob_range,fstar,'k:','LineWidth',2)
clabel(AA,BB,'FontSize',20,'LabelSpacing',1000)
hold on
contour(fmdry_range,fmmob_range,fstar,[0.9 0.9],'r','LineWidth',2)
xlabel('fmdry')
ylabel('fmmob')
%title('Contour of transition foam quality')