Continuation of multiphase equilibrium states at fixed overall composition.
The module initializes a multiphase state, applies stability checks when
requested, and continues the generalized isopleth through pressure,
temperature, or another selected specification. The result stores
converged MPEquilibriumState points and stability metadata.
line = create_generalized_isoz_line(model, nc, np, nstab, kinds_x, kind_w, &
z, x_l0, w0, betas0, P0, T0, spec_variable, spec_variable_value, &
ns0, S0, dS0, ws_stab=ws_stab)
For a standard two-phase line, use the dedicated phase-envelope routines.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=pr), | public, | parameter | :: | minT | = | 100 |
Minimum temperature [K]; tracing stops below it. |
Stored points and stability status for a multiphase isopleth.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | did_stability | = | .false. |
Reserved flag; currently never set by create_generalized_isoz_line. |
|
| logical, | public | :: | found_unstability | = | .false. |
|
|
| type(MPEquilibriumState), | public, | allocatable | :: | points(:) |
Converged multiphase states along the line. |
||
| real(kind=pr), | public, | allocatable | :: | w_more_stable(:) |
Trial composition with the lowest ; allocated only when |
Start a generalized multiphase isopleth from an existing phase state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | model |
EOS used for phase properties. |
||
| integer, | intent(in) | :: | nc |
Number of components; must equal |
||
| integer, | intent(in) | :: | np |
Number of main phases in the initial state. |
||
| integer, | intent(in) | :: | nstab |
Number of stability trial compositions supplied. |
||
| character(len=14), | intent(in) | :: | kinds_x(np) |
Phase kind for each main phase. |
||
| character(len=14), | intent(in) | :: | kind_w |
Kind of the reference phase. |
||
| real(kind=pr), | intent(in) | :: | z(nc) |
Overall feed composition. |
||
| real(kind=pr), | intent(in) | :: | x_l0(np,nc) |
Initial main-phase compositions. |
||
| real(kind=pr), | intent(in) | :: | w0(nc) |
Initial reference-phase composition. |
||
| real(kind=pr), | intent(in) | :: | betas0(np+1) |
Main-phase fractions followed by the reference-phase fraction. |
||
| real(kind=pr), | intent(in) | :: | P0 |
Initial pressure [bar]. |
||
| real(kind=pr), | intent(in) | :: | T0 |
Initial temperature [K]. |
||
| integer, | intent(in) | :: | spec_variable |
Index in of the variable held fixed along the line. |
||
| real(kind=pr), | intent(in) | :: | spec_variable_value |
Fixed value of |
||
| integer, | intent(in) | :: | ns0 |
Index in |
||
| real(kind=pr), | intent(in) | :: | S0 |
Initial continuation specification value. |
||
| real(kind=pr), | intent(in) | :: | dS0 |
Initial signed continuation step. |
||
| real(kind=pr), | intent(in), | optional | :: | ws_stab(nstab,nc) |
Trial compositions for stability analysis; required when |
|
| integer, | intent(in), | optional | :: | max_points |
Maximum number of points to continue. |
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. |