pt_envelope_2ph Function

public function pt_envelope_2ph(model, z, first_point, points, iterations, delta_0, specified_variable_0, solver, stop_conditions, maximum_pressure) result(envelopes)

Uses

  • proc~~pt_envelope_2ph~~UsesGraph proc~pt_envelope_2ph pt_envelope_2ph module~yaeos__auxiliar yaeos__auxiliar proc~pt_envelope_2ph->module~yaeos__auxiliar module~yaeos__constants yaeos__constants module~yaeos__auxiliar->module~yaeos__constants iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env

PT two-phase envelope calculation procedure.

Phase envelope calculation using the continuation method. Defaults to solving the saturation temperature and continues with an increment in it. The variable to specify can be changed by modifying specified_variable_0 with the corresponding variable number.

Arguments

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

Thermodyanmic model

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

Vector of molar fractions

type(EquilibriumState), intent(in) :: first_point

Initial point of the envelope

integer, intent(in), optional :: points

Maxmimum number of points, defaults to 500

integer, intent(in), optional :: iterations

Point solver maximum iterations, defaults to 100

real(kind=pr), intent(in), optional :: delta_0

Initial extrapolation

integer, intent(in), optional :: specified_variable_0

Position of specified variable, since the vector of variables is the values for specification will be for the equilibria constants, for and for .

procedure(continuation_solver), optional :: solver

Specify solver for each point, defaults to a full newton procedure

procedure(continuation_stopper), optional :: stop_conditions

Function that returns true if the continuation method should stop

real(kind=pr), intent(in), optional :: maximum_pressure

Maximum pressure to calculate [bar]

Return Value type(PTEnvel2)


Calls

proc~~pt_envelope_2ph~~CallsGraph proc~pt_envelope_2ph pt_envelope_2ph interface~optval optval proc~pt_envelope_2ph->interface~optval proc~continuation continuation proc~pt_envelope_2ph->proc~continuation proc~pt_envelope pt_envelope proc~pt_envelope_2ph->proc~pt_envelope proc~optval_character optval_character interface~optval->proc~optval_character proc~optval_integer optval_integer interface~optval->proc~optval_integer proc~optval_real optval_real interface~optval->proc~optval_real proc~full_newton full_newton proc~continuation->proc~full_newton proc~solve_system solve_system proc~continuation->proc~solve_system proc~pt_envelope->interface~optval proc~check_critical_jump check_critical_jump proc~pt_envelope->proc~check_critical_jump proc~detect_critical~2 detect_critical proc~pt_envelope->proc~detect_critical~2 proc~get_values_from_x~4 PTEnvelMP%get_values_from_X proc~pt_envelope->proc~get_values_from_x~4 proc~solve_point~5 PTEnvelMP%solve_point proc~pt_envelope->proc~solve_point~5 proc~update_specification~4 update_specification proc~pt_envelope->proc~update_specification~4 proc~interpol interpol proc~check_critical_jump->proc~interpol proc~detect_critical~2->proc~interpol proc~full_newton->proc~solve_system proc~solve_point~5->proc~get_values_from_x~4 proc~solve_point~5->proc~solve_system proc~pt_f_np~3 pt_F_NP proc~solve_point~5->proc~pt_f_np~3 none~dgesv dgesv proc~solve_system->none~dgesv proc~update_specification~4->proc~solve_system proc~near_critical near_critical proc~update_specification~4->proc~near_critical dvnvdb dvnvdb proc~pt_f_np~3->dvnvdb dvnvdlnkl dvnvdlnkl proc~pt_f_np~3->dvnvdlnkl dvnvdn dvnvdn proc~pt_f_np~3->dvnvdn dvwdb dvwdb proc~pt_f_np~3->dvwdb dvwdlnkl dvwdlnkl proc~pt_f_np~3->dvwdlnkl proc~lnphi_pt ArModel%lnphi_pt proc~pt_f_np~3->proc~lnphi_pt proc~lnphi_vt ArModel%lnphi_vt proc~lnphi_pt->proc~lnphi_vt proc~volume ArModel%volume proc~lnphi_pt->proc~volume residual_helmholtz residual_helmholtz proc~lnphi_vt->residual_helmholtz get_v0 get_v0 proc~volume->get_v0 interface~newton newton proc~volume->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Called by

proc~~pt_envelope_2ph~~CalledByGraph proc~pt_envelope_2ph pt_envelope_2ph proc~find_hpl find_hpl proc~find_hpl->proc~pt_envelope_2ph

Variables

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

Initial specification value

real(kind=pr), private :: X(size(z)+2)

Vector of variables used in the continuation method

real(kind=pr), private, allocatable :: XS(:,:)

All the calculated variables that are returned on the continuation method procedure (unused since each point is saved on the fly)

real(kind=pr), private :: dS0

Initial specification step

integer, private :: i
character(len=14), private :: kind
character(len=14), private :: kind_w
character(len=14), private :: kind_x(1)
integer, private :: max_iterations

Maximum number of iterations

integer, private :: max_points

Maximum number of points

type(PTEnvelMP), private :: mp_env
integer, private :: nc

Number of components

integer, private :: ns

Number of specified variable

real(kind=pr), private :: w0(size(z))
real(kind=pr), private :: x_l0(1,size(z))

Subroutines

subroutine detect_critical(X, dXdS, ns, S, dS)

Critical point detection

Read more…

Arguments

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

Vector of variables

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

Variation of variables wrt S

integer, intent(inout) :: ns

Number of specified variable

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

Specification value

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

Step in specification

subroutine foo(X, ns, S, F, dF, dFdS)

Function that needs to be solved at each envelope point

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: X(:)
integer, intent(in) :: ns
real(kind=pr), intent(in) :: S
real(kind=pr), intent(out) :: F(:)
real(kind=pr), intent(out) :: dF(:,:)
real(kind=pr), intent(out) :: dFdS(:)

subroutine save_point(X, iters)

Save the converged point

Arguments

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

subroutine update_spec(X, ns, S, dS, dXdS, step_iters)

Update the specification during continuation.

Arguments

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

Vector of variables

integer, intent(inout) :: ns

Number of specified variable in the vector

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

Variable specification value

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

Step in specification

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

Variation of variables with respect to specification

integer, intent(in) :: step_iters

Iterations used in the solver