Psychrometrics

A toolbox for air-water vapor psychrometrics for Julia

https://github.com/aumpierre-unb/psychrometrics.jl

Science Score: 41.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 5 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.6%) to scientific vocabulary

Keywords

chemical-engineering psychrometrics unit-operation
Last synced: 6 months ago · JSON representation ·

Repository

A toolbox for air-water vapor psychrometrics for Julia

Basic Info
  • Host: GitHub
  • Owner: aumpierre-unb
  • License: mit
  • Language: Julia
  • Default Branch: main
  • Homepage:
  • Size: 791 KB
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 5
Topics
chemical-engineering psychrometrics unit-operation
Created about 3 years ago · Last pushed 11 months ago
Metadata Files
Readme License Citation

README.md

Psychrometrics.jl

DOI License: MIT version pkgeval

Installing and Loading Psychrometrics

Psychrometrics can be installed and loaded either from the JuliaHub repository (last released version) or from the maintainer's repository.

Last Released Version

The last version of Psychrometrics can be installed from JuliaHub repository:

julia using Pkg Pkg.add("Psychrometrics") using Psychrometrics

If Psychrometrics is already installed, it can be updated:

julia using Pkg Pkg.update("Psychrometrics") using Psychrometrics

Pre-Release (Under Construction) Version

The pre-release (under construction) version of Psychrometrics can be installed from the maintainer's repository.

julia using Pkg Pkg.add(path="https://github.com/aumpierre-unb/Psychrometrics.jl") using Psychrometrics

Citation of Psychrometrics

You can cite all versions (both released and pre-released), by using 10.5281/zenodo.7493474.

This DOI represents all versions, and will always resolve to the latest one.

For citation of the last released version of Psychrometrics, please check CITATION file at the maintainer's repository.

The Psychrometrics Module for Julia

Psychrometrics provides a set of functions to compute the various variables related to water vapor humid air, providing the following functions:

  • psychro
  • humidity
  • satPress
  • enthalpy
  • volume
  • adiabSat
  • dewTemp
  • doPlot

psychro

psychro computes

  • the dry bulb temperature,
  • the wet bulb temperature,
  • the dew point temperature,
  • the adiabatic saturation temperature,
  • the humidity,
  • the saturation humidity,
  • the saturation humidity at wet bulb temperature,
  • the adiabatic saturation humidity,
  • the relative humidity,
  • the specific enthalpy,
  • the specific volume,
  • the density,
  • the water vapor pressure,
  • the saturation pressure and
  • the saturation pressure at wet bulb temperature.

given any two of the following parameters:

  • the dry bulb temperature,
  • the wet bulb temperature,
  • the dew point temperature,
  • the humidity,
  • the specific enthalpy,
  • the specific volume and
  • the relative humidity,

except for the combination of humidity and dew point temperature, which are not mutually independent.

If a different number of parameters is given, execution will be aborted.

If fig = true is given a schematic psychrometric chart is plotted as a graphical representation of the solution.

By default, psychro plots a schematic psychrometric chart with the solution (fig = true) with white background (back = :white). If fig = false is given, plot is omitted.

Syntax:

