Bubble, dew, and liquid-liquid saturation points at specified
temperature or pressure. The module first iterates a scalar Newton
method on with successive-substitution
updates of , and falls back to a full Newton solve in
if that does not converge.
A non-converged result is returned with kind = "failed".
sat = saturation_pressure(model, z, T, kind="bubble")
sat = saturation_temperature(model, z, P, kind="dew")
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | iters_first_step | = | 30 |
Maximum iterations for the initial scalar Newton step of saturation_pressure. |
|
| integer, | public | :: | iters_first_step_temperature | = | 100 |
Maximum iterations for the initial scalar Newton step of saturation_temperature. |
|
| integer, | public | :: | max_iterations | = | 2000 |
Maximum number of iterations for the full Newton solver |
|
| real(kind=pr), | public | :: | step_tol | = | 0.1_pr |
Currently unused (the scalar pressure step is limited to in code). |
|
| real(kind=pr), | public | :: | tol | = | 1e-6_pr |
Convergence tolerance for the saturation solvers |
Saturation pressure calculation function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in), | target | :: | model |
EOS used to evaluate phase fugacities. |
|
| real(kind=pr), | intent(in) | :: | n(:) |
Composition vector [moles / molar fraction] |
||
| real(kind=pr), | intent(in) | :: | t |
Temperature [K] |
||
| character(len=*), | intent(in) | :: | kind |
[bubble|dew|liquid-liquid] |
||
| real(kind=pr), | intent(in), | optional | :: | p0 |
Initial pressure [bar], defaults to the Wilson estimate |
|
| real(kind=pr), | intent(in), | optional | :: | y0(:) |
Initial guess used as to build ( |
|
| integer, | intent(in), | optional | :: | max_iters |
Currently ignored: the full Newton solve uses the module variable |
Saturation temperature calculation function.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in), | target | :: | model |
EOS used to evaluate phase fugacities. |
|
| real(kind=pr), | intent(in) | :: | n(:) |
Composition vector [moles / molar fraction] |
||
| real(kind=pr), | intent(in) | :: | p |
Pressure [bar] |
||
| character(len=*), | intent(in) | :: | kind |
[bubble|dew|liquid-liquid] |
||
| real(kind=pr), | intent(in), | optional | :: | t0 |
Initial temperature [K], defaults to 250 K |
|
| real(kind=pr), | intent(in), | optional | :: | y0(:) |
Initial guess used as to build ( |
|
| integer, | intent(in), | optional | :: | max_iters |
Currently ignored: the full Newton solve uses the module variable |