Closed YifeiLu closed 3 years ago
Hi Yifei,
That's an interesting suggestion. I am not quite sure what you are suggesting - this correlation is for a sub-critical liquid; it doesn't make sense to use it when T is larger than Tc.
Changing an equation so it provides new answers in a region it was not designed for is always hard. The approach I had planned was to truncate T to Tc; avoiding the numerical issue. Do you have a plot of what the new results look like?
Sincerely, Caleb
Hi Caleb,
First of all thanks a lot for this tool, it really helps me a lot! For this commit I'm not suggesting anything related to the calculation method or thermodynamics, but to fix some warning caused by python. I always get the "runtimewarning" when I run my own code. Therefore I checked the code a little bit and found this problem. This shouldn't affect the result at all as I understood, it's just a reformatting of the code to avoid such warnings. I'm actually using thermo to calculate gas properties, but I still got these warnings. FYI, I used thermo to calculate the following gas mixture with a temperature of 288.15K and pressure ranges from 50 to 70 bar.
gas_comp = OrderedDict([('methane', 0.96522), ('nitrogen', 0.00259), ('carbon dioxide', 0.00596), ('ethane', 0.01819), ('propane', 0.0046), ('isobutane', 0.00098), ('butane', 0.00101), ('2-methylbutane', 0.00047), ('pentane', 0.00032), ('hexane', 0.00066)])
On Thu, Jul 16, 2020 at 1:58 AM Caleb Bell notifications@github.com wrote:
Hi Yifei,
That's an interesting suggestion. I am not quite sure what you are suggesting - this correlation is for a sub-critical liquid; it doesn't make sense to use it when T is larger than Tc.
Changing an equation so it provides new answers in a region it was not designed for is always hard. The approach I had planned was to truncate T to Tc; avoiding the numerical issue. Do you have a plot of what the new results look like?
Sincerely, Caleb
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/CalebBell/thermo/pull/54#issuecomment-659075600, or unsubscribe https://github.com/notifications/unsubscribe-auth/AC5CR7EY66DLTXDAERORT53R3Y7DXANCNFSM4O3ACVJQ .
Closing, this change made its way into the chemicals library, which thermo now uses.
"runtimewarning: invalid value encountered in double_scalars" caused by python calculation order, for example: