This manipulator will allow you generate shapes of liquid lenses (phase A) bounded by an lower (phase B) and upper (phase C) fluid. All input parameters are in cgs units,for example,the surface tension of water in cgs units is 72 dynes/cm. R is the radius of the lens, (Subscript[σ, AC]) is the surface tension between phases A and C,(Subscript[σ, BC]) is the surface tension between phases B and C, S is the spreading coefficient (always negative), and (Subscript[ρ, X]) is the density of the X phase,and Σ is the radius of the wall of the container, where the slope of the B/C interface is assumed to be zero.  It is assumed that (Subscript[ρ, C])<(Subscript[ρ, A])<(Subscript[ρ, B]),although the profiler may work when this is not the case as well (pendant lenses). The acceleration due to gravity is fixed at 980.665 cm/(s^2). After you have input the parameters,press the "Update plot" button to generate a new plot and values for the volume and angles. The reported angles are in degrees
measured with respect to the horizontal. For Bond numbers greater than ~500,the profiler may have problems and produce unreliable results (Bo = (R^2)ρ g/σ). The export button allows you
to save data points along the three surfaces to a text file.  Choose the number of points that you want sampled along each surface
(the sampling is done at equal arc-length intervals). The coordinates of the AC interface are listed first, then the AB interface, then the BC interface.

CODE

