chmarti1 / PYroMat

PYroMat thermodynamic properties in Python
http://pyromat.org
Other
71 stars 13 forks source link

Problems with mp1.hsd #7

Closed jranalli closed 5 years ago

jranalli commented 5 years ago

These two calls produce different results for h (and s and d too). steam.h(p=400,x=0.25) and steam.hsd(p=400,x=0.25)

chmarti1 commented 5 years ago

Yup. It looks like HSD needs work. If I don't get to it today, I'll do it this weekend.

-

Chris


From: Joe Ranalli notifications@github.com Sent: Thursday, November 1, 2018 2:31:02 PM To: chmarti1/PYroMat Cc: Subscribed Subject: [chmarti1/PYroMat] Problems with mp1.hsd (#7)

These two calls produce different results for h (and s and d too). steam.h(p=400,x=0.25) and steam.hsd(p=400,x=0.25)

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchmarti1%2FPYroMat%2Fissues%2F7&data=02%7C01%7Ccrm28%40psu.edu%7C0b96809afd544a47423b08d64028324b%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636766938717591111&sdata=jkdVVf5OSHfTRdgzvcBRN7ULn8gcPzBpP0E%2BYqt9uIE%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FASt4ciTfalLIMnT0313Q1LDST3VnxnnAks5uqz3mgaJpZM4YIGg9&data=02%7C01%7Ccrm28%40psu.edu%7C0b96809afd544a47423b08d64028324b%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636766938717591111&sdata=Zgtb%2F22BL4ETQ%2FMma%2Be0aPW%2F%2Byv94Y%2F2OYvjARZOH%2BE%3D&reserved=0.

jranalli commented 5 years ago

There's an easy fix actually, which is to just pass along the calls to .h(), .s() and .d(), which appear to work fine. Might not be optimally efficient, but it does at least provide accurate results.

chmarti1 commented 5 years ago

I fixed the problem over the weekend. There was a = operator where there should have been +=. I also found a second bug that evades my memory.

As usual, your intuition is right; calling h, s, and d separately defies the purpose of hsd(). All of the computational complexity in the back end is tied up in calculating helholtz free energy and its derivatives. hsd() does that only once, where as the back-end work is repeated three times when h,s, and d are called individually.


From: Joe Ranalli notifications@github.com Sent: Friday, November 2, 2018 11:13:35 AM To: chmarti1/PYroMat Cc: Martin, Christopher Reed; Comment Subject: Re: [chmarti1/PYroMat] Problems with mp1.hsd (#7)

There's an easy fix actually, which is to just pass along the calls to .h(), .s() and .d(), which appear to work fine. Might not be optimally efficient, but it does at least provide accurate results.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fchmarti1%2FPYroMat%2Fissues%2F7%23issuecomment-435412611&data=02%7C01%7Ccrm28%40psu.edu%7Cc77f0f3e033d46dd2f0b08d640d5c462%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636767684201928463&sdata=3S%2FZ5KvwDLYEb%2BuNMrdNwoRwlBD3FVtl2CB%2F2Sv1SbU%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FASt4copJbQCO33xb0Z2ZJPDIfJ6-m-bTks5urGEfgaJpZM4YIGg9&data=02%7C01%7Ccrm28%40psu.edu%7Cc77f0f3e033d46dd2f0b08d640d5c462%7C7cf48d453ddb4389a9c1c115526eb52e%7C0%7C0%7C636767684201938459&sdata=MTjfEx5LcBpVWFi0Wzc3BnZj0Uwj0H8zMBpctdNmbyc%3D&reserved=0.

chmarti1 commented 5 years ago

Fixed.