solve_TP Subroutine

public subroutine solve_TP(model, kind, z, X, ns, S, tol, max_iterations, its)

Uses

  • proc~~solve_tp~~UsesGraph proc~solve_tp solve_TP module~nonlinear_solvers nonlinear_solvers proc~solve_tp->module~nonlinear_solvers module~yaeos__math yaeos__math proc~solve_tp->module~yaeos__math module~yaeos__math_nonlinearsolvers yaeos__math_nonlinearsolvers proc~solve_tp->module~yaeos__math_nonlinearsolvers module~yaeos__constants yaeos__constants module~nonlinear_solvers->module~yaeos__constants module~yaeos__math_linalg yaeos__math_linalg module~nonlinear_solvers->module~yaeos__math_linalg module~yaeos__math->module~yaeos__constants module~yaeos__math_continuation yaeos__math_continuation module~yaeos__math->module~yaeos__math_continuation module~yaeos__math->module~yaeos__math_linalg module~yaeos__math_nonlinearsolvers->module~yaeos__constants module~yaeos__math_nonlinearsolvers->module~yaeos__math_linalg iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__math_continuation->module~yaeos__constants module~yaeos__math_continuation->module~yaeos__math_linalg module~yaeos__math_linalg->module~yaeos__constants

solve_TP

Correct a fixed-pressure or fixed-temperature saturation point.

Description

Applies newton from yaeos__math_nonlinearsolvers to the residual system assembled by saturation_TP and updates the packed unknown vector in place.

Arguments

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

EOS used for phase fugacities.

character(len=*), intent(in) :: kind

"bubble", "dew", or "liquid-liquid"; any other value uses stable roots.

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

Feed composition.

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

Initial packed unknowns; corrected state on return.

integer, intent(in) :: ns

Index of the specified variable.

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

Specified value of X(ns) (log coordinates)

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

Residual tolerance.

integer, intent(in) :: max_iterations

Maximum corrector iterations.

integer, intent(out) :: its

Iterations used.


Calls

proc~~solve_tp~~CallsGraph proc~solve_tp solve_TP none~wrap wrap proc~solve_tp->none~wrap proc~newton~2 newton proc~solve_tp->proc~newton~2 proc~saturation_tp saturation_TP none~wrap->proc~saturation_tp proc~solve_system solve_system proc~newton~2->proc~solve_system proc~lnphi_pt ArModel%lnphi_pt proc~saturation_tp->proc~lnphi_pt none~dgesv dgesv proc~solve_system->none~dgesv proc~lnphi_vt ArModel%lnphi_vt proc~lnphi_pt->proc~lnphi_vt proc~volume~2 ArModel%volume proc~lnphi_pt->proc~volume~2 residual_helmholtz residual_helmholtz proc~lnphi_vt->residual_helmholtz get_v0 get_v0 proc~volume~2->get_v0 interface~newton newton proc~volume~2->interface~newton proc~newton_1d newton_1d interface~newton->proc~newton_1d

Called by

proc~~solve_tp~~CalledByGraph proc~solve_tp solve_TP proc~saturation_pressure saturation_pressure proc~saturation_pressure->proc~solve_tp proc~saturation_temperature saturation_temperature proc~saturation_temperature->proc~solve_tp

Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: F(size(X))

Residual or scalar equation value.

real(kind=pr), public :: G(size(X))
real(kind=pr), public :: H(size(X))
real(kind=pr), public :: Jp(size(X))
real(kind=pr), public :: X0(size(X))
real(kind=pr), public :: Xnew(size(X))
real(kind=pr), public :: alpha

Step length (unused)

real(kind=pr), public :: dF(size(X),size(X))
real(kind=pr), public :: dFdS(size(X))
real(kind=pr), public :: dG(size(X),size(X))
real(kind=pr), public :: dH(size(X),size(X))
real(kind=pr), public :: dx(size(X))
real(kind=pr), public :: grad_phi_p
integer, public :: info

Solver status code.

integer, public :: nc

Number of components.

real(kind=pr), public :: phi_ax
real(kind=pr), public :: phi_x
real(kind=pr), public :: t

Subroutines

subroutine wrap(X, F, J)

Arguments

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

Unknowns

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

Residual vector

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

Jacobian matrix