residual_helmholtz Subroutine

public subroutine residual_helmholtz(self, n, v, t, Ar, ArV, ArT, ArTV, ArV2, ArT2, Arn, ArVn, ArTn, Arn2)

residual_helmholtz

Evaluate residual Helmholtz energy and requested derivatives by AD.

Description

Converts real inputs into hyperdual variables, seeds their derivative slots, evaluates the concrete model’s Ar function, and copies the requested first- and second-order derivatives to optional outputs.

Examples

Usually called through inherited methods such as pressure or lnphi_pt rather than invoked directly.

Type Bound

ArModelAdiff

Arguments

Type IntentOptional Attributes Name
class(ArModelAdiff), intent(in) :: self

Model instance.

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

Component mole amounts [mol].

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

Total volume [L].

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

Temperature [K].

real(kind=pr), intent(out), optional :: Ar

Residual Helmholtz energy [bar L].

real(kind=pr), intent(out), optional :: ArV

[bar].

real(kind=pr), intent(out), optional :: ArT

[bar L/K].

real(kind=pr), intent(out), optional :: ArTV

[bar/K].

real(kind=pr), intent(out), optional :: ArV2

[bar/L].

real(kind=pr), intent(out), optional :: ArT2

[bar L/K^2].

real(kind=pr), intent(out), optional, dimension(size(n)) :: Arn

[bar L/mol].

real(kind=pr), intent(out), optional, dimension(size(n)) :: ArVn

[bar/mol].

real(kind=pr), intent(out), optional, dimension(size(n)) :: ArTn

[bar L/(K mol)].

real(kind=pr), intent(out), optional :: Arn2(size(n),size(n))

[bar L/mol^2].


Calls

proc~~residual_helmholtz~~CallsGraph proc~residual_helmholtz ArModelAdiff%residual_helmholtz Ar Ar proc~residual_helmholtz->Ar none~get_dardn get_dardn proc~residual_helmholtz->none~get_dardn none~get_dardn2 get_dardn2 proc~residual_helmholtz->none~get_dardn2 none~get_dardt get_dardt proc~residual_helmholtz->none~get_dardt none~get_dardt2 get_dardt2 proc~residual_helmholtz->none~get_dardt2 none~get_dardtn get_dardtn proc~residual_helmholtz->none~get_dardtn none~get_dardv get_dardv proc~residual_helmholtz->none~get_dardv none~get_dardv2 get_dardv2 proc~residual_helmholtz->none~get_dardv2 none~get_dardvn get_dardvn proc~residual_helmholtz->none~get_dardvn none~get_dardvt get_dardvt proc~residual_helmholtz->none~get_dardvt none~reset_vars~2 reset_vars proc~residual_helmholtz->none~reset_vars~2 none~get_dardn->Ar none~get_dardn->none~reset_vars~2 none~get_dardn2->Ar none~get_dardn2->none~reset_vars~2 none~get_dardt->Ar none~get_dardt->none~reset_vars~2 none~get_dardt2->Ar none~get_dardt2->none~reset_vars~2 none~get_dardtn->Ar none~get_dardtn->none~reset_vars~2 none~get_dardv->Ar none~get_dardv->none~reset_vars~2 none~get_dardv2->Ar none~get_dardv2->none~reset_vars~2 none~get_dardvn->Ar none~get_dardvn->none~reset_vars~2 none~get_dardvt->Ar none~get_dardvt->none~reset_vars~2

Variables

Type Visibility Attributes Name Initial
logical, public :: any_deriv
type(hyperdual), public :: d_Ar
type(hyperdual), public :: d_n(size(n))

Hyperdual component mole amounts.

type(hyperdual), public :: d_t

Hyperdual temperature input.

type(hyperdual), public :: d_v

Hyperdual total-volume input.


Subroutines

subroutine get_dardn()

Extract the first composition derivatives from hyperdual lanes.

Read more…

Arguments

None

subroutine get_dardn2()

Extract the symmetric mole-number Hessian and requested gradient.

Read more…

Arguments

None

subroutine get_dardt()

Extract the first derivative with respect to temperature.

Read more…

Arguments

None

subroutine get_dardt2()

Extract the second temperature derivative and optional first derivative.

Read more…

Arguments

None

subroutine get_dardtn()

Extract mixed temperature-mole derivatives and any requested first derivatives.

Read more…

Arguments

None

subroutine get_dardv()

Extract the first derivative with respect to volume.

Read more…

Arguments

None

subroutine get_dardv2()

Extract the second volume derivative and optional first derivative.

Read more…

Arguments

None

subroutine get_dardvn()

Extract mixed volume-mole derivatives and any requested first derivatives.

Read more…

Arguments

None

subroutine get_dardvt()

Extract the mixed volume-temperature derivative and first derivatives.

Read more…

Arguments

None

subroutine reset_vars()

Restore hyperdual inputs to the unperturbed state before a new seed.

Read more…

Arguments

None