Solve a saturation point for a pure component.
The set of equations solved with Newton’s method is:
where and denote the liquid and vapor phases of the pure component. The vector of variables is .
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model |
||
| integer, | intent(in) | :: | ncomp |
Component index |
||
| integer, | intent(in) | :: | nc |
Total number of components |
||
| real(kind=pr), | intent(inout) | :: | X(3) |
Variables |
||
| integer, | intent(in) | :: | ns |
Index of the specified variable in |
||
| real(kind=pr), | intent(in) | :: | S |
Variable value specified to solve |
||
| real(kind=pr), | intent(out) | :: | F(3) |
Residual vector |
||
| real(kind=pr), | intent(out) | :: | dF(3,3) |
Jacobian |
||
| integer, | intent(out) | :: | its |
Number of iterations |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | private | :: | B | ||||
| real(kind=pr), | private | :: | Py | ||||
| real(kind=pr), | private | :: | Pz | ||||
| real(kind=pr), | private | :: | T | ||||
| real(kind=pr), | private | :: | Vy | ||||
| real(kind=pr), | private | :: | Vz | ||||
| real(kind=pr), | private | :: | Xnew(3) | ||||
| real(kind=pr), | private | :: | dPdTy | ||||
| real(kind=pr), | private | :: | dPdTz | ||||
| real(kind=pr), | private | :: | dPdVy |
Pressure derivative with respect to the incipient-phase volume. |
|||
| real(kind=pr), | private | :: | dPdVz |
Pressure derivative with respect to the feed-phase volume. |
|||
| real(kind=pr), | private | :: | dX(3) | ||||
| real(kind=pr), | private | :: | dlnfdt_y(nc) | ||||
| real(kind=pr), | private | :: | dlnfdt_z(nc) | ||||
| real(kind=pr), | private | :: | dlnfdv_y(nc) | ||||
| real(kind=pr), | private | :: | dlnfdv_z(nc) | ||||
| integer, | private | :: | i |
Loop/index variable. |
|||
| real(kind=pr), | private | :: | lnfug_y(nc) |
Logarithmic thermodynamic quantity or intermediate. |
|||
| real(kind=pr), | private | :: | lnfug_z(nc) |
Logarithmic thermodynamic quantity or intermediate. |
|||
| real(kind=pr), | private | :: | z(nc) |
Pure-component mole vector |
Evaluate pure-fluid saturation residuals for the volume solver. The log-state vector contains liquid volume, vapor volume, and temperature; residuals enforce fugacity and pressure equality plus the variable specification.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=pr), | intent(inout) | :: | X(3) |
Variables |
||
| real(kind=pr), | intent(out) | :: | F(3) |
Residual vector |
||
| real(kind=pr), | intent(out) | :: | dF(3,3) |
Jacobian |