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)

Uses

  • proc~~solve_mp_flash_point~~UsesGraph proc~solve_mp_flash_point solve_mp_flash_point module~yaeos__math yaeos__math proc~solve_mp_flash_point->module~yaeos__math module~yaeos__constants yaeos__constants module~yaeos__math->module~yaeos__constants module~yaeos__math_continuation yaeos__math_continuation module~yaeos__math->module~yaeos__math_continuation module~yaeos__math_linalg yaeos__math_linalg module~yaeos__math->module~yaeos__math_linalg iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants

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.


Calls

proc~~solve_mp_flash_point~~CallsGraph proc~solve_mp_flash_point solve_mp_flash_point proc~pt_f_np~2 pt_F_NP proc~solve_mp_flash_point->proc~pt_f_np~2 proc~solve_system solve_system proc~solve_mp_flash_point->proc~solve_system proc~lnphi_pt ArModel%lnphi_pt proc~pt_f_np~2->proc~lnphi_pt none~dgesv dgesv proc~solve_system->none~dgesv proc~lnphi_vt ArModel%lnphi_vt proc~lnphi_pt->proc~lnphi_vt proc~volume~3 ArModel%volume proc~lnphi_pt->proc~volume~3 residual_helmholtz residual_helmholtz proc~lnphi_vt->residual_helmholtz get_v0 get_v0 proc~volume~3->get_v0 interface~newton newton proc~volume~3->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Called by

proc~~solve_mp_flash_point~~CalledByGraph proc~solve_mp_flash_point solve_mp_flash_point proc~pt_mp_flash pt_mp_flash proc~pt_mp_flash->proc~solve_mp_flash_point

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 :: info
integer, public :: nc

Number of components


Subroutines

subroutine lmsolve(n, m, xvec, fvec, info)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
integer, intent(in) :: m
real(kind=pr), intent(in) :: xvec(n)
real(kind=pr), intent(out) :: fvec(m)
integer, intent(inout) :: info