julia psychro(; Tdry::Number=NaN, # dry bulb temperature Twet::Number=NaN, # wet bulb temperature Tdew::Number=NaN, # dew bulb temperature W::Number=NaN, # absolute humidity φ::Number=NaN, # relative humidity h::Number=NaN, # specific enthalpy v::Number=NaN, # specific volume fig::Bool=false, # show/omit chart back::Symbol=:white, # plot background color unit::Symbol=:K # units for temperature (:K or :°C) )::HumidAir

Examples:

Compute the dry bulb temperature, the wet bulb temperature, the dew point temperature, the adiabatic saturation temperature, the humidity, the saturation humidity, the saturation humidity at wet bulb temperature, the adiabatic saturation humidity, the relative humidity, the specific enthalpy, the specific volume, the density, the water vapor pressure, the saturation pressure, the saturation pressure at wet bulb temperature given the dew point temperature is 22 °C and the relative humidity is 29 %.

julia humidAir = psychro( # all results ordered in one tuple Tdew=22 + 273.15, # dew temperature in K φ=0.29, # relative humidity fig=true # show plot ) humidAir.φ # relative humidity humidAir.Tdry # dry bulb temperature humidAir.Twet # wet bulb temperature

Compute the dry bulb temperature, the wet bulb temperature, the dew point temperature, the adiabatic saturation temperature, the humidity, the saturation humidity, the saturation humidity at wet bulb temperature, the adiabatic saturation humidity, the relative humidity, the specific enthalpy, the specific volume, the density, the water vapor pressure, the saturation pressure, the saturation pressure at wet bulb temperature given the specific enthalpy is 79.5 kJ/kg and the relative humidity is 0.29 # and plot a graphical representation of the answer in a schematic psychrometric chart.

julia psychro( h=79.5e3, # specific enthalpy in kJ/kg of dry air φ=0.29, # relative humidity fig=true, # show plot back=:transparent, # plot background transparent unit=:°C # temperature in °C )

8.5 cubic meters of humid air at dry bulb temperature of 293 K and wet bulb temperature of 288 K is subjected to two cycles of heating to 323 and adiabatic saturation. Compute the energy and water vapor demands. Assume the amount of dry air is constant.

julia state1 = psychro( # initial condition Tdry=293, Twet=288, fig=true ) sleep(3) state2 = psychro( # thermodynamic state after the firstheating is Tdry=323, W=state1.W, fig=true ) sleep(3) begin # thermodynamic state the after first adiabatic saturation local Tdry, W = adiabSat( state2.h, fig=true ) state3 = psychro( Tdry=Tdry, W=W, fig=true ) end sleep(3) state4 = psychro( # thermodynamic state after the second heating Tdry=323, W=state3.W, fig=true ) sleep(3) begin # thermodynamic state the after second adiabatic saturation local Tdry, W = adiabSat( state4.h, fig=true ) state5 = psychro( Tdry=Tdry, W=W, fig=true ) end sleep(3) begin # energy demand local V = 8.5 # initial volume of humid air is (state5.h - state1.h) * (V / state1.v) end begin # water vapor demand local V = 8.5 # initial volume of humid air is (state5.W - state1.W) * (V / state1.v) end try # PrettyTables is not included in Psychrometrics! using PrettyTables local table = [name for name in fieldnames(Psychrometrics.HumidAir)] for i in (state1, state2, state3, state4, state5) table = [table [getfield(i, field) for field in 1:nfields(i)]] end local header = [ "Parameter", "State 1", "State 2", "State 3", "State 4", "State 5" ] print( "\nSummary of process states:\n" ) pretty_table(table, header=header) catch end

humidity

humidity computes the humidity W (in kg/kg of dry air) of humid air given the water vapor pressure pw (in Pa) and the total pressure p (in Pa).

By default, total pressure is assumed to be the atmospheric pressure at sea level, p = 101325.

Syntax:

julia humidity( # humidity in kg/kg of dry air pw::Number, # water vapor pressure in Pa p::Number=101325 # total pressure in Pa )

Examples:

Compute the humidity of humid air at atmospheric pressure given water vapor pressure is 1 kPa at 1 atm total pressure.

julia humidity( # humidity in kg/kg of dry air 1e3 # water vapor pressure in Pa )

Compute the humidity of humid air at atmospheric pressure given dry bulb temperature is 305 K and relative humidiy is 50 % at 101325 Pa total pressure.

julia state = psychro( Tdry=305., # dry bulb temperature φ=0.50 # relative humidity ); state.W # absolute humidity calculated by psychro pw = state.φ * state.psat # water vapor pressure, by definition W = humidity(pw) # absolute humidity calculated by humidity W = 0.621945 * pw / (101325 - pw) # absolute humidity, by definition

Compute the humidity of humid air at atmospheric pressure given water vapor pressure is 1 kPa at 10 atm total pressure.

julia humidity( # humidity in kg/kg of dry air 1e3, # water vapor pressure in Pa 101325e1 # total pressure in Pa )

satPress

satPress computes the saturation pressure psat (in pa) of humid air given the dry bulb temperature Tdry (in K).

Syntax:

julia satPress( # saturation pressure in Pa Tdry::Number # dry bulb temperature in K )

Examples:

Compute the saturation pressure given the dry bulb temperature is 25 °C.

julia satPress( # saturation pressure in Pa 25 + 273.15; # dry bulb temperature in K )

enthalpy

enthalpy computes the specific enthalpy h (in J/kg of dry air) of humid air given the dry bulb temperature Tdry (in K) and the humidity W (in kg/kg of dry air).

Syntax:

julia enthalpy( # specific enthalpy in kJ/kg of dry air Tdry::Number, # dry bulb temperature in K W::Number # humidity in kg/kg of dry air )

Examples:

Compute the specific enthalpy given the dry bulb temperature is 25 °C and the humidity is 7 g/kg of dry air.

julia enthalpy( # specific enthalpy in J/kg of dry air 25 + 273.15, # dry bulb temperature in K 7e-3 # humidity in kg/kg of dry air )

volume

volume computes the specific volume v (in cu. m/kg of dry air) of humid air given the dry bulb temperature Tdry (in K), the humidity W (in kg/kg of dry air) and the total pressure p (in Pa).

By default, total pressure is assumed to be the atmospheric pressure at sea level, p = 101325.

Syntax:

julia volume( # specific enthalpy in J/kg of dry air Tdry::Number, # dry bulb temperature in K W::Number, # humidity in kg/kg of dry air p::Number=101325 # total pressure in Pa )

Examples:

Compute the specific volume given the dry bulb temperature is 25 °C and the humidity is 7 g/kg of dry air at 1 atm total pressure.

julia volume( # specific volume in cu. m/kg of dry air 25 + 273.15, # dry bulb temperature in K 7e-3 # humidity in kg/kg of dry air )

adiabSat

adiabSat computes the adiabatic saturation temperature Tadiab (in K) and the adiabatic saturation humidity Wadiab (in Kg/kg of dry air) given the specific enthalpy h (in J/kg of dry air).

If fig = true is given, a schematic psychrometric chart is plotted as a graphical representation of the solution.

Syntax:

julia adiabSat( # adiabatic saturation temperature in K h::Number; # specific enthalpy in J/kg of dry air fig::Bool=false, # show/omit chart back::Symbol=:white, # plot background color unit::Symbol=:K # units for temperature (:K or :°C) )

Examples:

Compute the adiabatic saturation temperature given the specific enthalpy is 82.4 kJ/kg of dry air and plot a graphical representation of the answer in a schematic psychrometric chart.

julia adiabSat( 82.4e3, # specific enthalpy in J/kg of dry air fig=true # show plot )

dewTemp

dewTemp computes the dew point temperature Tdew (in K) of humid air given the water vapor pressure pw (in Pa).

Syntax:

julia dewTemp( # dew point temperature in K pw::Number # water vapor pressure in Pa )

Examples:

Compute the dew temperature of humid air given the water vapor pressure is 1 kPa.

julia dewTemp( # dew temperature in K 1e3 # water vapor pressure in Pa )

doPlot

doPlot plots a schematic psychrometric chart.

Syntax:

julia doPlot(; back::Symbol=:white, unit::Symbol=:°C )

Examples:

Build a schematic psychrometric chart with temperature in °C with transparent background and save figure as psychrometricChart_transparent.svg.

julia doPlot( back=:transparent, # plot background transparent unit=:°C # temperature in °C ) using Plots savefig("psychrometricChart_transparent.svg")

Reference

The theory and the adjusted equations used in this package were taken from the first chapter of the 2017 ASHRAE Handbook Fundamentals Systems - International Metric System, published by the American Society of Heating, Refrigerating and Air-Conditioning Engineers.

Acknowledgements

The author of Psychrometrics package acknowledges Professor Brent Stephens, Ph.D. from the Illinois Institute of Technology for kindly suggesting the source reference for equations used in this package.

See Also

McCabeThiele.jl, PonchonSavarit.jl, InternalFluidFlow.jl.

Copyright © 2022 2023 2024 Alexandre Umpierre

email: aumpierre@gmail.com

Owner

  • Name: Alexandre Umpierre
  • Login: aumpierre-unb
  • Kind: user
  • Location: Brasilia/Brazil

Chemical Engineering teacher at University of Brasilia

Citation (CITATION)

You can cite all versions (including pre-release version) by using the
DOI 10.5281/zenodo.7493474.
This DOI represents all versions, and will always resolve to the latest one.

To cite (and export citation for various formats)
the last released version, please check
https://zenodo.org/account/settings/github/repository/aumpierre-unb/Psychrometrics.jl.

GitHub Events

Total
  • Issues event: 4
  • Watch event: 2
  • Issue comment event: 6
  • Push event: 3
  • Gollum event: 2
Last Year
  • Issues event: 4
  • Watch event: 2
  • Issue comment event: 6
  • Push event: 3
  • Gollum event: 2

Committers

Last synced: about 2 years ago

All Time
  • Total Commits: 95
  • Total Committers: 3
  • Avg Commits per committer: 31.667
  • Development Distribution Score (DDS): 0.253
Past Year
  • Commits: 95
  • Committers: 3
  • Avg Commits per committer: 31.667
  • Development Distribution Score (DDS): 0.253
Top Committers
Name Email Commits
aumpierre-unb a****e@g****m 71
Alexandre Umpierre 1****b 23
Christian Ortbauer c****r@s****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 2
  • Total pull requests: 1
  • Average time to close issues: 18 days
  • Average time to close pull requests: about 7 hours
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 2.5
  • Average comments per pull request: 2.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: about 1 month
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 3.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • LotusField (1)
  • sashadim (1)
  • JuliaTagBot (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads: unknown
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 9
juliahub.com: Psychrometrics

A toolbox for air-water vapor psychrometrics for Julia

  • Versions: 9
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent repos count: 9.9%
Dependent packages count: 38.9%
Average: 40.1%
Forks count: 53.5%
Stargazers count: 58.1%
Last synced: 6 months ago