{"action":"created","issue":{"url":"https://api.github.com/repos/CoolProp/CoolProp/issues/1150","repository_url":"https://api.github.com/repos/CoolProp/CoolProp","labels_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/1150/labels{/name}","comments_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/1150/comments","events_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/1150/events","html_url":"https://github.com/CoolProp/CoolProp/issues/1150","id":165060981,"number":1150,"title":"IF97 backend: Wrong results for cvmass","user":{"login":"spinnau","id":2995937,"avatar_url":"https://avatars.githubusercontent.com/u/2995937?v=3","gravatar_id":"","url":"https://api.github.com/users/spinnau","html_url":"https://github.com/spinnau","followers_url":"https://api.github.com/users/spinnau/followers","following_url":"https://api.github.com/users/spinnau/following{/other_user}","gists_url":"https://api.github.com/users/spinnau/gists{/gist_id}","starred_url":"https://api.github.com/users/spinnau/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spinnau/subscriptions","organizations_url":"https://api.github.com/users/spinnau/orgs","repos_url":"https://api.github.com/users/spinnau/repos","events_url":"https://api.github.com/users/spinnau/events{/privacy}","received_events_url":"https://api.github.com/users/spinnau/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/CoolProp/CoolProp/milestones/14","html_url":"https://github.com/CoolProp/CoolProp/milestones/v6.0.1","labels_url":"https://api.github.com/repos/CoolProp/CoolProp/milestones/14/labels","id":1781005,"number":14,"title":"v6.0.1","description":"Patch with minor changes","creator":{"login":"ibell","id":1859947,"avatar_url":"https://avatars.githubusercontent.com/u/1859947?v=3","gravatar_id":"","url":"https://api.github.com/users/ibell","html_url":"https://github.com/ibell","followers_url":"https://api.github.com/users/ibell/followers","following_url":"https://api.github.com/users/ibell/following{/other_user}","gists_url":"https://api.github.com/users/ibell/gists{/gist_id}","starred_url":"https://api.github.com/users/ibell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ibell/subscriptions","organizations_url":"https://api.github.com/users/ibell/orgs","repos_url":"https://api.github.com/users/ibell/repos","events_url":"https://api.github.com/users/ibell/events{/privacy}","received_events_url":"https://api.github.com/users/ibell/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":40,"state":"open","created_at":"2016-05-22T10:55:15Z","updated_at":"2016-07-13T01:46:25Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2016-07-12T11:51:52Z","updated_at":"2016-07-13T13:08:18Z","closed_at":null,"body":"Using the IF97 backend in CoolProp 6.0.0 to calculate the specific isochoric heat gives wrong results:\r\n\r\n```python\r\n>>> PropsSI('Cvmass', 'T', 20+273.15, 'P', 1e5, 'IF97::water')\r\n3723.23084013141\r\n\r\n>>> PropsSI('Cvmass', 'T', 20+273.15, 'P', 1e5, 'HEOS::water')\r\n4156.68620992575\r\n```"},"comment":{"url":"https://api.github.com/repos/CoolProp/CoolProp/issues/comments/232349120","html_url":"https://github.com/CoolProp/CoolProp/issues/1150#issuecomment-232349120","issue_url":"https://api.github.com/repos/CoolProp/CoolProp/issues/1150","id":232349120,"user":{"login":"henningjp","id":17114032,"avatar_url":"https://avatars.githubusercontent.com/u/17114032?v=3","gravatar_id":"","url":"https://api.github.com/users/henningjp","html_url":"https://github.com/henningjp","followers_url":"https://api.github.com/users/henningjp/followers","following_url":"https://api.github.com/users/henningjp/following{/other_user}","gists_url":"https://api.github.com/users/henningjp/gists{/gist_id}","starred_url":"https://api.github.com/users/henningjp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henningjp/subscriptions","organizations_url":"https://api.github.com/users/henningjp/orgs","repos_url":"https://api.github.com/users/henningjp/repos","events_url":"https://api.github.com/users/henningjp/events{/privacy}","received_events_url":"https://api.github.com/users/henningjp/received_events","type":"User","site_admin":false},"created_at":"2016-07-13T13:08:18Z","updated_at":"2016-07-13T13:08:18Z","body":"Well, the IF97 docs don't list verification values for Cv; only Cp.  That's how it got missed.\r\n\r\nProblem only appears to be in **Region 1**.  The other regions check out against EOS and my own implementation of IF97.  I assume there are no typos in the coefficients, or the other functions would be hosed up in **Region 1** as well; has to be in the cvmass function.\r\n\r\nLooking at [http://www.iapws.org/relguide/IF97-Rev.pdf](http://www.iapws.org/relguide/IF97-Rev.pdf) , there is a residual term added to the evaluation of cpmass(T,P).  The CoolProp/IF97 code for **Region 1** is using the generic region function, however, and it subtracts the residual from cpmass(T,P).\r\n\r\n        double cvmass(double T, double p)\r\n        {\r\n            double tau = T_star/T, PI = p/p_star;\r\n            return cpmass(T,p) - R*pow(1 + PI*dgammar_dPI(T,p) - tau*PI*d2gammar_dPIdTAU(T,p),2)/(1-PI*PI*d2gammar_dPI2(T, p));\r\n        }\r\n\r\nActually, it looks like the generic template function is the **Region 2** formulation and **Region 1** is not over-riding the generic region equation.  I can't work on it until next week, but if you want to leave this open, I'll look into it, test it, and put in a PR."}}
{"actor":{"display_login":"henningjp"}}