  We consider the Navier--Stokes--Fourier system in a bounded domain $\Omega
\subset R^d$, $d=2,3$, with physically realistic in/out flow boundary
conditions. We develop a new concept of weak solutions satisfying a general
form of relative energy inequality. The weak solutions exist globally in time
for any finite energy initial data and comply with the weak--strong uniqueness
principle.
