UNIFAC Derived Type

type, public, extends(GeModel) :: UNIFAC

UNIFAC model

Classic liquid-vapor UNIFAC model derived type

Description

This type holds the needed parameters for using a UNIFAC model mainly group areas, volumes and what temperature dependence function to use.

It also holds the individual molecules of a particular system and the set of all groups in the system as a “stew” of groups instead of being them included in particular molecules.

Examples

 ! UNIFAC model with ethanol-formic acid mix and calculate gammas
 use yaeos, only: pr, Groups, setup_unifac, UNIFAC

 type(UNIFAC) :: model
 type(Groups) :: molecules(2)
 real(pr) :: ln_gammas(2)

 ! Ethanol definition [CH3, CH2, OH]
 molecules(1)%groups_ids = [1, 2, 14] ! Subgroups ids
 molecules(1)%number_of_groups = [1, 1, 1] ! Subgroups occurrences

 ! formic acid definition [HCOOH]
 molecules(2)%groups_ids = [43]
 molecules(2)%number_of_groups = [1]

 ! Model setup
 model = setup_unifac(molecules)

 ! Calculate ln_gammas
 call model%ln_activity_coefficient([0.5_pr, 0.5_pr], 298.0_pr, ln_gammas)

 print *, ln_gammas ! result: 0.10505475697637946   0.28073129552766890

References

  1. Dortmund Data Bank Software & Separation Technology
  2. Fredenslund, A., Jones, R. L., & Prausnitz, J. M. (1975). Group‐contribution estimation of activity coefficients in nonideal liquid mixtures. AIChE Journal, 21(6), 1086–1099. https://doi.org/10.1002/aic.690210607
  3. Skjold-Jorgensen, S., Kolbe, B., Gmehling, J., & Rasmussen, P. (1979). Vapor-Liquid Equilibria by UNIFAC Group Contribution. Revision and Extension. Industrial & Engineering Chemistry Process Design and Development, 18(4), 714–722. https://doi.org/10.1021/i260072a024
  4. Gmehling, J., Rasmussen, P., & Fredenslund, A. (1982). Vapor-liquid equilibriums by UNIFAC group contribution. Revision and extension. 2. Industrial & Engineering Chemistry Process Design and Development, 21(1), 118–127. https://doi.org/10.1021/i200016a021
  5. Macedo, E. A., Weidlich, U., Gmehling, J., & Rasmussen, P. (1983). Vapor-liquid equilibriums by UNIFAC group contribution. Revision and extension. 3. Industrial & Engineering Chemistry Process Design and Development, 22(4), 676–678. https://doi.org/10.1021/i200023a023
  6. Tiegs, D., Rasmussen, P., Gmehling, J., & Fredenslund, A. (1987). Vapor-liquid equilibria by UNIFAC group contribution. 4. Revision and extension. Industrial & Engineering Chemistry Research, 26(1), 159–161. https://doi.org/10.1021/ie00061a030
  7. Hansen, H. K., Rasmussen, P., Fredenslund, A., Schiller, M., & Gmehling, J. (1991). Vapor-liquid equilibria by UNIFAC group contribution. 5. Revision and extension. Industrial & Engineering Chemistry Research, 30 (10), 2352–2355. https://doi.org/10.1021/ie00058a017
  8. Wittig, R., Lohmann, J., & Gmehling, J. (2003). Vapor−Liquid Equilibria by UNIFAC Group Contribution. 6. Revision and Extension. Industrial & Engineering Chemistry Research, 42(1), 183–188. https://doi.org/10.1021/ie020506l
  9. SINTEF - Thermopack

Components

Type Visibility Attributes Name Initial
type(Substances), public :: components

Substances contained in the module

real(kind=pr), public, allocatable :: group_area(:)

Group areas

real(kind=pr), public, allocatable :: group_volume(:)

Group volumes

type(Groups), public :: groups_stew

All the groups present in the system

type(Groups), public, allocatable :: molecules(:)

Substances present in the system

integer, public :: ngroups

Total number of individual groups in the mixture

integer, public :: nmolecules

Total number of molecules in the mixture

class(PsiFunction), public, allocatable :: psi_function

Temperature dependance function of the model

real(kind=pr), public, allocatable :: qk(:)

Area of each group k

real(kind=pr), public, allocatable :: thetas_ij(:,:)

Area fractions of the groups j on molecules i

real(kind=pr), public, allocatable :: vij(:,:)

Ocurrences of each group j on each molecule i

real(kind=pr), public :: z = 10

Model constant


Type-Bound Procedures

procedure, public :: excess_gibbs

  • public subroutine excess_gibbs(self, n, T, Ge, GeT, GeT2, Gen, GeTn, Gen2)

    Calculate the Gibbs excess energy of the UNIFAC model

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(UNIFAC), intent(in) :: self

    UNIFAC model

    real(kind=pr), intent(in) :: n(:)

    Moles vector [mol]

    real(kind=pr), intent(in) :: T

    Temperature [K]

    real(kind=pr), intent(out), optional :: Ge

    Excess Gibbs energy

    real(kind=pr), intent(out), optional :: GeT

    real(kind=pr), intent(out), optional :: GeT2

    real(kind=pr), intent(out), optional :: Gen(size(n))

    real(kind=pr), intent(out), optional :: GeTn(size(n))

    real(kind=pr), intent(out), optional :: Gen2(size(n),size(n))

procedure, public :: ln_activity_coefficient

  • public subroutine ln_activity_coefficient(self, n, T, lngamma)

    Arguments

    Type IntentOptional Attributes Name
    class(GeModel), intent(in) :: self
    real(kind=pr), intent(in) :: n(:)
    real(kind=pr), intent(in) :: T
    real(kind=pr), intent(out) :: lngamma(:)