yaeos__critical_pure_point_solver Module

Pure-component critical-point solver

Find pure-fluid critical constants for each component in an EOS model.

Description

The critical point of a pure component is defined by the conditions:

This module solves the resulting nonlinear system in the variables (V, T) using a Newton-Raphson iteration. Each residual is evaluated from the equation-of-state pressure and its numerical derivatives.

Examples

call find_critical_points_all_components(model, nc, Vc, Tc, Pc, converged)

Uses

  • module~~yaeos__critical_pure_point_solver~~UsesGraph module~yaeos__critical_pure_point_solver yaeos__critical_pure_point_solver module~yaeos__constants yaeos__constants module~yaeos__critical_pure_point_solver->module~yaeos__constants module~yaeos__models_ar yaeos__models_ar module~yaeos__critical_pure_point_solver->module~yaeos__models_ar iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__models_ar->module~yaeos__constants module~yaeos__models_base yaeos__models_base module~yaeos__models_ar->module~yaeos__models_base module~yaeos__substance yaeos__substance module~yaeos__models_base->module~yaeos__substance module~yaeos__substance->module~yaeos__constants

Used by

  • module~~yaeos__critical_pure_point_solver~~UsedByGraph module~yaeos__critical_pure_point_solver yaeos__critical_pure_point_solver proc~init_pcsaft init_pcsaft proc~init_pcsaft->module~yaeos__critical_pure_point_solver

Variables

Type Visibility Attributes Name Initial
real(kind=pr), private, parameter :: DT_STEP = 2.0e-2_pr

Finite-difference increment in temperature [K].

real(kind=pr), private, parameter :: DV_STEP = 2.0e-4_pr

Finite-difference increment in volume [L/mol].

integer, private, parameter :: MAX_ITER = 151

Maximum Newton iterations per component.

real(kind=pr), private, parameter :: TOL_RES = 2.0e-8_pr

Convergence threshold for the critical residual norm.

real(kind=pr), private, parameter :: TOL_STEP = 2.0e-6_pr

Convergence threshold for the Newton step norm.


Subroutines

public subroutine find_critical_points_all_components(model, nc, Vc, Tc, Pc, converged)

Estimate pure-component critical constants for every model component.

Read more…

Arguments

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

Equation of state used for pure-fluid saturation properties.

integer, intent(in) :: nc

Number of components; must match the model.

real(kind=pr), intent(out) :: Vc(nc)

Critical molar volumes [L/mol].

real(kind=pr), intent(out) :: Tc(nc)

Critical temperatures [K].

real(kind=pr), intent(out) :: Pc(nc)

Critical pressures [bar].

logical, intent(out) :: converged(nc)

True for components whose solve converged.

private subroutine estimate_critical_point(model, i, nc, V_est, T_est)

Construct an initial pure-component critical-point estimate.

Read more…

Arguments

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

Equation of state used to evaluate pressure and derivatives.

integer, intent(in) :: i

One-based component index.

integer, intent(in) :: nc

Number of components in the model.

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

Estimated critical volume [L/mol].

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

Estimated critical temperature [K].

private subroutine jacobian_critical_eqs(model, nc, i_comp, V, T, J)

Approximate the Jacobian of with respect to .

Read more…

Arguments

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

Equation of state used to evaluate the critical residual Jacobian.

integer, intent(in) :: nc

Number of components.

integer, intent(in) :: i_comp

One-based index of the pure component.

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

Total volume [L].

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

Temperature [K].

real(kind=pr), intent(out) :: J(2,2)

Jacobian rows , columns .

private subroutine residual_critical_eqs(model, nc, i_comp, V, T, f1, f2, P)

Evaluate the two criticality residuals at a pure-fluid state.

Read more…

Arguments

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

Equation of state used for pressure derivatives.

integer, intent(in) :: nc

Number of components.

integer, intent(in) :: i_comp

One-based index of the pure component.

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

Total volume [L].

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

Temperature [K].

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

First criticality residual, pressure differentiated with respect to volume.

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

Second criticality residual, pressure differentiated twice with respect to volume.

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

Pressure [bar].

private subroutine solve_critical_point(model, nc, i_comp, V_init, T_init, Vc, Tc, Pc, converged)

Solve the pure-component criticality equations from an initial guess.

Read more…

Arguments

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

Equation of state used for pressure derivatives.

integer, intent(in) :: nc

Number of components.

integer, intent(in) :: i_comp

One-based index of the pure component.

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

Initial molar volume [L/mol].

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

Initial temperature [K].

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

Critical molar volume [L/mol].

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

Critical temperature [K].

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

Critical pressure [bar].

logical, intent(out) :: converged

Whether either convergence test succeeded.