tx_envelope_2ph Function

public function tx_envelope_2ph(model, z0, alpha0, z_injection, first_point, points, iterations, delta_0, specified_variable_0, solver, stop_conditions) result(envelopes)

Uses

  • proc~~tx_envelope_2ph~~UsesGraph proc~tx_envelope_2ph tx_envelope_2ph module~yaeos__auxiliar yaeos__auxiliar proc~tx_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

TX 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) :: z0(:)

Vector of molar fractions of the global composition (main phase)

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

First point of

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

Vector of molar fractions of the injection fluid

type(EquilibriumState) :: first_point
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

Return Value type(TXEnvel2)


Calls

proc~~tx_envelope_2ph~~CallsGraph proc~tx_envelope_2ph tx_envelope_2ph df df proc~tx_envelope_2ph->df dfds dfds proc~tx_envelope_2ph->dfds dx dx proc~tx_envelope_2ph->dx f f proc~tx_envelope_2ph->f fdx fdx proc~tx_envelope_2ph->fdx fdx2 fdx2 proc~tx_envelope_2ph->fdx2 interface~optval optval proc~tx_envelope_2ph->interface~optval none~foo~3 foo proc~tx_envelope_2ph->none~foo~3 numdiff numdiff proc~tx_envelope_2ph->numdiff proc~continuation continuation proc~tx_envelope_2ph->proc~continuation proc~get_z get_z proc~tx_envelope_2ph->proc~get_z 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 none~foo~3->proc~get_z proc~lnphi_pt ArModel%lnphi_pt none~foo~3->proc~lnphi_pt proc~full_newton full_newton proc~continuation->proc~full_newton proc~solve_system solve_system proc~continuation->proc~solve_system proc~full_newton->proc~solve_system proc~lnphi_vt ArModel%lnphi_vt proc~lnphi_pt->proc~lnphi_vt proc~volume~3 ArModel%volume proc~lnphi_pt->proc~volume~3 none~dgesv dgesv proc~solve_system->none~dgesv 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

Variables

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

Initial specification value

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

Initial specification step

character(len=14), private :: kind
integer, private :: max_iterations

Maximum number of iterations

integer, private :: max_points

Maximum number of points

integer, private :: nc

Number of components

integer, private :: ns

Number of specified variable

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

Composition at some point


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

recursive 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