Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R513a data + formula problem in excel #452

Closed
gsavell121 opened this issue Sep 20, 2021 · 10 comments
Closed

R513a data + formula problem in excel #452

gsavell121 opened this issue Sep 20, 2021 · 10 comments

Comments

@gsavell121
Copy link

Description

I am quite new to Refprop and using the excel integration. Apologies if I have made a basic error, or if my thermodynamic understanding is lacking.

I am trying to look up the temperature and pressure of R513a based on known enthalpy and density values. If I put the values directly into refprop, I mostly seem to get reasonable results. However, when I use excel, large portions of the data return errors.

There is one data point in particular I am interested in at the moment which is returning an error - see steps to reproduce below.

I have tried to investigate the problem by plotting graphs both in REFPROP and Excel. As far as I can see, there seems to be a small data issue in REFPROP for this mixture around the 200kg/m3, 30°C, 270j/g point. Additionally, for some reason excel also cannot return large sections of the T-D or P-D plots between 250-700kg/m3. However, I'm unsure if problems are related. Please see additional information + attached excel file below.

Steps to Reproduce

  1. Using the refprop excel formula: '''=@RefProp("T","R513a","HD","SI with C",245,257,0)'''

**Expected behavior: returns "20.978" (°C) ** as per using the point lookup facility in REFPROP, and which seems reasonable

image

**Actual behavior: returns "#[DHFLSH error 4] One or more inputs are out of range; Pressure below zero: P = -22.8283 MPa." **

Versions

REFPROP Version: 10
Operating System and Version: Windows 10 Enterprise
**Access Method: Excel (formula wizard) **

Additional Information

(also see attached excel file: R513a data error query.xlsx)

To try to find the problem, I have used excel to plot Temperature vs Density for different Enthalpies - there seems to be a data point error at ~200kg/m3, 30°C, 270j/g point. Also, the results between 250-700kg/m3 are somewhat random - sometimes errors come up and sometimes erroneous results come back.

image

There seem to be similar issues with the Pressure vs Density graphs. The data point error persists - see the odd data point in the Refprop plot on the 30°C line at around 140kg/m3:

image

@ianhbell
Copy link
Contributor

ianhbell commented Sep 20, 2021 via email

@gsavell121
Copy link
Author

Thanks for the quick help - I'll have a look at the reference states and see about calculating from other properties to begin with.

Presumably the the odd data point in the R513a data is a different issue, or could that be caused by the same thing?

@ianhbell
Copy link
Contributor

Let's first fix the reference state issues. I think that is 99% of it, then also you might need to enable the saturation splines in Excel: usnistgov/REFPROP-wrappers#106

@EricLemmon
Copy link
Collaborator

It could also be a bug that we fixed some time ago. If the reference state issue doesn't work, send Ian an email and he'll send you the beta version: Ian.Bell@nist.gov

@gsavell121
Copy link
Author

Enabling saturation splines in Excel seems to have fixed most of the issue. I now get nice complete curves on the graphs and the formulas return sensible numbers - with the exception of one strange missing data point, now at around 300kg/m3:

image

@gsavell121
Copy link
Author

Regarding refence states, I haven't been able to figure out the correct changes in the VBA - I must be missing something because Excel is stubbornly returning the same results what ever settings I put in. If you can spot my issue I'd appreciate it! Thanks.

The steps I have followed are:

  1. Set i = 1 rather than 2:
    image

  2. Uncommented the 3 lines, and changed the option to 'ASH' for example:
    image

  3. Saved, closed, and restarted Excel

  4. Verified that the VBA changes persisted and that the addin is still looking at this copy of the .xla

  5. Recalculated the formula

@EricLemmon
Copy link
Collaborator

Have you tried the beta version yet? I believe this is fixed with that version. There is also an alpha version that could be tried if the beta fails.

@EricLemmon
Copy link
Collaborator

Has this issue been resolved?

@gsavell121
Copy link
Author

Hi Eric - not really, sorry. I've tried the Beta version, and I'm still having problems with both the strange data point in R513a and changing the reference states in Excel.

@EricLemmon
Copy link
Collaborator

I've lost your email address, can you send it again to eric.lemmon@nist.gov

@ianhbell ianhbell closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants