Evaluate a saturation residual system at fixed pressure or temperature.
Reconstructs phase compositions from logarithmic K-factors, evaluates
fugacity coefficients with root selections determined by kind, and
returns isofugacity, material-balance, and specification residuals:
, ,
and .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
EOS used for phase properties. |
||
| character(len=*), | intent(in) | :: | kind |
|
||
| real(kind=pr), | intent(in) | :: | z(size(model)) |
Feed composition. |
||
| real(kind=pr), | intent(in) | :: | X(:) |
Unknowns |
||
| integer, | intent(in) | :: | ns |
Index of the specified unknown. |
||
| real(kind=pr), | intent(in) | :: | S |
Value imposed on unknown |
||
| real(kind=pr), | intent(out) | :: | F(:) |
Residual vector. |
||
| real(kind=pr), | intent(out) | :: | dF(:,:) |
Jacobian with respect to the unknown vector. |
||
| real(kind=pr), | intent(out) | :: | dFdS(:) |
Residual derivative with respect to the specification. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | K(size(X)-2) |
Equilibrium K-factors |
|||
| real(kind=pr), | public | :: | P | ||||
| real(kind=pr), | public | :: | T | ||||
| real(kind=pr), | public | :: | Vy | ||||
| real(kind=pr), | public | :: | Vz | ||||
| real(kind=pr), | public | :: | dlnphi_dn_y(size(X)-2,size(X)-2) | ||||
| real(kind=pr), | public | :: | dlnphi_dn_z(size(X)-2,size(X)-2) | ||||
| real(kind=pr), | public | :: | dlnphi_dp_y(size(X)-2) | ||||
| real(kind=pr), | public | :: | dlnphi_dp_z(size(X)-2) | ||||
| real(kind=pr), | public | :: | dlnphi_dt_y(size(X)-2) | ||||
| real(kind=pr), | public | :: | dlnphi_dt_z(size(X)-2) | ||||
| integer, | public | :: | i |
Loop index |
|||
| integer, | public | :: | j |
Loop index |
|||
| character(len=14), | public | :: | kind_y | ||||
| character(len=14), | public | :: | kind_z | ||||
| real(kind=pr), | public | :: | lnPhi_y(size(X)-2) |
Logarithmic thermodynamic quantity or intermediate. |
|||
| real(kind=pr), | public | :: | lnPhi_z(size(X)-2) |
Logarithmic thermodynamic quantity or intermediate. |
|||
| integer, | public | :: | nc |
Number of components. |
|||
| real(kind=pr), | public | :: | y(size(X)-2) |
Incipient/second phase composition. |