Calculation of isoplethic phase equilibria lines.
This module contains the subroutines to calculate any kind of phase equilibria lines with constant composition.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | did_stability | = | .false. | ||
| logical, | public | :: | found_unstability | = | .false. | ||
| type(MPEquilibriumState), | public, | allocatable | :: | points(:) | |||
| real(kind=pr), | public, | allocatable | :: | w_more_stable(:) |
Create a new generalized line. This function initializes a new instance of the GeneralizedLine type.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model | |||
| integer, | intent(in) | :: | nc | |||
| integer, | intent(in) | :: | np | |||
| integer, | intent(in) | :: | nstab | |||
| character(len=14), | intent(in) | :: | kinds_x(np) | |||
| character(len=14), | intent(in) | :: | kind_w | |||
| real(kind=pr), | intent(in) | :: | z(nc) | |||
| real(kind=pr), | intent(in) | :: | x_l0(np,nc) | |||
| real(kind=pr), | intent(in) | :: | w0(nc) | |||
| real(kind=pr), | intent(in) | :: | betas0(np+1) | |||
| real(kind=pr), | intent(in) | :: | P0 | |||
| real(kind=pr), | intent(in) | :: | T0 | |||
| integer, | intent(in) | :: | spec_variable | |||
| real(kind=pr), | intent(in) | :: | spec_variable_value | |||
| integer, | intent(in) | :: | ns0 | |||
| real(kind=pr), | intent(in) | :: | S0 | |||
| real(kind=pr), | intent(in) | :: | dS0 | |||
| real(kind=pr), | intent(in), | optional | :: | ws_stab(nstab,nc) | ||
| integer, | intent(in), | optional | :: | max_points |
Function to solve at each point of a multi-phase envelope.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Model to use. |
||
| real(kind=pr), | intent(in) | :: | z(:) |
Mixture global composition. |
||
| integer, | intent(in) | :: | np |
Number of main phases. |
||
| character(len=14), | intent(in) | :: | kinds_x(np) |
Kind of the main phases. |
||
| character(len=14), | intent(in) | :: | kind_w |
Kind of the reference phase. |
||
| real(kind=pr), | intent(in) | :: | X(:) |
Vector of variables. |
||
| integer, | intent(in) | :: | ns1 |
Number of first specification. |
||
| real(kind=pr), | intent(in) | :: | S1 |
First specification value. |
||
| integer, | intent(in) | :: | ns2 |
Number of second specification. |
||
| real(kind=pr), | intent(in) | :: | S2 |
Second specification value. |
||
| real(kind=pr), | intent(out) | :: | F(size(X)) |
Vector of functions valuated. |
||
| real(kind=pr), | intent(out) | :: | df(size(X),size(X)) |
Jacobian matrix. |
Function to solve the multiphase flash problem.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
Model to use. |
||
| real(kind=pr), | intent(in) | :: | z(:) |
Mixture global composition. |
||
| integer, | intent(in) | :: | np |
Number of x phases. |
||
| character(len=14), | intent(in) | :: | kinds_x(np) |
Kind of the x phases. |
||
| character(len=14), | intent(in) | :: | kind_w |
Kind of the w phase. |
||
| real(kind=pr), | intent(inout) | :: | X(:) |
Vector of variables. |
||
| integer, | intent(in) | :: | ns1 |
Number of first specification. |
||
| real(kind=pr), | intent(in) | :: | S1 |
First specification value. |
||
| integer, | intent(in) | :: | ns2 |
Number of second specification. |
||
| real(kind=pr), | intent(in) | :: | S2 |
Second specification value. |
||
| integer, | intent(in) | :: | max_iters |
Maximum number of iterations. |
||
| real(kind=pr), | intent(out) | :: | F(size(X)) |
Vector of functions valuated. |
||
| real(kind=pr), | intent(out), | dimension(size(X), size(X)) | :: | df |
Jacobian matrix. |
|
| integer, | intent(out) | :: | iters |
Number of iterations performed. |