Skip to content

Commit

Permalink
fixed error adaptive ASHRAE
Browse files Browse the repository at this point in the history
  • Loading branch information
FedericoTartarini committed Apr 11, 2020
1 parent 8ad934a commit 4825645
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 6 additions & 0 deletions examples/calc_adaptive_ASHRAE.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from pythermalcomfort.models import adaptive_ashrae
from pprint import pprint

result = adaptive_ashrae(tdb=25, tr=25, t_running_mean=23, v=0.2)

pprint(result)
10 changes: 5 additions & 5 deletions src/pythermalcomfort/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def adaptive_ashrae(tdb, tr, t_running_mean, v, units='SI'):
# Figure out the relation between comfort and outdoor temperature depending on the level of conditioning.
t_cmf = 0.31 * t_running_mean + 17.8
tmp_cmf_80_low = t_cmf - 3.5
t_cmf_90_low = t_cmf - 2.5
tmp_cmf_90_low = t_cmf - 2.5
tmp_cmf_80_up = t_cmf + 3.5 + cooling_effect
tmp_cmf_90_up = t_cmf + 2.5 + cooling_effect

Expand All @@ -617,15 +617,15 @@ def acceptability(t_cmf_lower, t_cmf_upper):
return False

acceptability_80 = acceptability(tmp_cmf_80_low, tmp_cmf_80_up)
acceptability_90 = acceptability(t_cmf_90_low, t_cmf_90_low)
acceptability_90 = acceptability(tmp_cmf_90_low, tmp_cmf_90_up)

if units.lower() == 'ip':
t_cmf, tmp_cmf_80_low, tmp_cmf_80_up, t_cmf_90_low, tmp_cmf_90_up = units_converter(from_units='si', tmp_cmf=t_cmf, tmp_cmf_80_low=tmp_cmf_80_low,
tmp_cmf_80_up=tmp_cmf_80_up, tmp_cmf_90_low=t_cmf_90_low,
t_cmf, tmp_cmf_80_low, tmp_cmf_80_up, tmp_cmf_90_low, tmp_cmf_90_up = units_converter(from_units='si', tmp_cmf=t_cmf, tmp_cmf_80_low=tmp_cmf_80_low,
tmp_cmf_80_up=tmp_cmf_80_up, tmp_cmf_90_low=tmp_cmf_90_low,
tmp_cmf_90_up=tmp_cmf_90_up)

results = {'tmp_cmf': t_cmf, 'tmp_cmf_80_low': tmp_cmf_80_low, 'tmp_cmf_80_up': tmp_cmf_80_up,
'tmp_cmf_90_low': t_cmf_90_low, 'tmp_cmf_90_up': tmp_cmf_90_up,
'tmp_cmf_90_low': tmp_cmf_90_low, 'tmp_cmf_90_up': tmp_cmf_90_up,
'acceptability_80': acceptability_80, 'acceptability_90': acceptability_90, }

else:
Expand Down

0 comments on commit 4825645

Please sign in to comment.