Skip to content

Commit

Permalink
fixed error in calculation of temperature gradient and created first …
Browse files Browse the repository at this point in the history
…example.
  • Loading branch information
FedericoTartarini committed Feb 21, 2020
1 parent d33e11c commit 98bdba8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
21 changes: 21 additions & 0 deletions examples/calc_pmv_ppd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pythermalcomfort.models import pmv_ppd
from pythermalcomfort.psychrometrics import v_relative

# measured air velocity
v = 0.1

v_r = v_relative(v=v, met=1.4)
print(v_r)

# calculate PMV in accordance with the ASHRAE 55 2017
results = pmv_ppd(ta=27, tr=25, vr=v_r, rh=50, met=1.2, clo=0.5, wme=0, standard="ISO")

# print the results
print(results)

# print PMV value
print(results['pmv'])

# for users who wants to use the IP system
results_ip = pmv_ppd(ta=77, tr=77, vr=0.4, rh=50, met=1.2, clo=0.5, units="IP")
print(results_ip)
7 changes: 2 additions & 5 deletions src/pythermalcomfort/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def pmv_ppd(ta, tr, vr, rh, met, clo, wme=0, standard='ISO', units='SI'):
Raised if the number of iterations exceeds the threshold
ValueError
The 'standard' function input parameter can only be 'ISO' or 'ASHRAE'
Args:
units:
"""
if units.lower() == 'ip':
ta, tr, vr = units_converter(ta=ta, tr=tr, v=vr)
Expand Down Expand Up @@ -1068,7 +1065,7 @@ def vertical_tmp_grad_ppd(ta, tr, vr, rh, met, clo, vertical_tmp_grad, units='SI
clo : float
clothing insulation, [clo]
vertical_tmp_grad : float
vertical temperature gradient between the feet and the head, default in [°C] in [°F] if `units` = 'IP'
vertical temperature gradient between the feet and the head, default in [°C/m] in [°F/ft] if `units` = 'IP'
units: str (default="SI")
select the SI (International System of Units) or the IP (Imperial Units) system.
Expand All @@ -1090,7 +1087,7 @@ def vertical_tmp_grad_ppd(ta, tr, vr, rh, met, clo, vertical_tmp_grad, units='SI
"""
if units.lower() == 'ip':
ta, tr, vr = units_converter(ta=ta, tr=tr, v=vr)
vertical_tmp_grad *= 1.8
vertical_tmp_grad = vertical_tmp_grad / 1.8 * 3.28

check_standard_compliance(standard='ashrae', ta=ta, tr=tr, v_limited=vr, rh=rh, met=met, clo=clo)

Expand Down

0 comments on commit 98bdba8

Please sign in to comment.