In the circuit given in the figure, switch S is closed at position 1 for long time. Find the total heat generated in resistor of resistance 2r0, when the switch S is open at position 1 and closed at position 2.