It has long been a Catholic understanding that when circumstances prevent one from receiving Holy Communion, it is possible to make an Act of Spiritual Communion, which is a source of grace.
Spiritual Communion is an ardent desire to receive Jesus in the Most Holy Sacrament and lovingly embrace him at a time or in circumstances when one cannot receive Him in sacramental Communion.
This can be prayed in any place and at any time.