A new boundary condition for computer simulations of interfacial systems