Manipulate[Block[{x,y,LR,Pin,Bo},
Dynamic[Panel[TableForm[
{{ParametricPlot[{flist,Map[{-1,1} #&,flist]},{j,0,1},ImageSize->72 6,BaseStyle->{FontFamily->"Arial",16},PlotStyle->Red,Frame->True,AspectRatio->asprat,PlotRange->{{-rrange,rrange},Automatic}]},{},
{Text[Style[StringJoin["lens volume:   ",ToString[PaddedForm[volume,5]]],FontFamily->"Arial",FontSize->20]]},
{Text[Style[StringJoin["angle α:   ",ToString[PaddedForm[ang1a 180/π,4]]],FontFamily->"Arial",FontSize->20]]},
{Text[Style[StringJoin["angle β:   ",ToString[Round[ang2a 180/π*10000.0]/10000.0]],FontFamily->"Arial",FontSize->20]]},
{Text[Style[StringJoin["angle γ:   ",ToString[PaddedForm[ang3a 180/π,4]]],FontFamily->"Arial",FontSize->20]]},Refresh[{Text[Style[StringJoin["status:   ",ToString[status]],FontFamily->"Arial",FontSize->20]]},TrackedSymbols:>{status}]}]]]],
{{lensradius,1,Style["R",FontSize->18]},ControlType->InputField,FieldSize->6},
{{lenssurften,70,Style["(Subscript[σ, AC])",FontSize->18]},FieldSize->6},
{{spreadcoeff,-100,Style["S",FontSize->18]},FieldSize->6},
{{watsurften,20,Style["(Subscript[σ, BC])",FontSize->18]},FieldSize->6},
{{lensdensity,1,Style["(Subscript[ρ, A])",FontSize->18]},FieldSize->6},
{{watden,2,Style["(Subscript[ρ, B])",FontSize->18]},FieldSize->6},
{{airden,0,Style["(Subscript[ρ, C])",FontSize->18]},FieldSize->6},
{{wallrad,2,Style["Σ",FontSize->18]},FieldSize->6},
{{rrange,2,Style["plot range",FontSize->18]},FieldSize->6},
{{asprat,1,Style["aspect ratio",FontSize->18]},{1->"Square",Automatic->"Real"},ControlType->PopupMenu},
Grid[{{"                               ",Button["Update plot",
status="updating...";
flist=lenssystem[lensradius,wallrad,lenssurften,spreadcoeff,watsurften,lensdensity,watden,airden,980.665];
If[Length[flist]==3,
volume=Abs[(NIntegrate[Evaluate[flist[[1,2]] 2 π flist[[1,1]] D[flist[[1,1]],j]],{j,0,1}]+NIntegrate[Evaluate[-flist[[2,2]] 2 π flist[[2,1]] D[flist[[2,1]],j]],{j,0,1}])]];
status="completed";ang1a=ang1;ang2a=ang2;ang3a=ang3,
ImageSize->Medium,Method->"Queued"
]}}],
{{exppts,100,Style["exported points",FontSize->18]},FieldSize->6},
Grid[{{"                               ",Button["Export Data",
If[Length[flist]==3,Export[SystemDialogInput["FileSave"],Flatten[{Table[flist[[1]],{j,0,1,1/(exppts-1)}],"\n",Table[flist[[2]],{j,0,1,1/(exppts-1)}],"\n",Table[flist[[3]],{j,0,1,1/(exppts-1)}]},1],"Table"]],
Method->"Queued",ImageSize->Medium
]}}],
ControlPlacement->Left,
SynchronousUpdating->False,
BaseStyle->Black,
LabelStyle->15,
Initialization:>
(volume=0;
status="completed";
flist={{0,0}};  (*flist is a 3x2 list of interpolating functions, representing the AC interfac, the AB interface, and the BC interface, respectively. It is generated by the function lenssystem *)
ang1a=0; (* ang1a=α, ang2a=β, ang3a=γ *)
ang2a=0;
ang3a=0;
(* j is a parametric variable that goes from 0 to 1 for each interface; j=0 corresponds to r=0 for the lens interfaces, and j=0 corresponds to r=Σ, the edge of the container, for the BC interface  *)
curvtot=((-x'[j]y''[j]+x''[j] y'[j])/(((((x'[j])^2)+((y'[j])^2)))^(3/2)))+((-y'[j])/(x[j](((((x'[j])^2)+((y'[j])^2)))^(1/2))));
xpp=y'[j] (2 LR Pin-Bo LR y[j]+((y'[j])/(x[j])));  (* x''[j] *)
ypp=-x'[j] (2 LR Pin-Bo LR y[j]+((y'[j])/(x[j])));  (* y''[j]  *) 
xpp1=If[j<(10^(-6)),0,y'[j] (2 LR Pin-Bo LR y[j]+((y'[j])/(x[j])))];   (* take care of j=0 case *) 
ypp1=If[j<(10^(-6)),-(LR^2) Pin,-x'[j] (2 LR Pin-Bo LR y[j]+((y'[j])/(x[j])))];
(* Bo= Bond number, Pin= internal pressure at j=0, Lr= length of interface, xpp1 and ypp1 are used for the lens interfaces where r can equal zero, and xpp and ypp are used for the subphase interface. The "lenssystem" function will calculate the shape of all three interfaces given the radius (rad), radius of the container wall (wall), 3 surface tensions (surf1,surf2,surf3), three densities (den1,den2,den3), and gravity (g=980.665)*)  
myvecang[pt_]:=N[If[pt[[2]]<0,2 π-VectorAngle[pt,{1,0}],VectorAngle[pt,{1,0}]]];
lenssystem[rad_?NumericQ,wall_?NumericQ,surf1_?NumericQ,spread_?NumericQ,surf3_?NumericQ,den1_?NumericQ,den2_?NumericQ,den3_?NumericQ,grav_?NumericQ]:=
Block[{surf2=(surf3-spread-surf1),bond1,bond2,bond3},
(*below we calcluate the three bond numbers for the interfaces, and give guesses for the three contact angles, which are used to give a reasonable guess for the pressures in the lens and subphase.*)
bond1=(rad^2) (den1-den3) grav/surf1;
bond2=(rad^2) (den2-den1) grav/surf2;
bond3=(rad^2) (den2-den3) grav/surf3;
ang1g=180.  ArcCos[(((surf1^2)-(surf2^2)+(surf3^2))/(2 surf1 surf3))]/π-0;
ang2g=180. ArcCos[((-(surf1^2)+(surf2^2)+(surf3^2))/(2 surf2 surf3))]/π+0;
ang3g=0;
(*Pguess is a function that gives a reasonable guess for the pressure at the top of a lens given the Bond number*)
Pguess[xx_]:=(10^(-0.14809247161505015  ((Abs[xx])^0.6319007389279652))); 
(*testfunc1 calculates the profile of all three interfaces (tester1,tester2,tester3), given the pressure (Pint) and perimeter (LRt). It then outputs the 6 conditions that we need to fix the 3 pressures and 3 arclengths, which are that the functions are equal to R at the contact line (1 in scaled coordinates), the two contact angle equations, and the hydrostatic equilibrium equation.  When all the elements (6 in total) of testfunc1's output are zero, then the solution to the system has been found.*)
testfunc1[Pint1_?NumericQ,Pint2_?NumericQ,Pint3_?NumericQ,LRt1_?NumericQ,LRt2_?NumericQ,LRt3_?NumericQ]:=Block[{},
tester1={x[j],y[j]}/.NDSolve[{y''[j]==ypp1,x''[j]==xpp1,x[0]==0,x'[0]==LR,y'[0]==0,y[0]==0}/.{Bo->bond1,Pin->Pint1,LR->LRt1},{x[j],y[j]},{j,0,1},MaxStepFraction->.001,StartingStepSize->(10^(-6)),MaxSteps->10000][[1]];
tester1=tester1-{0,tester1[[2]]/.j->1};
tester2={x[j],-y[j]}/.NDSolve[{y''[j]==ypp1,x''[j]==xpp1,x[0]==0,x'[0]==LR,y'[0]==0,y[0]==0}/.{Bo->bond2,Pin->Pint2,LR->LRt2},{x[j],y[j]},{j,0,1},MaxStepFraction->.001,StartingStepSize->(10^(-6)),MaxSteps->10000][[1]];
tester2=tester2-{0,tester2[[2]]/.j->1};
tester3={x[j],y[j]}/.NDSolve[{y''[j]==ypp,x''[j]==xpp,x[1]==wall/rad,x'[1]==LR,y'[1]==0,y[1]==0}/.{Bo->bond3,Pin->Pint3,LR->LRt3},{x[j],y[j]},{j,1,0},MaxSteps->10000,MaxStepFraction->.001,StartingStepSize->(10^(-6))][[1]]/.j->1-j;
tester3=tester3-{0,tester3[[2]]/.j->1};
ang1=myvecang[{1,-1}D[tester1,j]/.j->1];
ang2=myvecang[{1,1}D[tester2,j]/.j->1];
ang3=myvecang[D[tester3,j]/.j->1]-π;
{1-tester1[[1]]/.j->1,1-tester2[[1]]/.j->1,1-tester3[[1]]/.j->1,surf1 Cos[ang1]+surf2 Cos[ang2]-surf3 Cos[ang3],surf1 Sin[ang1]-surf2 Sin[ang2]+surf3 Sin[ang3],2 surf1/rad Pint1+den1 grav rad(tester1[[2]]-tester2[[2]]/.j->0)-2 surf2/rad Pint2-den2 grav rad(tester3[[2]]-tester2[[2]]/.j->0)-2 surf3/rad Pint3-den3 grav rad(tester1[[2]]-tester3[[2]]/.j->0)}];
(*This part does the actual findroot calculation, and then we return the three interfaces, rescaled by the radius to make them in real units (cgs). IMPORTANT: If you want to fool around with making pendant lenses, you might have to change the guesses for the pressures and lengths in the FindRoot function below.*)
minvals=FindRoot[testfunc1[Pint1x,Pint2x,Pint3x,LRt1x,LRt2x,LRt3x],{{Pint1x,Max[0.1,Sin[ang1g π/180]Pguess[bond1]]},{Pint2x,Max[0.1,Sin[ang2g π/180]Pguess[bond2]]},{Pint3x,0},{LRt1x,1.05},{LRt2x,1.05},{LRt3x,(wall/rad)-1}}];
{tester1,tester2,tester3}rad])]