MHV Derived Type

type, public, extends(CubicMixRule) :: MHV

MHV

Michelsen’s modified Huron-Vidal cubic mixing rule.

Description

A zero-pressure-limit mixing rule coupling a cubic EOS with an excess-Gibbs model. The parameter q selects the MHV variant, and l can hold repulsive binary interactions. This mixing rule is based on the approximate zero-pressure limit of a cubic equation of state. At the approximate zero-pressure limit the attractive parameter can be expressed as:

Where is a weak function of temperature. In this implementation it is a constant chosen for the cubic EOS (e.g. for SRK, as in MHV1, and in PSRK).

Examples

To use the modified Huron-Vidal mixing rule it is necessary to define a CubicEoS and replace its original mixing rule with the one generated by the user.

type(MHV) :: mixrule
type(NRTL) :: ge_model
type(CubicEoS) :: model

! Define the Ge model to be used and the CubicEoS
ge_model = NRTL(a, b, c)
model = SoaveRedlichKwong(tc, pc, w)

! Use the initialization function to setup
mixrule = MHV(ge=ge_model, q=-0.593_pr, b=model%b)

! Replace the original mixrule on the previously defined model
model%mixrule = mixrule

! Ready to do calculations
call model%pressure(n, V, T, P)

References

Michelsen, M. L., Fluid Phase Equilibria 60 (1990) 213-219.


Inherits

type~~mhv~~InheritsGraph type~mhv MHV type~cubicmixrule CubicMixRule type~mhv->type~cubicmixrule type~gemodel GeModel type~mhv->type~gemodel ge type~basemodel BaseModel type~gemodel->type~basemodel type~substances Substances type~basemodel->type~substances components

Components

Type Visibility Attributes Name Initial
logical, public :: dn2 = .false.

Calculate second-order mole-number derivatives

class(GeModel), public, allocatable :: ge

Excess-Gibbs model in the MHV relation.

logical, public :: is_D_ddlc = .false.

Mixing rule D parameter depends on volume (density)

real(kind=pr), public, allocatable :: l(:,:)

Repulsive binary interaction matrix.

real(kind=pr), public :: q

MHV parameter defining the zero-pressure relation.

real(kind=pr), private, allocatable :: B

Mixture covolume.

real(kind=pr), private, allocatable :: bi(:)

Cached pure-component covolumes.

real(kind=pr), private, allocatable :: dBi(:)

Mole-number gradient of the mixture covolume.

real(kind=pr), private, allocatable :: dBij(:,:)

Mole-number Hessian of the mixture covolume.


Constructor

public interface MHV

  • private function init_mhv(Ge, b, q, lij) result(mixrule)

    MHV

    Construct a Michelsen modified Huron-Vidal mixing rule.

    Examples

    mixrule = MHV(ge=ge_model, b=model%b, q=-0.593_pr)
    

    Arguments

    Type IntentOptional Attributes Name
    class(GeModel), intent(in) :: Ge

    Excess Gibbs energy model

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

    Pure-component covolumes [L/mol]

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

    MHV parameter

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

    Binary repulsive interaction parameters (default zero)

    Return Value type(MHV)


Type-Bound Procedures

procedure, public :: Bmix => BmixMHV

  • private subroutine BmixMHV(self, n, bi, B, dBi, dBij)

    Quadratic mixing rule for the repulsive parameter, using as a combining rule.

    Read more…

    Arguments

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

    Mixing rule object.

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

    Component mole amounts [mol]

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

    Pure-component covolumes [L/mol]

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

    Mixture covolume [L]

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

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

procedure, public :: D1Mix => D1MixMHV

  • private subroutine D1MixMHV(self, n, d1i, D1, dD1i, dD1ij)

    Calculate the MHV mixture parameter and mole derivatives.

    Read more…

    Arguments

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

    Mixing rule object.

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

    Component mole amounts [mol]

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

    Pure-component values

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

    Mixture

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

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

procedure, public :: Dmix => DmixMHV

  • public subroutine DmixMHV(self, n, V, T, ai, daidt, daidt2, D, dDdV, dDdT, dDdV2, dDdT2, dDi, dDdTV, dDidV, dDidT, dDij)

    Mixing rule at the approximate zero-pressure limit as defined in the book of Michelsen and Møllerup.

    Read more…

    Arguments

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

    Mixing rule object.

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

    Moles vector [mol]

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

    Volume [L] (unused)

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

    Temperature [K]

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

    Pure components attractive parameters

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

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

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

    Mixture attractive parameter

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

    (not assigned)

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

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

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

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

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

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

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

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