A swift package for calculating properties of moist air, as well as conversions for several different units of measure.
Psychrometrics are used by Heating Ventilation and Air Conditioning (HVAC) professionals and engineers, as well by scientests and metorologists. This package aims to provide the calculations used for psychrometric evaluation. Most of the psychrometric calculations are based off of ASHRAE - Fundamentals (2017).
Include in your project using swift package manager.
let package = Package(
...
dependencies: [
.package(url: "https://github.com/swift-psychrometrics/swift-psychrometrics.git", from: "0.1.0")
],
...
)
This package provides several libraries depending on your needs. There are basic units of measure that are convertible to other standard units of measure, including S.I. and I.P. units. As well as calculations for moist and dry air conditions, and a few calculations for water.
Most of the types this library provides support basic mathematical operations (addition, subtraction, multiplication, and division). These operations should for the most part be considered safe, however there is nothing that prevents a value to be operated on with a different unit of measure, which could lead to unexpected results. This library will try to do the right thing and convert the units of measure (taking the left hand side of an operation as precedence), but it is encouraged to operate on the underlying raw values of the type for less error-prone results.
The following units of measure are provided with the corresponding conversions.
Temperature:
Length:
Pressure:
Relative Humidity
The following calculations are currently provided. Most of these types are Numeric
and support arithmetic.
Some of these calculations do not yet support different units of measure.
Density:
Dew Point
Enthalpy
Grains of Moisture
Humidity Ratio
Partial Pressure (Vapor Pressure)
Pressure as function of Altitude
Relative Humidity
Saturation Pressure
Specific Heat (not yet Numeric
supporting):
Specific Humidity
Specific Volume
Temperature as a function of Altitude
Total Delivered Heat Quantity
Wet Bulb
The documentation is currently being worked on / improved with more examples.
You can view the current api documentation here
This project is licensed under the MIT License
Contributions are welcome. If errors are found please submit an issue or pull-request.
link |
Stars: 5 |
Last commit: 2 weeks ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics