Composition Derivatives of Activity Coefficients

Composition Derivatives of Activity Coefficients

The derivation below is based on this resource from the people who created the CocoSimulator and this older paper from the same authors.

To write the derivative of the activity coefficient w.r.t to mole fraction, we’ll work from the Gibbs excess energy to find an expression for the activity coefficient in terms of derivatives of Gibbs excess energy.

Q=gERT=i=1nxilnγiQ = \frac{g^E}{RT} = \sum_{i=1}^n x_i \ln \gamma_i

Therefore, the activity coefficient is:

lnγi=(ntQ)niT,P,nki\ln \gamma_i = \frac{\partial(n_t Q)}{\partial n_i}|_{T,P,n_{k\neq i}}

where nkin_{k \neq i} indicates the unconstrained derivative where all components are fixed except ii

  • Using chain rule to expand:
lnγi=Q+ntQniT,P,nki\ln \gamma_i = Q + n_t \frac{\partial Q}{\partial n_i}|_{T,P,n_{k\neq i}}
  • We can expand the second term again using chain rule
    1. Qni=j=1nQjxjninki\frac{\partial Q}{\partial n_i} = \sum_{j=1}^n Q_j \frac{\partial x_j}{\partial n_i} |_{n_{k \neq i}}Qj=QxjxkjQ_j = \frac{\partial Q}{\partial x_j}|_{x_{k\neq j}}
    2. We can easily find QjQ_j, but how do we get the derivative of the mole fraction w.r.t moles?
  • Mole fraction derivative
    • We know from the differential for partial moles:
    • dni=d(ntxi)=ntdxi+xidntdn_i = d(n_tx_i) = n_t dx_i + x_i dn_tdnixijdnj=ntdxidn_i - x_i \sum_j dn_j = n_t dx_idxi=jδijxintdnjdx_i = \sum_j \frac{\delta_{ij}-x_i}{n_t} dn_j
    • δij\delta_{ij} is the kronecker delta, so it is 1 when i=ji=j and 0 everywhere else
    • We also know from the total differential
    • dxi=j(xinj)dnjdx_i = \sum_j \biggl(\frac{\partial x_i}{\partial n_j} \biggr) dn_j
    • By inspection of the last two equations
    • (xinj)nkj=1nt(δijxi)\biggl (\frac{\partial x_i}{\partial n_j} \biggr )_{n_{k \neq j}} = \frac{1}{n_t}(\delta_{ij} - x_i)
  • Putting all the expansions together:
    1. lnγi=Q+ntQniT,P,nki\ln \gamma_i = Q + n_t \frac{\partial Q}{\partial n_i}|_{T,P,n_{k\neq i}}lnγi=Q+nt(k=1nQkxkninli)\ln \gamma_i = Q + n_t\biggl(\sum_{k=1}^n Q_k \frac{\partial x_k}{\partial n_i} |_{n_{l \neq i}} \biggr)lnγi=Q+nt(k=1nQk1nt(δikxk))\ln \gamma_i = Q + n_t\biggl(\sum_{k=1}^n Q_k \frac{1}{n_t}(\delta_{ik} - x_k)\biggr)
    2. Cancel out ntn_t and expand the Kronecker delta out of the sum to get our desired expression for the activity coefficient:
lnγi=Q+Qi+k=1nxkQk\ln \gamma_i = Q + Q_i + \sum_{k=1}^n x_kQ_k
  • Now we can easily find the derivative of the activity coefficient w.r.t the mole fraction - this is the version that only constrains one mole fraction but doesn’t enforce them all summing to one:
  • lnγixjxli=Qijk=1nxkQkj\frac{\partial \ln \gamma_i}{\partial x_j}|_{x_{l \neq i}} = Q_{ij} - \sum_{k=1}^n x_kQ_{kj}QijQixjxkiQ_{ij} \equiv \frac{\partial Q_i}{\partial x_j} |_{x_k\neq i}
  • To get the constrained version, we can observe that an increase in the mole fraction of one component will result in an equal and opposite decrease in the mole fraction of another (given all other mole fractions are fixed except one). This then implies the following equations, starting from the total derivative of the activity coefficient:
  • d(lnγi(x1,,xN))=k=1Nlnγixkxjkdxkd(\ln \gamma_i(x_1, \dots, x_N)) = \sum_{k=1}^N \frac{\partial \ln \gamma_i}{\partial x_k}|_{x_{j \neq k}}dx_k

    Only two mole fractions are actually varying so when we take the partial derivative:

    xl(lnγi(x1,,xN))=lnγixlxjl+lnγixmxjmdxmdxl\frac{\partial}{\partial x_l}(\ln \gamma_i(x_1, \dots, x_N)) = \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq l}}+ \frac{\partial \ln \gamma_i}{\partial x_m}|_{x_{j \neq m}} \frac{dx_m}{dx_l}

    Note that that ll can be equal to ii.

    We know by the logic above that dxl=dxmdx_l = -dx_m, so

    lnγixlxji,l=lnγixlxjllnγixmxjm\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq l}}- \frac{\partial \ln \gamma_i}{\partial x_m}|_{x_{j \neq m}}lnγixlxji,l=Qilk=1nxkQkl(Qimk=1nxkQkm)\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= Q_{il} - \sum_{k=1}^n x_kQ_{kl} - \biggl(Q_{im} - \sum_{k=1}^n x_kQ_{km} \biggr)lnγixlxji,l=QilQim+k=1nxk(QklQkm)\frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= Q_{il} - Q_{im} + \sum_{k=1}^n x_k(Q_{kl} -Q_{km})

So if we put this in terms of the Gibbs excess energy directly:

RTlnγixlxji,l=2gExixl2gExixm+k=1nxk(2gExkxl2gExkxm)RT \frac{\partial \ln \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{\partial^2 g^E}{\partial x_i \partial x_l} - \frac{\partial^2 g^E}{\partial x_i \partial x_m} + \sum_{k=1}^n x_k \biggl(\frac{\partial^2 g^E}{\partial x_k \partial x_l} -\frac{\partial^2 g^E}{\partial x_k \partial x_m}\biggr)γixlxji,l=1RTγi(2gExixl2gExixm+k=1nxk(2gExkxl2gExkxm))\frac{\partial \gamma_i}{\partial x_l}|_{x_{j \neq i,l}}= \frac{1}{RT} \gamma_i \biggl( \frac{\partial^2 g^E}{\partial x_i \partial x_l} - \frac{\partial^2 g^E}{\partial x_i \partial x_m} + \sum_{k=1}^n x_k \biggl(\frac{\partial^2 g^E}{\partial x_k \partial x_l} -\frac{\partial^2 g^E}{\partial x_k \partial x_m}\biggr) \biggr)

From what I understand you can arbitrarily choose mm. This is the component which will be determined by all the others. In the paper, they choose the nnth component. From the third page in the PDF:

image