Basic sample script to compare isothermal properties of Ammonia #153
-
Hi! https://colab.research.google.com/drive/1q5_LhMmJ4o5SdNyf0RRFquV4Coq4W4b7?usp=sharing But the results are not as expected. This is a code snippet that summarizes what I am trying: from thermopack.saftvrmie import saftvrmie
#Initialize for NH3
eos = saftvrmie('NH3')
enthalpy_vap_saft = eos.enthalpy(ref_temp, ref_press*1e6, [1], eos.VAPPH, dhdt=True) # Specific enthalpy (J/mol), and optionally differentials
print(enthalpy_vap_saft)
enthalpy_liq_saft = eos.enthalpy(ref_temp, ref_press*1e6, [1], eos.LIQPH, dhdt=True) # Specific enthalpy (J/mol), and optionally differentials Can you please help? |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
It is somewhat unclear from the code snippet here what output you are expecting, but the reference data used by ThermoPack is found here, and appears to be different from the reference used in the source you linked in the notebook. Any discrepancy in absolute value for the enthalpy between ThermoPack and the other values in your notebook likely come from the difference in reference state. |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for the quick response! Appreciated. I am trying to assess if ThermoPack provides similar values to the source linked in the Notebook, which i believe corresponds to the same source (NIST). The enthalpy values that I get are negative and I cannot make sense of the data. I was expecting to get a similar value for the same reference point. Perhaps this code snippet makes it a little bit clearer: from thermopack.saftvrmie import saftvrmie
#Initialize for NH3
eos = saftvrmie('NH3')
# Reference point extracted from NIST
ref_temp = 300 #300K
ref_press = 0.001 #0.001MPa
ref_enthalpy = 28.990 #28.990 KJ/mol
ref_phase = eos.VAPPH
enthalpy_vap_saft, = eos.enthalpy(ref_temp, ref_press*1e6, [1], eos.VAPPH) # Specific enthalpy (J/mol), and optionally differentials
# Value of enthalpy_vap_saft is -45875.93633017853
enthalpy_liq_saft = eos.enthalpy(ref_temp, ref_press*1e6, [1], eos.LIQPH) # Specific enthalpy (J/mol), and optionally differentials
print(enthalpy_vap_saft)
assert round(enthalpy_vap_saft/1000, 1) == round(ref_enthalpy, 1) |
Beta Was this translation helpful? Give feedback.
-
Ok, I understand. The difference you are seeing comes from the NIST webbook calculator using a different reference value / reference state than the recommended value used by ThermoPack. It is admittedly not entirely clear to me where the reference values in the NIST webbook calculator come from. In any case, unless you are interested in chemical reactions, the reference enthalpy is irrelevant, in which case you can compare values computed using NIST webbook and values from ThermoPack by
For the first case, when you compare enthalpy differences, the reference state cancels out, such that values computed from ThermoPack should coincide quite closely with the values from NIST webbook, given that you are using an appropriate EoS. For the second case, you can use
If you are interested in doing calculations for chemical reactions: I've double checked, and found that the absolute enthalpy of ammonia computed using ThermoPack coincides closely with reported enthalpies of formation here, here, here, and here, so I would trust the ThermoPack value to give reasonable reaction enthalpies, rather than the value from NIST webbook calculator (as mentioned, it is somewhat unclear to me where their reference value comes from). |
Beta Was this translation helpful? Give feedback.
-
@ffraile, I'm closing this as not-planned and moving the thread to the discussions page, as the question seems to have been cleared up, and to not be an issue with thermopack. Don't hesitate to post on the discussion if you have more questions :) |
Beta Was this translation helpful? Give feedback.
Ok, I understand. The difference you are seeing comes from the NIST webbook calculator using a different reference value / reference state than the recommended value used by ThermoPack. It is admittedly not entirely clear to me where the reference values in the NIST webbook calculator come from.
In any case, unless you are interested in chemical reactions, the reference enthalpy is irrelevant, in which case you can compare values computed using NIST webbook and values from ThermoPack by
For the first case, when you compare enthalpy differences,…