The Joule cycle