GAS_CONSTANT giving varying values.

161 views
Skip to first unread message

Chandradhar Koneti

unread,
Sep 27, 2022, 6:53:01 AM9/27/22
to coolprop-users
Hello everyone,

As far as I remember thermodynamics, GAS_Constant is Universal Gas constant. It does not change. The specific gas constant changes based on the molar mass of the gas.

R_sp = R_u / M

Then why is it that CoolProp is giving different(not by much, 4th decimal onwards there are changes) values for Gas constant??

Upto 8.314 everything is the same but after that, they change. The change is negligible for all intents and purposes. I agree. I was just curious as to why that was happening.

Is it something to do with the inner workings of CoolProp or am I missing something fundamental?

I tried the following code:
```
import CoolProp
import CoolProp.CoolProp as cp
si = cp.PropsSI

list_gases = ['R11', 'R113', 'R114', 'R115', 'R116', 'R12', 'R123', 'R1233zd(E)', 'R1234yf', 'R1234ze(E)', 'R1234ze(Z)', 'R124', 'R1243zf', 'R125', 'R13', 'R134a', 'R13I1', 'R14', 'R141b', 'R142b', 'R143a', 'R152A', 'R161', 'R21', 'R218', 'R22', 'R227EA', 'R23', 'R236EA', 'R236FA', 'R245ca', 'R245fa', 'R32', 'R365MFC', 'R40', 'R404A', 'R407C', 'R41', 'R410A', 'R507A', 'Air', 'Argon', 'CarbonDioxide', 'CarbonMonoxide', 'Ethane', 'Fluorine', 'Helium', 'Hydrogen', 'Krypton', 'Methane', 'n-Butane', 'n-Decane', 'n-Dodecane', 'n-Heptane', 'n-Hexane', 'n-Nonane', 'n-Octane', 'n-Pentane', 'n-Propane', 'n-Undecane', 'Neon', 'Neopentane', 'Nitrogen', 'NitrousOxide', 'Oxygen']

for fluid in list_gases:
    print (str(fluid) + "\t\t:\t" + str(si("GAS_CONSTANT", fluid)) + "\n")
```


I got the following output:

R11                :    8.31451

R113            :    8.314471

R114            :    8.31451

R115            :    8.3144621

R116            :    8.314472

R12                :    8.314471

R123            :    8.31451

R1233zd(E)        :    8.3144621

R1234yf               :    8.314472

R1234ze(E)        :    8.314472

R1234ze(Z)        :    8.3144598

R124            :    8.314471

R1243zf            :    8.3144598

R125            :    8.314472

R13                :    8.31451

R134a            :    8.314471

R13I1            :    8.3144621

R14                :    8.31451

R141b            :    8.314472

R142b            :    8.314472

R143a            :    8.314472

R152A            :    8.314471

R161            :    8.314472

R21                :    8.31451

R218            :    8.314472

R22                :    8.31451

R227EA            :    8.3144621

R23                :    8.314472

R236EA            :    8.314472

R236FA            :    8.314472

R245ca            :    8.3144621

R245fa            :    8.3144621

R32                :    8.314471

R365MFC            :    8.3144621

R40                :    8.314472

R404A            :    8.314472

R407C            :    8.314472

R41                :    8.314472

R410A            :    8.314472

R507A            :    8.314472

Air                :    8.31451

Argon            :    8.31451

CarbonDioxide    :    8.31451

CarbonMonoxide    :    8.314472

Ethane            :    8.314472

Fluorine        :    8.31448

Helium            :    8.3144598

Hydrogen        :    8.314472

Krypton            :    8.314472

Methane            :    8.31451

n-Butane        :    8.314472

n-Decane        :    8.314472

n-Dodecane        :    8.314472

n-Heptane        :    8.31451

n-Hexane        :    8.3144598

n-Nonane        :    8.314472

n-Octane        :    8.3144598

n-Pentane        :    8.3144598

n-Propane        :    8.314472

n-Undecane        :    8.314472

Neon            :    8.3144598

Neopentane        :    8.314472

Nitrogen        :    8.31451

NitrousOxide    :    8.314472

Oxygen            :    8.31434

Martinus WERTS

unread,
Sep 27, 2022, 7:07:45 AM9/27/22
to coolpro...@googlegroups.com
Dear Chandradhar Koneti,

This is an interesting observation, even though the deviations are negligible in practice, as you point out.

To reassure you, there is only one universal gas constant R, which is the product of the Boltzmann constant (k_B) and the Avogadro constant (N_A). Since 2019, both  k_B and N_A have been attributed exact numerical values, and R has the exact numerical value of:

     8.31446261815324 J⋅K^−1⋅mol^−1

https://en.wikipedia.org/wiki/Gas_constant

I do not know why CoolProp reports different values for R, although I could think of certain scenarios where it would make sense, e.g. as a consistency check for the thermodynamic calculations.

Looking forward to learning more about this.

Best wishes
Martin
--
You received this message because you are subscribed to the Google Groups "coolprop-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/68a35919-97c3-416d-b3fd-de833e215dcdn%40googlegroups.com.

Matthis Thorade

unread,
Sep 27, 2022, 7:51:41 AM9/27/22
to coolprop-users
The background is nicely explained in this related RefProp ticket:

Martinus WERTS

unread,
Sep 28, 2022, 11:36:25 AM9/28/22
to coolpro...@googlegroups.com
This makes indeed for interesting reading from which we can appreciate the rich history of the equations of state that are being used by CoolProp. These EOS pre-date 2019 and were conceived at different times using the value of R that was accepted at that moment. (The value of R reported by CoolProp for a particular fluid EOS should then say something about the date that that EOS was established, shouldn't it?)

I am happy to have learned this.

Best wishes
Martin

Chandradhar Koneti

unread,
Sep 28, 2022, 12:01:41 PM9/28/22
to coolpro...@googlegroups.com
That was a very interesting read.
It does clarify some stuff.

Thanks for sharing 🙂

You received this message because you are subscribed to a topic in the Google Groups "coolprop-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/coolprop-users/uuKzTxsv4Ps/unsubscribe.
To unsubscribe from this group and all its topics, send an email to coolprop-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/coolprop-users/b93df438-d549-414b-91d6-e801be73f29bn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages