yaeos__consistency_armodel Module

yaeos__consistency_armodel

Consistency checks of Helmholtz free energy models (ArModel).

Description

This module contains tools to validate the analityc derivatives of implmented Helmholtz free energy models (ArModel). Also, allows to evaluate the consistency tests described in Thermodynamic Models: Fundamentals & Computational Aspects 2 ed. by Michelsen and Mollerup Chapter 2 section 3.

Available tools:

  • numeric_ar_derivatives: From an instantiated ArModel evaluate all the Helmholtz free energy derivatives from the central finite difference method.

  • ar_consistency: From an instantiated ArModel evaluate all the Michelsen and Mollerup consistency tests.

References

  1. Michelsen, M. L., & Mollerup, J. M. (2007). Thermodynamic models: Fundamentals & computational aspects (2. ed). Tie-Line Publications.


Subroutines

public subroutine ar_consistency(eos, n, V, T, eq31, eq33, eq34, eq36, eq37)

models consistency tests.

Read more…

Arguments

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

Equation of state

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

Moles number vector

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

Volume [L]

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

Temperature [K]

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

MM Eq. 31

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

MM Eq. 33

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

MM Eq. 34

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

MM Eq. 36

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

MM Eq. 37

public subroutine numeric_ar_derivatives(eos, n, V, T, d_n, d_v, d_t, Ar, ArV, ArT, Arn, ArV2, ArT2, ArTV, ArVn, ArTn, Arn2)

Evaluate the Helmholtz derivatives with central finite difference.

Read more…

Arguments

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

Equation of state

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

Moles number vector

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

Volume [L]

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

Temperature [K]

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

Moles finite difference step

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

Volume finite difference step

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

Temperature finite difference step

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

Residual Helmoltz energy

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

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

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

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

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

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

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

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

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