critical_point Function

public function critical_point(model, z0, zi, spec, S, max_iters, u0, V0, T0, a0)

critical_point

Description

Calculates a single critical point of a mixture using a Newton-Raphson method. It is possible to specify different variables to be fixed with the spec argument, the spec_CP variable helps when selecting the specified variable.

Examples

Default behaviour

  cp = critical_point(&
       model, z0, zi, S=0.5_pr, spec=spec_CP%a, max_iters=1000)

Specifiying another variable

The natural variables are a, lnV, lnT and lnP. So it is important to specify the variable in logaritmic scale if that is the case.

  cp = critical_point(model, z0, zi, S=log(200._pr), spec=spec_CP%P, max_iters=1000)

Arguments

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

Equation of state model

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

Molar fractions of the first fluid

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

Molar fractions of the second fluid

integer, intent(in) :: spec

Specification [1:"z", 2:"V", 3:"T", 4:"P"]

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

Specification value

integer, intent(in) :: max_iters

Maxiumum number of iterations

real(kind=pr), intent(in), optional :: u0(:)

Initial eigen-vector

real(kind=pr), intent(in), optional :: V0

Initial volume [L/mol].

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

Initial temperature [K].

real(kind=pr), intent(in), optional :: a0

Initial value

Return Value type(EquilibriumState)


Variables

Type Visibility Attributes Name Initial
real(kind=pr), public :: F(4)
real(kind=pr), public :: X(4)
real(kind=pr), public :: dX(4)
real(kind=pr), public :: df(4,4)
integer, public :: i
real(kind=pr), public :: l
integer, public :: ns
real(kind=pr), public :: u(size(z0))
real(kind=pr), public :: u_new(size(z0))
real(kind=pr), public :: z(size(z0))