  The Soft Glassy Rheology (SGR) model is a mesoscopic framework which proved
to be very successful in describing flow and deformation of various amorphous
materials phenomenologically (e.g. pastes, slurries, foams etc). In this paper,
we cast SGR in a general, model independent framework for nonequilibrium
thermodynamics called General Equation for the Nonequilibrium
Reversible-Irreversible Coupling (GENERIC). This leads to a new formulation of
SGR which clarifies how it can properly be coupled to hydrodynamic fields,
resulting in a thermodynamically consistent, local, continuum version of SGR.
Additionally, we find that compliance with thermodynamics imposes the existence
of a modification to the stress tensor as predicted by SGR.
