Procedures of the core calculations of CubicEoS mixing rules.
This module holds all the basic math to use mixing rules in other codes. Keeping it simple and accessible.
bi = [0.2_pr, 0.3_pr]
lij = reshape([0.0_pr, 0.2_pr, 0.2_pr, 0.0_pr], [2,2])
! Calculate B parameter with Quadratic Mixing Rules.
call bmix_qmr(n, bi, lij, b, dbi, dbij)
Evaluate the ternary cubic repulsive mixture parameter and derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | n(:) |
Component mole amounts [mol] |
||
| real(kind=pr), | intent(in) | :: | bijk(:,:,:) |
Ternary covolume tensor [L/mol] |
||
| real(kind=pr), | intent(out) | :: | Bmix |
[L] |
||
| real(kind=pr), | intent(out) | :: | dBi(:) |
|
||
| real(kind=pr), | intent(out) | :: | dBij(:,:) |
|
Evaluate the ternary cubic attractive mixture parameter and derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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) | :: | a(:,:,:) |
tensor (see |
||
| real(kind=pr), | intent(in) | :: | dadt(:,:,:) |
|
||
| real(kind=pr), | intent(in) | :: | dadt2(:,:,:) |
|
||
| real(kind=pr), | intent(out) | :: | D |
Mixture attractive parameter |
||
| real(kind=pr), | intent(out) | :: | dDdV |
(zero) |
||
| 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(:,:) |
|
Calculate the tensor of the CMR.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | ai(:) |
|
||
| real(kind=pr), | intent(in) | :: | daidt(:) |
|
||
| real(kind=pr), | intent(in) | :: | daidt2(:) |
|
||
| real(kind=pr), | intent(in) | :: | k(:,:,:) |
tensor |
||
| real(kind=pr), | intent(in) | :: | dkdt(:,:,:) |
|
||
| real(kind=pr), | intent(in) | :: | dkdt2(:,:,:) |
|
||
| real(kind=pr), | intent(out) | :: | a(:,:,:) |
matrix |
||
| real(kind=pr), | intent(out) | :: | dadt(:,:,:) |
matrix |
||
| real(kind=pr), | intent(out) | :: | dadt2(:,:,:) |
matrix |
Attractive parameter calculation for the Huron-Vidal mixing rule.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | n(:) |
Component mole amounts [mol] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(in) | :: | bi(:) |
Pure-component covolumes [L/mol] |
||
| real(kind=pr), | intent(in) | :: | B |
Mixture covolume [L] |
||
| real(kind=pr), | intent(in) | :: | dBi(:) |
|
||
| real(kind=pr), | intent(in) | :: | dBij(:,:) |
|
||
| real(kind=pr), | intent(in) | :: | D1 |
Mixture |
||
| real(kind=pr), | intent(in) | :: | dD1i(:) |
|
||
| real(kind=pr), | intent(in) | :: | dD1ij(:,:) |
|
||
| real(kind=pr), | intent(in) | :: | ai(:) |
Pure-component attractive parameters |
||
| real(kind=pr), | intent(in) | :: | daidt(:) |
|
||
| real(kind=pr), | intent(in) | :: | daidt2(:) |
|
||
| real(kind=pr), | intent(in) | :: | Ge |
Excess Gibbs energy [bar L] |
||
| real(kind=pr), | intent(in) | :: | GeT |
|
||
| real(kind=pr), | intent(in) | :: | GeT2 |
|
||
| real(kind=pr), | intent(in) | :: | Gen(:) |
|
||
| real(kind=pr), | intent(in) | :: | GeTn(:) |
|
||
| real(kind=pr), | intent(in) | :: | Gen2(:,:) |
|
||
| real(kind=pr), | intent(out) | :: | D |
Mixture attractive parameter [bar L^2] |
||
| real(kind=pr), | intent(out) | :: | dDdT |
|
||
| real(kind=pr), | intent(out) | :: | dDdT2 |
|
||
| real(kind=pr), | intent(out) | :: | dDi(:) |
|
||
| real(kind=pr), | intent(out) | :: | dDidT(:) |
|
||
| real(kind=pr), | intent(out) | :: | dDij(:,:) |
|
Calculate the linear mixture covolume and composition derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | n(:) |
Component mole amounts. |
||
| real(kind=pr), | intent(in) | :: | bi(:) |
Pure-component covolumes. |
||
| real(kind=pr), | intent(out) | :: | b |
Mixture covolume. |
||
| real(kind=pr), | intent(out) | :: | dbi(:) |
Mole-number gradient of the mixture covolume. |
||
| real(kind=pr), | intent(out) | :: | dbij(:,:) |
Mole-number Hessian of the mixture covolume. |
Calculate the QMR covolume and its first and second mole derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | n(:) |
Component mole amounts. |
||
| real(kind=pr), | intent(in) | :: | bi(:) |
Pure-component covolumes. |
||
| real(kind=pr), | intent(in) | :: | lij(:,:) |
Repulsive binary interaction matrix. |
||
| real(kind=pr), | intent(out) | :: | b |
Mixture covolume. |
||
| real(kind=pr), | intent(out) | :: | dbi(:) |
Mole-number gradient of the mixture covolume. |
||
| real(kind=pr), | intent(out) | :: | dbij(:,:) |
Mole-number Hessian of the mixture covolume. |
RKPR parameter mixing rule.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| 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(:,:) |
|
Infinite pressure limit parameter
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nc |
Number of components |
||
| real(kind=pr), | intent(in) | :: | d1 |
Mixture |
||
| real(kind=pr), | intent(in), | optional | :: | dd1i(nc) |
|
|
| real(kind=pr), | intent(in), | optional | :: | dd1ij(nc,nc) |
|
|
| real(kind=pr), | intent(out) | :: | L |
|
||
| real(kind=pr), | intent(out), | optional | :: | dLi(nc) |
|
|
| real(kind=pr), | intent(out), | optional | :: | dLij(nc,nc) |
|