yaeos__equilibria_boundaries_generalized_isopleths Module

Generalized multiphase isopleths

Continuation of multiphase equilibrium states at fixed overall composition.

Description

The module initializes a multiphase state, applies stability checks when requested, and continues the generalized isopleth through pressure, temperature, or another selected specification. The result stores converged MPEquilibriumState points and stability metadata.

Examples

line = create_generalized_isoz_line(model, nc, np, nstab, kinds_x, kind_w, &
   z, x_l0, w0, betas0, P0, T0, spec_variable, spec_variable_value, &
   ns0, S0, dS0, ws_stab=ws_stab)

For a standard two-phase line, use the dedicated phase-envelope routines.


Uses

  • module~~yaeos__equilibria_boundaries_generalized_isopleths~~UsesGraph module~yaeos__equilibria_boundaries_generalized_isopleths yaeos__equilibria_boundaries_generalized_isopleths module~yaeos__constants yaeos__constants module~yaeos__equilibria_boundaries_generalized_isopleths->module~yaeos__constants module~yaeos__equilibria_equilibrium_state yaeos__equilibria_equilibrium_state module~yaeos__equilibria_boundaries_generalized_isopleths->module~yaeos__equilibria_equilibrium_state module~yaeos__equilibria_stability yaeos__equilibria_stability module~yaeos__equilibria_boundaries_generalized_isopleths->module~yaeos__equilibria_stability module~yaeos__math yaeos__math module~yaeos__equilibria_boundaries_generalized_isopleths->module~yaeos__math module~yaeos__models_ar yaeos__models_ar module~yaeos__equilibria_boundaries_generalized_isopleths->module~yaeos__models_ar iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__equilibria_equilibrium_state->module~yaeos__constants module~yaeos__equilibria_stability->module~yaeos__constants module~yaeos__equilibria_stability->module~yaeos__models_ar module~yaeos__models_base yaeos__models_base module~yaeos__equilibria_stability->module~yaeos__models_base module~yaeos__models_ge yaeos__models_ge module~yaeos__equilibria_stability->module~yaeos__models_ge 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__models_ar->module~yaeos__constants module~yaeos__models_ar->module~yaeos__models_base module~yaeos__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants module~yaeos__substance yaeos__substance module~yaeos__models_base->module~yaeos__substance module~yaeos__models_ge->module~yaeos__constants module~yaeos__models_ge->module~yaeos__models_base module~yaeos__substance->module~yaeos__constants

Used by

  • module~~yaeos__equilibria_boundaries_generalized_isopleths~~UsedByGraph module~yaeos__equilibria_boundaries_generalized_isopleths yaeos__equilibria_boundaries_generalized_isopleths module~yaeos__equilibria yaeos__equilibria module~yaeos__equilibria->module~yaeos__equilibria_boundaries_generalized_isopleths module~yaeos yaeos module~yaeos->module~yaeos__equilibria

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public, parameter :: minT = 100

Minimum temperature [K]; tracing stops below it.


Derived Types

type, public ::  GeneralizedIsoZLine

Stored points and stability status for a multiphase isopleth.

Read more…

Components

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

Reserved flag; currently never set by create_generalized_isoz_line.

logical, public :: found_unstability = .false.

.true. if a trial composition gave , which stops the line.

type(MPEquilibriumState), public, allocatable :: points(:)

Converged multiphase states along the line.

real(kind=pr), public, allocatable :: w_more_stable(:)

Trial composition with the lowest ; allocated only when found_unstability.


Functions

public function create_generalized_isoz_line(model, nc, np, nstab, kinds_x, kind_w, z, x_l0, w0, betas0, P0, T0, spec_variable, spec_variable_value, ns0, S0, dS0, ws_stab, max_points)

Start a generalized multiphase isopleth from an existing phase state.

Read more…

Arguments

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

EOS used for phase properties.

integer, intent(in) :: nc

Number of components; must equal size(z).

integer, intent(in) :: np

Number of main phases in the initial state.

integer, intent(in) :: nstab

Number of stability trial compositions supplied.

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

Phase kind for each main phase.

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

Kind of the reference phase.

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

Overall feed composition.

real(kind=pr), intent(in) :: x_l0(np,nc)

Initial main-phase compositions.

real(kind=pr), intent(in) :: w0(nc)

Initial reference-phase composition.

real(kind=pr), intent(in) :: betas0(np+1)

Main-phase fractions followed by the reference-phase fraction.

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

Initial pressure [bar].

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

Initial temperature [K].

integer, intent(in) :: spec_variable

Index in of the variable held fixed along the line.

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

Fixed value of X(spec_variable) (log for , ).

integer, intent(in) :: ns0

Index in X of the initial continuation (moving) variable.

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

Initial continuation specification value.

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

Initial signed continuation step.

real(kind=pr), intent(in), optional :: ws_stab(nstab,nc)

Trial compositions for stability analysis; required when nstab > 0.

integer, intent(in), optional :: max_points

Maximum number of points to continue.

Return Value type(GeneralizedIsoZLine)


Subroutines

public subroutine pt_F_NP(model, z, np, kinds_x, kind_w, X, ns1, S1, ns2, S2, F, df)

Function to solve at each point of a multi-phase envelope.

Read more…

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.

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(in) :: 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.

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

Vector of functions valuated.

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

Jacobian matrix.

public subroutine solve_generalized_point(model, z, np, kinds_x, kind_w, X, ns1, S1, ns2, S2, max_iters, F, df, iters)

Function to solve the multiphase flash problem.

Read more…

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.

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

Jacobian matrix.

integer, intent(out) :: iters

Number of iterations performed.