From 0ed115246a707758c7b9197c27ed253442528df2 Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Fri, 24 Jan 2025 14:12:45 -0800 Subject: [PATCH] fix(simulation): Ensure direct-to-idf methods use EPW file water mains --- honeybee_energy/simulation/parameter.py | 15 ++---- honeybee_energy/simulation/sizing.py | 56 +++++++++++----------- tests/simulation_parameter_test.py | 2 - tests/simulation_shadowcalculation_test.py | 2 - tests/simulation_sizing_test.py | 4 +- 5 files changed, 32 insertions(+), 47 deletions(-) diff --git a/honeybee_energy/simulation/parameter.py b/honeybee_energy/simulation/parameter.py index 7fbb8c553..11aed3bec 100644 --- a/honeybee_energy/simulation/parameter.py +++ b/honeybee_energy/simulation/parameter.py @@ -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): diff --git a/honeybee_energy/simulation/sizing.py b/honeybee_energy/simulation/sizing.py index 7f58590b1..d16ce643c 100644 --- a/honeybee_energy/simulation/sizing.py +++ b/honeybee_energy/simulation/sizing.py @@ -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 @@ -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] diff --git a/tests/simulation_parameter_test.py b/tests/simulation_parameter_test.py index 053edd02a..b7ccfe8db 100644 --- a/tests/simulation_parameter_test.py +++ b/tests/simulation_parameter_test.py @@ -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.""" diff --git a/tests/simulation_shadowcalculation_test.py b/tests/simulation_shadowcalculation_test.py index 3a8554e9d..0377d404b 100644 --- a/tests/simulation_shadowcalculation_test.py +++ b/tests/simulation_shadowcalculation_test.py @@ -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.""" diff --git a/tests/simulation_sizing_test.py b/tests/simulation_sizing_test.py index fef74036d..3d6d44bc0 100644 --- a/tests/simulation_sizing_test.py +++ b/tests/simulation_sizing_test.py @@ -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