min_tpd Subroutine

public subroutine min_tpd(model, z, P, T, mintpd, w, all_minima)

min_tpd

Find the minimum of the reduced tangent-plane distance.

Description

Minimizes Michelsen’s modified tangent-plane distance with respect to the trial-phase mole numbers. A negative minimum indicates that the feed is unstable. The routine can optionally return all the minima found from different starting points.

Arguments

Type IntentOptional Attributes Name
class(BaseModel), target :: model

Thermodynamic model

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

Feed composition

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

Pressure [bar]

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

Temperature [K]

real(kind=pr), intent(out) :: mintpd

Minimal value of

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

Trial composition

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

All the found minima


Calls

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

Called by

proc~~min_tpd~~CalledByGraph proc~min_tpd min_tpd 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 :: V
real(kind=pr), public :: di(size(z))
real(kind=pr), public :: dw(size(w))
real(kind=pr), public :: dx(size(w))
integer, public :: i

Loop index i.

integer, public :: iters
integer, public :: j

Loop index j.

real(kind=pr), public :: lnphi_w(size(w))
real(kind=pr), public :: lnphi_z(size(z))
integer, public :: max_iters
real(kind=pr), public :: mins(size(w))
integer, public :: nc

Number of components.

integer, public :: stat
real(kind=pr), public :: ws(size(w),size(w))