ln_activity_coefficient Subroutine

public subroutine ln_activity_coefficient(eos, n, P, T, root_type, lngamma, dlngammadP, dlngammadT, dlngammadn)

Calculate natural logarithm of activity coefficients and its derivatives given pressure and temperature.

Examples

```fortran ! eos = PengRobinson76(Tc, Pc, w)

n = [1.0_pr, 1.0_pr] ! T = 300.0_pr ! P = 1.0_pr

call eos%ln_activity_coefficient(& n, P, T, root_type=”stable”, & lngamma=lngamma, dlngammadP=dlngammadP, & dlngammadT=dlngammadT, dlngammadn=dlngammadn & ) ```

Type Bound

Gerg2008

Arguments

Type IntentOptional Attributes Name
class(Gerg2008), intent(in) :: eos

Model

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

Moles number vector

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

Pressure [bar]

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

Temperature [K]

character(len=*), intent(in) :: root_type

Desired root-type to solve. Options are: ["liquid", "vapor", "stable"]

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

Natural logarithm of activity coefficient

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

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

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


Calls

proc~~ln_activity_coefficient~2~~CallsGraph proc~ln_activity_coefficient~2 Gerg2008%ln_activity_coefficient proc~gerg_2008 gerg_2008 proc~ln_activity_coefficient~2->proc~gerg_2008 proc~lnphi_pt ArModel%lnphi_pt proc~ln_activity_coefficient~2->proc~lnphi_pt proc~get_original_parameters get_original_parameters proc~gerg_2008->proc~get_original_parameters proc~soaveredlichkwong SoaveRedlichKwong proc~gerg_2008->proc~soaveredlichkwong proc~lnphi_vt ArModel%lnphi_vt proc~lnphi_pt->proc~lnphi_vt proc~volume~2 ArModel%volume proc~lnphi_pt->proc~volume~2 proc~original_parameters original_parameters proc~get_original_parameters->proc~original_parameters residual_helmholtz residual_helmholtz proc~lnphi_vt->residual_helmholtz get_v0 get_v0 proc~volume~2->get_v0 interface~newton newton proc~volume~2->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: dPdV
real(kind=pr), public :: dPdn(size(n))
real(kind=pr), public :: dVdn(size(n))
real(kind=pr), public :: dlnPhi_i_dT(size(n))
real(kind=pr), public :: dlnPhi_i_dT_temp(1)
real(kind=pr), public :: dlnPhidT(size(n))
real(kind=pr), public :: dlnPhidn(size(n),size(n))
logical, public :: dn
logical, public :: dp
logical, public :: dt
type(Gerg2008), public :: eos_temp
logical, public :: gam
integer, public :: i
real(kind=pr), public :: lnPhi(size(n))
real(kind=pr), public :: lnPhi_i(size(n))
real(kind=pr), public :: lnPhi_i_temp(1)
real(kind=pr), public :: npure(size(n))
logical, public :: present_derivs
real(kind=pr), public :: vi(size(n))
real(kind=pr), public :: vi_temp