-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New functions molar_density and mass_density added #30
Conversation
Update methods.jl
added functions for molar densities and mass densities
Upstream changes
Added unitful functions for mass density and molar density
added test cases for molar_density and mass_density functions
Hi Ramesh, Thanks a lot for this! We agree that densities would certainly a useful property to support (we have a long list of properties we want to support and just need to get around to it...). However, you have also pointed out something we hadn't considered: supporting both mass and molar basis properties. A simple solution could be just to do as you did and simply have molar_property and mass_property functions. We do wonder if there isn't a cleaner way to do this? One suggestion is something like: Cheers, Pierre |
We probably need to pass in the model struct directly to the function to allow it to access the molar mass. It would probably have to be something like
Not sure if it’s an elegant-enough solution though. But mass and molar densities are extremely common, and they’re some of the few intensive properties that we could support (the rest are mostly extensive). I think I’m personally fine with accepting this PR for these two properties. |
In that case we'll merge then. I'll move the tests into the main methods_test file later on. We can sort out the molar and mass basis issue later on. |
Hi @pw0908,
I have added new functions molar_density and mass_density and the corresponding unitful versions as well. I found that having functions which calculate densities to be quite handy based on my experience at work using other GERG2008 (fortran and C++) implementations. I have added a self contained test set for these functions.
Please see if it fits into the upstream code base and can be merged. I will be glad if these changes could get in.
Please let me know if you have any comments.
Regards
Ramesh