Theory and Numerics of Open System Thermodynamics