function neg_vis_foam = findSwt (S_w)

global krw0 krg0 S_wc S_gr nw ng visw visg epdry fmmob fmdry

Fwater=0.5+(atan(epdry*(S_w-fmdry)))/pi;
krw=krw0*((S_w-S_wc)/(1-S_gr-S_wc)).^nw;
krg=krg0*(1-(S_w-S_wc)/(1-S_gr-S_wc)).^ng.*(1./(1+fmmob*Fwater));
fg=1./(1+krw.*visg./(krg.*visw));
vis_foam=1./(krw/visw+krg/visg);

neg_vis_foam=-vis_foam;

