Continuation routines for two-phase and multiphase boundaries in the plane.
The public two-phase entry point pt_envelope_2ph continues from a converged saturation point at fixed overall composition. The module also defines the PTEnvel2 result type and exports critical-point markers found along the envelope.
envelope = pt_envelope_2ph(model, z, saturation_state)
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | private | :: | Vy | ||||
| real(kind=pr), | private | :: | Vz | ||||
| real(kind=pr), | private, | parameter | :: | near_critical_K | = | 0.01 |
Two-phase isopleth. Phase boundary line of a fluid at constant composition.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(CriticalPoint), | public, | allocatable | :: | cps(:) |
Critical points found along the line. |
||
| type(EquilibriumState), | public, | allocatable | :: | points(:) |
Each point through the line. |
| procedure, public, pass :: write => write_PTEnvel2 | |
| generic, public :: write (FORMATTED) => write |
Critical point located on a pressure-temperature envelope.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public | :: | P |
Pressure [bar] |
|||
| real(kind=pr), | public | :: | T |
Temperature [K] |
Find a liquid-liquid phase boundary on the PT plane. At a specified pressure. The procedure consists in looking for the temperature at which the fugacity of a component in the mixture is higher than the fugacity of the same component in a pure phase. This is done for each component in the mixture. The component with the highest temperature is selected as it should be the first one appearing. If all components have a negative difference then the mixture is probably stable at all temperatures.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Equation of state model |
||
| real(kind=pr), | intent(in) | :: | z(:) |
Mole fractions |
||
| real(kind=pr), | intent(in) | :: | T0 |
Initial temperature [K] |
||
| real(kind=pr), | intent(in) | :: | P0 |
Search pressure [bar] |
||
| integer, | intent(in) | :: | max_points |
Maximum number of points passed to the envelope continuation. |
PT two-phase envelope calculation procedure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Thermodynamic model |
||
| real(kind=pr), | intent(in) | :: | z(:) |
Vector of molar fractions |
||
| type(EquilibriumState), | intent(in) | :: | first_point |
Initial point of the envelope |
||
| integer, | intent(in), | optional | :: | points |
Maximum number of points, defaults to 500 |
|
| integer, | intent(in), | optional | :: | iterations |
Point solver maximum iterations, defaults to 100 |
|
| real(kind=pr), | intent(in), | optional | :: | delta_0 |
Initial specification step , defaults to 0.01 |
|
| integer, | intent(in), | optional | :: | specified_variable_0 |
Position of specified variable, since the vector of variables is the values for specification will be for the equilibria constants, for and for . Defaults to (). |
|
| procedure(continuation_solver), | optional | :: | solver |
Specify solver for each point, defaults to a full newton procedure |
||
| procedure(continuation_stopper), | optional | :: | stop_conditions |
Function that returns true if the continuation method should stop |
||
| real(kind=pr), | intent(in), | optional | :: | maximum_pressure |
Maximum pressure to calculate [bar] |
Write a two-phase PT envelope using sectioned, plotting-friendly output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(PTEnvel2), | intent(in) | :: | pt2 |
Envelope result to serialize. |
||
| integer, | intent(in) | :: | unit |
Output unit number. |
||
| character(len=*), | intent(in) | :: | iotype |
Fortran formatted-I/O mode. |
||
| integer, | intent(in) | :: | v_list(:) |
Format control list supplied by the runtime. |
||
| integer, | intent(out) | :: | iostat |
I/O status returned to the runtime. |
||
| character(len=*), | intent(inout) | :: | iomsg |
I/O error message buffer. |