tm Function

public function tm(model, z, w, P, T, d, dtpd)

Alternative formulation of tangent-plane-distance

Michelsen’s modified function, .

Description

Alternative formulation of the reduced tangent plane function, where the test phase is defined in moles, which enables for unconstrained minimization.

Examples

Calculation of tm

 tm = tpd(model, z, w, P, T)
 ---------------------------

Using precalculated trial-phase data

It is possible to calculate externaly the d_i vector and use it for later calculations.

call fugacity_tp(&
  model, z, T=T, P=P, V=Vz, root_type="stable", lnphip=lnphi_z&
)
lnphi_z = lnphi_z - log(P)
di = log(z) + lnphi_z
tm = tpd(model, z, w, P, T, d=di)
 ---------------------------

References

  1. Thermodynamic Models: Fundamental and Computational Aspects, Michael L. Michelsen, Jørgen M. Mollerup. Tie-Line Publications, Denmark (2004) doi

Arguments

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

Thermodynamic model

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

Feed composition

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

Test-phase mole numbers vector

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

Pressure [bar]

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

Temperature [K]

real(kind=pr), intent(in), optional :: d(:)

vector

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

Return Value real(kind=pr)


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: di(size(z))
real(kind=pr), public :: lnphi_w(size(z))
real(kind=pr), public :: lnphi_z(size(z))
real(kind=pr), public :: vw
real(kind=pr), public :: vz