Let the closed atmospheric parcel exchange heat and volume work with reservoirs at fixed temperature and pressure , while reactions rearrange its conserved elemental inventory. For a reversible differential between equilibrium states, the first law of thermodynamics, with chemical work included, is
The Gibbs free energy therefore obeys
The first law of thermodynamics supplies this differential but does not alone choose the direction of a reaction. The Second law of thermodynamics does: for the parcel plus its reservoirs, at fixed and with no non-volume work,
Thus spontaneous reactions decrease Gibbs free energy, and stable thermochemical equilibrium is its constrained minimum. For an allowed reaction of extent , let , with positive stoichiometric vector entries for products and negative entries for reactants. At an interior minimum,
The condition must hold for every independent allowed reaction, with fixed total atoms of each element and any relevant charge constraint. At a boundary with absent species, only feasible one-sided variations are permitted. These are the hypotheses of constrained Gibbs minimization for chemical equilibrium.
For an ideal gas mixture, , where is the volume mixing ratio and the molar gas constant. Therefore
This is a dimensionless activity-based equilibrium constant, not a bare product of dimensional pressures.