Ge_residual Subroutine

public subroutine Ge_residual(self, n, T, Ge, dGe_dn, dGe_dn2, dGe_dT, dGe_dT2, dGe_dTn)

UNIFAC residual term

Evaluate the UNIFAC residual therm

Description

Evaluate the UNIFAC residual therm. The residual Gibbs excess energy and its derivatives are evaluated as:

With:

In the UNIFAC model, the values are calculated assuming that the molecule “i” is pure, hence only the subgroups of the molecule “i” must be considered for the calculation. On the other hand, for the values, all the system’s subgroups are considered.

The compositional derivatives:

With:

The temperature derivatives:

With:

Temperature-compositional cross derivative:

With:

References

  1. SINTEF - Thermopack

Arguments

Type IntentOptional Attributes Name
class(UNIFAC) :: self
real(kind=pr), intent(in) :: n(self%nmolecules)

Moles vector

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

Temperature [K]

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

Residual Gibbs excess energy

real(kind=pr), intent(out), optional :: dGe_dn(self%nmolecules)

real(kind=pr), intent(out), optional :: dGe_dn2(self%nmolecules,self%nmolecules)

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

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

real(kind=pr), intent(out), optional :: dGe_dTn(self%nmolecules)


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: Ejk(self%ngroups,self%ngroups)
real(kind=pr), public :: Ge_aux
real(kind=pr), public :: aux_sum(self%nmolecules)
real(kind=pr), public :: aux_sum2
real(kind=pr), public :: dEjk_dt(self%ngroups,self%ngroups)
real(kind=pr), public :: dEjk_dt2(self%ngroups,self%ngroups)
real(kind=pr), public :: dGe_dT_aux
real(kind=pr), public :: dGe_dn_aux(self%nmolecules)
real(kind=pr), public :: dlambda_ik_dT(self%nmolecules,self%ngroups)
real(kind=pr), public :: dlambda_ik_dT2(self%nmolecules,self%ngroups)
real(kind=pr), public :: dlambda_k_dT(self%ngroups)
real(kind=pr), public :: dlambda_k_dT2(self%ngroups)
real(kind=pr), public :: dlambda_k_dn(self%nmolecules,self%ngroups)
real(kind=pr), public :: dlambda_k_dn2(self%nmolecules,self%nmolecules,self%ngroups)
real(kind=pr), public :: dlambda_k_dndT(self%nmolecules,self%ngroups)
logical, public :: dn
logical, public :: dn2
logical, public :: dt
logical, public :: dt2
logical, public :: dtn
integer, public :: i
integer, public :: j
integer, public :: k
integer, public :: l
real(kind=pr), public :: lambda_ik(self%nmolecules,self%ngroups)
real(kind=pr), public :: lambda_k(self%ngroups)
logical, public :: pge
real(kind=pr), public :: sum_Q_v_dlambda_k_dn(self%nmolecules,self%nmolecules)
real(kind=pr), public :: sum_ni_vij_Qj_Ejk(self%ngroups)
real(kind=pr), public :: sum_ni_vij_Qj_dEjk_dT(self%ngroups)
real(kind=pr), public :: sum_ni_vik_Qk
real(kind=pr), public :: sum_nl_vlj(self%ngroups)
real(kind=pr), public :: sum_vQ_Lambda(self%nmolecules)
real(kind=pr), public :: sum_vij_Qj_Ejk(self%nmolecules,self%ngroups)
real(kind=pr), public :: sum_vij_Qj_dEjk_dT(self%nmolecules,self%ngroups)
real(kind=pr), public :: sum_vij_Qj_dEjk_dT2(self%nmolecules,self%ngroups)
real(kind=pr), public :: sum_vij_Qj_dlambdas_dT(self%nmolecules)
real(kind=pr), public :: sum_vij_Qj_dlambdas_dT2(self%nmolecules)
real(kind=pr), public :: sum_vik_Qk(self%nmolecules)
real(kind=pr), public :: theta_j(self%ngroups)