next up previous
Next: Iterative matrix Up: Cpropep functions description Previous: Cpropep functions description

equilibrium

This function is responsible to compute the entire equilibrium problem. It works in the following way.

  1. Find a first approximation of the moles number considering only gazes.
  2. Fill the matrix of the reduced Gibbs iteration equation.
  3. Solve the matrix

  4. Compute the new approximation using the matrix solution

    First, the control factor that should limit the speed of convergence to avoid negative mol number for gazes.

    $\displaystyle \lambda_1 = \frac{2}{\text{max}(\left\vert\Delta \ln{T}\right\ver...
... \ln{n}\right\vert, \left\vert\Delta \ln{n_j}\right\vert)} \qquad (j=1,2,...,m)$

    $\displaystyle \lambda_2=$min$\displaystyle \left\vert
\frac{-\ln{(\frac{n_j}{n})}-9.2103404}{\Delta \ln{n_j} - \Delta \ln{n}}\right\vert
\qquad (j=1,2,...,m)$

    $\displaystyle \lambda =$   min$\displaystyle (1, \lambda_1, \lambda_2) $

    $\displaystyle n_j = e^{( \ln{n_j} + \lambda \Delta \ln{n_j})} \qquad
(j=1,2,...,m)$

    $\displaystyle n_j = n_j + \lambda \Delta \ln{n_j} \qquad (j=m+1,...,n)$

    $\displaystyle n = e^{(\ln{n} + \lambda \Delta \ln{T})}$

    if it is a non-fixed temperature problem,

    $\displaystyle T = e^{(\ln{T} + \lambda \Delta \ln{T})}$

  5. Check for convergence
    The iteration procedure stop when the following criteria are satisfy

    $\displaystyle \frac{n_j\left\vert\Delta
\ln{n_j}\right\vert}{\underset{j=1}{\overset{m}{\sum}} n_j} \leq 0.5\times
10^{-5} \qquad (j=1,...,m)$

    $\displaystyle \frac{\left\vert\Delta {n_j}\right\vert}{\underset{j=1}{\overset{m}{\sum}}
n_j} \leq 0.5\times
10^{-5} \qquad (j=1,...,n)$

    $\displaystyle \left\vert\Delta \ln{n}\right\vert \leq 0.5\times10^{-5}$

    If there is condensed species which concentration is negative, they should be discard from the list of considered species and convergence to a new equilibrium is obtain.

  6. Test for condensed phases
    For each possible condensed species, the following criteria determine if a species should be include. This criteria check if the inclusion of the condensed decrease free energy. If more than one condensed satusfy the criterium, only the most negative should be include. This process is repeated until all condensed have been discard or included.

    $\displaystyle \frac{\delta{G}}{\delta{n_j}}=\left( \frac{\mu_j^0}{RT}\right)_c -
\sum_{i=1}^{l}{\pi_i a_{ij}} < 0$


next up previous
Next: Iterative matrix Up: Cpropep functions description Previous: Cpropep functions description
Antoine Lefebvre 2000-03-26