Calculation and interpolation of the saturation line of a pure component. pure_saturation_line traces the line from the critical point down to a specified pressure or temperature, and PurePsat stores and interpolates the result.
line = pure_saturation_line(model, component=1, minP=0.1_pr, minT=100.0_pr)
Tsat = line%get_T(P=1.0_pr)
Saturation line of a pure component. Contains the saturation
temperatures, pressures, and phase volumes, together with linear
interpolators for get_T and get_P.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public, | allocatable | :: | P(:) |
Pressure [bar] |
||
| real(kind=pr), | public, | allocatable | :: | T(:) |
Temperature [K] |
||
| real(kind=pr), | public, | allocatable | :: | Vx(:) |
Molar volume [L/mol] in the liquid phase |
||
| real(kind=pr), | public, | allocatable | :: | Vy(:) |
Molar volume [L/mol] in the vapor phase |
||
| type(linear_interp_1d), | private | :: | interpolator_get_P |
Interpolates pressure as a function of temperature. |
|||
| type(linear_interp_1d), | private | :: | interpolator_get_T |
Interpolates temperature as a function of pressure. |
| procedure, public :: get_P | |
| procedure, public :: get_T |
Interpolate the saturation pressure at a requested temperature.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(PurePsat), | intent(inout) | :: | pt |
Stored saturation data and interpolator. |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K]. |
Get the saturation temperature for a given pressure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(PurePsat), | intent(inout) | :: | pt |
Stored saturation data and interpolator. |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar]. |
Saturation pressures and temperatures for a pure component.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model |
||
| integer, | intent(in) | :: | component |
Component index to calculate the line |
||
| real(kind=pr), | intent(in) | :: | minP |
Minimum pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | minT |
Minimum temperature [K] |
Solve a saturation point for a pure component.
| 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(4) |
Variables |
||
| integer, | intent(in) | :: | ns |
Index of the specified variable (see above). |
||
| real(kind=pr), | intent(in) | :: | S |
Variable value specified to solve |
||
| real(kind=pr), | intent(out) | :: | F(4) |
Function |
||
| real(kind=pr), | intent(out) | :: | dF(4,4) |
Jacobian |
||
| real(kind=pr), | intent(out) | :: | dFdS(4) |
Derivative of the function with respect to S |
||
| integer, | intent(out) | :: | its |
Number of iterations |