Thermodynamic derivation of the hydrodynamical model for charge transport in semiconductors