All CubicEoS in yaeos
include a CubicMixRule derived type, which
handles how the and parameters in the CubicEoS are calculated.
Quadratic mixing rules are the ussually most used mixing rules for cubic equations of state.
QMR are handled by the QMR derived type. Which can be used like:
use yaeos, only: pr, QMR
type(QMR) :: mixrule
real(pr) :: kij(2, 2), lij(2, 2)
kij(1, :) = [0.0, 0.1]
kij(2, :) = [0.1, 0.0]
lij(1, :) = [0.0, 0.01]
lij(2, :) = [0.01, 0.0]
mixrule = QMR(k=kij, l=lij)
By default the matrix will be calculated with a constant
value (as shown below). But this functionality can be modified by replacing
the get_aij
procedure
use yaeos, only: pr, QMR
type(QMR) :: mixrule
real(pr) :: kij(2, 2), lij(2, 2)
kij(1, :) = [0.0, 0.1]
kij(2, :) = [0.1, 0.0]
lij(1, :) = [0.0, 0.01]
lij(2, :) = [0.01, 0.0]
mixrule = QMR(k=kij, l=lij)
mixrule%get_aij => my_aij_implementation
subroutine my_aij_implementation(self, ai, daidt, daidt2, aij, daijdt, daijdt2)
class(QMR) :: self
real(pr), intent(in) :: ai(:), daidt(:), daidt2(:)
real(pr), intent(out) :: aij(:, :), daijdt(:, .), daijdt2(:, :)
! Implementation here
end subroutine
It is possible to mix the attractive parameter of Cubic Equations with an excess Gibbs-based model. This can be useful for cases of polar molecules and/or systems that have been fitted to models.
This mixing rule is based on the aproximate zero-pressure limit of a cubic equation of state. At the aproximate zero-pressure limit the attractive parameter can be expressed as:
Where is a weak function of temperature. In the case of MHV
and simplicity it is considered that depends on the model used.