solve_mp_flash_point Subroutine

public subroutine solve_mp_flash_point(model, z, np, kinds_x, kind_w, X, ns1, S1, ns2, S2, max_iters, F, less_phases, beta_0_index, iters)

Function to solve the multiphase flash problem.

Arguments

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

Model to use.

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

Mixture global composition.

integer, intent(in) :: np

Number of x phases.

character(len=14), intent(in) :: kinds_x(np)

Kind of the x phases.

character(len=14), intent(in) :: kind_w

Kind of the w phase.

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

Vector of variables.

integer, intent(in) :: ns1

Number of first specification.

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

First specification value.

integer, intent(in) :: ns2

Number of second specification.

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

Second specification value.

integer, intent(in) :: max_iters

Maximum number of iterations.

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

Vector of functions valuated.

logical, intent(out) :: less_phases

True if the solution has less phases than expected.

integer, intent(out) :: beta_0_index

Index of beta that equals zero.

integer, intent(out) :: iters

Number of iterations performed.


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public, dimension(size(X)) :: dX

Newton step vector.

real(kind=pr), public, dimension(size(X), size(X)) :: df

Jacobian matrix.

integer, public :: i
integer, public :: iBetas(np+1)

Index of the betas in the vector X

integer, public :: nc

Number of components