yaeos__models_solvers Module

Model-specific numerical solvers

Specialized numerical methods used by EOS implementations.

Description

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.

Examples

call volume_michelsen(model, n, P, T, V, root_type="stable")

References

Michelsen, M. L., and J. M. Mollerup, Thermodynamic Models: Fundamentals & Computational Aspects, 2nd ed., Tie-Line Publications, 2007.


Uses

  • module~~yaeos__models_solvers~~UsesGraph module~yaeos__models_solvers yaeos__models_solvers module~yaeos__constants yaeos__constants module~yaeos__models_solvers->module~yaeos__constants module~yaeos__models_ar yaeos__models_ar module~yaeos__models_solvers->module~yaeos__models_ar iso_fortran_env iso_fortran_env module~yaeos__constants->iso_fortran_env module~yaeos__models_ar->module~yaeos__constants module~yaeos__models_base yaeos__models_base module~yaeos__models_ar->module~yaeos__models_base module~yaeos__substance yaeos__substance module~yaeos__models_base->module~yaeos__substance module~yaeos__substance->module~yaeos__constants

Used by

  • module~~yaeos__models_solvers~~UsedByGraph module~yaeos__models_solvers yaeos__models_solvers module~yaeos__models_ar_saft_pcsaft YAEOS__MODELS_AR_SAFT_PCSAFT module~yaeos__models_ar_saft_pcsaft->module~yaeos__models_solvers proc~volume CubicEoS%volume proc~volume->module~yaeos__models_solvers proc~volume~4 PCSAFT%volume proc~volume~4->module~yaeos__models_solvers module~yaeos__models yaeos__models module~yaeos__models->module~yaeos__models_ar_saft_pcsaft module~yaeos yaeos module~yaeos->module~yaeos__models module~yaeos__extra_fluids yaeos__extra_fluids module~yaeos__extra_fluids->module~yaeos__models proc~co2_h2o_isop co2_h2o_isop proc~co2_h2o_isop->module~yaeos__models

Subroutines

public subroutine solve_point(eos, n, P, T, V, Pcalc, ZETA, ZETMIN, ZETMAX, AT, iter)

Correct one pressure root in reduced-covolume coordinates.

Read more…

Arguments

Type IntentOptional 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.

public subroutine volume_michelsen(eos, n, P, T, V, root_type, max_iters, V0)

Volume solver at a given pressure.

Read more…

Arguments

Type IntentOptional 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, solve_point caps at 500)

real(kind=pr), intent(in), optional :: V0

Initial volume guess [L]; see Notes