Specialized numerical methods used by EOS implementations.
The principal routine is volume_michelsen. It solves in reduced
covolume , bounded between zero and one, rather than
iterating directly over an unbounded volume. Models must implement
get_v0 to provide the covolume or lower-volume estimate.
call volume_michelsen(model, n, P, T, V, root_type="stable")
Michelsen, M. L., and J. M. Mollerup, Thermodynamic Models: Fundamentals & Computational Aspects, 2nd ed., Tie-Line Publications, 2007.
Correct one pressure root in reduced-covolume coordinates.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
EOS used for residual pressure evaluation. |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Component mole amounts. |
||
| real(kind=pr), | intent(in) | :: | P |
Objective pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | V |
Obtained volume [L] |
||
| real(kind=pr), | intent(out) | :: | Pcalc |
Calculated pressure at V [bar] |
||
| real(kind=pr), | intent(inout) | :: | ZETA |
Current reduced covolume iterate, updated in place. |
||
| real(kind=pr), | intent(inout) | :: | ZETMIN |
Lower bound for the reduced covolume root. |
||
| real(kind=pr), | intent(inout) | :: | ZETMAX |
Upper bound for the reduced covolume root. |
||
| real(kind=pr), | intent(out) | :: | AT |
, a residual-Gibbs-like quantity used to select the stable root. |
||
| integer, | intent(out) | :: | iter |
Iterations used by the corrector. |
Volume solver at a given pressure.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ArModel), | intent(in) | :: | eos |
EOS providing pressure and residual Helmholtz derivatives. |
||
| real(kind=pr), | intent(in) | :: | n(:) |
Mixture moles [mol] |
||
| real(kind=pr), | intent(in) | :: | P |
Pressure [bar] |
||
| real(kind=pr), | intent(in) | :: | T |
Temperature [K] |
||
| real(kind=pr), | intent(out) | :: | V |
Volume [L] |
||
| character(len=*), | intent(in), | optional | :: | root_type |
Type of root [“vapor” | “liquid” | “stable”] |
|
| integer, | intent(in), | optional | :: | max_iters |
Maximum number of iterations (default 1000; currently unused, |
|
| real(kind=pr), | intent(in), | optional | :: | V0 |
Initial volume guess [L]; see Notes |