Closed neuraldude closed 3 years ago
Thanks for contacting me. The issue is that the rankine demo code is very old and does not reflect updates to the way saturation properties are handled. I am in the process of updating the website now; this will be fixed.
In the meantime, if you remove "p=p1," from the argument list inside of the saturation enthalpy method call. The saturation methods only need temperature.
h1, h5 = steam.hs(T=T1)
From: neuraldude @.> Sent: Friday, September 17, 2021 2:10 PM To: chmarti1/PYroMat @.> Cc: Subscribed @.***> Subject: [chmarti1/PYroMat] running the rankine.py demo (#16)
I've pip installed PYroMat 2.1.3, but can't get to run the rankine cycle demo at http://www.pyromat.org/src/rankine.pyhttps://nam10.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pyromat.org%2Fsrc%2Frankine.py&data=04%7C01%7Ccrm28%40psu.edu%7Ceda7f25cc6fd430eaa0808d97a0662a7%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637674990106551719%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=CIQzQTYSjc7bDDlqL3UKt5SU2nrCYJBe6vuQar6NORE%3D&reserved=0 . I get the error
'pyromat.utility.PMParamError: Saturation temperature and pressure cannot be simultaneously specified'
and it seems to have something to do with the line
h1,h5 = steam.hs(p=p1,T=T1) # these are faster with T and p
in the file.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchmarti1%2FPYroMat%2Fissues%2F16&data=04%7C01%7Ccrm28%40psu.edu%7Ceda7f25cc6fd430eaa0808d97a0662a7%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637674990106551719%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=ipySq3Dne6eIgBh2fThpZtRRdhBl3ie15mcQpCn1zvg%3D&reserved=0, or unsubscribehttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAEVXQ4V32IDPHN7RURJD3DDUCOAABANCNFSM5EICJAHQ&data=04%7C01%7Ccrm28%40psu.edu%7Ceda7f25cc6fd430eaa0808d97a0662a7%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637674990106561713%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=8gfgk0A%2BpMkqMQmtEqOv8rBa9DsvQAewqo2gKJ83Md4%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Ccrm28%40psu.edu%7Ceda7f25cc6fd430eaa0808d97a0662a7%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637674990106561713%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=6nZlZCyo4L18RuGztthWsn6cuWeDYpdJz78DXTL%2FVEg%3D&reserved=0 or Androidhttps://nam10.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Ccrm28%40psu.edu%7Ceda7f25cc6fd430eaa0808d97a0662a7%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C637674990106571707%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=oqllmstHQ1WegJn4txxeUNqYNGVymjTwZtwWSWURt3E%3D&reserved=0.
Now let me give a more detailed reply...
The old "if97" multi-phase steam class used a piecewise temperature-pressure formulation for properties. Of course, specifying either temperature OR pressure along the saturation line is enough to specify the state, but the property methods required both, so the saturation property methods would have to calculate whichever of the two was missing. That meant it was faster to supply both at a time if you happened to already know them.
That all changed with the migration to the "mp1" class, back in version 2.0.7. Now, the back-end uses a much more robust (if lest convenient for engineering purposes) temperature, pressure formulation. Now, specifying either temperature or pressure will do. Specifying both does not help at all. In either case, density will need to be calculated, but that is computationally cheap, so it is no longer worth it to worry about it.
This is not technically an issue with the software, but I'm going to leave the issue open until the website has been updated. That is scheduled for the coming weeks. It won't be ready until I've validated some other aspects of the update. Thanks again for raising the issue!
The new website includes updated example codes. These out-dated lines have been fixed.
I've pip installed PYroMat 2.1.3, but can't get to run the rankine cycle demo at http://www.pyromat.org/src/rankine.py . I get the error
'pyromat.utility.PMParamError: Saturation temperature and pressure cannot be simultaneously specified'
and it seems to have something to do with the line
h1,h5 = steam.hs(p=p1,T=T1) # these are faster with T and p
in the file.