Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(simulation): Ensure direct-to-idf methods use EPW file water mains #1068

Merged
merged 1 commit into from
Jan 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 12 deletions honeybee_energy/simulation/parameter.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,18 +249,9 @@ def building_idf(self, identifier='Building'):

def water_mains_idf(self):
"""Get an IDF string for the water mains object."""
# TODO: Remove generation of mains temps from des days if bug is fixed in E+ 9.7
if len(self.sizing_parameter.design_days) > 0:
db_temps = [dday.dry_bulb_condition.dry_bulb_max
for dday in self.sizing_parameter.design_days]
avg_temp = (max(db_temps) + min(db_temps)) / 2
return generate_idf_string(
'Site:WaterMainsTemperature', ('Correlation', '', str(avg_temp), '4'),
('calculation method', 'schedule', 'average temp', 'delta temp'))
else:
return generate_idf_string(
'Site:WaterMainsTemperature', ('CorrelationFromWeatherFile',),
('calculation method',))
return generate_idf_string(
'Site:WaterMainsTemperature', ('CorrelationFromWeatherFile',),
('calculation method',))

@classmethod
def from_idf(cls, idf_string):
Expand Down
56 changes: 28 additions & 28 deletions honeybee_energy/simulation/sizing.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class SizingParameter(object):
* QuickServiceRestaurant
* Laboratory
* Courthouse

bypass_efficiency_sizing: A boolean to indicate whether the efficiency
standard should trigger an sizing run that sets the efficiencies
standard should trigger a sizing run that sets the efficiencies
of all HVAC equipment in the Model (False) or the standard should
only be written into the OSM and the sizing run should be
bypassed (True). Bypassing the sizing run is useful when you only
Expand Down Expand Up @@ -432,32 +432,32 @@ def to_idf(self):
.. code-block:: shell

SizingPeriod:DesignDay,
NAS.Jacksonville-Towers.Field Ann Htg 99.6% Condns DB, !- Name
1, !- Month
21, !- Day of Month
WinterDesignDay, !- Day Type
1.3, !- Max Dry-Bulb Temp {C}
0.0, !- Daily Dry-Bulb Temp Range {C}
DefaultMultipliers, !- Dry-Bulb Temp Range Modifier Type
, !- Dry-Bulb Temp Range Modifier Schedule Name
Wetbulb, !- Humidity Condition Type
1.3, !- Wetbulb/Dewpoint at Max Dry-Bulb {C}
, !- Humidity Indicating Day Schedule Name
, !- Humidity Ratio at Maximum Dry-Bulb {kgWater/kgDryAir}
, !- Enthalpy at Maximum Dry-Bulb {J/kg}
, !- Daily Wet-Bulb Temperature Range {deltaC}
101252.0, !- Barometric Pressure {Pa}
4.3, !- Wind Speed {m/s}
320.0, !- Wind Direction {Degrees; N=0, S=180}
No, !- Rain {Yes/No}
No, !- Snow on ground {Yes/No}
No, !- Daylight Savings Time Indicator {Yes/No}
ASHRAEClearSky, !- Solar Model Indicator
, !- Beam Solar Day Schedule Name
, !- Diffuse Solar Day Schedule Name
, !- ASHRAE Clear Sky Beam Optical Depth (taub)
, !- ASHRAE Clear Sky Diffuse Optical Depth (taud)
0.0; !- Clearness (0.0 to 1.2)
Jacksonville Ann Htg 99.6% Condns DB, !- Name
1, !- Month
21, !- Day of Month
WinterDesignDay, !- Day Type
1.3, !- Max Dry-Bulb Temp {C}
0.0, !- Daily Dry-Bulb Temp Range {C}
DefaultMultipliers, !- Dry-Bulb Temp Range Modifier Type
, !- Dry-Bulb Temp Range Modifier Schedule Name
Wetbulb, !- Humidity Condition Type
1.3, !- Wetbulb/Dewpoint at Max Dry-Bulb {C}
, !- Humidity Indicating Day Schedule Name
, !- Humidity Ratio at Max Dry-Bulb {kgWater/kgDryAir}
, !- Enthalpy at Maximum Dry-Bulb {J/kg}
, !- Daily Wet-Bulb Temperature Range {deltaC}
101252.0, !- Barometric Pressure {Pa}
4.3, !- Wind Speed {m/s}
320.0, !- Wind Direction {Degrees; N=0, S=180}
No, !- Rain {Yes/No}
No, !- Snow on ground {Yes/No}
No, !- Daylight Savings Time Indicator {Yes/No}
ASHRAEClearSky, !- Solar Model Indicator
, !- Beam Solar Day Schedule Name
, !- Diffuse Solar Day Schedule Name
, !- ASHRAE Clear Sky Beam Optical Depth (taub)
, !- ASHRAE Clear Sky Diffuse Optical Depth (taud)
0.0; !- Clearness (0.0 to 1.2)
"""
# process the design_days
design_days = [dday.to_idf() for dday in self.design_days]
Expand Down
2 changes: 0 additions & 2 deletions tests/simulation_parameter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from ladybug_geometry.geometry2d.pointvector import Vector2D
from ladybug.dt import Date

import pytest


def test_simulation_parameter_init():
"""Test the initialization of SimulationParameter and basic properties."""
Expand Down
2 changes: 0 additions & 2 deletions tests/simulation_shadowcalculation_test.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# coding=utf-8
from honeybee_energy.simulation.shadowcalculation import ShadowCalculation

import pytest


def test_shadow_calculation_init():
"""Test the initialization of ShadowCalculation and basic properties."""
Expand Down
4 changes: 1 addition & 3 deletions tests/simulation_sizing_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
from ladybug.ddy import DDY
from ladybug.designday import DesignDay

import pytest


def test_sizing_parameter_init():
def test_sizing_parameter_init():
"""Test the initialization of SizingParameter and basic properties."""
sizing = SizingParameter()
str(sizing) # test the string representation
Expand Down
Loading