An object that is
immersed in a fluid and approaching a substrate
may find a potential energy minimum at a certain distance due to the
balance between attractive and repulsive Casimir–Lifshitz forces,
a phenomenon referred to as quantum trapping. This equilibrium depends
on the relative values of the dielectric functions of the materials
involved. Herein, we study quantum trapping effects in planar nanocomposite
materials and demonstrate that they are strongly dependent on the
characteristics of the spatial inhomogeneity. As a model case, we
consider spherical particles embedded in an otherwise homogeneous
material. We propose an effective medium approximation that accounts
for the effect of inclusions and find that an unprecedented and counterintuitive
intense repulsive Casimir–Lifshitz force arises as a result
of the strong optical scattering and absorption size-dependent resonances
caused by their presence. Our results imply that the proper analysis
of quantum trapping effects requires comprehensive knowledge and a
detailed description of the potential inhomogeneity (caused by imperfections,
pores, inclusions, and density variations) present in the materials
involved.