Skip to content

PhaseType Function result incorrect in Peng Robinson #995

@alkanism

Description

@alkanism

Function PhaseType in PengRobinson.vb returns a phase type of "L" for a gas composition I have.

The gas composition I have and its properties are in the attached screenshot files.
This should really be a gas composition in a gaseous state.

Image Image

I tested this in a file where only an Input stream is defined; nothing else. And Peng Robinson is the EOS selected.

I believe the problem is originating from the following lines which compute the compressibility factor (as a very small number instead of 1.0003)
_zarray = CalcZ(T, P, Vx, VKij, VTc, VPc, Vw)
_mingz = ZtoMinG(_zarray.ToArray(), T, P, Vx, VKij, VTc, VPc, Vw)
Z = _zarray(_mingz(0))

This block of code is also used in ReturnParameters function and elsewhere too.
Because of that the CalcJouleThamsonCoefficient and CalcIsothermalCompressibility functions might be calculating incorrect values as well.

My OS is Windows 11 Pro
DWSIM version I am using is 8.8.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needednot a bugThis is not a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions