  The chemical potential of adsorbed or confined fluids provides insight into
their unique thermodynamic properties and determines adsorption isotherms.
However, it is often difficult to compute this quantity from atomistic
simulations using existing statistical mechanical methods. We introduce a
computational framework that utilizes static structure factors, thermodynamic
integration and free energy perturbation, for calculating the absolute chemical
potential of fluids. For demonstration, we apply the method to compute the
adsorption isotherms of carbon dioxide in a metal-organic framework (MOF) and
water in carbon nanotubes.
