Residual Helmholtz Energy for a generic Cubic Equation of State.
Calculates the residual Helmholtz Energy for a generic Cubic EoS as defined by Michelsen and Møllerup:
When the mixing rule produces a D that depends on volume (e.g. the
s-DDLC local composition rule), the non-zero volume derivatives
dDdV, dDdV2, dDdTV, and dDidV drive additional correction
terms that are added to ArV, ArV2, ArTV, and ArVn.
For standard mixing rules all four inputs should be passed as zero;
the correction terms are always evaluated, so they then vanish.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(in) | :: | n(:) |
Mole numbers |
||
| real(kind=pr), | intent(in) | :: | V |
Volume [L] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(in) | :: | B |
Mixture covolume [L] |
||
| real(kind=pr), | intent(in) | :: | dBi(size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | dBij(size(n),size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | D |
Mixture attractive parameter [bar L^2] |
||
| real(kind=pr), | intent(in) | :: | dDdV |
— zero for V-independent mixing rules |
||
| real(kind=pr), | intent(in) | :: | dDdV2 |
— zero for V-independent mixing rules |
||
| real(kind=pr), | intent(in) | :: | dDdT |
|
||
| real(kind=pr), | intent(in) | :: | dDdT2 |
|
||
| real(kind=pr), | intent(in) | :: | dDdTV |
— zero for V-independent mixing rules |
||
| real(kind=pr), | intent(in) | :: | dDi(size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | dDidV(size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | dDidT(size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | dDij(size(n),size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | D1 |
parameter |
||
| real(kind=pr), | intent(in) | :: | dD1i(size(n)) |
|
||
| real(kind=pr), | intent(in) | :: | dD1ij(size(n),size(n)) |
|
||
| real(kind=pr), | intent(out), | optional | :: | Ar |
Residual Helmholtz energy [bar L] |
|
| real(kind=pr), | intent(out), | optional | :: | ArV |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArT |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArTV |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArV2 |
|
|
| real(kind=pr), | intent(out), | optional | :: | ArT2 |
|
|
| real(kind=pr), | intent(out), | optional | :: | Arn(size(n)) |
|
|
| 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)) |
|
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | AUX | ||||
| real(kind=pr), | public | :: | D2 | ||||
| real(kind=pr), | public | :: | FFB | ||||
| real(kind=pr), | public | :: | FFBB | ||||
| real(kind=pr), | public | :: | FFBV | ||||
| real(kind=pr), | public | :: | auxD2 |
Second-order intermediate quantity used by this procedure. |
|||
| real(kind=pr), | public | :: | f | ||||
| real(kind=pr), | public | :: | fB | ||||
| real(kind=pr), | public | :: | fBD1 | ||||
| real(kind=pr), | public | :: | fD1 | ||||
| real(kind=pr), | public | :: | fD1D1 | ||||
| real(kind=pr), | public | :: | fVD1 | ||||
| real(kind=pr), | public | :: | fv | ||||
| real(kind=pr), | public | :: | fv2 | ||||
| real(kind=pr), | public | :: | g | ||||
| real(kind=pr), | public | :: | gv | ||||
| real(kind=pr), | public | :: | gv2 | ||||
| integer, | public | :: | i |
Loop index |
|||
| integer, | public | :: | j |
Loop index |
|||
| integer, | public | :: | nc |
Number of components. |
|||
| real(kind=pr), | public | :: | totn |
Total number of moles. |