Nonequilibrium molecular dynamics simulations of confined fluids in contact with the bulk