dwsim icon indicating copy to clipboard operation
dwsim copied to clipboard

[Bug] PVF / dew point calculation error

Open andr1976 opened this issue 3 years ago • 17 comments

Describe the bug Dewpoint calculation fails for the PVF flash for PR, SRK, GERG etc

Expected behavior Identify dew point temperature of -11 / -12 C'ish at 40 barg

Desktop (please complete the following information):

  • OS: [e.g. Windows]
  • Version [e.g. v8.0.0]

Additional context See attached file dewpoint_error.zip

andr1976 avatar Jun 19 '22 19:06 andr1976

@andr1976 does it fails due to an error or wrong temperature value? just to be sure

DanWBR avatar Jun 22 '22 20:06 DanWBR

@andr1976 initial estimates are close to the trivial solution. the algorithm conditions are satisfied in the end, even with the wrong temperature. do you have any suggestion?

DanWBR avatar Jun 22 '22 20:06 DanWBR

The calculation runs but returns a temperature which is not the dew point at the specified pressure. Far from. Things start to go sideways above 30'something bar.

andr1976 avatar Jun 22 '22 21:06 andr1976

image

image

andr1976 avatar Jun 22 '22 22:06 andr1976

Ok one is with SRK but the same applies with PR. There is apparently a regression in the stability of the PVF/TVF algorithm

andr1976 avatar Jun 22 '22 22:06 andr1976

@andr1976 did you check this with latest code?

DanWBR avatar Jun 28 '22 18:06 DanWBR

Sorry, no haven’t had time yet

tir. 28. jun. 2022 kl. 20.34 skrev Daniel Wagner @.***>:

@andr1976 https://github.com/andr1976 did you check this with latest code?

— Reply to this email directly, view it on GitHub https://github.com/DanWBR/dwsim/issues/333#issuecomment-1169085992, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN6EIDZ67JGT52PMIOYO3I3VRNAVDANCNFSM5ZG23CAQ . You are receiving this because you were mentioned.Message ID: @.***>

andr1976 avatar Jun 28 '22 21:06 andr1976

@DanWBR , yes dew point is fine now, but the bubl-point is messed up now above 44-46 bar depending on EOS. I also think the critical point is way off. Above this pressure bubl point temperature suddenly jumps from -76 C to -10 C

andr1976 avatar Jun 29 '22 12:06 andr1976

This is the envelope expected image

andr1976 avatar Jun 29 '22 12:06 andr1976

@andr1976 the critical point is the reference to stop calculating dew and bubble points... it is very far from the correct one in this specific case

DanWBR avatar Jun 29 '22 13:06 DanWBR

Yes, I see. Thing is, this is natural gas (although a little to the heavy side), so this is something that could potentially be encountered quite often

andr1976 avatar Jun 29 '22 13:06 andr1976

This looks better (PR). SRK still fails to calculate the correct critical point. GERG will need a new algorithm as I don't have a general procedure to calculate critical points - only PR and SRK for now.

image

DanWBR avatar Jun 29 '22 14:06 DanWBR

the chart title is wrong - it was calculated with PR.

DanWBR avatar Jun 29 '22 14:06 DanWBR

Looks way better now - I think PP is somehow defaulting to the last PP available, for the title, not for the calcs

andr1976 avatar Jun 29 '22 21:06 andr1976

Could be nice to have Ian Bell on-board to do the critical point calculation method :-)
https://www.nist.gov/publications/calculation-critical-points-helmholtz-energy-explicit-mixture-models

andr1976 avatar Jun 30 '22 09:06 andr1976

@andr1976 I have an implementation of this method for quite some time already, but I've let it aside as it is slow and was not working. I'm revisiting it to see if I can get it working.

DanWBR avatar Jun 30 '22 11:06 DanWBR

SRK:

image

DanWBR avatar Jun 30 '22 14:06 DanWBR