Richard Otis more outline of the general method  over 8 years ago

Commit id: f9c79e8c03aa8752f73f6d72797ef1a71aa76ca3

deletions | additions      

       

# Numerical Approach  The general Gibbs energy minimization problem can be stated in the following way, making use of the compound energy formalism to decompose phases into independent sublattices. A (A  similar construction for Helmholtz energy requires only a change of variables. variables.)  \[  \textrm{min } G_m(T, P, f^i, y^i_{s, j}) \textrm{ where } c_k (T, P, f^i, y^i_{s, j}) = 0 

This formulation only considers equality constraints explicitly. The inequality constraints, \(f^i \gt 0 \) and \(y^i_{s, j} > 0 \), are left implicit and instead handled by a separate step discussed later.  Consider the multi-component, multi-phase case when \(T\) and \(P\) are fixed along with some combination obeying the Gibbs phase rule of \(\mu_j\) and \(x_j\), the chemical potential and mole fraction of components, respectively.  The following  general approach to energy minimization is as follows. can be applied.  1. Sample an initial set of points in the internal degrees of freedom of each phase and compute the molar Gibbs  energy. 2. Map the internal degrees of freedom to global composition space. 3. Construct an initial simplex with dimension equal to the number of components, \(J\). Each vertex is located at a pure composition for each component, i.e., the simplex coordinates comprise a \(J \times J\) identity matrix and therefore bound composition space. Each vertex also has an energy coordinate. If any \(\mu_j\) are specified the corresponding energy coordinate for that vertex may be fixed at that value. Otherwise, it can be set to the maximum energy sampled in the initial grid times a factor guaranteeing that the simplex lies strictly above the energy surface.  4. Compute the driving force.  5. We are converged when the change in chemical potentials is less than some value. We cannot use the change in energy because of dilute cases.