psychrometrics / psychrolib

📚 Library of psychrometric functions to calculate 🌡️ thermodynamic properties of air for Python, C, C#, Fortran, R, JavaScript and VBA/Excel
MIT License
222 stars 60 forks source link

Structure, docs and tests #3

Closed dmey closed 6 years ago

dmey commented 7 years ago

I will be making structural changes and produce documentation for the Fortran (to start with) code. I will be doing this in branches but I wanted to ask you if you are happy for me to send you pull requests for every major change. I will also be adding some tests using the functions inside Energy Plus as a benchmark for your/our implementations so that they can be checked and evaluated against a well know implementation. Are you happy with this as well and will you be looking to merge all this? Thanks

didierthevenard commented 7 years ago

Thanks for your comments and contributions. Please give me a few days to look them over and I will get back to you.

dmey commented 7 years ago

Sure, thanks.

didierthevenard commented 7 years ago

Hi, I have been looking at the changes you propose (sorry for the delay) and I agree with most of them, thanks for taking the time to rework the directory structure, cleaning the readme file, and fixing the encoding of the files. A few comments regarding the Fortran version.

  1. First I agree with you that there is an issue with the units in the calculation of dry air density and dry air volume in the C++ and other versions. However I don't think that the right approach is to change the molar mass of air to g/mol instead of kg/mol. In the library so far all the mass quantities have been expressed in kg so I suggest that it should stay that way. I think the error in the code is simply a factor 1000 in the GetDryAirDensity and GetDryAirVolume functions. Once this is removed the functions should work better. I think this is something you had suggested in your previous post. I will need to propagate that fix to all other languages.
  2. I didn't quite understand your comment about enthalpies being in kJ/kg in the current version of the library. From the code I looked at it all seems to be in J/kg. If you remove the KILO from GetDryAirEnthalpy you will actually end up expressing the enthalpy in kJ/kg, not J/kg. Compare to GeMoistAirEnthalpy in which you can set HumRatio to zero to get the same result.
  3. I have fixed a few of the comments and a couple of minor naming issues in your code, please see the attached and let me know if you agree with the changes I suggest and I will proceed with the merge.
  4. Thanks for the enthalpy functions (which I reviewed) and the heat capacity function (which I have not reviewed). At some point in the future I may translate those to other languages.
  5. Tests against EnergyPlus - feel free to go ahead, however I am not sure that it will be very conclusive because the formulae used by EnergyPlus may be different from those in the ASHRAE Handbook. Best regards and thanks again for your work.

Psychrometrics_SI.f90.txt

dmey commented 6 years ago

Thanks for this, I am going to close this. Please see: #2