solve_critical_point Subroutine

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

solve_critical_point

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

Description

The residual vector is . Its Jacobian with respect to is approximated by centered finite differences, and a direct 2-by-2 Newton step is applied. Non-positive trial volume or temperature is reset to half the corresponding initial value.

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.


Calls

proc~~solve_critical_point~~CallsGraph proc~solve_critical_point solve_critical_point proc~jacobian_critical_eqs jacobian_critical_eqs proc~solve_critical_point->proc~jacobian_critical_eqs proc~residual_critical_eqs residual_critical_eqs proc~solve_critical_point->proc~residual_critical_eqs proc~jacobian_critical_eqs->proc~residual_critical_eqs proc~pressure ArModel%pressure proc~residual_critical_eqs->proc~pressure residual_helmholtz residual_helmholtz proc~pressure->residual_helmholtz

Called by

proc~~solve_critical_point~~CalledByGraph proc~solve_critical_point solve_critical_point proc~find_critical_points_all_components find_critical_points_all_components proc~find_critical_points_all_components->proc~solve_critical_point proc~init_pcsaft init_pcsaft proc~init_pcsaft->proc~find_critical_points_all_components

Variables

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

Jacobian matrix.

real(kind=pr), private :: J_inv(2,2)
real(kind=pr), private :: P
real(kind=pr), private :: T
real(kind=pr), private :: V
real(kind=pr), private :: dX(2)
real(kind=pr), private :: det
real(kind=pr), private :: f1
real(kind=pr), private :: f2
integer, private :: iter

Iteration count.

real(kind=pr), private :: norm_f