A thermodynamical framework for hydrodynamical models of carrier transport in semiconductors