Environmental Management based on Thermodynamics: a case study in the Province of Pesaro (Italy)