Generic aspects of convexification with applications to thermodynamic equilibrium