Thermodynamically consistent formulation of a deterministic non equilibrium theory of non homogeneous media