The affinity in local chemical equilibrium