where Δ U 0 denotes the change of internal energy of the system, and Δ U i denotes the change of internal energy of the i th of the m surrounding subsystems that are in open contact with the system, due to transfer between the system and that i th surrounding subsystem, and Q denotes the internal energy transferred as heat from the heat reservoir of the surroundings to the system, and W denotes the energy transferred from the system to the surrounding subsystems that are in adiabatic connection with it. The case of a wall that is permeable to matter and can move so as to allow transfer of energy as work is not considered here.