tm Function

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

tm

Evaluate Michelsen’s modified reduced tangent-plane distance.

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

 tpd_value = tm(model, z, w, P, T)

Using precalculated feed data

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

call model%lnphi_pt(z, T=T, P=P, V=Vz, root_type="stable", lnPhi=lnphi_z)
d = log(z) + lnphi_z
tpd_value = tm(model, z, w, P, T, d=d)

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(BaseModel), 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(:)

Gradient of tm with respect to trial-phase mole amounts.

Return Value real(kind=pr)


Calls

proc~~tm~~CallsGraph proc~tm tm ln_activity_coefficient ln_activity_coefficient proc~tm->ln_activity_coefficient lnphi_pt lnphi_pt proc~tm->lnphi_pt

Called by

proc~~tm~~CalledByGraph proc~tm tm proc~create_generalized_isoz_line create_generalized_isoz_line proc~create_generalized_isoz_line->proc~tm proc~min_tpd min_tpd proc~min_tpd->proc~tm proc~flash_second_order flash_second_order proc~flash_second_order->proc~min_tpd proc~pt_mp_flash pt_mp_flash proc~pt_mp_flash->proc~min_tpd

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