px_F_NP Subroutine

public subroutine px_F_NP(model, z0, zi, np, T, beta_w, X, ns, S, F, df)

px_F_NP

System of equations to solve a multiphase-point at constant temperature.

Description

A multiphase equilibria point between np+1 phases and nc components, where the np+1 phase is a phase taken as reference for the calculation of equilibria rations , can be defined by the system of equations:

Arguments

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

Model to use.

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

First mixture composition.

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

Second mixture composition.

integer, intent(in) :: np

Number of main phases.

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

Temperature [K].

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

Fraction of the reference (incipient) phase.

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

Vector of variables.

integer, intent(in) :: ns

Number of specification.

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

Specification value.

real(kind=pr), intent(out) :: F(size(X))

Vector of functions valuated.

real(kind=pr), intent(out) :: df(size(X),size(X))

Jacobian matrix.


Variables

Type Visibility Attributes Name Initial
real(kind=pr), private :: K(np,size(z0))
real(kind=pr), private :: P
real(kind=pr), private :: Vl(np)
real(kind=pr), private :: Vw
real(kind=pr), private :: alpha
real(kind=pr), private :: betas(np)
real(kind=pr), private :: denom(size(z0))
real(kind=pr), private :: denomdlnK(np,size(z0),size(z0))
real(kind=pr), private, dimension(size(z0), size(z0)) :: dlnphi_dn
real(kind=pr), private, dimension(np, size(z0), size(z0)) :: dlnphi_dn_l
real(kind=pr), private, dimension(size(z0), size(z0)) :: dlnphi_dn_w
real(kind=pr), private :: dlnphi_dp(size(z0))
real(kind=pr), private, dimension(np, size(z0)) :: dlnphi_dp_l
real(kind=pr), private, dimension(size(z0)) :: dlnphi_dp_w
real(kind=pr), private :: dlnphi_dt(size(z0))
real(kind=pr), private, dimension(np, size(z0)) :: dlnphi_dt_l
real(kind=pr), private, dimension(size(z0)) :: dlnphi_dt_w
real(kind=pr), private :: dwda(size(z0))
real(kind=pr), private :: dwdb(np,size(z0))
real(kind=pr), private :: dwdlnK(np,size(z0))
real(kind=pr), private :: dx_l_dlnK(np,np,size(z0))
real(kind=pr), private :: dzda(size(z0))
integer, private :: i
integer, private :: idx_1
integer, private :: idx_2
integer, private :: j
integer, private :: l
integer, private :: lb
real(kind=pr), private :: lnphi(size(z0))
real(kind=pr), private, dimension(np, size(z0)) :: lnphi_l
real(kind=pr), private, dimension(size(z0)) :: lnphi_w
real(kind=pr), private :: moles(size(z0))
integer, private :: nc
integer, private :: phase
integer, private :: ub
real(kind=pr), private, dimension(size(z0)) :: w
real(kind=pr), private, dimension(np, size(z0)) :: x_l
real(kind=pr), private :: z(size(z0))