lnphi_pt Subroutine

private subroutine lnphi_pt(eos, n, P, T, V, root_type, lnPhi, dlnPhidP, dlnPhidT, dlnPhidn, dPdV, dPdT, dPdn)

Calculate natural logarithm of fugacity given pressure and temperature.

Calculate the natural logarithm of the fugacity coefficient and its derivatives given pressure and temperature. This routine will obtain the desired volume root at the specified pressure and calculate fugacity at that point.The routine gives the possibility to calculate the pressure derivatives and volume.

Examples

eos = PengRobinson76(Tc, Pc, w)

n = [1.0_pr, 1.0_pr]
T = 300.0_pr
V = 1.0_pr

call eos%lnphi_pt(&
   n, V, T, lnPhi=lnPhi, &
   dlnPhidP=dlnPhidP, dlnPhidT=dlnPhidT, dlnPhidn=dlnPhidn &
   )

Type Bound

ArModel

Arguments

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

Model

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

Mixture mole numbers

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

Pressure [bar]

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

Temperature [K]

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

Volume [L]

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

Type of root desired [“liquid”, “vapor”, “stable”]

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

vector

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

ln(phi) Presssure derivative

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

ln(phi) Temperature derivative

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

ln(phi) compositional derivative

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

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

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


Variables

Type Visibility Attributes Name Initial
real(kind=pr), private :: P_in
real(kind=pr), private :: V_in