From classical thermodynamics to phase-field method