  The free-energy barrier of filling a spherical cavity having an inner wall of
various wettabiities is studied. The morphology and free energy of a
lens-shaped droplet are determined from the minimum of the free energy. The
effect of line tension on the free energy is also studied. Then, the
equilibrium contact angle of the droplet is determined from the generalized
Young's equation. By increasing the droplet volume within the spherical cavity,
the droplet morphology changes from spherical with an equilibrium contact angle
of $180^{\circ}$ to a lens with a convex meniscus, where the morphological
complete drying transition occurs. By further increasing the droplet volume,
the meniscus changes from convex to concave. Then, the lens-shaped droplet with
concave meniscus spreads over the whole inner wall resulting in an equilibrium
contact angle of $0^{\circ}$ to leave a spherical bubble, where the
morphological complete wetting transition occurs. Finally, the whole cavity is
filled with liquid. The free energy shows a barrier from complete drying to
complete wetting as a function of droplet volume, which corresponds to the
energy barrier between the Cassie and Wenzel state of the superhydrophobic
surface with spherical cavities. The free-energy maximum occurs when the
meniscus of the droplet becomes flat and it is given by an analytic formula.
The effect of line tension is expressed by the scaled line tension, and this
effect is largest at the free-energy maximum. The positive line tension
increases the free-energy maximum, which thus, increases the stability of the
Cassie superhydrophobic state, whereas the negative line tension destabilizes
the superhydrophobic state.
