PX two-phase envelope calculation procedure.
Phase envelope calculation using the continuation method.
Defaults to solving the saturation temperature and continues with
an increment in it. The variable to specify can be changed by modifying
specified_variable_0
with the corresponding variable number.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(ArModel), | intent(in) | :: | model |
Thermodyanmic model |
||
real(kind=pr), | intent(in) | :: | z0(:) |
Vector of molar fractions of the global composition (main phase) |
||
real(kind=pr), | intent(in) | :: | alpha0 |
First point of |
||
real(kind=pr), | intent(in) | :: | z_injection(:) |
Vector of molar fractions of the injection fluid |
||
type(EquilibriumState) | :: | first_point | ||||
integer, | intent(in), | optional | :: | points |
Maxmimum 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 extrapolation |
|
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 . |
|
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 |
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=pr), | public | :: | S0 |
Initial specification value |
|||
real(kind=pr), | public | :: | T | ||||
real(kind=pr), | public | :: | X(size(z)+2) | ||||
real(kind=pr), | public, | allocatable | :: | XS(:,:) | |||
real(kind=pr), | public | :: | dS0 |
Initial specification step |
|||
character(len=14), | public | :: | kind | ||||
integer, | public | :: | max_iterations |
Maximum number of iterations |
|||
integer, | public | :: | max_points |
Maximum number of points |
|||
integer, | public | :: | nc |
Number of components |
|||
integer, | public | :: | ns |
Number of specified variable |
|||
real(kind=pr), | public | :: | z(size(z0)) |
Composition at some point |
Critical point detection
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(inout) | :: | X(:) |
Vector of variables |
||
real(kind=pr), | intent(inout) | :: | dXdS(:) |
Variation of variables wrt S |
||
integer, | intent(inout) | :: | ns |
Number of specified variable |
||
real(kind=pr), | intent(inout) | :: | S |
Specification value |
||
real(kind=pr), | intent(inout) | :: | dS |
Step in specification |
Function that needs to be solved at each envelope point
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | X(:) | |||
integer, | intent(in) | :: | ns | |||
real(kind=pr), | intent(in) | :: | S | |||
real(kind=pr), | intent(out) | :: | F(:) | |||
real(kind=pr), | intent(out) | :: | dF(:,:) | |||
real(kind=pr), | intent(out) | :: | dFdS(:) |
Save the converged point
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(in) | :: | X(:) | |||
integer, | intent(in) | :: | iters |
Update the specification during continuation.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=pr), | intent(inout) | :: | X(:) |
Vector of variables |
||
integer, | intent(inout) | :: | ns |
Number of specified variable in the vector |
||
real(kind=pr), | intent(inout) | :: | S |
Variable specification value |
||
real(kind=pr), | intent(inout) | :: | dS |
Step in specification |
||
real(kind=pr), | intent(inout) | :: | dXdS(:) |
Variation of variables with respect to specification |
||
integer, | intent(in) | :: | step_iters |
Iterations used in the solver |