An anisotropic many-body H2 potential energy function has been developed for use in heterogeneous systems. The intermolecular potential has been derived from first principles and expressed in a form that is readily transferred to exogenous systems, e.g. in modeling H2 sorption in solid-state materials. Explicit many-body polarization effects, known to be important in simulating hydrogen at high density, are incorporated. The analytic form of the potential energy function is suitable for methods of statistical physics, such as Monte Carlo or Molecular Dynamics simulation. The model has been validated on dense supercritical hydrogen and demonstrated to reproduce the experimental data with high accuracy.