Inconsistency in the value of Gibbs energy for processes at constant pressure and temperature We know that for both reversible and Irreversible processes we have $dG=V dp-S dT$
If $p$ and $T$ are constant we've $dG=0$.
But it's also said here, for processes that occur in a closed system under constant temperature and
pressure,
$\Delta G \leq 0$.
But this contradicts the first equation. What is wrong here?
 A: The starting sentence of this question should be stated in a slightly different way. Small differences of Gibbs free energy  $dG$ can be written as the differential of a function of $p$ and $T$ only for reversible processes. However, since $G$ is a state function (the differential is exact), the expression valid for a reversible path can be used to evaluate the difference of free energy even if the connecting process is not reversible. However, this preliminary observation does not change the problem that apparently, an isothermal and isobaric process should leave unchanged the value of $G$.
This is true provided the system is kept at thermodynamic equilibrium with respect to its internal subsystems. The case of the Gibbs free energy $G$ (and, as a consequence, of its differential $dG$) is parallel to the case of entropy. In the case of entropy, we know that:

*

*its definition requires a reversible path connecting two states ($\Delta S=Q_{rev}/T$);

*once $\Delta S$ has been defined as above, we find that for any irreversible process connecting the same two states $\Delta S \ge Q_{irr}/T$.

*Only in the case of a reversible process, the change of entropy of a closed system can be written in terms of the exact differential form
$$
dS = \frac{dU}{T}+\frac{pdV}{T}. \tag{1} 
$$
Therefore, using equation  $1$ for $\Delta S$, does not imply that $Q_{irr}=d U +pdV$. From a more physical perspective, on an irreversible path, it is not ensured even the existence of the quantities in the right-hand side of the equation $1$. For example, think of a fast process such that a fast-moving piston. There would be a single value of pressure in a turbulent motion?

*Now, the most important point. In a rigid and isolated system $dU=0$ and $dV=0$. Therefore $\Delta S=0$ provided the system is always at thermodynamic equilibrium. If some internal constraint is removed, the system, still isolated and without global volume variation, undergoes an evolution to find a new equilibrium state. However, if we consider the system's internal evolution, we find $\Delta S \ge 0$ even though no heat has been exchanged between the system and surroundings.

The same considerations apply to the case of the Gibbs free energy for systems at fixed temperature and pressure. The possibility that in the presence of irreversible internal processes $\Delta G \le 0$ is not in contradiction with the fact that $dP=0$ and $d T=0$.
The usual formal description of this kind of process probably does not help to make clear the situation. Better alternatives could be either introducing an internal entropy (or Gibbs free energy) change or to state from the beginning that there could be additional variables describing internal constraints of the thermodynamic system.
A: In my judgment, the entire analysis in your link is bogus, starting with $dQ<\frac{dQ_{irrev}}{T}$.  This equation should actually read $dQ<\frac{dQ_{irrev}}{T_B}$ where $T_B$ is the temperature at the boundary interface between the system and its surroundings (see Moran et al, Fundamentals of Engineering Thermodynamics or Fermi, Thermodynamics).  For an irreversible process, the temperature of the system is not going to be uniform, and $T_B$ will not be equal to even the average temperature of the system.
