From 517e887cde07a86cc937629f6c5a5d24d8920d0a Mon Sep 17 00:00:00 2001 From: Chris Mackey Date: Fri, 1 Dec 2023 18:51:56 -0800 Subject: [PATCH] fix(simulation): Process the unmet_setpoint_tolerance in SimulationPar --- .../_defaults/simulation-parameter.json | 97 ++++++++++++++++--- .../simulation/parameter_model.rb | 11 +++ 2 files changed, 95 insertions(+), 13 deletions(-) diff --git a/lib/honeybee/_defaults/simulation-parameter.json b/lib/honeybee/_defaults/simulation-parameter.json index 73badf0b..14a54fab 100644 --- a/lib/honeybee/_defaults/simulation-parameter.json +++ b/lib/honeybee/_defaults/simulation-parameter.json @@ -3,7 +3,7 @@ "servers": [], "info": { "description": "Honeybee simulation-parameter schema.", - "version": "1.40.0", + "version": "1.54.0", "title": "Honeybee Simulation Parameter Schema", "contact": { "name": "Ladybug Tools", @@ -44,6 +44,11 @@ "x-displayName": "CalculationUpdateMethod", "description": "\n" }, + { + "name": "climatezones_model", + "x-displayName": "ClimateZones", + "description": "\n" + }, { "name": "daylightsavingtime_model", "x-displayName": "DaylightSavingTime", @@ -69,6 +74,11 @@ "x-displayName": "DryBulbCondition", "description": "\n" }, + { + "name": "efficiencystandards_model", + "x-displayName": "EfficiencyStandards", + "description": "\n" + }, { "name": "humiditycondition_model", "x-displayName": "HumidityCondition", @@ -138,11 +148,13 @@ "ashraetau_model", "calculationmethod_model", "calculationupdatemethod_model", + "climatezones_model", "daylightsavingtime_model", "daysofweek_model", "designday_model", "designdaytypes_model", "drybulbcondition_model", + "efficiencystandards_model", "humiditycondition_model", "humiditytypes_model", "reportingfrequency_model", @@ -193,18 +205,6 @@ } ] }, - "include_sqlite": { - "title": "Include Sqlite", - "description": "Boolean to note whether a SQLite report should be requested from the simulation.", - "default": true, - "type": "boolean" - }, - "include_html": { - "title": "Include Html", - "description": "Boolean to note whether an HTML report should be requested from the simulation.", - "default": true, - "type": "boolean" - }, "outputs": { "title": "Outputs", "description": "A list of EnergyPlus output names as strings, which are requested from the simulation.", @@ -220,6 +220,15 @@ "items": { "type": "string" } + }, + "unmet_setpoint_tolerance": { + "title": "Unmet Setpoint Tolerance", + "description": "A number in degrees Celsius for the difference that the zone conditions must be from the thermostat setpoint in order for the setpoint to be considered unmet. This will affect how unmet hours are reported in the output. ASHRAE 90.1 uses a tolerance of 1.11C, which is equivalent to 1.8F.", + "default": 1.11, + "minimum": 0, + "maximum": 10, + "type": "number", + "format": "double" } }, "additionalProperties": false @@ -813,6 +822,47 @@ ], "additionalProperties": false }, + "EfficiencyStandards": { + "title": "EfficiencyStandards", + "description": "An enumeration.", + "enum": [ + "ASHRAE_2019", + "ASHRAE_2016", + "ASHRAE_2013", + "ASHRAE_2010", + "ASHRAE_2007", + "ASHRAE_2004", + "DOE_Ref_1980_2004", + "DOE_Ref_Pre_1980" + ], + "type": "string" + }, + "ClimateZones": { + "title": "ClimateZones", + "description": "An enumeration.", + "enum": [ + "0A", + "1A", + "2A", + "3A", + "4A", + "5A", + "6A", + "0B", + "1B", + "2B", + "3B", + "4B", + "5B", + "6B", + "3C", + "4C", + "5C", + "7", + "8" + ], + "type": "string" + }, "SizingParameter": { "title": "SizingParameter", "description": "Used to specify heating and cooling sizing criteria and safety factors.", @@ -848,6 +898,27 @@ "exclusiveMinimum": 0, "type": "number", "format": "double" + }, + "efficiency_standard": { + "description": "Text to specify the efficiency standard, which will automatically set the efficiencies of all HVAC equipment when provided. Note that providing a standard here will cause the OpenStudio translation process to perform an additional sizing calculation with EnergyPlus, which is needed since the default efficiencies of equipment vary depending on their size. THIS WILL SIGNIFICANTLY INCREASE TRANSLATION TIME TO OPENSTUDIO. However, it is often worthwhile when the goal is to match the HVAC specification with a particular standard.", + "allOf": [ + { + "$ref": "#/components/schemas/EfficiencyStandards" + } + ] + }, + "climate_zone": { + "description": "Text indicating the ASHRAE climate zone to be used with the efficiency_standard. When unspecified, the climate zone will be inferred from the design days on this sizing parameter object.", + "allOf": [ + { + "$ref": "#/components/schemas/ClimateZones" + } + ] + }, + "building_type": { + "title": "Building Type", + "description": "Text for the building type to be used in the efficiency_standard. If the type is not recognized or is None, it will be assumed that the building is a generic NonResidential. The following have specified systems per the standard: Residential, NonResidential, MidriseApartment, HighriseApartment, LargeOffice, MediumOffice, SmallOffice, Retail, StripMall, PrimarySchool, SecondarySchool, SmallHotel, LargeHotel, Hospital, Outpatient, Warehouse, SuperMarket, FullServiceRestaurant, QuickServiceRestaurant, Laboratory, Courthouse.", + "type": "string" } }, "additionalProperties": false diff --git a/lib/to_openstudio/simulation/parameter_model.rb b/lib/to_openstudio/simulation/parameter_model.rb index 0b56ec57..2ff8ad9e 100644 --- a/lib/to_openstudio/simulation/parameter_model.rb +++ b/lib/to_openstudio/simulation/parameter_model.rb @@ -254,6 +254,12 @@ def create_openstudio_objects end end + # set defaults for the simulation output + os_unmet_tol = @openstudio_model.getOutputControlReportingTolerances + default_unmet_tol = out_defaults[:unmet_setpoint_tolerance][:default] + os_unmet_tol.setToleranceforTimeHeatingSetpointNotMet(default_unmet_tol) + os_unmet_tol.setToleranceforTimeCoolingSetpointNotMet(default_unmet_tol) + # set Outputs for the simulation if @hash[:output] if @hash[:output][:outputs] @@ -272,6 +278,11 @@ def create_openstudio_objects os_report.addSummaryReport(report) end end + if @hash[:output][:unmet_setpoint_tolerance] + unmet_tol = @hash[:output][:unmet_setpoint_tolerance] + os_unmet_tol.setToleranceforTimeHeatingSetpointNotMet(unmet_tol) + os_unmet_tol.setToleranceforTimeCoolingSetpointNotMet(unmet_tol) + end end # set defaults for the year description