PXEnvelMP Derived Type

type, public :: PXEnvelMP

Multiphase PX envelope.


Components

Type Visibility Attributes Name Initial
real(kind=pr), public, allocatable :: alpha(:)

Molar relation between two mixtures.

type(MPPoint), public, allocatable :: points(:)

Array of converged points.

real(kind=pr), public, allocatable :: z0(:)

Original mixture mole fractions.

real(kind=pr), public, allocatable :: zi(:)

Other mixture mole fractions


Type-Bound Procedures

procedure, public, nopass :: get_values_from_X

  • private subroutine get_values_from_X(X, np, z0, zi, beta_w, x_l, w, betas, P, alpha)

    Extract the values of the variables from the vector X.

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    real(kind=pr), intent(in) :: X(:)

    Vector of variables.

    integer, intent(in) :: np

    Number of main phases.

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

    Initial mixture composition.

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

    Second mixture composition.

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

    Reference phase beta.

    real(kind=pr), intent(out) :: x_l(np,size(z0))

    Mole fractions of the main phases.

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

    Mole fractions of the incipient phase.

    real(kind=pr), intent(out) :: betas(np)

    Fractions of the main phases.

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

    Pressure [bar].

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

    .

procedure, public, nopass :: solve_point

  • private subroutine solve_point(model, z0, zi, np, T, beta_w, X, ns, S, dXdS, F, df, iters, max_iterations)

    Solve the system of equations for a multiphase point.

    Read more…

    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(inout) :: X(:)

    Vector of variables

    integer, intent(in) :: ns

    Number of specification

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

    Specification value

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

    Sensitivity of the variables wrt the specification

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

    Vector of functions valuated

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

    Jacobian matrix

    integer, intent(out) :: iters

    Number of iterations needed to converge the point

    integer, intent(in) :: max_iterations

    Maximum number of iterations to solve the point

procedure, public :: write => write_envelope_PX_MP

  • private subroutine write_envelope_PX_MP(env, unit)

    Arguments

    Type IntentOptional Attributes Name
    class(PXEnvelMP), intent(in) :: env
    integer, intent(in) :: unit