solve_point Subroutine

private subroutine solve_point(model, z, np, beta_w, kinds_x, kind_w, X, ns, S, dXdS, F, df, Vl, Vw, iters, max_iterations)

Uses

  • proc~~solve_point~4~~UsesGraph proc~solve_point~4 PTEnvelMP%solve_point iso_fortran_env iso_fortran_env proc~solve_point~4->iso_fortran_env module~yaeos__math yaeos__math proc~solve_point~4->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 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

`solve_point

Solve a multiphase phase equilbiria at a fixed $T,P,\beta^w$

Description

This subroutine uses the Newton method to solve the system of equations for the calculation of a multiphase phase eqiulibria point. To help with convergence, damping on the at each step is done, avoiding divergence and undesired big steps.

Type Bound

PTEnvelMP

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 main phases

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

Fraction of the reference (incipient) phase

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

Kind of the main phases

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

Kind of the reference 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))
real(kind=pr), intent(out) :: F(size(X))

Vector of functions valuated

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

Jacobian matrix

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

Main phases volumes

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

Reference phase volume

integer, intent(out) :: iters

Number of iterations to solve the current point

integer, intent(in) :: max_iterations

Maximum number of iterations to solve the point


Calls

proc~~solve_point~4~~CallsGraph proc~solve_point~4 PTEnvelMP%solve_point proc~get_values_from_x~3 PTEnvelMP%get_values_from_X proc~solve_point~4->proc~get_values_from_x~3 proc~pt_f_np pt_F_NP proc~solve_point~4->proc~pt_f_np proc~solve_system solve_system proc~solve_point~4->proc~solve_system proc~lnphi_pt ArModel%lnphi_pt proc~pt_f_np->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_point~4~~CalledByGraph proc~solve_point~4 PTEnvelMP%solve_point proc~pt_envelope pt_envelope proc~pt_envelope->proc~solve_point~4 proc~pt_envelope_2ph pt_envelope_2ph proc~pt_envelope_2ph->proc~pt_envelope proc~find_hpl find_hpl proc~find_hpl->proc~pt_envelope_2ph

Variables

Type Visibility Attributes Name Initial
real(kind=pr), private :: P

Pressure

real(kind=pr), private :: T

Temperature

real(kind=pr), private :: X0(size(X))

Initial value of

real(kind=pr), private :: betas(np)

Mole fraction of each main phase

real(kind=pr), private :: dX(size(X))

Newton step

integer, private :: i

Indexing variable

integer, private :: iBetas(np)

Index of beta variables

integer, private :: iP

Pressure variable index

integer, private :: iT

Temperature variable index

integer, private :: l

Phase index

integer, private :: nc

NUmber of components

real(kind=pr), private :: w(size(z))

Composition of reference phase

real(kind=pr), private :: x_l(np,size(z))

Composition of the main phases