  We consider thermal machines powered by locally equilibrium reservoirs that
share classical or quantum correlations. The reservoirs are modelled by the
so-called collisional model or repeated interactions model. In our framework,
two reservoir particles, initially prepared in a thermal state, are correlated
through a unitary transformation and afterwards interact locally with the two
quantum subsystems which form the working fluid. For a particular class of
unitaries, we show how the transformation applied to the reservoir particles
affects the amount of heat transferred and the work produced. We then compute
the distribution of heat and work when the unitary is chosen randomly, proving
that the total swap transformation is the optimal one. Finally, we analyse the
performance of the machines in terms of classical and quantum correlations
established among the microscopic constituents of the machine.
