Read Chapter-2 of "Thermodynamics - A New Approach" by S. Bhattacharjee, Prentice Hall, 2003 for a complete discussion of the balance equations.