Code Monkey home page Code Monkey logo

Comments (3)

tkeskita avatar tkeskita commented on August 22, 2024

Hi, can you share your AGA8 Fortran code? Are you sure its giving you the residual properties?

from phasepy.

gustavochm avatar gustavochm commented on August 22, 2024

Hi!

Thanks for you interest in Phasepy.

The thermal derivatives properties (Entropy, Enthalpy, Cv, Cp and speed of sound) were just added recently to the package. After this enquiry I checked the functions and there is no bug in the functions (the relations are correctly coded). I used the following expressions:

thermal derivatives

There are several reasons that could explain the differences between the AGA8 package.

  • In phasepy the thermal derivatives of the Helmholtz free energy are computed numerically (I tried different steps at your code and this didn't changed the results)
  • Could you please confirm that the reported values from the Entropy and Enthalpy from AGA8 are computed in the (T,P,N) ensemble and that the reported value is the residual one.
  • For the heat capacities it is my belief that the AGA8 package might be returning the total heat capacities (residual + ideal). Consider that the ideal contribution takes the values reported for methane (CpId = 35.315 # J / mol K and CvId = CpId - r # J / mol K, obtained from DIPPR 801), then the computed total isochoric and isobaric heat capacities are 27.01 and 35.46 J/mol K , respectively. Way closer to the reported values by AGA8. To complement this point, the reported isochoric and isobaric heat capacities on NIST for methane at 288K and 1 bar are 27.050 and 35.448 J / mol K.
  • For the speed of sound calculation, the result can change considerably by means of the ideal gas contribution (CvId, CpId). Better results of this contribution can be obtained from the DIPPR 801 correlation. For example, as your mixture is mostly methane its reported value could be used (CpId = 35.315 # J / mol K and CvId = CpId - r # J / mol K). With those values the computed speed of sound is 387.097 m/s. This result is closer to the reported by AGA8.

It would be interesting to compare the source codes of both implementations!

I hope this help!

from phasepy.

infinity77 avatar infinity77 commented on August 22, 2024

Hi,

you are indeed correct and the AGA8 code is not reporting residual properties, I completely missed it from looking at the code.

the AGA8 implementation (at least for simple stuff) is public domain and you can find it here in 4 different languages:

https://github.com/usnistgov/AGA8

from phasepy.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.