yaeos__equilibria_boundaries_auxiliar Module

Equilibria boundaries auxiliar module This module contains the auxiliar functions and subroutines used in the phase-boundaries calculations.


Uses

  • module~~yaeos__equilibria_boundaries_auxiliar~~UsesGraph module~yaeos__equilibria_boundaries_auxiliar yaeos__equilibria_boundaries_auxiliar module~yaeos__constants yaeos__constants module~yaeos__equilibria_boundaries_auxiliar->module~yaeos__constants module~yaeos__math yaeos__math module~yaeos__equilibria_boundaries_auxiliar->module~yaeos__math iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env 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__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants

Used by

  • module~~yaeos__equilibria_boundaries_auxiliar~~UsedByGraph module~yaeos__equilibria_boundaries_auxiliar yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_mp yaeos__equilibria_boundaries_phase_envelopes_mp module~yaeos__equilibria_boundaries_phase_envelopes_mp->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_mp_px yaeos__equilibria_boundaries_phase_envelopes_mp_px module~yaeos__equilibria_boundaries_phase_envelopes_mp_px->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_mp_tx yaeos__equilibria_boundaries_phase_envelopes_mp_tx module~yaeos__equilibria_boundaries_phase_envelopes_mp_tx->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_px yaeos__equilibria_boundaries_phase_envelopes_px module~yaeos__equilibria_boundaries_phase_envelopes_px->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_px3 yaeos__equilibria_boundaries_phase_envelopes_px3 module~yaeos__equilibria_boundaries_phase_envelopes_px3->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria_boundaries_phase_envelopes_tx yaeos__equilibria_boundaries_phase_envelopes_tx module~yaeos__equilibria_boundaries_phase_envelopes_tx->module~yaeos__equilibria_boundaries_auxiliar proc~update_specification~3 update_specification proc~update_specification~3->module~yaeos__equilibria_boundaries_auxiliar module~yaeos__equilibria yaeos__equilibria module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_mp module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_mp_px module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_mp_tx module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_px module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_px3 module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_tx module~yaeos__equilibria_boundaries_phase_envelopes_pt yaeos__equilibria_boundaries_phase_envelopes_pt module~yaeos__equilibria->module~yaeos__equilibria_boundaries_phase_envelopes_pt module~yaeos__equilibria_boundaries_phase_envelopes_pt->module~yaeos__equilibria_boundaries_phase_envelopes_mp module~yaeos yaeos module~yaeos->module~yaeos__equilibria

Derived Types

type, public ::  NearCritical

Near critical point information.

Components

Type Visibility Attributes Name Initial
logical, public :: entering = .false.

Entering a critical region. This attribute is used to ensure that the correct indexes are used since they should not be updated while inside the region, just on the first point.

integer, public :: i

Index of the component with the max

integer, public :: j

Index of the component with the minimum

integer, public :: l

Index of the phase that is becoming critical with the reference phase.

logical, public :: near_critical = .false.

If we are satisfying the condition of being near a critical point.


Subroutines

public subroutine check_critical_jump(nc, np, ns, kinds_x, kind_w, X, X_last_converged, Xc, found_critical, jumped_critical)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nc

Number of components

integer, intent(in) :: np

Number of main phases

integer, intent(in) :: ns

Number of the specified variable

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

Kinds of the main phases

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

Kind of the incipient phase

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

Current point

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

Previously converged point

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

Critical point

logical, intent(in) :: found_critical

If a critical point was already found in the current point

logical, intent(out) :: jumped_critical

If a critical point was jumped

public subroutine detect_critical(nc, np, point, kinds_x, kind_w, binary_stop, Xold, X, dXdS, ns, dS, S, found_critical, Xc)

Detect if the system is close to a critical point.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nc

Number of components in the mixture.

integer, intent(in) :: np

Number of main phases.

integer, intent(in) :: point

Point number in the phase boundary.

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

Kinds of the main phases.

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

Kind of the incipient phase.

logical, intent(in) :: binary_stop

If true, stop at the critical point if its a binary system.

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

Old vector of variables.

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

Vector of variables.

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

Sensitivity of the variables wrt the specification.

integer, intent(inout) :: ns

Number of the specified variable.

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

Step size of the specification for the next point.

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

Specification value.

logical, intent(out) :: found_critical

If true, a critical point was found.

real(kind=pr) :: Xc(size(X))

Vector of variables at the critical point.

public subroutine get_z(alpha, z_0, z_inj, z, dzda)

Calculate the fluid composition based on an amount of addition of second fluid.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=pr), intent(in) :: alpha

Addition percentaje

real(kind=pr), intent(in) :: z_0(:)
real(kind=pr), intent(in) :: z_inj(:)
real(kind=pr), intent(out) :: z(size(z_0))

New composition

real(kind=pr), intent(out), optional :: dzda(size(z_0))

Derivative wrt

public subroutine near_critical(nc, np, X, near_crit, l, i, j)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: nc

Number of components

integer, intent(in) :: np

Number of main phases

real(kind=pr), intent(in) :: X(nc*np+np+2)

Vector of variables

logical, intent(out) :: near_crit

If the system is near a critical point

integer, intent(out) :: l

Index of the near-critical phase

integer, intent(out) :: i

Index of the component with the maximum lnK

integer, intent(out) :: j

Index of the component with the minimum lnK