diff --git a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md index 0d145e891d7..f7b106c0311 100644 --- a/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md +++ b/developer/doc/ReleaseNotes/OpenStudio_Release_Notes_3_7_0_TDB.md @@ -82,6 +82,8 @@ You can also refer to the [OpenStudio SDK Python Binding Version Compatibility M * Fix #4930 - Support undisturbed ground temperature models on GroundHeatExchangerVertical * Update `GroundHeatExchanger:Vertical` to actually use the Ground Temeprature Model field * [#4923](https://github.com/NREL/OpenStudio/pull/4923) - Fix #4692 - Modify `Model::load` to use the VersionTranslator instead of loading it assuming the version of the loaded OSM is the same as the current SDK version being used. +* [#4972](https://github.com/NREL/OpenStudio/pull/4972) - V23.2.0-IOFreeze - wrap `DistrictHeating:Steam` and rename `DistrictHeating` to `DistrictHeatingWater` + * The `DistrictHeating` class (and related Model getters such as `Model::getDistrictHeatings`) are deprecated but kept for backward Compatibility for now. ## Minor changes and bug fixes diff --git a/developer/ruby/deprecated_methods.csv b/developer/ruby/deprecated_methods.csv index bf8274a85e9..d5f94829050 100644 --- a/developer/ruby/deprecated_methods.csv +++ b/developer/ruby/deprecated_methods.csv @@ -236,4 +236,53 @@ model,SurfacePropertyExposedFoundationPerimeter,surfaceName,3.7.0,19bea0ce243d4f model,TableMultiVariableLookup,Entire Class,3.5.0,1c7521a7912473b3b8ba5c533fdf810936ff5c60,TableLookup, energyplus,ForwardTranslator,translateTableMultiVariableLookup,3.5.0,1c7521a7912473b3b8ba5c533fdf810936ff5c60,Remove TableMultiVariableLookup for TableLookup, energyplus,ForwardTranslatePlantEquipmentOperationSchemes,componentType,3.6.0,1417dcb7f48c92629a1e5c43dd2b030c1711bf99,Model SDK: HVACComponent::componentType(), -energyplus,ForwardTranslatePlantEquipmentOperationSchemes,plantLoopType,3.6.0,1417dcb7f48c92629a1e5c43dd2b030c1711bf99,Model SDK: Loop::componentType(), \ No newline at end of file +energyplus,ForwardTranslatePlantEquipmentOperationSchemes,plantLoopType,3.6.0,1417dcb7f48c92629a1e5c43dd2b030c1711bf99,Model SDK: Loop::componentType(), +model,DistrictHeating,Entire Class,3.7.0,4c3f3bf17b9da6bf9ff4bafd5cbb954a08333045,Renamed to DistrictHeatingWater, +model,AirLoopHVACUnitarySystem,maximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->maximumCyclingRate, +model,AirLoopHVACUnitarySystem,isMaximumCyclingRateDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,setMaximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setMaximumCyclingRate, +model,AirLoopHVACUnitarySystem,resetMaximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,heatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->latentCapacityTimeConstant, +model,AirLoopHVACUnitarySystem,isHeatPumpTimeConstantDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,setHeatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setLatentCapacityTimeConstant, +model,AirLoopHVACUnitarySystem,resetHeatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,heatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->fanDelayTime, +model,AirLoopHVACUnitarySystem,isHeatPumpFanDelayTimeDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,setHeatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setFanDelayTime, +model,AirLoopHVACUnitarySystem,resetHeatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,AirLoopHVACUnitarySystem,fractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,AirLoopHVACUnitarySystem,isFractionofOnCyclePowerUseDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,AirLoopHVACUnitarySystem,setFractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,AirLoopHVACUnitarySystem,resetFractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,ZoneHVACWaterToAirHeatPump,maximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->maximumCyclingRate, +model,ZoneHVACWaterToAirHeatPump,isMaximumCyclingRateDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,setMaximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setMaximumCyclingRate, +model,ZoneHVACWaterToAirHeatPump,resetMaximumCyclingRate,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,heatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->latentCapacityTimeConstant, +model,ZoneHVACWaterToAirHeatPump,isHeatPumpTimeConstantDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,setHeatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setLatentCapacityTimeConstant, +model,ZoneHVACWaterToAirHeatPump,resetHeatPumpTimeConstant,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,heatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->fanDelayTime, +model,ZoneHVACWaterToAirHeatPump,isHeatPumpFanDelayTimeDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,setHeatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,coolingCoil()->setFanDelayTime, +model,ZoneHVACWaterToAirHeatPump,resetHeatPumpFanDelayTime,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Child coolingCoil holds the property but it's required, +model,ZoneHVACWaterToAirHeatPump,fractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,ZoneHVACWaterToAirHeatPump,isFractionofOnCyclePowerUseDefaulted,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,ZoneHVACWaterToAirHeatPump,setFractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,ZoneHVACWaterToAirHeatPump,resetFractionofOnCyclePowerUse,3.7.0,d0e00eff0cbb5420f5447ff9c94e3afc11785482,None: Property no longer used, +model,EnvironmentalImpactFactors,districtHeatingEfficiency,3.7.0,49433c8c8108785d5ed6d11bd8e48b8d5a5be843,districtHeatingWaterEfficiency, +model,EnvironmentalImpactFactors,steamConversionEfficiency,3.7.0,49433c8c8108785d5ed6d11bd8e48b8d5a5be843,districtHeatingSteamConversionEfficiency, +model,EnvironmentalImpactFactors,setDistrictHeatingEfficiency,3.7.0,49433c8c8108785d5ed6d11bd8e48b8d5a5be843,setDistrictHeatingWaterEfficiency, +model,EnvironmentalImpactFactors,setSteamConversionEfficiency,3.7.0,49433c8c8108785d5ed6d11bd8e48b8d5a5be843,setDistrictHeatingSteamConversionEfficiency, +model,AirLoopHVACUnitarySystem,setSupplyAirFlowRateMethodDuringCoolingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRateMethodDuringCoolingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRateDuringCoolingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRatePerFloorAreaDuringCoolingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,resetFractionofAutosizedDesignCoolingSupplyAirFlowRate,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,resetDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringCoolingOperation, autosizeSupplyAirFlowRateDuringCoolingOperation, setSupplyAirFlowRatePerFloorAreaDuringCoolingOperation, setFractionofAutosizedDesignCoolingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringCoolingOperation", +model,AirLoopHVACUnitarySystem,setSupplyAirFlowRateMethodDuringHeatingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRateMethodDuringHeatingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRateDuringHeatingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", +model,AirLoopHVACUnitarySystem,resetSupplyAirFlowRatePerFloorAreaduringHeatingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", +model,AirLoopHVACUnitarySystem,resetFractionofAutosizedDesignHeatingSupplyAirFlowRate,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", +model,AirLoopHVACUnitarySystem,resetDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation,3.7.0,84bd57c5117cba9fc0716f2329d70ba5708c080a,"Done when calling setSupplyAirFlowRateDuringHeatingOperation, autosizeSupplyAirFlowRateDuringHeatingOperation, setSupplyAirFlowRatePerFloorAreaDuringHeatingOperation, setFractionofAutosizedDesignHeatingSupplyAirFlowRate, setDesignSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation", diff --git a/resources/energyplus/AllFuelTypes/in.idf b/resources/energyplus/AllFuelTypes/in.idf index 08667ee1c97..5080627ffe8 100644 --- a/resources/energyplus/AllFuelTypes/in.idf +++ b/resources/energyplus/AllFuelTypes/in.idf @@ -1,557 +1,585 @@ - Version,23.2; - - Timestep,6; - - LifeCycleCost:Parameters, - Life Cycle Cost Parameters, !- Name - EndOfYear, !- Discounting Convention - ConstantDollar, !- Inflation Approach - 0.03, !- Real Discount Rate - , !- Nominal Discount Rate - , !- Inflation - , !- Base Date Month - 2011, !- Base Date Year - , !- Service Date Month - 2011, !- Service Date Year - 25, !- Length of Study Period in Years - , !- Tax rate - None; !- Depreciation Method - - LifeCycleCost:UsePriceEscalation, - U.S. Avg Commercial-Electricity, !- LCC Price Escalation Name - Electricity, !- Resource - 2011, !- Escalation Start Year - January, !- Escalation Start Month - 0.9838, !- Year 1 Escalation - 0.9730, !- Year 2 Escalation - 0.9632, !- Year 3 Escalation - 0.9611, !- Year 4 Escalation - 0.9571, !- Year 5 Escalation - 0.9553, !- Year 6 Escalation - 0.9539, !- Year 7 Escalation - 0.9521, !- Year 8 Escalation - 0.9546, !- Year 9 Escalation - 0.9550, !- - 0.9553, !- - 0.9564, !- - 0.9575, !- - 0.9596, !- - 0.9618, !- - 0.9614, !- - 0.9618, !- - 0.9618, !- - 0.9593, !- - 0.9589, !- - 0.9607, !- - 0.9625, !- - 0.9650, !- - 0.9708, !- - 0.9751, !- - 0.9762, !- - 0.9766, !- - 0.9766, !- - 0.9769, !- - 0.9773; !- - - LifeCycleCost:UsePriceEscalation, - U.S. Avg Commercial-Distillate Oil, !- LCC Price Escalation Name - FuelOilNo1, !- Resource - 2011, !- Escalation Start Year - January, !- Escalation Start Month - 0.9714, !- Year 1 Escalation - 0.9730, !- Year 2 Escalation - 0.9942, !- Year 3 Escalation - 1.0164, !- Year 4 Escalation - 1.0541, !- Year 5 Escalation - 1.0928, !- Year 6 Escalation - 1.1267, !- Year 7 Escalation - 1.1580, !- Year 8 Escalation - 1.1792, !- Year 9 Escalation - 1.1967, !- - 1.2200, !- - 1.2333, !- - 1.2566, !- - 1.2709, !- - 1.2826, !- - 1.2985, !- - 1.3102, !- - 1.3250, !- - 1.3261, !- - 1.3282, !- - 1.3324, !- - 1.3356, !- - 1.3431, !- - 1.3510, !- - 1.3568, !- - 1.3606, !- - 1.3637, !- - 1.3674, !- - 1.3706, !- - 1.3743; !- - - LifeCycleCost:UsePriceEscalation, - U.S. Avg Commercial-Residual Oil, !- LCC Price Escalation Name - FuelOilNo2, !- Resource - 2011, !- Escalation Start Year - January, !- Escalation Start Month - 0.8469, !- Year 1 Escalation - 0.8257, !- Year 2 Escalation - 0.8681, !- Year 3 Escalation - 0.8988, !- Year 4 Escalation - 0.9289, !- Year 5 Escalation - 0.9604, !- Year 6 Escalation - 0.9897, !- Year 7 Escalation - 1.0075, !- Year 8 Escalation - 1.0314, !- Year 9 Escalation - 1.0554, !- - 1.0861, !- - 1.1278, !- - 1.1497, !- - 1.1620, !- - 1.1743, !- - 1.1852, !- - 1.1948, !- - 1.2037, !- - 1.2071, !- - 1.2119, !- - 1.2139, !- - 1.2194, !- - 1.2276, !- - 1.2365, !- - 1.2420, !- - 1.2461, !- - 1.2509, !- - 1.2550, !- - 1.2591, !- - 1.2638; !- - - LifeCycleCost:UsePriceEscalation, - U.S. Avg Commercial-Natural gas, !- LCC Price Escalation Name - NaturalGas, !- Resource - 2011, !- Escalation Start Year - January, !- Escalation Start Month - 0.9823, !- Year 1 Escalation - 0.9557, !- Year 2 Escalation - 0.9279, !- Year 3 Escalation - 0.9257, !- Year 4 Escalation - 0.9346, !- Year 5 Escalation - 0.9412, !- Year 6 Escalation - 0.9512, !- Year 7 Escalation - 0.9645, !- Year 8 Escalation - 0.9856, !- Year 9 Escalation - 1.0067, !- - 1.0222, !- - 1.0410, !- - 1.0610, !- - 1.0787, !- - 1.0942, !- - 1.1098, !- - 1.1220, !- - 1.1308, !- - 1.1386, !- - 1.1486, !- - 1.1619, !- - 1.1763, !- - 1.1918, !- - 1.2118, !- - 1.2284, !- - 1.2439, !- - 1.2605, !- - 1.2772, !- - 1.2938, !- - 1.3115; !- - - LifeCycleCost:UsePriceEscalation, - U.S. Avg Commercial-Coal, !- LCC Price Escalation Name - Coal, !- Resource - 2011, !- Escalation Start Year - January, !- Escalation Start Month - 0.9970, !- Year 1 Escalation - 1.0089, !- Year 2 Escalation - 1.0089, !- Year 3 Escalation - 0.9941, !- Year 4 Escalation - 0.9941, !- Year 5 Escalation - 1.0000, !- Year 6 Escalation - 1.0030, !- Year 7 Escalation - 1.0059, !- Year 8 Escalation - 1.0089, !- Year 9 Escalation - 1.0119, !- - 1.0148, !- - 1.0178, !- - 1.0208, !- - 1.0267, !- - 1.0297, !- - 1.0356, !- - 1.0415, !- - 1.0534, !- - 1.0564, !- - 1.0593, !- - 1.0653, !- - 1.0712, !- - 1.0742, !- - 1.0801, !- - 1.0831, !- - 1.0831, !- - 1.0861, !- - 1.0890, !- - 1.0920, !- - 1.0950; !- - - Building, - Building 1, !- Name - , !- North Axis {deg} - , !- Terrain - , !- Loads Convergence Tolerance Value {W} - , !- Temperature Convergence Tolerance Value {deltaC} - , !- Solar Distribution - , !- Maximum Number of Warmup Days - ; !- Minimum Number of Warmup Days - - SimulationControl, - No, !- Do Zone Sizing Calculation - No, !- Do System Sizing Calculation - No, !- Do Plant Sizing Calculation - Yes, !- Run Simulation for Sizing Periods - Yes, !- Run Simulation for Weather File Run Periods - , !- Do HVAC Sizing Simulation for Sizing Periods - ; !- Maximum Number of HVAC Sizing Simulation Passes - - Sizing:Parameters, - 1.25, !- Heating Sizing Factor - 1.15; !- Cooling Sizing Factor - - RunPeriod, - Run Period 1, !- Name - 1, !- Begin Month - 1, !- Begin Day of Month - 2009, !- Begin Year - 12, !- End Month - 31, !- End Day of Month - 2009, !- End Year - Thursday, !- Day of Week for Start Day - No, !- Use Weather File Holidays and Special Days - No, !- Use Weather File Daylight Saving Period - No, !- Apply Weekend Holiday Rule - Yes, !- Use Weather File Rain Indicators - Yes; !- Use Weather File Snow Indicators - - Output:Table:SummaryReports, - AllSummary; !- Report 1 Name - - GlobalGeometryRules, - UpperLeftCorner, !- Starting Vertex Position - Counterclockwise, !- Vertex Entry Direction - Relative, !- Coordinate System - Relative, !- Daylighting Reference Point Coordinate System - Relative; !- Rectangular Surface Coordinate System - - ScheduleTypeLimits, - OnOff, !- Name - 0, !- Lower Limit Value - 1, !- Upper Limit Value - Discrete, !- Numeric Type - availability; !- Unit Type - - Schedule:Constant,Always On Discrete,OnOff,1; - - Schedule:Constant,Always Off Discrete,,0; - - Schedule:Constant,Always On Continuous,,1; - - OutdoorAir:Node, - Model Outdoor Air Node; !- Name - - Exterior:FuelEquipment, - Coal - 8000 W, !- Name - Coal, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 8000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - Diesel - 6000 W, !- Name - Diesel, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 6000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - DistrictCooling - 13000 W, !- Name - DistrictCooling, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 13000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - DistrictHeating - 12000 W, !- Name - DistrictHeatingWater, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 12000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - Electricity - 1000 W, !- Name - Electricity, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 1000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - FuelOilNo1 - 4000 W, !- Name - FuelOilNo1, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 4000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - FuelOilNo2 - 5000 W, !- Name - FuelOilNo2, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 5000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - Gasoline - 7000 W, !- Name - Gasoline, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 7000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - NaturalGas - 2000 W, !- Name - NaturalGas, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 2000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - OtherFuel1 - 9000 W, !- Name - OtherFuel1, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 9000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - OtherFuel2 - 10000 W, !- Name - OtherFuel2, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 10000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - Propane - 3000 W, !- Name - Propane, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 3000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:FuelEquipment, - Steam - 11000 W, !- Name - DistrictHeatingSteam, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 11000, !- Design Level {W} - General; !- End-Use Subcategory - - Exterior:WaterEquipment, - Water - 1 m3/s, !- Name - Water, !- Fuel Use Type - Always On Discrete, !- Schedule Name - 0, !- Design Level {m3/s} - General; !- End-Use Subcategory - - OutputControl:Table:Style, - HTML; !- Column Separator - - Output:VariableDictionary,IDF,Unsorted; - - Output:SQLite, - SimpleAndTabular; !- Option Type - - LifeCycleCost:NonrecurringCost, - Default Cost, !- Name - Construction, !- Category - 0, !- Cost - ServicePeriod; !- Start of Costs - - Output:Table:Monthly, - Building Energy Performance - Electricity, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Electricity, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Electricity Peak Demand, !- Name - 2, !- Digits After Decimal - Electricity:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Electricity, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Natural Gas, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:NaturalGas, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Natural Gas Peak Demand, !- Name - 2, !- Digits After Decimal - NaturalGas:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:NaturalGas, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Gasoline, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Gasoline, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Gasoline Peak Demand, !- Name - 2, !- Digits After Decimal - Gasoline:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Gasoline, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Diesel, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Diesel,!- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Diesel Peak Demand, !- Name - 2, !- Digits After Decimal - Diesel:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Diesel,!- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Coal, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Coal, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Coal Peak Demand, !- Name - 2, !- Digits After Decimal - Coal:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Coal, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Fuel Oil No 1, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:FuelOilNo1, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Fuel Oil No 1 Peak Demand, !- Name - 2, !- Digits After Decimal - FuelOilNo1:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:FuelOilNo1, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Fuel Oil No 2, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:FuelOilNo2, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Fuel Oil No 2 Peak Demand, !- Name - 2, !- Digits After Decimal - FuelOilNo2:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:FuelOilNo2, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Propane, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Propane, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Propane Peak Demand, !- Name - 2, !- Digits After Decimal - Propane:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Propane, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Other Fuel 1, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:OtherFuel1, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Other Fuel 1 Peak Demand, !- Name - 2, !- Digits After Decimal - OtherFuel1:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:OtherFuel1, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Other Fuel 2, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:OtherFuel2, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Other Fuel 2 Peak Demand, !- Name - 2, !- Digits After Decimal - OtherFuel2:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:OtherFuel2, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - District Cooling, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:DistrictCooling, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - District Cooling Peak Demand, !- Name - 2, !- Digits After Decimal - DistrictCooling:Facility,!- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:DistrictCooling, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - District Heating, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - District Heating Peak Demand, !- Name - 2, !- Digits After Decimal - DistrictHeatingWater:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 - - Output:Table:Monthly, - Building Energy Performance - Water, !- Name - 2, !- Digits After Decimal - ExteriorEquipment:Water, !- Variable or Meter 1 Name - SumOrAverage; !- Aggregation Type for Variable or Meter 1 - - Output:Table:Monthly, - Building Energy Performance - Water Peak Demand, !- Name - 2, !- Digits After Decimal - Water:Facility, !- Variable or Meter 1 Name - Maximum, !- Aggregation Type for Variable or Meter 1 - ExteriorEquipment:Water, !- Variable or Meter 2 Name - ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Version, + 23.2; !- Version Identifier + +Timestep, + 6; !- Number of Timesteps per Hour + +LifeCycleCost:Parameters, + Life Cycle Cost Parameters, !- Name + EndOfYear, !- Discounting Convention + ConstantDollar, !- Inflation Approach + 0.03, !- Real Discount Rate + , !- Nominal Discount Rate + , !- Inflation + , !- Base Date Month + 2011, !- Base Date Year + , !- Service Date Month + 2011, !- Service Date Year + 25, !- Length of Study Period in Years + , !- Tax rate + None; !- Depreciation Method + +LifeCycleCost:UsePriceEscalation, + U.S. Avg Commercial-Electricity, !- Name + Electricity, !- Resource + 2011, !- Escalation Start Year + January, !- Escalation Start Month + 0.9838, !- Year Escalation 1 + 0.9730, !- Year Escalation 2 + 0.9632, !- Year Escalation 3 + 0.9611, !- Year Escalation 4 + 0.9571, !- Year Escalation 5 + 0.9553, !- Year Escalation 6 + 0.9539, !- Year Escalation 7 + 0.9521, !- Year Escalation 8 + 0.9546, !- Year Escalation 9 + 0.9550, !- Year Escalation 10 + 0.9553, !- Year Escalation 11 + 0.9564, !- Year Escalation 12 + 0.9575, !- Year Escalation 13 + 0.9596, !- Year Escalation 14 + 0.9618, !- Year Escalation 15 + 0.9614, !- Year Escalation 16 + 0.9618, !- Year Escalation 17 + 0.9618, !- Year Escalation 18 + 0.9593, !- Year Escalation 19 + 0.9589, !- Year Escalation 20 + 0.9607, !- Year Escalation 21 + 0.9625, !- Year Escalation 22 + 0.9650, !- Year Escalation 23 + 0.9708, !- Year Escalation 24 + 0.9751, !- Year Escalation 25 + 0.9762, !- Year Escalation 26 + 0.9766, !- Year Escalation 27 + 0.9766, !- Year Escalation 28 + 0.9769, !- Year Escalation 29 + 0.9773; !- Year Escalation 30 + +LifeCycleCost:UsePriceEscalation, + U.S. Avg Commercial-Distillate Oil, !- Name + FuelOilNo1, !- Resource + 2011, !- Escalation Start Year + January, !- Escalation Start Month + 0.9714, !- Year Escalation 1 + 0.9730, !- Year Escalation 2 + 0.9942, !- Year Escalation 3 + 1.0164, !- Year Escalation 4 + 1.0541, !- Year Escalation 5 + 1.0928, !- Year Escalation 6 + 1.1267, !- Year Escalation 7 + 1.1580, !- Year Escalation 8 + 1.1792, !- Year Escalation 9 + 1.1967, !- Year Escalation 10 + 1.2200, !- Year Escalation 11 + 1.2333, !- Year Escalation 12 + 1.2566, !- Year Escalation 13 + 1.2709, !- Year Escalation 14 + 1.2826, !- Year Escalation 15 + 1.2985, !- Year Escalation 16 + 1.3102, !- Year Escalation 17 + 1.3250, !- Year Escalation 18 + 1.3261, !- Year Escalation 19 + 1.3282, !- Year Escalation 20 + 1.3324, !- Year Escalation 21 + 1.3356, !- Year Escalation 22 + 1.3431, !- Year Escalation 23 + 1.3510, !- Year Escalation 24 + 1.3568, !- Year Escalation 25 + 1.3606, !- Year Escalation 26 + 1.3637, !- Year Escalation 27 + 1.3674, !- Year Escalation 28 + 1.3706, !- Year Escalation 29 + 1.3743; !- Year Escalation 30 + +LifeCycleCost:UsePriceEscalation, + U.S. Avg Commercial-Residual Oil, !- Name + FuelOilNo2, !- Resource + 2011, !- Escalation Start Year + January, !- Escalation Start Month + 0.8469, !- Year Escalation 1 + 0.8257, !- Year Escalation 2 + 0.8681, !- Year Escalation 3 + 0.8988, !- Year Escalation 4 + 0.9289, !- Year Escalation 5 + 0.9604, !- Year Escalation 6 + 0.9897, !- Year Escalation 7 + 1.0075, !- Year Escalation 8 + 1.0314, !- Year Escalation 9 + 1.0554, !- Year Escalation 10 + 1.0861, !- Year Escalation 11 + 1.1278, !- Year Escalation 12 + 1.1497, !- Year Escalation 13 + 1.1620, !- Year Escalation 14 + 1.1743, !- Year Escalation 15 + 1.1852, !- Year Escalation 16 + 1.1948, !- Year Escalation 17 + 1.2037, !- Year Escalation 18 + 1.2071, !- Year Escalation 19 + 1.2119, !- Year Escalation 20 + 1.2139, !- Year Escalation 21 + 1.2194, !- Year Escalation 22 + 1.2276, !- Year Escalation 23 + 1.2365, !- Year Escalation 24 + 1.2420, !- Year Escalation 25 + 1.2461, !- Year Escalation 26 + 1.2509, !- Year Escalation 27 + 1.2550, !- Year Escalation 28 + 1.2591, !- Year Escalation 29 + 1.2638; !- Year Escalation 30 + +LifeCycleCost:UsePriceEscalation, + U.S. Avg Commercial-Natural gas, !- Name + NaturalGas, !- Resource + 2011, !- Escalation Start Year + January, !- Escalation Start Month + 0.9823, !- Year Escalation 1 + 0.9557, !- Year Escalation 2 + 0.9279, !- Year Escalation 3 + 0.9257, !- Year Escalation 4 + 0.9346, !- Year Escalation 5 + 0.9412, !- Year Escalation 6 + 0.9512, !- Year Escalation 7 + 0.9645, !- Year Escalation 8 + 0.9856, !- Year Escalation 9 + 1.0067, !- Year Escalation 10 + 1.0222, !- Year Escalation 11 + 1.0410, !- Year Escalation 12 + 1.0610, !- Year Escalation 13 + 1.0787, !- Year Escalation 14 + 1.0942, !- Year Escalation 15 + 1.1098, !- Year Escalation 16 + 1.1220, !- Year Escalation 17 + 1.1308, !- Year Escalation 18 + 1.1386, !- Year Escalation 19 + 1.1486, !- Year Escalation 20 + 1.1619, !- Year Escalation 21 + 1.1763, !- Year Escalation 22 + 1.1918, !- Year Escalation 23 + 1.2118, !- Year Escalation 24 + 1.2284, !- Year Escalation 25 + 1.2439, !- Year Escalation 26 + 1.2605, !- Year Escalation 27 + 1.2772, !- Year Escalation 28 + 1.2938, !- Year Escalation 29 + 1.3115; !- Year Escalation 30 + +LifeCycleCost:UsePriceEscalation, + U.S. Avg Commercial-Coal, !- Name + Coal, !- Resource + 2011, !- Escalation Start Year + January, !- Escalation Start Month + 0.9970, !- Year Escalation 1 + 1.0089, !- Year Escalation 2 + 1.0089, !- Year Escalation 3 + 0.9941, !- Year Escalation 4 + 0.9941, !- Year Escalation 5 + 1.0000, !- Year Escalation 6 + 1.0030, !- Year Escalation 7 + 1.0059, !- Year Escalation 8 + 1.0089, !- Year Escalation 9 + 1.0119, !- Year Escalation 10 + 1.0148, !- Year Escalation 11 + 1.0178, !- Year Escalation 12 + 1.0208, !- Year Escalation 13 + 1.0267, !- Year Escalation 14 + 1.0297, !- Year Escalation 15 + 1.0356, !- Year Escalation 16 + 1.0415, !- Year Escalation 17 + 1.0534, !- Year Escalation 18 + 1.0564, !- Year Escalation 19 + 1.0593, !- Year Escalation 20 + 1.0653, !- Year Escalation 21 + 1.0712, !- Year Escalation 22 + 1.0742, !- Year Escalation 23 + 1.0801, !- Year Escalation 24 + 1.0831, !- Year Escalation 25 + 1.0831, !- Year Escalation 26 + 1.0861, !- Year Escalation 27 + 1.0890, !- Year Escalation 28 + 1.0920, !- Year Escalation 29 + 1.0950; !- Year Escalation 30 + +Building, + Building 1, !- Name + , !- North Axis {deg} + , !- Terrain + , !- Loads Convergence Tolerance Value {W} + , !- Temperature Convergence Tolerance Value {deltaC} + , !- Solar Distribution + , !- Maximum Number of Warmup Days + ; !- Minimum Number of Warmup Days + +SimulationControl, + No, !- Do Zone Sizing Calculation + No, !- Do System Sizing Calculation + No, !- Do Plant Sizing Calculation + Yes, !- Run Simulation for Sizing Periods + Yes, !- Run Simulation for Weather File Run Periods + , !- Do HVAC Sizing Simulation for Sizing Periods + ; !- Maximum Number of HVAC Sizing Simulation Passes + +Sizing:Parameters, + 1.25, !- Heating Sizing Factor + 1.15; !- Cooling Sizing Factor + +RunPeriod, + Run Period 1, !- Name + 1, !- Begin Month + 1, !- Begin Day of Month + 2009, !- Begin Year + 12, !- End Month + 31, !- End Day of Month + 2009, !- End Year + Thursday, !- Day of Week for Start Day + No, !- Use Weather File Holidays and Special Days + No, !- Use Weather File Daylight Saving Period + No, !- Apply Weekend Holiday Rule + Yes, !- Use Weather File Rain Indicators + Yes; !- Use Weather File Snow Indicators + +Output:Table:SummaryReports, + AllSummary; !- Report Name 1 + +GlobalGeometryRules, + UpperLeftCorner, !- Starting Vertex Position + Counterclockwise, !- Vertex Entry Direction + Relative, !- Coordinate System + Relative, !- Daylighting Reference Point Coordinate System + Relative; !- Rectangular Surface Coordinate System + +ScheduleTypeLimits, + OnOff, !- Name + 0, !- Lower Limit Value {BasedOnField A3} + 1, !- Upper Limit Value {BasedOnField A3} + Discrete, !- Numeric Type + availability; !- Unit Type + +Schedule:Constant, + Always On Discrete, !- Name + OnOff, !- Schedule Type Limits Name + 1; !- Hourly Value + +Schedule:Constant, + Always Off Discrete, !- Name + , !- Schedule Type Limits Name + 0; !- Hourly Value + +Schedule:Constant, + Always On Continuous, !- Name + , !- Schedule Type Limits Name + 1; !- Hourly Value + +OutdoorAir:Node, + Model Outdoor Air Node; !- Name + +Exterior:FuelEquipment, + Coal - 8000 W, !- Name + Coal, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 8000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + Diesel - 6000 W, !- Name + Diesel, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 6000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + DistrictCooling - 13000 W, !- Name + DistrictCooling, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 13000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + DistrictHeatingSteam - 11000 W, !- Name + DistrictHeatingSteam, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 11000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + DistrictHeatingWater - 12000 W, !- Name + DistrictHeatingWater, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 12000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + Electricity - 1000 W, !- Name + Electricity, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 1000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + FuelOilNo1 - 4000 W, !- Name + FuelOilNo1, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 4000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + FuelOilNo2 - 5000 W, !- Name + FuelOilNo2, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 5000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + Gasoline - 7000 W, !- Name + Gasoline, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 7000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + NaturalGas - 2000 W, !- Name + NaturalGas, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 2000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + OtherFuel1 - 9000 W, !- Name + OtherFuel1, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 9000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + OtherFuel2 - 10000 W, !- Name + OtherFuel2, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 10000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:FuelEquipment, + Propane - 3000 W, !- Name + Propane, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 3000, !- Design Level {W} + General; !- End-Use Subcategory + +Exterior:WaterEquipment, + Water - 1 m3/s, !- Name + Water, !- Fuel Use Type + Always On Discrete, !- Schedule Name + 0, !- Design Level {m3/s} + General; !- End-Use Subcategory + +OutputControl:Table:Style, + HTML; !- Column Separator + +Output:VariableDictionary, + IDF, !- Key Field + Unsorted; !- Sort Option + +Output:SQLite, + SimpleAndTabular; !- Option Type + +LifeCycleCost:NonrecurringCost, + Default Cost, !- Name + Construction, !- Category + 0, !- Cost + ServicePeriod; !- Start of Costs + +Output:Table:Monthly, + Building Energy Performance - Electricity, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Electricity, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Electricity Peak Demand, !- Name + 2, !- Digits After Decimal + Electricity:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Electricity, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Natural Gas, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:NaturalGas, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Natural Gas Peak Demand, !- Name + 2, !- Digits After Decimal + NaturalGas:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:NaturalGas, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Gasoline, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Gasoline, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Gasoline Peak Demand, !- Name + 2, !- Digits After Decimal + Gasoline:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Gasoline, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Diesel, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Diesel, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Diesel Peak Demand, !- Name + 2, !- Digits After Decimal + Diesel:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Diesel, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Coal, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Coal, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Coal Peak Demand, !- Name + 2, !- Digits After Decimal + Coal:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Coal, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Fuel Oil No 1, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:FuelOilNo1, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Fuel Oil No 1 Peak Demand, !- Name + 2, !- Digits After Decimal + FuelOilNo1:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:FuelOilNo1, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Fuel Oil No 2, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:FuelOilNo2, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Fuel Oil No 2 Peak Demand, !- Name + 2, !- Digits After Decimal + FuelOilNo2:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:FuelOilNo2, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Propane, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Propane, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Propane Peak Demand, !- Name + 2, !- Digits After Decimal + Propane:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Propane, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Other Fuel 1, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:OtherFuel1, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Other Fuel 1 Peak Demand, !- Name + 2, !- Digits After Decimal + OtherFuel1:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:OtherFuel1, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Other Fuel 2, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:OtherFuel2, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Other Fuel 2 Peak Demand, !- Name + 2, !- Digits After Decimal + OtherFuel2:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:OtherFuel2, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - District Cooling, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:DistrictCooling, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - District Cooling Peak Demand, !- Name + 2, !- Digits After Decimal + DistrictCooling:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:DistrictCooling, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - District Heating Water, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - District Heating Water Peak Demand, !- Name + 2, !- Digits After Decimal + DistrictHeatingWater:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:DistrictHeatingWater, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - District Heating Steam, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:DistrictHeatingSteam, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - District Heating Steam Peak Demand, !- Name + 2, !- Digits After Decimal + DistrictHeatingSteam:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:DistrictHeatingSteam, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 + +Output:Table:Monthly, + Building Energy Performance - Water, !- Name + 2, !- Digits After Decimal + ExteriorEquipment:Water, !- Variable or Meter Name 1 + SumOrAverage; !- Aggregation Type for Variable or Meter 1 + +Output:Table:Monthly, + Building Energy Performance - Water Peak Demand, !- Name + 2, !- Digits After Decimal + Water:Facility, !- Variable or Meter Name 1 + Maximum, !- Aggregation Type for Variable or Meter 1 + ExteriorEquipment:Water, !- Variable or Meter Name 2 + ValueWhenMaximumOrMinimum; !- Aggregation Type for Variable or Meter 2 diff --git a/resources/model/OpenStudio.idd b/resources/model/OpenStudio.idd index 83ba4030a4b..4b1f840b15c 100644 --- a/resources/model/OpenStudio.idd +++ b/resources/model/OpenStudio.idd @@ -16767,13 +16767,19 @@ OS:DistrictCooling, \required-field \type object-list \object-list ConnectionNames - N1 ; \field Nominal Capacity + N1 , \field Nominal Capacity \units W \minimum 0.0 \autosizable \required-field + A5 ; \field Capacity Fraction Schedule + \note Schedule values are multiplied by Nominal Capacity for current capacity + \required-field + \type object-list + \object-list ScheduleNames -OS:DistrictHeating, +OS:DistrictHeating:Water, + \memo Centralized source of hot water, such as a district heating system. A1, \field Handle \type handle \required-field @@ -16788,11 +16794,43 @@ OS:DistrictHeating, \required-field \type object-list \object-list ConnectionNames - N1 ; \field Nominal Capacity + N1 , \field Nominal Capacity \units W \minimum 0.0 \autosizable \required-field + A5 ; \field Capacity Fraction Schedule + \note Schedule values are multiplied by Nominal Capacity for current capacity + \required-field + \type object-list + \object-list ScheduleNames + +OS:DistrictHeating:Steam, + \memo Centralized source of Steam, such as a district heating system. + A1, \field Handle + \type handle + \required-field + A2 , \field Name + \required-field + \reference ConnectionObject + A3 , \field Steam Inlet Node Name + \required-field + \type object-list + \object-list ConnectionNames + A4 , \field Steam Outlet Node Name + \required-field + \type object-list + \object-list ConnectionNames + N1 , \field Nominal Capacity + \autosizable + \units W + \minimum 0.0 + \required-field + A5 ; \field Capacity Fraction Schedule + \note Schedule values are multiplied by Nominal Capacity for current capacity + \required-field + \type object-list + \object-list ScheduleNames OS:GroundHeatExchanger:Vertical, \extensible:2 diff --git a/src/energyplus/CMakeLists.txt b/src/energyplus/CMakeLists.txt index 9384653128c..9caeb1792dd 100644 --- a/src/energyplus/CMakeLists.txt +++ b/src/energyplus/CMakeLists.txt @@ -144,7 +144,8 @@ set(${target_name}_src ForwardTranslator/ForwardTranslateDesignDay.cpp ForwardTranslator/ForwardTranslateDesignSpecificationOutdoorAir.cpp ForwardTranslator/ForwardTranslateDistrictCooling.cpp - ForwardTranslator/ForwardTranslateDistrictHeating.cpp + ForwardTranslator/ForwardTranslateDistrictHeatingWater.cpp + ForwardTranslator/ForwardTranslateDistrictHeatingSteam.cpp ForwardTranslator/ForwardTranslateDuct.cpp ForwardTranslator/ForwardTranslateElectricEquipment.cpp ForwardTranslator/ForwardTranslateElectricEquipmentITEAirCooled.cpp diff --git a/src/energyplus/ForwardTranslator.cpp b/src/energyplus/ForwardTranslator.cpp index 0a102223adb..68816a177f4 100644 --- a/src/energyplus/ForwardTranslator.cpp +++ b/src/energyplus/ForwardTranslator.cpp @@ -1501,9 +1501,14 @@ namespace energyplus { retVal = translateDistrictCooling(districtCooling); break; } - case openstudio::IddObjectType::OS_DistrictHeating: { - auto districtHeating = modelObject.cast(); - retVal = translateDistrictHeating(districtHeating); + case openstudio::IddObjectType::OS_DistrictHeating_Water: { + auto districtHeating = modelObject.cast(); + retVal = translateDistrictHeatingWater(districtHeating); + break; + } + case openstudio::IddObjectType::OS_DistrictHeating_Steam: { + auto districtHeatingSteam = modelObject.cast(); + retVal = translateDistrictHeatingSteam(districtHeatingSteam); break; } case openstudio::IddObjectType::OS_Duct: { @@ -3495,8 +3500,12 @@ namespace energyplus { IddObjectType::OS_Curve_Triquadratic, IddObjectType::OS_Table_MultiVariableLookup, IddObjectType::OS_Table_Lookup, - IddObjectType::OS_DistrictCooling, - IddObjectType::OS_DistrictHeating, + + // Should be on a PlantLoop to be translated + // IddObjectType::OS_DistrictCooling, + // IddObjectType::OS_DistrictHeating_Water, + // IddObjectType::OS_DistrictHeating_Steam, + IddObjectType::OS_EvaporativeCooler_Direct_ResearchSpecial, IddObjectType::OS_Node, diff --git a/src/energyplus/ForwardTranslator.hpp b/src/energyplus/ForwardTranslator.hpp index ab7295603f9..2a48815bb4c 100644 --- a/src/energyplus/ForwardTranslator.hpp +++ b/src/energyplus/ForwardTranslator.hpp @@ -180,7 +180,8 @@ namespace model { class DesignDay; class DesignSpecificationOutdoorAir; class DistrictCooling; - class DistrictHeating; + class DistrictHeatingWater; + class DistrictHeatingSteam; class Duct; class ElectricEquipment; class ElectricEquipmentITEAirCooled; @@ -927,7 +928,9 @@ namespace energyplus { boost::optional translateDistrictCooling(model::DistrictCooling& modelObject); - boost::optional translateDistrictHeating(model::DistrictHeating& modelObject); + boost::optional translateDistrictHeatingWater(model::DistrictHeatingWater& modelObject); + + boost::optional translateDistrictHeatingSteam(model::DistrictHeatingSteam& modelObject); boost::optional translateDuct(model::Duct& modelObject); diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictCooling.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictCooling.cpp index ce8c326b04b..d6fd257f39b 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictCooling.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictCooling.cpp @@ -7,6 +7,8 @@ #include "../../model/Model.hpp" #include "../../model/DistrictCooling.hpp" #include "../../model/DistrictCooling_Impl.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" #include "../../utilities/idf/IdfExtensibleGroup.hpp" #include "../../utilities/idf/Workspace.hpp" #include "../../utilities/idf/WorkspaceObjectOrder.hpp" @@ -21,57 +23,36 @@ namespace openstudio { namespace energyplus { boost::optional ForwardTranslator::translateDistrictCooling(DistrictCooling& modelObject) { - OptionalString s; - OptionalDouble d; - OptionalModelObject temp; - boost::optional value; - IdfObject idfObject(IddObjectType::DistrictCooling); + // Name + IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::DistrictCooling, modelObject); - m_idfObjects.push_back(idfObject); - - /////////////////////////////////////////////////////////////////////////// - // Field: Name //////////////////////////////////////////////////////////// - s = modelObject.name(); - if (s) { - idfObject.setName(*s); - } - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - // Inlet Node Name //////////////////////////////////////////////////// - temp = modelObject.inletModelObject(); - if (temp) { - s = temp->name(); - if (s) { - idfObject.setString(openstudio::DistrictCoolingFields::ChilledWaterInletNodeName, *s); - } + // Inlet Node Name + if (auto node_ = modelObject.inletModelObject()) { + idfObject.setString(DistrictCoolingFields::ChilledWaterInletNodeName, node_->nameString()); } - /////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - // Outlet Node Name /////////////////////////////////////////////////// - temp = modelObject.outletModelObject(); - if (temp) { - s = temp->name(); - if (s) { - idfObject.setString(openstudio::DistrictCoolingFields::ChilledWaterOutletNodeName, *s); - } + // Outlet Node Name + if (auto node_ = modelObject.outletModelObject()) { + idfObject.setString(DistrictCoolingFields::ChilledWaterOutletNodeName, node_->nameString()); } - /// - //////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////// - //Nominal Capacity /////////////////////////////////////////////////// + // Nominal Capacity if (modelObject.isNominalCapacityAutosized()) { idfObject.setString(DistrictCoolingFields::NominalCapacity, "Autosize"); - } else if ((value = modelObject.nominalCapacity())) { - idfObject.setDouble(DistrictCoolingFields::NominalCapacity, value.get()); + } else if (auto value_ = modelObject.nominalCapacity()) { + idfObject.setDouble(DistrictCoolingFields::NominalCapacity, *value_); + } + + // Capacity Fraction Schedule Name + { + Schedule capacityFractionSchedule = modelObject.capacityFractionSchedule(); + if (auto sch_ = translateAndMapModelObject(capacityFractionSchedule)) { + idfObject.setString(DistrictCoolingFields::CapacityFractionScheduleName, sch_->nameString()); + } } - // - //////////////////////////////////////////////////////////////////////// - return boost::optional(idfObject); + return idfObject; } } // namespace energyplus diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeating.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeating.cpp deleted file mode 100644 index b4cc7f7cab3..00000000000 --- a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeating.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/*********************************************************************************************************************** -* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. -* See also https://openstudio.net/license -***********************************************************************************************************************/ - -#include "../ForwardTranslator.hpp" -#include "../../model/Model.hpp" -#include "../../model/DistrictHeating.hpp" -#include "../../model/DistrictHeating_Impl.hpp" -#include "../../utilities/idf/IdfExtensibleGroup.hpp" -#include "../../utilities/idf/Workspace.hpp" -#include "../../utilities/idf/WorkspaceObjectOrder.hpp" -#include "../../utilities/core/Logger.hpp" -#include -#include - -using namespace openstudio::model; - -namespace openstudio { - -namespace energyplus { - - boost::optional ForwardTranslator::translateDistrictHeating(DistrictHeating& modelObject) { - OptionalString s; - OptionalDouble d; - OptionalModelObject temp; - boost::optional value; - - IdfObject idfObject(IddObjectType::DistrictHeating_Water); - - m_idfObjects.push_back(idfObject); - - /////////////////////////////////////////////////////////////////////////// - // Field: Name //////////////////////////////////////////////////////////// - s = modelObject.name(); - if (s) { - idfObject.setName(*s); - } - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - // Inlet Node Name //////////////////////////////////////////////////// - temp = modelObject.inletModelObject(); - if (temp) { - s = temp->name(); - if (s) { - idfObject.setString(openstudio::DistrictHeating_WaterFields::HotWaterInletNodeName, *s); - } - } - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - // Outlet Node Name /////////////////////////////////////////////////// - temp = modelObject.outletModelObject(); - if (temp) { - s = temp->name(); - if (s) { - idfObject.setString(openstudio::DistrictHeating_WaterFields::HotWaterOutletNodeName, *s); - } - } - /// - //////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - //Nominal Capacity /////////////////////////////////////////////////// - if (modelObject.isNominalCapacityAutosized()) { - idfObject.setString(DistrictHeating_WaterFields::NominalCapacity, "Autosize"); - } else if ((value = modelObject.nominalCapacity())) { - idfObject.setDouble(DistrictHeating_WaterFields::NominalCapacity, value.get()); - } - // - //////////////////////////////////////////////////////////////////////// - - return boost::optional(idfObject); - } - -} // namespace energyplus - -} // namespace openstudio diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingSteam.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingSteam.cpp new file mode 100644 index 00000000000..836978c814a --- /dev/null +++ b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingSteam.cpp @@ -0,0 +1,60 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Model.hpp" +#include "../../model/DistrictHeatingSteam.hpp" +#include "../../model/DistrictHeatingSteam_Impl.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../utilities/idf/IdfExtensibleGroup.hpp" +#include "../../utilities/idf/Workspace.hpp" +#include "../../utilities/idf/WorkspaceObjectOrder.hpp" +#include "../../utilities/core/Logger.hpp" +#include +#include + +using namespace openstudio::model; + +namespace openstudio { + +namespace energyplus { + + boost::optional ForwardTranslator::translateDistrictHeatingSteam(DistrictHeatingSteam& modelObject) { + + // Name + IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::DistrictHeating_Steam, modelObject); + + // Inlet Node Name + if (auto node_ = modelObject.inletModelObject()) { + idfObject.setString(DistrictHeating_SteamFields::SteamInletNodeName, node_->nameString()); + } + + // Outlet Node Name + if (auto node_ = modelObject.outletModelObject()) { + idfObject.setString(DistrictHeating_SteamFields::SteamOutletNodeName, node_->nameString()); + } + + // Nominal Capacity + if (modelObject.isNominalCapacityAutosized()) { + idfObject.setString(DistrictHeating_SteamFields::NominalCapacity, "Autosize"); + } else if (auto value_ = modelObject.nominalCapacity()) { + idfObject.setDouble(DistrictHeating_SteamFields::NominalCapacity, *value_); + } + + // Capacity Fraction Schedule Name + { + Schedule capacityFractionSchedule = modelObject.capacityFractionSchedule(); + if (auto sch_ = translateAndMapModelObject(capacityFractionSchedule)) { + idfObject.setString(DistrictHeating_SteamFields::CapacityFractionScheduleName, sch_->nameString()); + } + } + + return idfObject; + } + +} // namespace energyplus + +} // namespace openstudio diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingWater.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingWater.cpp new file mode 100644 index 00000000000..adeceeacdce --- /dev/null +++ b/src/energyplus/ForwardTranslator/ForwardTranslateDistrictHeatingWater.cpp @@ -0,0 +1,59 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Model.hpp" +#include "../../model/DistrictHeatingWater.hpp" +#include "../../model/DistrictHeatingWater_Impl.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../utilities/idf/IdfExtensibleGroup.hpp" +#include "../../utilities/idf/Workspace.hpp" +#include "../../utilities/idf/WorkspaceObjectOrder.hpp" +#include "../../utilities/core/Logger.hpp" +#include +#include + +using namespace openstudio::model; + +namespace openstudio { + +namespace energyplus { + + boost::optional ForwardTranslator::translateDistrictHeatingWater(DistrictHeatingWater& modelObject) { + + // Name + IdfObject idfObject = createRegisterAndNameIdfObject(IddObjectType::DistrictHeating_Water, modelObject); + + // Inlet Node Name + if (auto node_ = modelObject.inletModelObject()) { + idfObject.setString(DistrictHeating_WaterFields::HotWaterInletNodeName, node_->nameString()); + } + + // Outlet Node Name + if (auto node_ = modelObject.outletModelObject()) { + idfObject.setString(DistrictHeating_WaterFields::HotWaterOutletNodeName, node_->nameString()); + } + + // Nominal Capacity + if (modelObject.isNominalCapacityAutosized()) { + idfObject.setString(DistrictHeating_WaterFields::NominalCapacity, "Autosize"); + } else if (auto value_ = modelObject.nominalCapacity()) { + idfObject.setDouble(DistrictHeating_WaterFields::NominalCapacity, *value_); + } + + // Capacity Fraction Schedule Name + { + Schedule capacityFractionSchedule = modelObject.capacityFractionSchedule(); + if (auto sch_ = translateAndMapModelObject(capacityFractionSchedule)) { + idfObject.setString(DistrictHeating_WaterFields::CapacityFractionScheduleName, sch_->nameString()); + } + } + + return idfObject; + } +} // namespace energyplus + +} // namespace openstudio diff --git a/src/energyplus/ForwardTranslator/ForwardTranslatePlantEquipmentOperationSchemes.cpp b/src/energyplus/ForwardTranslator/ForwardTranslatePlantEquipmentOperationSchemes.cpp index 3cfc421445d..2ae937c92c1 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslatePlantEquipmentOperationSchemes.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslatePlantEquipmentOperationSchemes.cpp @@ -204,7 +204,13 @@ namespace energyplus { result = waterHeater.useSideDesignFlowRate(); break; } - case openstudio::IddObjectType::OS_DistrictHeating: { + case openstudio::IddObjectType::OS_DistrictCooling: { + break; + } + case openstudio::IddObjectType::OS_DistrictHeating_Water: { + break; + } + case openstudio::IddObjectType::OS_DistrictHeating_Steam: { break; } case openstudio::IddObjectType::OS_CentralHeatPumpSystem: { @@ -250,9 +256,6 @@ namespace energyplus { case openstudio::IddObjectType::OS_ThermalStorage_Ice_Detailed: { break; } - case openstudio::IddObjectType::OS_DistrictCooling: { - break; - } case openstudio::IddObjectType::OS_CoolingTower_SingleSpeed: { auto tower = component.cast(); result = tower.designWaterFlowRate(); diff --git a/src/energyplus/ForwardTranslator/ForwardTranslateSizingPlant.cpp b/src/energyplus/ForwardTranslator/ForwardTranslateSizingPlant.cpp index 7fd3dcf0acf..576d33382ec 100644 --- a/src/energyplus/ForwardTranslator/ForwardTranslateSizingPlant.cpp +++ b/src/energyplus/ForwardTranslator/ForwardTranslateSizingPlant.cpp @@ -41,7 +41,10 @@ namespace energyplus { case openstudio::IddObjectType::OS_WaterHeater_Stratified: { return PlantSizingType::HOTWATER; } - case openstudio::IddObjectType::OS_DistrictHeating: { + case openstudio::IddObjectType::OS_DistrictHeating_Water: { + return PlantSizingType::HOTWATER; + } + case openstudio::IddObjectType::OS_DistrictHeating_Steam: { return PlantSizingType::HOTWATER; } case openstudio::IddObjectType::OS_Chiller_Electric_ASHRAE205: { diff --git a/src/energyplus/Test/DistrictCooling_GTest.cpp b/src/energyplus/Test/DistrictCooling_GTest.cpp new file mode 100644 index 00000000000..a340686c887 --- /dev/null +++ b/src/energyplus/Test/DistrictCooling_GTest.cpp @@ -0,0 +1,52 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include +#include "EnergyPlusFixture.hpp" + +#include "../ForwardTranslator.hpp" + +#include "../../model/Model.hpp" +#include "../../model/DistrictCooling.hpp" + +#include + +#include +#include "../../utilities/idf/IdfObject.hpp" +#include "../../utilities/idf/IdfObject_Impl.hpp" + +#include "../../utilities/idf/WorkspaceObject.hpp" +#include "../../utilities/idf/WorkspaceObject_Impl.hpp" + +using namespace openstudio::energyplus; +using namespace openstudio::model; +using namespace openstudio; + +TEST_F(EnergyPlusFixture, ForwardTranslator_DistrictCooling) { + Model m; + + PlantLoop plant_loop(m); + + DistrictCooling districtCooling(m); + + EXPECT_TRUE(districtCooling.setNominalCapacity(1.0)); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtCooling.setCapacityFractionSchedule(scheduleConstant)); + + EXPECT_TRUE(plant_loop.addSupplyBranchForComponent(districtCooling)); + + ForwardTranslator ft; + Workspace w = ft.translateModel(m); + + EXPECT_EQ(1u, w.getObjectsByType(IddObjectType::DistrictCooling).size()); + + IdfObject idf_dc = w.getObjectsByType(IddObjectType::DistrictCooling)[0]; + + EXPECT_EQ(districtCooling.nameString(), idf_dc.getString(DistrictCoolingFields::Name, false).get()); + EXPECT_EQ(districtCooling.inletModelObject().get().nameString(), idf_dc.getString(DistrictCoolingFields::ChilledWaterInletNodeName, false).get()); + EXPECT_EQ(districtCooling.outletModelObject().get().nameString(), idf_dc.getString(DistrictCoolingFields::ChilledWaterOutletNodeName, false).get()); + EXPECT_EQ(1.0, idf_dc.getDouble(DistrictCoolingFields::NominalCapacity, false).get()); + EXPECT_EQ(scheduleConstant.nameString(), idf_dc.getString(DistrictCoolingFields::CapacityFractionScheduleName, false).get()); +} diff --git a/src/energyplus/Test/DistrictHeatingSteam_GTest.cpp b/src/energyplus/Test/DistrictHeatingSteam_GTest.cpp new file mode 100644 index 00000000000..50ec46480a3 --- /dev/null +++ b/src/energyplus/Test/DistrictHeatingSteam_GTest.cpp @@ -0,0 +1,54 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include +#include "EnergyPlusFixture.hpp" + +#include "../ForwardTranslator.hpp" + +#include "../../model/Model.hpp" +#include "../../model/DistrictHeatingSteam.hpp" + +#include + +#include +#include "../../utilities/idf/IdfObject.hpp" +#include "../../utilities/idf/IdfObject_Impl.hpp" + +#include "../../utilities/idf/WorkspaceObject.hpp" +#include "../../utilities/idf/WorkspaceObject_Impl.hpp" + +using namespace openstudio::energyplus; +using namespace openstudio::model; +using namespace openstudio; + +TEST_F(EnergyPlusFixture, ForwardTranslator_DistrictHeatingSteam) { + Model m; + + PlantLoop plant_loop(m); + + DistrictHeatingSteam districtHeatingSteam(m); + + EXPECT_TRUE(districtHeatingSteam.setNominalCapacity(1.0)); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtHeatingSteam.setCapacityFractionSchedule(scheduleConstant)); + + EXPECT_TRUE(plant_loop.addSupplyBranchForComponent(districtHeatingSteam)); + + ForwardTranslator ft; + Workspace w = ft.translateModel(m); + + EXPECT_EQ(1u, w.getObjectsByType(IddObjectType::DistrictHeating_Steam).size()); + + IdfObject idf_dhs = w.getObjectsByType(IddObjectType::DistrictHeating_Steam)[0]; + + EXPECT_EQ(districtHeatingSteam.nameString(), idf_dhs.getString(DistrictHeating_SteamFields::Name, false).get()); + EXPECT_EQ(districtHeatingSteam.inletModelObject().get().nameString(), + idf_dhs.getString(DistrictHeating_SteamFields::SteamInletNodeName, false).get()); + EXPECT_EQ(districtHeatingSteam.outletModelObject().get().nameString(), + idf_dhs.getString(DistrictHeating_SteamFields::SteamOutletNodeName, false).get()); + EXPECT_EQ(1.0, idf_dhs.getDouble(DistrictHeating_SteamFields::NominalCapacity, false).get()); + EXPECT_EQ(scheduleConstant.nameString(), idf_dhs.getString(DistrictHeating_SteamFields::CapacityFractionScheduleName, false).get()); +} diff --git a/src/energyplus/Test/DistrictHeatingWater_GTest.cpp b/src/energyplus/Test/DistrictHeatingWater_GTest.cpp new file mode 100644 index 00000000000..c1c870fbcf3 --- /dev/null +++ b/src/energyplus/Test/DistrictHeatingWater_GTest.cpp @@ -0,0 +1,55 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include +#include "EnergyPlusFixture.hpp" + +#include "../ForwardTranslator.hpp" + +#include "../../model/Model.hpp" +#include "../../model/DistrictHeatingWater.hpp" +#include "../../model/ScheduleConstant.hpp" + +#include + +#include +#include "../../utilities/idf/IdfObject.hpp" +#include "../../utilities/idf/IdfObject_Impl.hpp" + +#include "../../utilities/idf/WorkspaceObject.hpp" +#include "../../utilities/idf/WorkspaceObject_Impl.hpp" + +using namespace openstudio::energyplus; +using namespace openstudio::model; +using namespace openstudio; + +TEST_F(EnergyPlusFixture, ForwardTranslator_DistrictHeatingWater) { + Model m; + + PlantLoop plant_loop(m); + + DistrictHeatingWater districtHeatingWater(m); + + EXPECT_TRUE(districtHeatingWater.setNominalCapacity(1.0)); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtHeatingWater.setCapacityFractionSchedule(scheduleConstant)); + + EXPECT_TRUE(plant_loop.addSupplyBranchForComponent(districtHeatingWater)); + + ForwardTranslator ft; + Workspace w = ft.translateModel(m); + + EXPECT_EQ(1u, w.getObjectsByType(IddObjectType::DistrictHeating_Water).size()); + + IdfObject idf_dhw = w.getObjectsByType(IddObjectType::DistrictHeating_Water)[0]; + + EXPECT_EQ(districtHeatingWater.nameString(), idf_dhw.getString(DistrictHeating_WaterFields::Name, false).get()); + EXPECT_EQ(districtHeatingWater.inletModelObject().get().nameString(), + idf_dhw.getString(DistrictHeating_WaterFields::HotWaterInletNodeName, false).get()); + EXPECT_EQ(districtHeatingWater.outletModelObject().get().nameString(), + idf_dhw.getString(DistrictHeating_WaterFields::HotWaterOutletNodeName, false).get()); + EXPECT_EQ(1.0, idf_dhw.getDouble(DistrictHeating_WaterFields::NominalCapacity, false).get()); + EXPECT_EQ(scheduleConstant.nameString(), idf_dhw.getString(DistrictHeating_WaterFields::CapacityFractionScheduleName, false).get()); +} diff --git a/src/energyplus/Test/PlantEquipmentOperationSchemes_GTest.cpp b/src/energyplus/Test/PlantEquipmentOperationSchemes_GTest.cpp index 39fe1f0ca81..f1a331defa0 100644 --- a/src/energyplus/Test/PlantEquipmentOperationSchemes_GTest.cpp +++ b/src/energyplus/Test/PlantEquipmentOperationSchemes_GTest.cpp @@ -27,7 +27,7 @@ #include "../../model/CoolingTowerTwoSpeed.hpp" #include "../../model/CoolingTowerVariableSpeed.hpp" #include "../../model/DistrictCooling.hpp" -#include "../../model/DistrictHeating.hpp" +#include "../../model/DistrictHeatingWater.hpp" #include "../../model/EvaporativeFluidCoolerSingleSpeed.hpp" #include "../../model/EvaporativeFluidCoolerTwoSpeed.hpp" #include "../../model/FluidCoolerSingleSpeed.hpp" @@ -626,7 +626,7 @@ TEST_F(EnergyPlusFixture, ForwardTranslator_PlantEquipmentOperationSchemes_compo } { - DistrictHeating obj(m); + DistrictHeatingWater obj(m); EXPECT_EQ(openstudio::energyplus::ComponentType::HEATING, openstudio::energyplus::componentType(obj)); } diff --git a/src/model/CMakeLists.txt b/src/model/CMakeLists.txt index e9fa0111418..d5f7f454a05 100644 --- a/src/model/CMakeLists.txt +++ b/src/model/CMakeLists.txt @@ -623,9 +623,12 @@ set(${target_name}_src DistrictCooling.hpp DistrictCooling_Impl.hpp DistrictCooling.cpp - DistrictHeating.hpp - DistrictHeating_Impl.hpp - DistrictHeating.cpp + DistrictHeatingWater.hpp + DistrictHeatingWater_Impl.hpp + DistrictHeatingWater.cpp + DistrictHeatingSteam.hpp + DistrictHeatingSteam_Impl.hpp + DistrictHeatingSteam.cpp Duct.hpp Duct_Impl.hpp Duct.cpp @@ -2050,7 +2053,8 @@ set(${target_name}_test_src test/DesignSpecificationOutdoorAir_GTest.cpp test/DesignSpecificationZoneAirDistribution_GTest.cpp test/DistrictCooling_GTest.cpp - test/DistrictHeating_GTest.cpp + test/DistrictHeatingWater_GTest.cpp + test/DistrictHeatingSteam_GTest.cpp test/Duct_GTest.cpp test/ElectricEquipment_GTest.cpp test/ElectricEquipmentITEAirCooled_GTest.cpp diff --git a/src/model/ConcreteModelObjects.hpp b/src/model/ConcreteModelObjects.hpp index c61481f755b..40e218737ef 100644 --- a/src/model/ConcreteModelObjects.hpp +++ b/src/model/ConcreteModelObjects.hpp @@ -193,7 +193,8 @@ #include "DesignSpecificationOutdoorAir.hpp" #include "DesignSpecificationZoneAirDistribution.hpp" #include "DistrictCooling.hpp" -#include "DistrictHeating.hpp" +#include "DistrictHeatingWater.hpp" +#include "DistrictHeatingSteam.hpp" #include "Duct.hpp" #include "ElectricEquipment.hpp" #include "ElectricEquipmentDefinition.hpp" @@ -744,7 +745,8 @@ #include "DesignSpecificationOutdoorAir_Impl.hpp" #include "DesignSpecificationZoneAirDistribution_Impl.hpp" #include "DistrictCooling_Impl.hpp" -#include "DistrictHeating_Impl.hpp" +#include "DistrictHeatingWater_Impl.hpp" +#include "DistrictHeatingSteam_Impl.hpp" #include "Duct_Impl.hpp" #include "ElectricEquipment_Impl.hpp" #include "ElectricEquipmentDefinition_Impl.hpp" diff --git a/src/model/DistrictCooling.cpp b/src/model/DistrictCooling.cpp index b4a146482bd..2a9650f6a4d 100644 --- a/src/model/DistrictCooling.cpp +++ b/src/model/DistrictCooling.cpp @@ -5,8 +5,11 @@ #include "DistrictCooling.hpp" #include "DistrictCooling_Impl.hpp" +#include "Model.hpp" #include "Node.hpp" #include "Node_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" #include "../utilities/core/Assert.hpp" #include "../utilities/data/DataEnums.hpp" @@ -47,6 +50,33 @@ namespace model { return DistrictCooling::iddObjectType(); } + std::vector DistrictCooling_Impl::getScheduleTypeKeys(const Schedule& schedule) const { + std::vector result; + const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_DistrictCoolingFields::CapacityFractionSchedule) != fieldIndices.cend()) { + result.emplace_back("DistrictCooling", "Capacity Fraction Schedule"); + } + return result; + } + + unsigned DistrictCooling_Impl::inletPort() const { + return OS_DistrictCoolingFields::ChilledWaterInletNodeName; + } + + unsigned DistrictCooling_Impl::outletPort() const { + return OS_DistrictCoolingFields::ChilledWaterOutletNodeName; + } + + bool DistrictCooling_Impl::addToNode(Node& node) { + if (boost::optional plant = node.plantLoop()) { + if (plant->supplyComponent(node.handle())) { + return StraightComponent_Impl::addToNode(node); + } + } + + return false; + } + boost::optional DistrictCooling_Impl::nominalCapacity() const { return getDouble(OS_DistrictCoolingFields::NominalCapacity, true); } @@ -60,35 +90,24 @@ namespace model { return result; } - bool DistrictCooling_Impl::setNominalCapacity(boost::optional nominalCapacity) { - bool result(false); - if (nominalCapacity) { - result = setDouble(OS_DistrictCoolingFields::NominalCapacity, nominalCapacity.get()); - } - return result; + bool DistrictCooling_Impl::setNominalCapacity(double nominalCapacity) { + return setDouble(OS_DistrictCoolingFields::NominalCapacity, nominalCapacity); } void DistrictCooling_Impl::autosizeNominalCapacity() { - bool result = setString(OS_DistrictCoolingFields::NominalCapacity, "autosize"); + const bool result = setString(OS_DistrictCoolingFields::NominalCapacity, "autosize"); OS_ASSERT(result); } - unsigned DistrictCooling_Impl::inletPort() const { - return OS_DistrictCoolingFields::ChilledWaterInletNodeName; + Schedule DistrictCooling_Impl::capacityFractionSchedule() const { + auto sch_ = getObject().getModelObjectTarget(OS_DistrictCoolingFields::CapacityFractionSchedule); + OS_ASSERT(sch_); + return *sch_; } - unsigned DistrictCooling_Impl::outletPort() const { - return OS_DistrictCoolingFields::ChilledWaterOutletNodeName; - } - - bool DistrictCooling_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { - if (plant->supplyComponent(node.handle())) { - return StraightComponent_Impl::addToNode(node); - } - } - - return false; + bool DistrictCooling_Impl::setCapacityFractionSchedule(Schedule& schedule) { + const bool result = setSchedule(OS_DistrictCoolingFields::CapacityFractionSchedule, "DistrictCooling", "Capacity Fraction", schedule); + return result; } boost::optional DistrictCooling_Impl::autosizedNominalCapacity() const { @@ -128,6 +147,12 @@ namespace model { DistrictCooling::DistrictCooling(const Model& model) : StraightComponent(DistrictCooling::iddObjectType(), model) { OS_ASSERT(getImpl()); autosizeNominalCapacity(); + + { + auto schedule = model.alwaysOnContinuousSchedule(); + const bool ok = setCapacityFractionSchedule(schedule); + OS_ASSERT(ok); + } } IddObjectType DistrictCooling::iddObjectType() { @@ -143,6 +168,10 @@ namespace model { return getImpl()->isNominalCapacityAutosized(); } + Schedule DistrictCooling::capacityFractionSchedule() const { + return getImpl()->capacityFractionSchedule(); + } + bool DistrictCooling::setNominalCapacity(double nominalCapacity) { return getImpl()->setNominalCapacity(nominalCapacity); } @@ -151,6 +180,10 @@ namespace model { getImpl()->autosizeNominalCapacity(); } + bool DistrictCooling::setCapacityFractionSchedule(Schedule& schedule) { + return getImpl()->setCapacityFractionSchedule(schedule); + } + /// @cond DistrictCooling::DistrictCooling(std::shared_ptr impl) : StraightComponent(std::move(impl)) {} diff --git a/src/model/DistrictCooling.hpp b/src/model/DistrictCooling.hpp index 58abcff26a5..ecd5f3c6a99 100644 --- a/src/model/DistrictCooling.hpp +++ b/src/model/DistrictCooling.hpp @@ -13,6 +13,8 @@ namespace openstudio { namespace model { + class Schedule; + namespace detail { class DistrictCooling_Impl; @@ -28,6 +30,7 @@ namespace model { /** @name Constructors and Destructors */ //@{ + // The capacityFractionSchedule is defaulted to alwaysOnContinuousSchedule explicit DistrictCooling(const Model& model); virtual ~DistrictCooling() = default; @@ -53,6 +56,8 @@ namespace model { bool isNominalCapacityAutosized() const; + Schedule capacityFractionSchedule() const; + //@} /** @name Setters */ //@{ @@ -61,6 +66,8 @@ namespace model { void autosizeNominalCapacity(); + bool setCapacityFractionSchedule(Schedule& schedule); + //@} /** @name Other */ //@{ diff --git a/src/model/DistrictCooling_Impl.hpp b/src/model/DistrictCooling_Impl.hpp index 064b30e7003..0ef719ea371 100644 --- a/src/model/DistrictCooling_Impl.hpp +++ b/src/model/DistrictCooling_Impl.hpp @@ -13,6 +13,8 @@ namespace openstudio { namespace model { + class Schedule; + namespace detail { /** DistrictCooling_Impl is a StraightComponent_Impl that is the implementation class for DistrictCooling.*/ @@ -44,6 +46,8 @@ namespace model { virtual unsigned outletPort() const override; + virtual bool addToNode(Node& node) override; + virtual void autosize() override; virtual void applySizingValues() override; @@ -53,6 +57,8 @@ namespace model { virtual std::vector heatingFuelTypes() const override; virtual std::vector appGHeatingFuelTypes() const override; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + //@} /** @name Getters */ //@{ @@ -61,21 +67,23 @@ namespace model { bool isNominalCapacityAutosized() const; - boost::optional autosizedNominalCapacity() const; + Schedule capacityFractionSchedule() const; //@} /** @name Setters */ //@{ - bool addToNode(Node& node) override; + bool setNominalCapacity(double nominalCapacity); + + void autosizeNominalCapacity(); + + bool setCapacityFractionSchedule(Schedule& schedule); //@} /** @name Other */ //@{ - bool setNominalCapacity(boost::optional nominalCapacity); - - void autosizeNominalCapacity(); + boost::optional autosizedNominalCapacity() const; //@} diff --git a/src/model/DistrictHeating.cpp b/src/model/DistrictHeating.cpp deleted file mode 100644 index 75d89c35e44..00000000000 --- a/src/model/DistrictHeating.cpp +++ /dev/null @@ -1,165 +0,0 @@ -/*********************************************************************************************************************** -* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. -* See also https://openstudio.net/license -***********************************************************************************************************************/ - -#include "DistrictHeating.hpp" -#include "DistrictHeating_Impl.hpp" -#include "Node.hpp" -#include "Node_Impl.hpp" - -#include "../utilities/core/Assert.hpp" -#include "../utilities/data/DataEnums.hpp" - -#include -#include - -namespace openstudio { -namespace model { - - namespace detail { - - DistrictHeating_Impl::DistrictHeating_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) - : StraightComponent_Impl(idfObject, model, keepHandle) { - OS_ASSERT(idfObject.iddObject().type() == DistrictHeating::iddObjectType()); - } - - DistrictHeating_Impl::DistrictHeating_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) - : StraightComponent_Impl(other, model, keepHandle) { - OS_ASSERT(other.iddObject().type() == DistrictHeating::iddObjectType()); - } - - DistrictHeating_Impl::DistrictHeating_Impl(const DistrictHeating_Impl& other, Model_Impl* model, bool keepHandle) - : StraightComponent_Impl(other, model, keepHandle) {} - - const std::vector& DistrictHeating_Impl::outputVariableNames() const { - static const std::vector result{ - "District Heating Water Energy", - "District Heating Water Rate", - "District Heating Water Inlet Temperature", - "District Heating Water Outlet Temperature", - "District Heating Water Mass Flow Rate", - }; - return result; - } - - IddObjectType DistrictHeating_Impl::iddObjectType() const { - return DistrictHeating::iddObjectType(); - } - - boost::optional DistrictHeating_Impl::nominalCapacity() const { - return getDouble(OS_DistrictHeatingFields::NominalCapacity, true); - } - - bool DistrictHeating_Impl::isNominalCapacityAutosized() const { - bool result = false; - boost::optional value = getString(OS_DistrictHeatingFields::NominalCapacity, true); - if (value) { - result = openstudio::istringEqual(value.get(), "autosize"); - } - return result; - } - - bool DistrictHeating_Impl::setNominalCapacity(boost::optional nominalCapacity) { - bool result(false); - if (nominalCapacity) { - result = setDouble(OS_DistrictHeatingFields::NominalCapacity, nominalCapacity.get()); - } - return result; - } - - void DistrictHeating_Impl::autosizeNominalCapacity() { - bool result = setString(OS_DistrictHeatingFields::NominalCapacity, "autosize"); - OS_ASSERT(result); - } - - unsigned DistrictHeating_Impl::inletPort() const { - return OS_DistrictHeatingFields::HotWaterInletNodeName; - } - - unsigned DistrictHeating_Impl::outletPort() const { - return OS_DistrictHeatingFields::HotWaterOutletNodeName; - } - - bool DistrictHeating_Impl::addToNode(Node& node) { - if (boost::optional plant = node.plantLoop()) { - if (plant->supplyComponent(node.handle())) { - return StraightComponent_Impl::addToNode(node); - } - } - - return false; - } - - boost::optional DistrictHeating_Impl::autosizedNominalCapacity() const { - return getAutosizedValue("Design Size Nominal Capacity", "W"); - } - - void DistrictHeating_Impl::autosize() { - autosizeNominalCapacity(); - } - - void DistrictHeating_Impl::applySizingValues() { - boost::optional val; - val = autosizedNominalCapacity(); - if (val) { - setNominalCapacity(val.get()); - } - } - - ComponentType DistrictHeating_Impl::componentType() const { - return ComponentType::Heating; - } - - std::vector DistrictHeating_Impl::coolingFuelTypes() const { - return {}; - } - - std::vector DistrictHeating_Impl::heatingFuelTypes() const { - return {FuelType::DistrictHeating}; - } - - std::vector DistrictHeating_Impl::appGHeatingFuelTypes() const { - return {AppGFuelType::District}; - } - - } // namespace detail - - DistrictHeating::DistrictHeating(const Model& model) : StraightComponent(DistrictHeating::iddObjectType(), model) { - OS_ASSERT(getImpl()); - autosizeNominalCapacity(); - } - - IddObjectType DistrictHeating::iddObjectType() { - IddObjectType result(IddObjectType::OS_DistrictHeating); - return result; - } - - boost::optional DistrictHeating::nominalCapacity() const { - return getImpl()->nominalCapacity(); - } - - bool DistrictHeating::isNominalCapacityAutosized() const { - return getImpl()->isNominalCapacityAutosized(); - } - - bool DistrictHeating::setNominalCapacity(double nominalCapacity) { - return getImpl()->setNominalCapacity(nominalCapacity); - } - - void DistrictHeating::autosizeNominalCapacity() { - getImpl()->autosizeNominalCapacity(); - } - - /// @cond - - DistrictHeating::DistrictHeating(std::shared_ptr impl) : StraightComponent(std::move(impl)) {} - /// @endcond - - boost::optional DistrictHeating::autosizedNominalCapacity() const { - return getImpl()->autosizedNominalCapacity(); - } - -} // namespace model - -} // namespace openstudio diff --git a/src/model/DistrictHeating.hpp b/src/model/DistrictHeating.hpp deleted file mode 100644 index 50bd63d894b..00000000000 --- a/src/model/DistrictHeating.hpp +++ /dev/null @@ -1,98 +0,0 @@ -/*********************************************************************************************************************** -* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. -* See also https://openstudio.net/license -***********************************************************************************************************************/ - -#ifndef MODEL_DISTRICTHEATING_HPP -#define MODEL_DISTRICTHEATING_HPP - -#include "ModelAPI.hpp" -#include "StraightComponent.hpp" - -namespace openstudio { - -namespace model { - - namespace detail { - - class DistrictHeating_Impl; - - } // namespace detail - - /** DistrictHeating is a StraightComponent that wraps the OpenStudio IDD object 'OS:DistrictHeating'. */ - - class MODEL_API DistrictHeating : public StraightComponent - { - - public: - /** @name Constructors and Destructors */ - //@{ - - explicit DistrictHeating(const Model& model); - - virtual ~DistrictHeating() = default; - // Default the copy and move operators because the virtual dtor is explicit - DistrictHeating(const DistrictHeating& other) = default; - DistrictHeating(DistrictHeating&& other) = default; - DistrictHeating& operator=(const DistrictHeating&) = default; - DistrictHeating& operator=(DistrictHeating&&) = default; - - //@} - - //@} - /** @name Static Methods */ - //@{ - - static IddObjectType iddObjectType(); - - //@} - /** @name Getters */ - //@{ - - boost::optional nominalCapacity() const; - - bool isNominalCapacityAutosized() const; - - //@} - /** @name Setters */ - //@{ - - bool setNominalCapacity(double nominalCapacity); - - void autosizeNominalCapacity(); - - //@} - /** @name Other */ - //@{ - - //@} - - boost::optional autosizedNominalCapacity() const; - - protected: - /// @cond - using ImplType = detail::DistrictHeating_Impl; - - explicit DistrictHeating(std::shared_ptr impl); - - friend class detail::DistrictHeating_Impl; - friend class Model; - friend class IdfObject; - friend class openstudio::detail::IdfObject_Impl; - - /// @endcond - - private: - REGISTER_LOGGER("openstudio.model.DistrictHeating"); - }; - - /** \relates DistrictHeating*/ - using OptionalDistrictHeating = boost::optional; - - /** \relates DistrictHeating*/ - using DistrictHeatingVector = std::vector; - -} // namespace model -} // namespace openstudio - -#endif // MODEL_DISTRICTHEATING_HPP diff --git a/src/model/DistrictHeatingSteam.cpp b/src/model/DistrictHeatingSteam.cpp new file mode 100644 index 00000000000..8a7f998b498 --- /dev/null +++ b/src/model/DistrictHeatingSteam.cpp @@ -0,0 +1,195 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include "DistrictHeatingSteam.hpp" +#include "DistrictHeatingSteam_Impl.hpp" +#include "Model.hpp" +#include "Node.hpp" +#include "Node_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" + +#include "../utilities/core/Assert.hpp" +#include "../utilities/data/DataEnums.hpp" + +#include +#include + +namespace openstudio { +namespace model { + + namespace detail { + + DistrictHeatingSteam_Impl::DistrictHeatingSteam_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(idfObject, model, keepHandle) { + OS_ASSERT(idfObject.iddObject().type() == DistrictHeatingSteam::iddObjectType()); + } + + DistrictHeatingSteam_Impl::DistrictHeatingSteam_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(other, model, keepHandle) { + OS_ASSERT(other.iddObject().type() == DistrictHeatingSteam::iddObjectType()); + } + + DistrictHeatingSteam_Impl::DistrictHeatingSteam_Impl(const DistrictHeatingSteam_Impl& other, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(other, model, keepHandle) {} + + const std::vector& DistrictHeatingSteam_Impl::outputVariableNames() const { + static const std::vector result{ + "District Heating Hot Water Rate", "District Heating Hot Water Energy", "District Heating Rate", + "District Heating Inlet Temperature", "District Heating Outlet Temperature", "District Heating Mass Flow Rate"}; + return result; + } + + IddObjectType DistrictHeatingSteam_Impl::iddObjectType() const { + return DistrictHeatingSteam::iddObjectType(); + } + + std::vector DistrictHeatingSteam_Impl::getScheduleTypeKeys(const Schedule& schedule) const { + std::vector result; + const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_DistrictHeating_SteamFields::CapacityFractionSchedule) != fieldIndices.cend()) { + result.emplace_back("DistrictHeatingSteam", "Capacity Fraction Schedule"); + } + return result; + } + + unsigned DistrictHeatingSteam_Impl::inletPort() const { + return OS_DistrictHeating_SteamFields::SteamInletNodeName; + } + + unsigned DistrictHeatingSteam_Impl::outletPort() const { + return OS_DistrictHeating_SteamFields::SteamOutletNodeName; + } + + bool DistrictHeatingSteam_Impl::addToNode(Node& node) { + if (boost::optional plant = node.plantLoop()) { + if (plant->supplyComponent(node.handle())) { + return StraightComponent_Impl::addToNode(node); + } + } + + return false; + } + + boost::optional DistrictHeatingSteam_Impl::nominalCapacity() const { + return getDouble(OS_DistrictHeating_SteamFields::NominalCapacity, true); + } + + bool DistrictHeatingSteam_Impl::isNominalCapacityAutosized() const { + bool result = false; + boost::optional value = getString(OS_DistrictHeating_SteamFields::NominalCapacity, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + bool DistrictHeatingSteam_Impl::setNominalCapacity(double nominalCapacity) { + return setDouble(OS_DistrictHeating_SteamFields::NominalCapacity, nominalCapacity); + } + + void DistrictHeatingSteam_Impl::autosizeNominalCapacity() { + const bool result = setString(OS_DistrictHeating_SteamFields::NominalCapacity, "autosize"); + OS_ASSERT(result); + } + + Schedule DistrictHeatingSteam_Impl::capacityFractionSchedule() const { + auto sch_ = getObject().getModelObjectTarget(OS_DistrictHeating_SteamFields::CapacityFractionSchedule); + OS_ASSERT(sch_); + return *sch_; + } + + bool DistrictHeatingSteam_Impl::setCapacityFractionSchedule(Schedule& schedule) { + const bool result = + setSchedule(OS_DistrictHeating_SteamFields::CapacityFractionSchedule, "DistrictHeatingSteam", "Capacity Fraction", schedule); + return result; + } + + boost::optional DistrictHeatingSteam_Impl::autosizedNominalCapacity() const { + return getAutosizedValue("Design Size Nominal Capacity", "W"); + } + + void DistrictHeatingSteam_Impl::autosize() { + autosizeNominalCapacity(); + } + + void DistrictHeatingSteam_Impl::applySizingValues() { + boost::optional val; + val = autosizedNominalCapacity(); + if (val) { + setNominalCapacity(val.get()); + } + } + + ComponentType DistrictHeatingSteam_Impl::componentType() const { + return ComponentType::Heating; + } + + std::vector DistrictHeatingSteam_Impl::coolingFuelTypes() const { + return {}; + } + + std::vector DistrictHeatingSteam_Impl::heatingFuelTypes() const { + return {FuelType::Steam}; + } + + std::vector DistrictHeatingSteam_Impl::appGHeatingFuelTypes() const { + return {AppGFuelType::District}; + } + + } // namespace detail + + DistrictHeatingSteam::DistrictHeatingSteam(const Model& model) : StraightComponent(DistrictHeatingSteam::iddObjectType(), model) { + OS_ASSERT(getImpl()); + autosizeNominalCapacity(); + + { + auto schedule = model.alwaysOnContinuousSchedule(); + const bool ok = setCapacityFractionSchedule(schedule); + OS_ASSERT(ok); + } + } + + IddObjectType DistrictHeatingSteam::iddObjectType() { + IddObjectType result(IddObjectType::OS_DistrictHeating_Steam); + return result; + } + + boost::optional DistrictHeatingSteam::nominalCapacity() const { + return getImpl()->nominalCapacity(); + } + + bool DistrictHeatingSteam::isNominalCapacityAutosized() const { + return getImpl()->isNominalCapacityAutosized(); + } + + Schedule DistrictHeatingSteam::capacityFractionSchedule() const { + return getImpl()->capacityFractionSchedule(); + } + + bool DistrictHeatingSteam::setNominalCapacity(double nominalCapacity) { + return getImpl()->setNominalCapacity(nominalCapacity); + } + + void DistrictHeatingSteam::autosizeNominalCapacity() { + getImpl()->autosizeNominalCapacity(); + } + + bool DistrictHeatingSteam::setCapacityFractionSchedule(Schedule& schedule) { + return getImpl()->setCapacityFractionSchedule(schedule); + } + + /// @cond + + DistrictHeatingSteam::DistrictHeatingSteam(std::shared_ptr impl) : StraightComponent(std::move(impl)) {} + /// @endcond + + boost::optional DistrictHeatingSteam::autosizedNominalCapacity() const { + return getImpl()->autosizedNominalCapacity(); + } + +} // namespace model + +} // namespace openstudio diff --git a/src/model/DistrictHeatingSteam.hpp b/src/model/DistrictHeatingSteam.hpp new file mode 100644 index 00000000000..6b9ad97e1d2 --- /dev/null +++ b/src/model/DistrictHeatingSteam.hpp @@ -0,0 +1,105 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#ifndef MODEL_DISTRICTHEATINGSTEAM_HPP +#define MODEL_DISTRICTHEATINGSTEAM_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent.hpp" + +namespace openstudio { + +namespace model { + + class Schedule; + + namespace detail { + + class DistrictHeatingSteam_Impl; + + } // namespace detail + + /** DistrictHeatingSteam is a StraightComponent that wraps the OpenStudio IDD object 'OS:DistrictHeatingSteam'. */ + + class MODEL_API DistrictHeatingSteam : public StraightComponent + { + + public: + /** @name Constructors and Destructors */ + //@{ + + // The capacityFractionSchedule is defaulted to alwaysOnContinuousSchedule + explicit DistrictHeatingSteam(const Model& model); + + virtual ~DistrictHeatingSteam() = default; + // Default the copy and move operators because the virtual dtor is explicit + DistrictHeatingSteam(const DistrictHeatingSteam& other) = default; + DistrictHeatingSteam(DistrictHeatingSteam&& other) = default; + DistrictHeatingSteam& operator=(const DistrictHeatingSteam&) = default; + DistrictHeatingSteam& operator=(DistrictHeatingSteam&&) = default; + + //@} + + //@} + /** @name Static Methods */ + //@{ + + static IddObjectType iddObjectType(); + + //@} + /** @name Getters */ + //@{ + + boost::optional nominalCapacity() const; + + bool isNominalCapacityAutosized() const; + + Schedule capacityFractionSchedule() const; + + //@} + /** @name Setters */ + //@{ + + bool setNominalCapacity(double nominalCapacity); + + void autosizeNominalCapacity(); + + bool setCapacityFractionSchedule(Schedule& schedule); + + //@} + /** @name Other */ + //@{ + + //@} + + boost::optional autosizedNominalCapacity() const; + + protected: + /// @cond + using ImplType = detail::DistrictHeatingSteam_Impl; + + explicit DistrictHeatingSteam(std::shared_ptr impl); + + friend class detail::DistrictHeatingSteam_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + + /// @endcond + + private: + REGISTER_LOGGER("openstudio.model.DistrictHeatingSteam"); + }; + + /** \relates DistrictHeatingSteam*/ + using OptionalDistrictHeatingSteam = boost::optional; + + /** \relates DistrictHeatingSteam*/ + using DistrictHeatingSteamVector = std::vector; + +} // namespace model +} // namespace openstudio + +#endif // MODEL_DISTRICTHEATINGSTEAM_HPP diff --git a/src/model/DistrictHeating_Impl.hpp b/src/model/DistrictHeatingSteam_Impl.hpp similarity index 60% rename from src/model/DistrictHeating_Impl.hpp rename to src/model/DistrictHeatingSteam_Impl.hpp index 5f37514f566..407363839e7 100644 --- a/src/model/DistrictHeating_Impl.hpp +++ b/src/model/DistrictHeatingSteam_Impl.hpp @@ -3,8 +3,8 @@ * See also https://openstudio.net/license ***********************************************************************************************************************/ -#ifndef MODEL_DISTRICTHEATING_IMPL_HPP -#define MODEL_DISTRICTHEATING_IMPL_HPP +#ifndef MODEL_DISTRICTHEATINGSTEAM_IMPL_HPP +#define MODEL_DISTRICTHEATINGSTEAM_IMPL_HPP #include "ModelAPI.hpp" #include "StraightComponent_Impl.hpp" @@ -13,24 +13,26 @@ namespace openstudio { namespace model { + class Schedule; + namespace detail { - /** DistrictHeating_Impl is a StraightComponent_Impl that is the implementation class for DistrictHeating.*/ + /** DistrictHeatingSteam_Impl is a StraightComponent_Impl that is the implementation class for DistrictHeatingSteam.*/ - class MODEL_API DistrictHeating_Impl : public StraightComponent_Impl + class MODEL_API DistrictHeatingSteam_Impl : public StraightComponent_Impl { public: /** @name Constructors and Destructors */ //@{ - DistrictHeating_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); + DistrictHeatingSteam_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); - DistrictHeating_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); + DistrictHeatingSteam_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); - DistrictHeating_Impl(const DistrictHeating_Impl& other, Model_Impl* model, bool keepHandle); + DistrictHeatingSteam_Impl(const DistrictHeatingSteam_Impl& other, Model_Impl* model, bool keepHandle); - virtual ~DistrictHeating_Impl() = default; + virtual ~DistrictHeatingSteam_Impl() = default; //@} /** @name Virtual Methods */ @@ -43,6 +45,9 @@ namespace model { virtual unsigned inletPort() const override; virtual unsigned outletPort() const override; + + virtual bool addToNode(Node& node) override; + virtual void autosize() override; virtual void applySizingValues() override; @@ -52,6 +57,8 @@ namespace model { virtual std::vector heatingFuelTypes() const override; virtual std::vector appGHeatingFuelTypes() const override; + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + //@} /** @name Getters */ //@{ @@ -60,27 +67,29 @@ namespace model { bool isNominalCapacityAutosized() const; - boost::optional autosizedNominalCapacity() const; + Schedule capacityFractionSchedule() const; //@} /** @name Setters */ //@{ - bool setNominalCapacity(boost::optional nominalCapacity); + bool setNominalCapacity(double nominalCapacity); void autosizeNominalCapacity(); - bool addToNode(Node& node) override; + bool setCapacityFractionSchedule(Schedule& schedule); //@} /** @name Other */ //@{ + boost::optional autosizedNominalCapacity() const; + //@} protected: private: - REGISTER_LOGGER("openstudio.model.DistrictHeating"); + REGISTER_LOGGER("openstudio.model.DistrictHeatingSteam"); }; } // namespace detail @@ -89,4 +98,4 @@ namespace model { } // namespace openstudio -#endif // MODEL_DISTRICTHEATING_IMPL_HPP +#endif // MODEL_DISTRICTHEATINGSTEAM_IMPL_HPP diff --git a/src/model/DistrictHeatingWater.cpp b/src/model/DistrictHeatingWater.cpp new file mode 100644 index 00000000000..31be4ae86f9 --- /dev/null +++ b/src/model/DistrictHeatingWater.cpp @@ -0,0 +1,199 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include "DistrictHeatingWater.hpp" +#include "DistrictHeatingWater_Impl.hpp" +#include "Model.hpp" +#include "Node.hpp" +#include "Node_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" + +#include "../utilities/core/Assert.hpp" +#include "../utilities/data/DataEnums.hpp" + +#include +#include + +namespace openstudio { +namespace model { + + namespace detail { + + DistrictHeatingWater_Impl::DistrictHeatingWater_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(idfObject, model, keepHandle) { + OS_ASSERT(idfObject.iddObject().type() == DistrictHeatingWater::iddObjectType()); + } + + DistrictHeatingWater_Impl::DistrictHeatingWater_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(other, model, keepHandle) { + OS_ASSERT(other.iddObject().type() == DistrictHeatingWater::iddObjectType()); + } + + DistrictHeatingWater_Impl::DistrictHeatingWater_Impl(const DistrictHeatingWater_Impl& other, Model_Impl* model, bool keepHandle) + : StraightComponent_Impl(other, model, keepHandle) {} + + const std::vector& DistrictHeatingWater_Impl::outputVariableNames() const { + static const std::vector result{ + "District Heating Water Energy", + "District Heating Water Rate", + "District Heating Water Inlet Temperature", + "District Heating Water Outlet Temperature", + "District Heating Water Mass Flow Rate", + }; + return result; + } + + IddObjectType DistrictHeatingWater_Impl::iddObjectType() const { + return DistrictHeatingWater::iddObjectType(); + } + + std::vector DistrictHeatingWater_Impl::getScheduleTypeKeys(const Schedule& schedule) const { + std::vector result; + const UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + if (std::find(fieldIndices.cbegin(), fieldIndices.cend(), OS_DistrictHeating_WaterFields::CapacityFractionSchedule) != fieldIndices.cend()) { + result.emplace_back("DistrictHeatingWater", "Capacity Fraction Schedule"); + } + return result; + } + + unsigned DistrictHeatingWater_Impl::inletPort() const { + return OS_DistrictHeating_WaterFields::HotWaterInletNodeName; + } + + unsigned DistrictHeatingWater_Impl::outletPort() const { + return OS_DistrictHeating_WaterFields::HotWaterOutletNodeName; + } + + bool DistrictHeatingWater_Impl::addToNode(Node& node) { + if (boost::optional plant = node.plantLoop()) { + if (plant->supplyComponent(node.handle())) { + return StraightComponent_Impl::addToNode(node); + } + } + + return false; + } + + boost::optional DistrictHeatingWater_Impl::nominalCapacity() const { + return getDouble(OS_DistrictHeating_WaterFields::NominalCapacity, true); + } + + bool DistrictHeatingWater_Impl::isNominalCapacityAutosized() const { + bool result = false; + boost::optional value = getString(OS_DistrictHeating_WaterFields::NominalCapacity, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + bool DistrictHeatingWater_Impl::setNominalCapacity(double nominalCapacity) { + return setDouble(OS_DistrictHeating_WaterFields::NominalCapacity, nominalCapacity); + } + + void DistrictHeatingWater_Impl::autosizeNominalCapacity() { + const bool result = setString(OS_DistrictHeating_WaterFields::NominalCapacity, "autosize"); + OS_ASSERT(result); + } + + Schedule DistrictHeatingWater_Impl::capacityFractionSchedule() const { + auto sch_ = getObject().getModelObjectTarget(OS_DistrictHeating_WaterFields::CapacityFractionSchedule); + OS_ASSERT(sch_); + return *sch_; + } + + bool DistrictHeatingWater_Impl::setCapacityFractionSchedule(Schedule& schedule) { + const bool result = + setSchedule(OS_DistrictHeating_WaterFields::CapacityFractionSchedule, "DistrictHeatingWater", "Capacity Fraction", schedule); + return result; + } + + boost::optional DistrictHeatingWater_Impl::autosizedNominalCapacity() const { + return getAutosizedValue("Design Size Nominal Capacity", "W"); + } + + void DistrictHeatingWater_Impl::autosize() { + autosizeNominalCapacity(); + } + + void DistrictHeatingWater_Impl::applySizingValues() { + boost::optional val; + val = autosizedNominalCapacity(); + if (val) { + setNominalCapacity(val.get()); + } + } + + ComponentType DistrictHeatingWater_Impl::componentType() const { + return ComponentType::Heating; + } + + std::vector DistrictHeatingWater_Impl::coolingFuelTypes() const { + return {}; + } + + std::vector DistrictHeatingWater_Impl::heatingFuelTypes() const { + return {FuelType::DistrictHeating}; + } + + std::vector DistrictHeatingWater_Impl::appGHeatingFuelTypes() const { + return {AppGFuelType::District}; + } + + } // namespace detail + + DistrictHeatingWater::DistrictHeatingWater(const Model& model) : StraightComponent(DistrictHeatingWater::iddObjectType(), model) { + OS_ASSERT(getImpl()); + autosizeNominalCapacity(); + + { + auto schedule = model.alwaysOnContinuousSchedule(); + const bool ok = setCapacityFractionSchedule(schedule); + OS_ASSERT(ok); + } + } + + IddObjectType DistrictHeatingWater::iddObjectType() { + IddObjectType result(IddObjectType::OS_DistrictHeating_Water); + return result; + } + + boost::optional DistrictHeatingWater::nominalCapacity() const { + return getImpl()->nominalCapacity(); + } + + bool DistrictHeatingWater::isNominalCapacityAutosized() const { + return getImpl()->isNominalCapacityAutosized(); + } + + bool DistrictHeatingWater::setNominalCapacity(double nominalCapacity) { + return getImpl()->setNominalCapacity(nominalCapacity); + } + + void DistrictHeatingWater::autosizeNominalCapacity() { + getImpl()->autosizeNominalCapacity(); + } + + Schedule DistrictHeatingWater::capacityFractionSchedule() const { + return getImpl()->capacityFractionSchedule(); + } + + bool DistrictHeatingWater::setCapacityFractionSchedule(Schedule& schedule) { + return getImpl()->setCapacityFractionSchedule(schedule); + } + + /// @cond + + DistrictHeatingWater::DistrictHeatingWater(std::shared_ptr impl) : StraightComponent(std::move(impl)) {} + /// @endcond + + boost::optional DistrictHeatingWater::autosizedNominalCapacity() const { + return getImpl()->autosizedNominalCapacity(); + } + +} // namespace model + +} // namespace openstudio diff --git a/src/model/DistrictHeatingWater.hpp b/src/model/DistrictHeatingWater.hpp new file mode 100644 index 00000000000..6cc19d59275 --- /dev/null +++ b/src/model/DistrictHeatingWater.hpp @@ -0,0 +1,109 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#ifndef MODEL_DISTRICTHEATINGWATER_HPP +#define MODEL_DISTRICTHEATINGWATER_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent.hpp" + +namespace openstudio { + +namespace model { + + class Schedule; + + namespace detail { + + class DistrictHeatingWater_Impl; + + } // namespace detail + + /** DistrictHeatingWater is a StraightComponent that wraps the OpenStudio IDD object 'OS:DistrictHeating:Water'. */ + + class MODEL_API DistrictHeatingWater : public StraightComponent + { + + public: + /** @name Constructors and Destructors */ + //@{ + + // The capacityFractionSchedule is defaulted to alwaysOnContinuousSchedule + explicit DistrictHeatingWater(const Model& model); + + virtual ~DistrictHeatingWater() = default; + // Default the copy and move operators because the virtual dtor is explicit + DistrictHeatingWater(const DistrictHeatingWater& other) = default; + DistrictHeatingWater(DistrictHeatingWater&& other) = default; + DistrictHeatingWater& operator=(const DistrictHeatingWater&) = default; + DistrictHeatingWater& operator=(DistrictHeatingWater&&) = default; + + //@} + + //@} + /** @name Static Methods */ + //@{ + + static IddObjectType iddObjectType(); + + //@} + /** @name Getters */ + //@{ + + boost::optional nominalCapacity() const; + + bool isNominalCapacityAutosized() const; + + Schedule capacityFractionSchedule() const; + + //@} + /** @name Setters */ + //@{ + + bool setNominalCapacity(double nominalCapacity); + + void autosizeNominalCapacity(); + + bool setCapacityFractionSchedule(Schedule& schedule); + + //@} + /** @name Other */ + //@{ + + //@} + + boost::optional autosizedNominalCapacity() const; + + protected: + /// @cond + using ImplType = detail::DistrictHeatingWater_Impl; + + explicit DistrictHeatingWater(std::shared_ptr impl); + + friend class detail::DistrictHeatingWater_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + + /// @endcond + + private: + REGISTER_LOGGER("openstudio.model.DistrictHeatingWater"); + }; + + /** \relates DistrictHeatingWater*/ + using OptionalDistrictHeatingWater = boost::optional; + + /** \relates DistrictHeatingWater*/ + using DistrictHeatingWaterVector = std::vector; + + // In E+ 23.2.0, DistrictHeating was renamed to DistrictHeating:Water. We typedef for backwards compatibility + using DistrictHeating [[deprecated("Deprecated at 3.7.0, replaced with DistrictHeatingWater. It will be removed after three releases")]] = + DistrictHeatingWater; + +} // namespace model +} // namespace openstudio + +#endif // MODEL_DISTRICTHEATINGWATER_HPP diff --git a/src/model/DistrictHeatingWater_Impl.hpp b/src/model/DistrictHeatingWater_Impl.hpp new file mode 100644 index 00000000000..14fea33cde9 --- /dev/null +++ b/src/model/DistrictHeatingWater_Impl.hpp @@ -0,0 +1,101 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#ifndef MODEL_DISTRICTHEATINGWATER_IMPL_HPP +#define MODEL_DISTRICTHEATINGWATER_IMPL_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent_Impl.hpp" + +namespace openstudio { + +namespace model { + + class Schedule; + + namespace detail { + + /** DistrictHeatingWater_Impl is a StraightComponent_Impl that is the implementation class for DistrictHeatingWater.*/ + + class MODEL_API DistrictHeatingWater_Impl : public StraightComponent_Impl + { + + public: + /** @name Constructors and Destructors */ + //@{ + + DistrictHeatingWater_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle); + + DistrictHeatingWater_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle); + + DistrictHeatingWater_Impl(const DistrictHeatingWater_Impl& other, Model_Impl* model, bool keepHandle); + + virtual ~DistrictHeatingWater_Impl() = default; + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const override; + + virtual IddObjectType iddObjectType() const override; + + virtual unsigned inletPort() const override; + + virtual unsigned outletPort() const override; + + virtual bool addToNode(Node& node) override; + + virtual void autosize() override; + + virtual void applySizingValues() override; + + virtual ComponentType componentType() const override; + virtual std::vector coolingFuelTypes() const override; + virtual std::vector heatingFuelTypes() const override; + virtual std::vector appGHeatingFuelTypes() const override; + + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const override; + + //@} + /** @name Getters */ + //@{ + + boost::optional nominalCapacity() const; + + bool isNominalCapacityAutosized() const; + + Schedule capacityFractionSchedule() const; + + //@} + /** @name Setters */ + //@{ + + bool setNominalCapacity(double nominalCapacity); + + void autosizeNominalCapacity(); + + bool setCapacityFractionSchedule(Schedule& schedule); + + //@} + /** @name Other */ + //@{ + + boost::optional autosizedNominalCapacity() const; + + //@} + + protected: + private: + REGISTER_LOGGER("openstudio.model.DistrictHeatingWater"); + }; + + } // namespace detail + +} // namespace model + +} // namespace openstudio + +#endif // MODEL_DISTRICTHEATINGWATER_IMPL_HPP diff --git a/src/model/Model.cpp b/src/model/Model.cpp index 18caded3bf1..e363f6483bc 100644 --- a/src/model/Model.cpp +++ b/src/model/Model.cpp @@ -4024,7 +4024,8 @@ namespace model { REGISTER_CONSTRUCTOR(DesignSpecificationOutdoorAir); REGISTER_CONSTRUCTOR(DesignSpecificationZoneAirDistribution); REGISTER_CONSTRUCTOR(DistrictCooling); - REGISTER_CONSTRUCTOR(DistrictHeating); + REGISTER_CONSTRUCTOR(DistrictHeatingWater); + REGISTER_CONSTRUCTOR(DistrictHeatingSteam); REGISTER_CONSTRUCTOR(Duct); REGISTER_CONSTRUCTOR(ElectricEquipment); REGISTER_CONSTRUCTOR(ElectricEquipmentDefinition); @@ -4595,7 +4596,8 @@ namespace model { REGISTER_COPYCONSTRUCTORS(DesignSpecificationOutdoorAir); REGISTER_COPYCONSTRUCTORS(DesignSpecificationZoneAirDistribution); REGISTER_COPYCONSTRUCTORS(DistrictCooling); - REGISTER_COPYCONSTRUCTORS(DistrictHeating); + REGISTER_COPYCONSTRUCTORS(DistrictHeatingWater); + REGISTER_COPYCONSTRUCTORS(DistrictHeatingSteam); REGISTER_COPYCONSTRUCTORS(Duct); REGISTER_COPYCONSTRUCTORS(ElectricEquipment); REGISTER_COPYCONSTRUCTORS(ElectricEquipmentDefinition); diff --git a/src/model/ModelStraightComponent.i b/src/model/ModelStraightComponent.i index 88a9e3ba1a9..525f332901b 100644 --- a/src/model/ModelStraightComponent.i +++ b/src/model/ModelStraightComponent.i @@ -147,7 +147,8 @@ MODELOBJECT_TEMPLATES(CoolingTowerSingleSpeed); MODELOBJECT_TEMPLATES(CoolingTowerTwoSpeed); MODELOBJECT_TEMPLATES(CoolingTowerVariableSpeed); MODELOBJECT_TEMPLATES(DistrictCooling); -MODELOBJECT_TEMPLATES(DistrictHeating); +MODELOBJECT_TEMPLATES(DistrictHeatingWater); +MODELOBJECT_TEMPLATES(DistrictHeatingSteam); MODELOBJECT_TEMPLATES(Duct); MODELOBJECT_TEMPLATES(EvaporativeCoolerDirectResearchSpecial); MODELOBJECT_TEMPLATES(EvaporativeCoolerIndirectResearchSpecial); @@ -233,7 +234,8 @@ SWIG_MODELOBJECT(CoolingTowerSingleSpeed,1); SWIG_MODELOBJECT(CoolingTowerTwoSpeed,1); SWIG_MODELOBJECT(CoolingTowerVariableSpeed,1); SWIG_MODELOBJECT(DistrictCooling,1); -SWIG_MODELOBJECT(DistrictHeating,1); +SWIG_MODELOBJECT(DistrictHeatingWater,1); +SWIG_MODELOBJECT(DistrictHeatingSteam,1); SWIG_MODELOBJECT(Duct,1); SWIG_MODELOBJECT(EvaporativeCoolerDirectResearchSpecial,1); SWIG_MODELOBJECT(EvaporativeCoolerIndirectResearchSpecial,1); @@ -268,21 +270,10 @@ SWIG_MODELOBJECT(TemperingValve,1); SWIG_MODELOBJECT(ThermalStorageIceDetailed,1); SWIG_MODELOBJECT(WaterUseConnections,1); -#if defined SWIGRUBY - - // Provide alternative name for backwards compatibility between old=AirTerminalSingleDuctUncontrolled and new=AirTerminalSingleDuctConstantVolumeNoReheat - %init %{ - // Alias class name, which allows instantion of new object - rb_eval_string("OpenStudio::Model::AirTerminalSingleDuctUncontrolled = OpenStudio::Model::AirTerminalSingleDuctConstantVolumeNoReheat"); - - // Provide get methods - rb_eval_string("OpenStudio::IdfObject.class_eval { define_method(:to_AirTerminalSingleDuctUncontrolled) { OpenStudio::Model::toAirTerminalSingleDuctConstantVolumeNoReheat(self); } }"); - rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:getAirTerminalSingleDuctUncontrolled) { |handle| OpenStudio::Model::getAirTerminalSingleDuctConstantVolumeNoReheat(self, handle); } }"); - rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:getAirTerminalSingleDuctUncontrolleds) { OpenStudio::Model::getAirTerminalSingleDuctConstantVolumeNoReheats(self); } }"); - rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:getAirTerminalSingleDuctUncontrolledByName) { |name| OpenStudio::Model::getAirTerminalSingleDuctConstantVolumeNoReheatByName(self, name); } }"); - rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:getAirTerminalSingleDuctUncontrolledsByName) { |name, exactMatch| OpenStudio::Model::getAirTerminalSingleDuctConstantVolumeNoReheatsByName(self, name, exactMatch); } }"); - %} -#endif +// DEPRECATED +// MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) +MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT(DistrictHeating, DistrictHeatingWater, 3, 7, 0) +MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT(AirTerminalSingleDuctUncontrolled, AirTerminalSingleDuctConstantVolumeNoReheat, 2, 7, 0) #if defined(SWIGCSHARP) || defined(SWIGJAVA) %inline { diff --git a/src/model/Model_Common_Include.i b/src/model/Model_Common_Include.i index c4fa317f447..e8cdb9c9627 100644 --- a/src/model/Model_Common_Include.i +++ b/src/model/Model_Common_Include.i @@ -92,6 +92,18 @@ %} %enddef + %define MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT_EXTENSION(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) + %init %{ + rb_eval_string("OpenStudio::Model::" #_oldName " = OpenStudio::Model::" #_newName ""); + + rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:get" #_oldName ") { |handle| OpenStudio::logFree(OpenStudio::Warn, 'openstudio.model._oldName', 'Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName');OpenStudio::Model::get" #_newName "(self, handle); } }"); + rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:get" #_oldName "s) { OpenStudio::logFree(OpenStudio::Warn, 'openstudio.model._oldName', 'Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName'); OpenStudio::Model::get" #_newName "s(self); } }"); + rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:get" #_oldName "ByName) { |name| OpenStudio::logFree(OpenStudio::Warn, 'openstudio.model._oldName', 'Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName'); OpenStudio::Model::get" #_newName "ByName(self, name); } }"); + rb_eval_string("OpenStudio::Model::Model.class_eval { define_method(:get" #_oldName "sByName) { |name, exactMatch| OpenStudio::logFree(OpenStudio::Warn, 'openstudio.model._oldName', 'Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName'); OpenStudio::Model::get" #_newName "sByName(self, name, exactMatch); } }"); + %} + %enddef + + #elif defined SWIGCSHARP // should be able to do something here as C# supports partial classes @@ -178,31 +190,59 @@ #elif defined SWIGPYTHON + %pythoncode %{ +# Import common modules +import typing +import warnings +%} // Let's use monkey-patching via unbound functions %define MODELOBJECT_EXTENSION(_name) %pythoncode %{ def _to_##_name(self) -> Optional##_name: + """Try to cast the ModelObject to a _name. + + :return: An Optional _name. + """ return to##_name(self) openstudioutilitiesidf.IdfObject.to_##_name = _to_##_name - def _get##_name(self, t_handle: "UUID") -> Optional##_name: - return get##_name(self, t_handle) - Model.get##_name = _get##_name + def _get##_name(self, t_handle: typing.Union[openstudioutilitiescore.UUID, str]) -> Optional##_name: + """Try to get an object of type _name referenced by its handle. - def _get##_name(self, t_handle_str: str) -> Optional##_name: - return get##_name(self, openstudioutilitiescore.toUUID(t_handle_str)) + :param t_handle: The object's handle + :return: An Optional _name. + """ + if isinstance(t_handle, str): + t_handle = openstudioutilitiescore.toUUID(t_handle) + return get##_name(self, t_handle) Model.get##_name = _get##_name def _get##_name##s(self) -> _name##Vector: + """Get a vector of all objects of type _name in the model. + + :return: A vector of _name. + """ return get##_name##s(self) Model.get##_name##s = _get##_name##s def _get##_name##ByName(self, t_name: str) -> Optional##_name: + """Try to get an object of type _name that has this specific name (case-insentive). + + :param t_name: The object's name + :return: An Optional _name. + """ return get##_name##ByName(self, t_name) Model.get##_name##ByName = _get##_name##ByName def _get##_name##sByName(self, t_name: str, t_exactMatch: bool) -> _name##Vector: + """Returns all objects of type _name named t_name (case insensitive). + + :param t_name: The object's name + :param t_exactMatch: if false, will return all objects with name or name plus an integer suffix + + :return: A vector of matches. + """ return get##_name##sByName(self, t_name, t_exactMatch) Model.get##_name##sByName = _get##_name##sByName %} @@ -211,14 +251,26 @@ %define UNIQUEMODELOBJECT_EXTENSION(_name) %pythoncode %{ def _to_##_name(self) -> Optional##_name: + """Try to cast the ModelObject to a _name. + + :return: An Optional _name. + """ return to##_name(self) openstudioutilitiesidf.IdfObject.to_##_name = _to_##_name def _get##_name(self) -> _name: + """Get or instantiate a UniqueModelObject of type _name. + + :return: An existing _name or a newly instantiated one. + """ return get##_name(self) Model.get##_name = _get##_name def _getOptional##_name(self) -> Optional##_name: + """Return a UniqueModelObject of type _name only if it's already present in the Model. + + :return: An Optional _name. + """ return getOptional##_name(self) Model.getOptional##_name = _getOptional##_name %} @@ -231,6 +283,86 @@ openstudioutilitiesidf.IdfExtensibleGroup.to_##_name = _to_##_name %} %enddef + + %define MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT_EXTENSION(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) + %pythoncode %{ + + _oldName = _newName + + def _to_##_oldName(self) -> Optional##_newName: + """Try to cast the ModelObject to a _newName. + + :return: An Optional _newName. + + .. deprecated:: _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch + Use :meth:`"IdfObject.to_##_newName"`. + """ + warnings.warn("_oldName was deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.", category=FutureWarning) + openstudioutilitiescore.logFree(openstudioutilitiescore.Warn, "openstudio.model._oldName", "Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.") + return to##_newName(self) + openstudioutilitiesidf.IdfObject.to_##_oldName = _to_##_oldName + + def _get##_oldName(self, t_handle: typing.Union[openstudioutilitiescore.UUID, str]) -> Optional##_newName: + """Try to get an object of type _newName referenced by its handle. + + :param t_handle: The object's handle + :return: An Optional _newName. + + .. deprecated:: _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch + Use :meth:`"Model.get##_newName"`. + """ + warnings.warn("_oldName was deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.", category=FutureWarning) + if isinstance(t_handle, str): + t_handle = openstudioutilitiescore.toUUID(t_handle) + openstudioutilitiescore.logFree(openstudioutilitiescore.Warn, "openstudio.model._oldName", "Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.") + return get##_newName(self, t_handle) + Model.get##_oldName = _get##_oldName + + def _get##_oldName##s(self) -> _newName##Vector: + """Get a vector of all objects of type _newName in the model. + + :return: A vector of _newName. + + .. deprecated:: _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch + Use :meth:`"Model.get##_newName##s"`. + """ + warnings.warn("_oldName was deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.", category=FutureWarning) + openstudioutilitiescore.logFree(openstudioutilitiescore.Warn, "openstudio.model._oldName", "Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.") + return get##_newName##s(self) + Model.get##_oldName##s = _get##_oldName##s + + def _get##_oldName##ByName(self, t_name: str) -> Optional##_newName: + """Try to get an object of type _newName that has this specific name (case-insentive). + + :param t_name: The object's name + :return: An Optional _newName. + + .. deprecated:: _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch + Use :meth:`"Model.get##_newName##ByName"`. + """ + warnings.warn("_oldName was deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.", category=FutureWarning) + openstudioutilitiescore.logFree(openstudioutilitiescore.Warn, "openstudio.model._oldName", "Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.") + return get##_newName##ByName(self, t_name) + Model.get##_oldName##ByName = _get##_oldName##ByName + + def _get##_oldName##sByName(self, t_name: str, t_exactMatch: bool) -> _newName##Vector: + """Returns all objects of type _newName named t_name (case insensitive). + + :param t_name: The object's name + :param t_exactMatch: if false, will return all objects with name or name plus an integer suffix + + :return: A vector of matches. + + .. deprecated:: _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch + Use :meth:`"Model.get##_newName##sByName"`. + """ + warnings.warn("_oldName was deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.", category=FutureWarning) + openstudioutilitiescore.logFree(openstudioutilitiescore.Warn, "openstudio.model._oldName", "Deprecated at _deprecatedAtVersionMajor._deprecatedAtVersionMinor._deprecatedAtVersionPatch, use _newName.") + return get##_newName##sByName(self, t_name, t_exactMatch) + Model.get##_oldName##sByName = _get##_oldName##sByName + %} + %enddef + #else #define MODELOBJECT_EXTENSION(_name) @@ -390,5 +522,14 @@ #endif %enddef +%define MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) + #if defined SWIGRUBY + MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT_EXTENSION(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) + #endif + + #if defined SWIGPYTHON + MODELOBJECT_ALIAS_CLASS_DEPRECATED_AT_EXTENSION(_oldName, _newName, _deprecatedAtVersionMajor, _deprecatedAtVersionMinor, _deprecatedAtVersionPatch) + #endif +%enddef #endif //MODEL_I diff --git a/src/model/ScheduleTypeRegistry.cpp b/src/model/ScheduleTypeRegistry.cpp index 13c1ccba746..9d04068153a 100644 --- a/src/model/ScheduleTypeRegistry.cpp +++ b/src/model/ScheduleTypeRegistry.cpp @@ -236,6 +236,9 @@ namespace model { {"DefaultScheduleSet", "Steam Equipment", "steamEquipmentSchedule", true, "", 0.0, 1.0}, {"DefaultScheduleSet", "Other Equipment", "otherEquipmentSchedule", true, "", OptionalDouble(), OptionalDouble()}, {"DesignSpecificationOutdoorAir", "Outdoor Air Flow Rate", "outdoorAirFlowRateFractionSchedule", true, "", 0.0, 1.0}, + {"DistrictCooling", "Capacity Fraction", "capacityFractionSchedule", true, "Dimensionless", 0.0, OptionalDouble()}, + {"DistrictHeatingWater", "Capacity Fraction", "capacityFractionSchedule", true, "Dimensionless", 0.0, OptionalDouble()}, + {"DistrictHeatingSteam", "Capacity Fraction", "capacityFractionSchedule", true, "Dimensionless", 0.0, OptionalDouble()}, {"ElectricEquipment", "Electric Equipment", "schedule", true, "", 0.0, 1.0}, {"ElectricEquipmentITEAirCooled", "Design Power Input", "designPowerInputSchedule", true, "", 0.0, 1.0}, {"ElectricEquipmentITEAirCooled", "CPU Loading", "cPULoadingSchedule", true, "", 0.0, 1.0}, diff --git a/src/model/test/DistrictCooling_GTest.cpp b/src/model/test/DistrictCooling_GTest.cpp index ca7a73c8c12..3431861aa88 100644 --- a/src/model/test/DistrictCooling_GTest.cpp +++ b/src/model/test/DistrictCooling_GTest.cpp @@ -12,22 +12,37 @@ #include "../Node.hpp" #include "../Node_Impl.hpp" #include "../AirLoopHVACZoneSplitter.hpp" +#include "../Schedule.hpp" +#include "../Schedule_Impl.hpp" +#include "../ScheduleConstant.hpp" +#include "../ScheduleConstant_Impl.hpp" using namespace openstudio; using namespace openstudio::model; //test construction of the object -TEST_F(ModelFixture, DistrictCooling_DistrictCooling) { - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; +TEST_F(ModelFixture, DistrictCooling_GettersSetters) { - ASSERT_EXIT( - { - Model m; - DistrictCooling testObject(m); - - exit(0); - }, - ::testing::ExitedWithCode(0), ""); + Model m; + DistrictCooling districtCooling(m); + + // Default to autosize + EXPECT_FALSE(districtCooling.nominalCapacity()); + EXPECT_TRUE(districtCooling.isNominalCapacityAutosized()); + // Set it + districtCooling.setNominalCapacity(1000.0); + ASSERT_TRUE(districtCooling.nominalCapacity()); + EXPECT_EQ(1000.0, districtCooling.nominalCapacity().get()); + EXPECT_FALSE(districtCooling.isNominalCapacityAutosized()); + // autosize + districtCooling.autosizeNominalCapacity(); + EXPECT_TRUE(districtCooling.isNominalCapacityAutosized()); + EXPECT_FALSE(districtCooling.nominalCapacity()); + + EXPECT_EQ(m.alwaysOnContinuousSchedule(), districtCooling.capacityFractionSchedule()); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtCooling.setCapacityFractionSchedule(scheduleConstant)); + EXPECT_EQ(scheduleConstant, districtCooling.capacityFractionSchedule()); } //test connecting the object to a loop and get the inlet node and the outlet node @@ -38,29 +53,29 @@ TEST_F(ModelFixture, DistrictCooling_connections) { PlantLoop plantLoop(m); //make a DistrictCooling object - DistrictCooling testObject(m); + DistrictCooling districtCooling(m); //get the supply outlet node of the plant loop Node plantOutletNode = plantLoop.supplyOutletNode(); //hook the DistrictCooling object to the supply outlet node - ASSERT_TRUE(testObject.addToNode(plantOutletNode)); + ASSERT_TRUE(districtCooling.addToNode(plantOutletNode)); //it should now be on a loop and have inlet and outlet objects - ASSERT_TRUE(testObject.loop()); - ASSERT_TRUE(testObject.inletModelObject()); - ASSERT_TRUE(testObject.outletModelObject()); + ASSERT_TRUE(districtCooling.loop()); + ASSERT_TRUE(districtCooling.inletModelObject()); + ASSERT_TRUE(districtCooling.outletModelObject()); //it should be removable from the loop - ASSERT_TRUE(testObject.isRemovable()); + ASSERT_TRUE(districtCooling.isRemovable()); //now, disconnect the object - testObject.disconnect(); + districtCooling.disconnect(); //it should no longer have a loop or inlet/outlet objects - ASSERT_FALSE(testObject.loop()); - ASSERT_FALSE(testObject.inletModelObject()); - ASSERT_FALSE(testObject.outletModelObject()); + ASSERT_FALSE(districtCooling.loop()); + ASSERT_FALSE(districtCooling.inletModelObject()); + ASSERT_FALSE(districtCooling.outletModelObject()); //make an airloop AirLoopHVAC airLoop(m); @@ -69,41 +84,28 @@ TEST_F(ModelFixture, DistrictCooling_connections) { Node airOutletNode = airLoop.supplyOutletNode(); //it should not connect to an airloop - ASSERT_FALSE(testObject.addToNode(airOutletNode)); -} - -//test setting and getting the nominal capacity -TEST_F(ModelFixture, DistrictCooling_NominalCapacity) { - Model m; - DistrictCooling testObject(m); - - //test setting and getting the field with a double - double testValue(1); - testObject.setNominalCapacity(testValue); - auto capacity = testObject.nominalCapacity(); - ASSERT_TRUE(capacity); - ASSERT_EQ(1, capacity.get()); + ASSERT_FALSE(districtCooling.addToNode(airOutletNode)); } //test cloning the object TEST_F(ModelFixture, DistrictCooling_Clone) { Model m; //make an object to clone, and edit some property to make sure the clone worked - DistrictCooling testObject(m); + DistrictCooling districtCooling(m); - testObject.setNominalCapacity(1234); + districtCooling.setNominalCapacity(1234); //clone into the same model - auto testObjectClone = testObject.clone(m).cast(); - auto capacity = testObjectClone.nominalCapacity(); + auto districtCoolingClone = districtCooling.clone(m).cast(); + auto capacity = districtCoolingClone.nominalCapacity(); ASSERT_TRUE(capacity); ASSERT_EQ(1234, capacity.get()); //clone into another model Model m2; - auto testObjectClone2 = testObject.clone(m2).cast(); + auto districtCoolingClone2 = districtCooling.clone(m2).cast(); - capacity = testObjectClone2.nominalCapacity(); + capacity = districtCoolingClone2.nominalCapacity(); ASSERT_TRUE(capacity); ASSERT_EQ(1234, capacity.get()); } diff --git a/src/model/test/DistrictHeatingSteam_GTest.cpp b/src/model/test/DistrictHeatingSteam_GTest.cpp new file mode 100644 index 00000000000..1eccfa2d16f --- /dev/null +++ b/src/model/test/DistrictHeatingSteam_GTest.cpp @@ -0,0 +1,150 @@ +/*********************************************************************************************************************** +* OpenStudio(R), Copyright (c) Alliance for Sustainable Energy, LLC. +* See also https://openstudio.net/license +***********************************************************************************************************************/ + +#include +#include "ModelFixture.hpp" +#include "../DistrictHeatingSteam.hpp" +#include "../DistrictHeatingSteam_Impl.hpp" +#include "../AirLoopHVAC.hpp" +#include "../PlantLoop.hpp" +#include "../Node.hpp" +#include "../Node_Impl.hpp" +#include "../AirLoopHVACZoneSplitter.hpp" +#include "../Schedule.hpp" +#include "../Schedule_Impl.hpp" +#include "../ScheduleConstant.hpp" +#include "../ScheduleConstant_Impl.hpp" + +using namespace openstudio; +using namespace openstudio::model; + +//test construction of the object +TEST_F(ModelFixture, DistrictHeatingSteam_GettersSetters) { + + Model m; + DistrictHeatingSteam districtHeatingSteam(m); + + // Default to autosize + EXPECT_FALSE(districtHeatingSteam.nominalCapacity()); + EXPECT_TRUE(districtHeatingSteam.isNominalCapacityAutosized()); + // Set it + districtHeatingSteam.setNominalCapacity(1000.0); + ASSERT_TRUE(districtHeatingSteam.nominalCapacity()); + EXPECT_EQ(1000.0, districtHeatingSteam.nominalCapacity().get()); + EXPECT_FALSE(districtHeatingSteam.isNominalCapacityAutosized()); + // autosize + districtHeatingSteam.autosizeNominalCapacity(); + EXPECT_TRUE(districtHeatingSteam.isNominalCapacityAutosized()); + EXPECT_FALSE(districtHeatingSteam.nominalCapacity()); + + EXPECT_EQ(m.alwaysOnContinuousSchedule(), districtHeatingSteam.capacityFractionSchedule()); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtHeatingSteam.setCapacityFractionSchedule(scheduleConstant)); + EXPECT_EQ(scheduleConstant, districtHeatingSteam.capacityFractionSchedule()); +} + +//test connecting the object to a loop and get the inlet node and the outlet node +TEST_F(ModelFixture, DistrictHeatingSteam_connections) { + Model m; + + //make a plant loop + PlantLoop plantLoop(m); + + //make a districtHeatingSteam object + DistrictHeatingSteam districtHeatingSteam(m); + + //get the supply outlet node of the plant loop + Node plantOutletNode = plantLoop.supplyOutletNode(); + + //hook the districtHeatingSteam object to the supply outlet node + ASSERT_TRUE(districtHeatingSteam.addToNode(plantOutletNode)); + + //it should now be on a loop and have inlet and outlet objects + ASSERT_TRUE(districtHeatingSteam.loop()); + ASSERT_TRUE(districtHeatingSteam.inletModelObject()); + ASSERT_TRUE(districtHeatingSteam.outletModelObject()); + + //it should be removable from the loop + ASSERT_TRUE(districtHeatingSteam.isRemovable()); + + //now, disconnect the object + districtHeatingSteam.disconnect(); + + //it should no longer have a loop or inlet/outlet objects + ASSERT_FALSE(districtHeatingSteam.loop()); + ASSERT_FALSE(districtHeatingSteam.inletModelObject()); + ASSERT_FALSE(districtHeatingSteam.outletModelObject()); + + //make an airloop + AirLoopHVAC airLoop(m); + + //get the supply outlet node of the airloop + Node airOutletNode = airLoop.supplyOutletNode(); + + //it should not connect to an airloop + ASSERT_FALSE(districtHeatingSteam.addToNode(airOutletNode)); +} + +//test cloning the object +TEST_F(ModelFixture, DistrictHeatingSteam_Clone) { + + Model m; + + //make an object to clone, and edit some property to make sure the clone worked + + DistrictHeatingSteam districtHeatingSteam(m); + + districtHeatingSteam.setNominalCapacity(1234); + + //clone into the same model + + auto districtHeatingClone = districtHeatingSteam.clone(m).cast(); + + auto capacity = districtHeatingClone.nominalCapacity(); + ASSERT_TRUE(capacity); + ASSERT_EQ(1234, capacity.get()); + + //clone into another model + + Model m2; + + auto districtHeatingClone2 = districtHeatingSteam.clone(m2).cast(); + + capacity = districtHeatingClone2.nominalCapacity(); + ASSERT_TRUE(capacity); + ASSERT_EQ(1234, capacity.get()); +} + +TEST_F(ModelFixture, DistrictHeatingSteam_addToNode) { + Model m; + DistrictHeatingSteam testObject(m); + + AirLoopHVAC airLoop(m); + + Node supplyOutletNode = airLoop.supplyOutletNode(); + + EXPECT_FALSE(testObject.addToNode(supplyOutletNode)); + EXPECT_EQ((unsigned)2, airLoop.supplyComponents().size()); + + Node inletNode = airLoop.zoneSplitter().lastOutletModelObject()->cast(); + + EXPECT_FALSE(testObject.addToNode(inletNode)); + EXPECT_EQ((unsigned)5, airLoop.demandComponents().size()); + + PlantLoop plantLoop(m); + supplyOutletNode = plantLoop.supplyOutletNode(); + EXPECT_TRUE(testObject.addToNode(supplyOutletNode)); + EXPECT_EQ((unsigned)7, plantLoop.supplyComponents().size()); + + Node demandOutletNode = plantLoop.demandOutletNode(); + EXPECT_FALSE(testObject.addToNode(demandOutletNode)); + EXPECT_EQ((unsigned)5, plantLoop.demandComponents().size()); + + auto testObjectClone = testObject.clone(m).cast(); + supplyOutletNode = plantLoop.supplyOutletNode(); + + EXPECT_TRUE(testObjectClone.addToNode(supplyOutletNode)); + EXPECT_EQ((unsigned)9, plantLoop.supplyComponents().size()); +} diff --git a/src/model/test/DistrictHeating_GTest.cpp b/src/model/test/DistrictHeatingWater_GTest.cpp similarity index 66% rename from src/model/test/DistrictHeating_GTest.cpp rename to src/model/test/DistrictHeatingWater_GTest.cpp index 0a8097c85c2..a49f75f3e50 100644 --- a/src/model/test/DistrictHeating_GTest.cpp +++ b/src/model/test/DistrictHeatingWater_GTest.cpp @@ -5,40 +5,55 @@ #include #include "ModelFixture.hpp" -#include "../DistrictHeating.hpp" -#include "../DistrictHeating_Impl.hpp" +#include "../DistrictHeatingWater.hpp" +#include "../DistrictHeatingWater_Impl.hpp" #include "../AirLoopHVAC.hpp" #include "../PlantLoop.hpp" #include "../Node.hpp" #include "../Node_Impl.hpp" #include "../AirLoopHVACZoneSplitter.hpp" +#include "../Schedule.hpp" +#include "../Schedule_Impl.hpp" +#include "../ScheduleConstant.hpp" +#include "../ScheduleConstant_Impl.hpp" using namespace openstudio; using namespace openstudio::model; //test construction of the object -TEST_F(ModelFixture, DistrictHeating_DistrictHeating) { - ::testing::FLAGS_gtest_death_test_style = "threadsafe"; +TEST_F(ModelFixture, DistrictHeatingWater_GettersSetters) { - ASSERT_EXIT( - { - Model m; - DistrictHeating districtHeating(m); - - exit(0); - }, - ::testing::ExitedWithCode(0), ""); + Model m; + DistrictHeatingWater districtHeating(m); + + // Default to autosize + EXPECT_FALSE(districtHeating.nominalCapacity()); + EXPECT_TRUE(districtHeating.isNominalCapacityAutosized()); + // Set it + districtHeating.setNominalCapacity(1000.0); + ASSERT_TRUE(districtHeating.nominalCapacity()); + EXPECT_EQ(1000.0, districtHeating.nominalCapacity().get()); + EXPECT_FALSE(districtHeating.isNominalCapacityAutosized()); + // autosize + districtHeating.autosizeNominalCapacity(); + EXPECT_TRUE(districtHeating.isNominalCapacityAutosized()); + EXPECT_FALSE(districtHeating.nominalCapacity()); + + EXPECT_EQ(m.alwaysOnContinuousSchedule(), districtHeating.capacityFractionSchedule()); + ScheduleConstant scheduleConstant(m); + EXPECT_TRUE(districtHeating.setCapacityFractionSchedule(scheduleConstant)); + EXPECT_EQ(scheduleConstant, districtHeating.capacityFractionSchedule()); } //test connecting the object to a loop and get the inlet node and the outlet node -TEST_F(ModelFixture, DistrictHeating_connections) { +TEST_F(ModelFixture, DistrictHeatingWater_connections) { Model m; //make a plant loop PlantLoop plantLoop(m); //make a districtheating object - DistrictHeating districtHeating(m); + DistrictHeatingWater districtHeating(m); //get the supply outlet node of the plant loop Node plantOutletNode = plantLoop.supplyOutletNode(); @@ -72,38 +87,20 @@ TEST_F(ModelFixture, DistrictHeating_connections) { ASSERT_FALSE(districtHeating.addToNode(airOutletNode)); } -//test setting and getting the nominal capacity -TEST_F(ModelFixture, DistrictHeating_NominalCapacity) { - - Model m; - DistrictHeating districtHeating(m); - - //test setting and getting the field with a double - double testValue(1); - - districtHeating.setNominalCapacity(testValue); - - auto capacity = districtHeating.nominalCapacity(); - ASSERT_TRUE(capacity); - ASSERT_EQ(1, capacity.get()); - - //test setting and getting the field with a quantity -} - //test cloning the object -TEST_F(ModelFixture, DistrictHeating_Clone) { +TEST_F(ModelFixture, DistrictHeatingWater_Clone) { Model m; //make an object to clone, and edit some property to make sure the clone worked - DistrictHeating districtHeating(m); + DistrictHeatingWater districtHeating(m); districtHeating.setNominalCapacity(1234); //clone into the same model - auto districtHeatingClone = districtHeating.clone(m).cast(); + auto districtHeatingClone = districtHeating.clone(m).cast(); auto capacity = districtHeatingClone.nominalCapacity(); ASSERT_TRUE(capacity); @@ -113,16 +110,16 @@ TEST_F(ModelFixture, DistrictHeating_Clone) { Model m2; - auto districtHeatingClone2 = districtHeating.clone(m2).cast(); + auto districtHeatingClone2 = districtHeating.clone(m2).cast(); capacity = districtHeatingClone2.nominalCapacity(); ASSERT_TRUE(capacity); ASSERT_EQ(1234, capacity.get()); } -TEST_F(ModelFixture, DistrictHeating_addToNode) { +TEST_F(ModelFixture, DistrictHeatingWater_addToNode) { Model m; - DistrictHeating testObject(m); + DistrictHeatingWater testObject(m); AirLoopHVAC airLoop(m); @@ -145,9 +142,18 @@ TEST_F(ModelFixture, DistrictHeating_addToNode) { EXPECT_FALSE(testObject.addToNode(demandOutletNode)); EXPECT_EQ((unsigned)5, plantLoop.demandComponents().size()); - auto testObjectClone = testObject.clone(m).cast(); + auto testObjectClone = testObject.clone(m).cast(); supplyOutletNode = plantLoop.supplyOutletNode(); EXPECT_TRUE(testObjectClone.addToNode(supplyOutletNode)); EXPECT_EQ((unsigned)9, plantLoop.supplyComponents().size()); } + +// In E+ 23.2.0, DistrictHeating was renamed to DistrictHeatingWater +// So we test that we can instantiate with the old name too +TEST_F(ModelFixture, DistrictHeatingWater_Alias2320) { + Model m; + DistrictHeating districHeating(m); + + EXPECT_EQ(districHeating.iddObjectType(), DistrictHeatingWater::iddObjectType()); +} diff --git a/src/osversion/VersionTranslator.cpp b/src/osversion/VersionTranslator.cpp index bc0e8042a70..dabd48cc418 100644 --- a/src/osversion/VersionTranslator.cpp +++ b/src/osversion/VersionTranslator.cpp @@ -4571,7 +4571,7 @@ namespace osversion { IdfFile targetIdf(idd_3_0_0.iddFile()); ss << targetIdf.versionObject().get(); - // Making the map case-insentive by providing a Comparator `IstringCompare` + // Making the map case-insensitive by providing a Comparator `IstringCompare` const std::map replaceFuelTypesMap({ {"FuelOil#1", "FuelOilNo1"}, {"FuelOil#2", "FuelOilNo2"}, @@ -5099,7 +5099,7 @@ namespace osversion { const static boost::regex re_strip_multiple_spaces("[' ']{2,}"); - // Making the map case-insentive by providing a Comparator `IstringCompare` + // Making the map case-insensitive by providing a Comparator `IstringCompare` // https://github.com/NREL/EnergyPlus/blob/v9.4.0-IOFreeze/src/Transition/SupportFiles/Report%20Variables%209-3-0%20to%209-4-0.csv const static std::map replaceOutputVariablesMap({ {"Other Equipment FuelOil#1 Rate", "Other Equipment FuelOilNo1 Rate"}, @@ -7898,7 +7898,7 @@ namespace osversion { {"OS:Coil:WaterHeating:AirToWaterHeatPump:Wrapped", 13}, }}; - // Making the map case-insentive by providing a Comparator `IstringCompare` + // Making the map case-insensitive by providing a Comparator `IstringCompare` const std::map replaceFuelTypesMap{{ {"Steam", "DistrictHeatingSteam"}, {"DistrictHeating", "DistrictHeatingWater"}, @@ -7949,7 +7949,7 @@ namespace osversion { const static boost::regex re_strip_multiple_spaces("[' ']{2,}"); - // Making the map case-insentive by providing a Comparator `IstringCompare` + // Making the map case-insensitive by providing a Comparator `IstringCompare` // https://github.com/NREL/EnergyPlus/blob/v9.4.0-IOFreeze/src/Transition/SupportFiles/Report%20Variables%209-3-0%20to%209-4-0.csv const static std::map replaceOutputVariablesMap({ {"District Cooling Chilled Water Energy", "District Cooling Water Energy"}, @@ -7975,6 +7975,60 @@ namespace osversion { {"Steam", "DistrictHeatingSteam"}, }}; + // Could make it a static inside the lambda, except that it won't be reset so if you try to translate twice it fails + std::string discreteSchHandleStr; + + auto getOrCreateAlwaysOnContinuousSheduleHandleStr = [this, &ss, &idf_3_6_1, &idd_3_7_0, &discreteSchHandleStr]() -> std::string { + if (!discreteSchHandleStr.empty()) { + LOG(Trace, "Already found 'Always On Continuous' Schedule in model with handle " << discreteSchHandleStr); + return discreteSchHandleStr; + } + + const std::string name = "Always On Continuous"; + const double val = 1.0; + // Add an alwaysOnDiscreteSchedule if one does not already exist + for (const IdfObject& object : idf_3_6_1.getObjectsByType(idf_3_6_1.iddFile().getObject("OS:Schedule:Constant").get())) { + if (boost::optional name_ = object.getString(1)) { + if (istringEqual(name_.get(), name)) { + if (boost::optional value = object.getDouble(3)) { + if (equal(value.get(), val)) { + discreteSchHandleStr = object.getString(0).get(); // Store in state variable + LOG(Trace, "Found existing 'Always On Continuous' Schedule in model with handle " << discreteSchHandleStr); + return discreteSchHandleStr; + } + } + } + } + } + + auto discreteSch = IdfObject(idd_3_7_0.getObject("OS:Schedule:Constant").get()); + + discreteSchHandleStr = toString(createUUID()); // Store in state variable + discreteSch.setString(0, discreteSchHandleStr); + discreteSch.setString(1, name); + discreteSch.setDouble(3, val); + + IdfObject typeLimits(idd_3_7_0.getObject("OS:ScheduleTypeLimits").get()); + typeLimits.setString(0, toString(createUUID())); + typeLimits.setString(1, name + " Limits"); + typeLimits.setDouble(2, 0.0); + typeLimits.setDouble(3, 1.0); + typeLimits.setString(4, "Continuous"); + typeLimits.setString(5, ""); + + discreteSch.setString(2, typeLimits.getString(0).get()); + + ss << discreteSch; + ss << typeLimits; + + // Register new objects + m_new.emplace_back(std::move(discreteSch)); + m_new.emplace_back(std::move(typeLimits)); + LOG(Trace, "Created 'Always On Continuous' Schedule with handle " << discreteSchHandleStr); + + return discreteSchHandleStr; + }; + for (const IdfObject& object : idf_3_6_1.objects()) { auto iddname = object.iddObject().name(); @@ -8355,6 +8409,49 @@ namespace osversion { m_refactored.push_back(RefactoredObjectData(object, newObject)); ss << newObject; + } else if (iddname == "OS:DistrictHeating") { + + // Object was renamed from OS:DistrictHeating to OS:DistrictHeating:Water (since OS:DistrictHeating:Steam was added) + + // Fields that have been added from 3.6.1 to 3.7.0: + // ------------------------------------------------ + // * Capacity Fraction Schedule * 5 + + // We start by creating a new object, and copy every field. + auto iddObject = idd_3_7_0.getObject("OS:DistrictHeating:Water"); + IdfObject newObject(iddObject.get()); + + for (size_t i = 0; i < object.numFields(); ++i) { + if ((value = object.getString(i))) { + newObject.setString(i, value.get()); + } + } + + // Add the new "Capacity Fraction Schedule" + newObject.setString(5, getOrCreateAlwaysOnContinuousSheduleHandleStr()); + + ss << newObject; + m_refactored.emplace_back(std::move(object), std::move(newObject)); + + } else if (iddname == "OS:DistrictCooling") { + // Fields that have been added from 3.6.1 to 3.7.0: + // ------------------------------------------------ + // * Capacity Fraction Schedule * 5 + + auto iddObject = idd_3_7_0.getObject("OS:DistrictCooling"); + IdfObject newObject(iddObject.get()); + + for (size_t i = 0; i < object.numFields(); ++i) { + if ((value = object.getString(i))) { + newObject.setString(i, value.get()); + } + } + // Add the new "Capacity Fraction Schedule" + newObject.setString(5, getOrCreateAlwaysOnContinuousSheduleHandleStr()); + + ss << newObject; + m_refactored.emplace_back(std::move(object), std::move(newObject)); + } else if (iddname == "OS:Output:Meter") { std::string name = object.nameString(); diff --git a/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch.rb b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch.rb new file mode 100644 index 00000000000..768d3f759d5 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch.rb @@ -0,0 +1,40 @@ +#require '/usr/local/openstudio-3.6.1/Ruby/openstudio' + +include OpenStudio::Model + +def test_create_schedule + m = Model.new + + # New required-field Schedule at end + dh = DistrictHeating.new(m) + dh.setNominalCapacity(1000.0) + + dc = DistrictCooling.new(m) + dc.setNominalCapacity(1000.0) + + raise if m.getSchedules.size != 0 + raise if m.getScheduleTypeLimitss.size != 0 + + m.save('test_vt_DistrictObjects_CapacityFracSch_Create.osm', true) +end + +def test_get_schedule + m = Model.new + + m.alwaysOnContinuousSchedule + + # New required-field Schedule at end + dh = DistrictHeating.new(m) + dh.setNominalCapacity(1000.0) + + dc = DistrictCooling.new(m) + dc.setNominalCapacity(1000.0) + + raise if m.getSchedules.size != 1 + raise if m.getScheduleTypeLimitss.size != 1 + + m.save('test_vt_DistrictObjects_CapacityFracSch_Get.osm', true) +end + +test_create_schedule() +test_get_schedule() diff --git a/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Create.osm b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Create.osm new file mode 100644 index 00000000000..9b6f7a75420 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Create.osm @@ -0,0 +1,19 @@ + +OS:Version, + {1ce67f4d-7624-49ff-ac29-b45975d633aa}, !- Handle + 3.6.1; !- Version Identifier + +OS:DistrictHeating, + {f7bd858e-11b5-4220-bcd3-7d46facb79d6}, !- Handle + District Heating 1, !- Name + , !- Hot Water Inlet Node Name + , !- Hot Water Outlet Node Name + 1000; !- Nominal Capacity {W} + +OS:DistrictCooling, + {040dac85-5e44-43d9-9718-5e39d586d81e}, !- Handle + District Cooling 1, !- Name + , !- Chilled Water Inlet Node Name + , !- Chilled Water Outlet Node Name + 1000; !- Nominal Capacity {W} + diff --git a/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Get.osm b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Get.osm new file mode 100644 index 00000000000..0107f4ceaf7 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Get.osm @@ -0,0 +1,33 @@ + +OS:Version, + {3220cf3b-b622-4432-a01f-8129277bdf83}, !- Handle + 3.6.1; !- Version Identifier + +OS:Schedule:Constant, + {3a8f5b14-be9c-4b56-9af6-a512d996db0d}, !- Handle + Always On Continuous, !- Name + {9848b957-db73-4f36-bf2d-8f8b9d2fec51}, !- Schedule Type Limits Name + 1; !- Value + +OS:ScheduleTypeLimits, + {9848b957-db73-4f36-bf2d-8f8b9d2fec51}, !- Handle + Fractional, !- Name + 0, !- Lower Limit Value + 1, !- Upper Limit Value + Continuous, !- Numeric Type + ; !- Unit Type + +OS:DistrictHeating, + {9f2ae70e-ede6-447f-91ba-79690910dfc1}, !- Handle + District Heating 1, !- Name + , !- Hot Water Inlet Node Name + , !- Hot Water Outlet Node Name + 1000; !- Nominal Capacity {W} + +OS:DistrictCooling, + {ffb9ee58-0d18-4825-ba40-0f1d841445f0}, !- Handle + District Cooling 1, !- Name + , !- Chilled Water Inlet Node Name + , !- Chilled Water Outlet Node Name + 1000; !- Nominal Capacity {W} + diff --git a/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.osm b/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.osm new file mode 100644 index 00000000000..8da0f217eb3 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.osm @@ -0,0 +1,226 @@ + +OS:Version, + {6c1b329d-515d-4998-a38f-059c20f9308d}, !- Handle + 3.6.1; !- Version Identifier + +OS:DistrictHeating, + {d3c7c7b6-31ac-4ab7-a193-1f3ff4754b88}, !- Handle + My DistrictHeating, !- Name + {4b129444-ff11-4881-8c7b-a5922047f153}, !- Hot Water Inlet Node Name + {21f7ead8-dc8b-4fde-8959-83754a97345a}, !- Hot Water Outlet Node Name + 1000; !- Nominal Capacity {W} + +OS:PlantLoop, + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Handle + Plant Loop 1, !- Name + , !- Fluid Type + 0, !- Glycol Concentration + , !- User Defined Fluid Type + , !- Plant Equipment Operation Heating Load + , !- Plant Equipment Operation Cooling Load + , !- Primary Plant Equipment Operation Scheme + {2ac98608-1b90-4fd8-af71-46bb5da625f9}, !- Loop Temperature Setpoint Node Name + , !- Maximum Loop Temperature {C} + , !- Minimum Loop Temperature {C} + , !- Maximum Loop Flow Rate {m3/s} + , !- Minimum Loop Flow Rate {m3/s} + Autocalculate, !- Plant Loop Volume {m3} + {fc7c4821-279c-43a8-ac2f-950611fd5ae8}, !- Plant Side Inlet Node Name + {3645b873-dfae-4f69-9cfd-16f4416211c1}, !- Plant Side Outlet Node Name + , !- Plant Side Branch List Name + {81a2a9da-c71a-4730-957a-57006bac5af4}, !- Demand Side Inlet Node Name + {61d96d8d-39f5-4572-add4-3997caf8e19f}, !- Demand Side Outlet Node Name + , !- Demand Side Branch List Name + , !- Demand Side Connector List Name + Optimal, !- Load Distribution Scheme + {3b843282-67f6-4de7-9685-47160cf7b07d}, !- Availability Manager List Name + , !- Plant Loop Demand Calculation Scheme + , !- Common Pipe Simulation + , !- Pressure Simulation Type + , !- Plant Equipment Operation Heating Load Schedule + , !- Plant Equipment Operation Cooling Load Schedule + , !- Primary Plant Equipment Operation Scheme Schedule + , !- Component Setpoint Operation Scheme Schedule + {d58a3b32-a8fd-4472-9244-8c842d64ca6d}, !- Demand Mixer Name + {8ca24421-a939-42e5-bcf0-ae257c410d8b}, !- Demand Splitter Name + {7e24bc0b-2ff9-43a3-b76e-76fca4d9d723}, !- Supply Mixer Name + {568d6efb-52c2-4cc6-b197-3e5e70887025}; !- Supply Splitter Name + +OS:Node, + {3c431c63-b731-4934-a849-6a1d992362b9}, !- Handle + Node 1, !- Name + {fc7c4821-279c-43a8-ac2f-950611fd5ae8}, !- Inlet Port + {2938400a-7fe3-4659-887c-8d0935e20034}; !- Outlet Port + +OS:Node, + {2ac98608-1b90-4fd8-af71-46bb5da625f9}, !- Handle + Node 2, !- Name + {1e78a5ea-cb7d-49ee-a33b-76f38242416d}, !- Inlet Port + {3645b873-dfae-4f69-9cfd-16f4416211c1}; !- Outlet Port + +OS:Node, + {b3227399-e307-4f1c-b2f9-ae73ab9c9220}, !- Handle + DH Inlet, !- Name + {a0857168-4c0d-4b9f-a473-13f5c947ddce}, !- Inlet Port + {4b129444-ff11-4881-8c7b-a5922047f153}; !- Outlet Port + +OS:Connector:Mixer, + {7e24bc0b-2ff9-43a3-b76e-76fca4d9d723}, !- Handle + Connector Mixer 1, !- Name + {1e78a5ea-cb7d-49ee-a33b-76f38242416d}, !- Outlet Branch Name + {f7c3e06a-c2d2-4c63-8490-17af37eb9b19}; !- Inlet Branch Name 1 + +OS:Connector:Splitter, + {568d6efb-52c2-4cc6-b197-3e5e70887025}, !- Handle + Connector Splitter 1, !- Name + {2938400a-7fe3-4659-887c-8d0935e20034}, !- Inlet Branch Name + {a0857168-4c0d-4b9f-a473-13f5c947ddce}; !- Outlet Branch Name 1 + +OS:Connection, + {fc7c4821-279c-43a8-ac2f-950611fd5ae8}, !- Handle + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Source Object + 14, !- Outlet Port + {3c431c63-b731-4934-a849-6a1d992362b9}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {2938400a-7fe3-4659-887c-8d0935e20034}, !- Handle + {3c431c63-b731-4934-a849-6a1d992362b9}, !- Source Object + 3, !- Outlet Port + {568d6efb-52c2-4cc6-b197-3e5e70887025}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {a0857168-4c0d-4b9f-a473-13f5c947ddce}, !- Handle + {568d6efb-52c2-4cc6-b197-3e5e70887025}, !- Source Object + 3, !- Outlet Port + {b3227399-e307-4f1c-b2f9-ae73ab9c9220}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {1e78a5ea-cb7d-49ee-a33b-76f38242416d}, !- Handle + {7e24bc0b-2ff9-43a3-b76e-76fca4d9d723}, !- Source Object + 2, !- Outlet Port + {2ac98608-1b90-4fd8-af71-46bb5da625f9}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {3645b873-dfae-4f69-9cfd-16f4416211c1}, !- Handle + {2ac98608-1b90-4fd8-af71-46bb5da625f9}, !- Source Object + 3, !- Outlet Port + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Target Object + 15; !- Inlet Port + +OS:Node, + {84a551fb-cd2b-4429-9c00-2bdf1a3d4849}, !- Handle + Node 4, !- Name + {81a2a9da-c71a-4730-957a-57006bac5af4}, !- Inlet Port + {b1db32e4-b1c0-474f-a628-dda9a8fde256}; !- Outlet Port + +OS:Node, + {31cf1a8f-cb88-46e4-8b13-8ef810611a3a}, !- Handle + Node 5, !- Name + {e01e71d1-bac7-4824-b5f2-f239645222f2}, !- Inlet Port + {61d96d8d-39f5-4572-add4-3997caf8e19f}; !- Outlet Port + +OS:Node, + {bc1b4947-9d69-4d79-9e89-3113150fcf75}, !- Handle + Node 6, !- Name + {ad6b2c6a-4754-477d-abe3-7a5c7f3ff43e}, !- Inlet Port + {38f4c014-bbe5-4b98-ae57-da55fbb0ffe2}; !- Outlet Port + +OS:Connector:Mixer, + {d58a3b32-a8fd-4472-9244-8c842d64ca6d}, !- Handle + Connector Mixer 2, !- Name + {e01e71d1-bac7-4824-b5f2-f239645222f2}, !- Outlet Branch Name + {38f4c014-bbe5-4b98-ae57-da55fbb0ffe2}; !- Inlet Branch Name 1 + +OS:Connector:Splitter, + {8ca24421-a939-42e5-bcf0-ae257c410d8b}, !- Handle + Connector Splitter 2, !- Name + {b1db32e4-b1c0-474f-a628-dda9a8fde256}, !- Inlet Branch Name + {ad6b2c6a-4754-477d-abe3-7a5c7f3ff43e}; !- Outlet Branch Name 1 + +OS:Connection, + {81a2a9da-c71a-4730-957a-57006bac5af4}, !- Handle + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Source Object + 17, !- Outlet Port + {84a551fb-cd2b-4429-9c00-2bdf1a3d4849}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {b1db32e4-b1c0-474f-a628-dda9a8fde256}, !- Handle + {84a551fb-cd2b-4429-9c00-2bdf1a3d4849}, !- Source Object + 3, !- Outlet Port + {8ca24421-a939-42e5-bcf0-ae257c410d8b}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {ad6b2c6a-4754-477d-abe3-7a5c7f3ff43e}, !- Handle + {8ca24421-a939-42e5-bcf0-ae257c410d8b}, !- Source Object + 3, !- Outlet Port + {bc1b4947-9d69-4d79-9e89-3113150fcf75}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {38f4c014-bbe5-4b98-ae57-da55fbb0ffe2}, !- Handle + {bc1b4947-9d69-4d79-9e89-3113150fcf75}, !- Source Object + 3, !- Outlet Port + {d58a3b32-a8fd-4472-9244-8c842d64ca6d}, !- Target Object + 3; !- Inlet Port + +OS:Connection, + {e01e71d1-bac7-4824-b5f2-f239645222f2}, !- Handle + {d58a3b32-a8fd-4472-9244-8c842d64ca6d}, !- Source Object + 2, !- Outlet Port + {31cf1a8f-cb88-46e4-8b13-8ef810611a3a}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {61d96d8d-39f5-4572-add4-3997caf8e19f}, !- Handle + {31cf1a8f-cb88-46e4-8b13-8ef810611a3a}, !- Source Object + 3, !- Outlet Port + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Target Object + 18; !- Inlet Port + +OS:Sizing:Plant, + {400916b5-75d9-4d78-aac8-76f019943585}, !- Handle + {aea26249-e0ba-4bc7-9270-2be7888354c0}, !- Plant or Condenser Loop Name + Heating, !- Loop Type + 82, !- Design Loop Exit Temperature {C} + 11, !- Loop Design Temperature Difference {deltaC} + NonCoincident, !- Sizing Option + 1, !- Zone Timesteps in Averaging Window + None; !- Coincident Sizing Factor Mode + +OS:AvailabilityManagerAssignmentList, + {3b843282-67f6-4de7-9685-47160cf7b07d}, !- Handle + Plant Loop 1 AvailabilityManagerAssignmentList; !- Name + +OS:Node, + {d1a5e8c2-fe4a-426f-82ea-be7b123e517f}, !- Handle + DH Outlet, !- Name + {21f7ead8-dc8b-4fde-8959-83754a97345a}, !- Inlet Port + {f7c3e06a-c2d2-4c63-8490-17af37eb9b19}; !- Outlet Port + +OS:Connection, + {4b129444-ff11-4881-8c7b-a5922047f153}, !- Handle + {b3227399-e307-4f1c-b2f9-ae73ab9c9220}, !- Source Object + 3, !- Outlet Port + {d3c7c7b6-31ac-4ab7-a193-1f3ff4754b88}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {21f7ead8-dc8b-4fde-8959-83754a97345a}, !- Handle + {d3c7c7b6-31ac-4ab7-a193-1f3ff4754b88}, !- Source Object + 3, !- Outlet Port + {d1a5e8c2-fe4a-426f-82ea-be7b123e517f}, !- Target Object + 2; !- Inlet Port + +OS:Connection, + {f7c3e06a-c2d2-4c63-8490-17af37eb9b19}, !- Handle + {d1a5e8c2-fe4a-426f-82ea-be7b123e517f}, !- Source Object + 3, !- Outlet Port + {7e24bc0b-2ff9-43a3-b76e-76fca4d9d723}, !- Target Object + 3; !- Inlet Port + diff --git a/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.rb b/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.rb new file mode 100644 index 00000000000..4f805c4eaa0 --- /dev/null +++ b/src/osversion/test/3_7_0/test_vt_RenameDistrictHeating.rb @@ -0,0 +1,15 @@ +#require '/usr/local/openstudio-3.6.1/Ruby/openstudio' + +include OpenStudio::Model + +m = Model.new + +dh = DistrictHeating.new(m) +dh.setName("My DistrictHeating") +p = PlantLoop.new(m) +p.addSupplyBranchForComponent(dh) +dh.inletModelObject.get.setName("DH Inlet") +dh.outletModelObject.get.setName("DH Outlet") +dh.setNominalCapacity(1000.0) + +m.save('test_vt_RenameDistrictHeating.osm', true) diff --git a/src/osversion/test/VersionTranslator_GTest.cpp b/src/osversion/test/VersionTranslator_GTest.cpp index 293b55398a4..9decf7e4908 100644 --- a/src/osversion/test/VersionTranslator_GTest.cpp +++ b/src/osversion/test/VersionTranslator_GTest.cpp @@ -3639,3 +3639,63 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_CoilsHeating) { EXPECT_EQ("Coil Heating Desuperheater 1", chd.getString(1).get()); // Name EXPECT_EQ(5, chd.getDouble(7).get()); // On Cycle Parasitic Electric Load } + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_DistrictHeating) { + openstudio::path osmPath = resourcesPath() / toPath("osversion/3_7_0/test_vt_RenameDistrictHeating.osm"); + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + std::vector dhs = model_->getObjectsByType("OS:DistrictHeating:Water"); + ASSERT_EQ(1u, dhs.size()); + const auto& dh = dhs.front(); + + EXPECT_EQ("My DistrictHeating", dh.nameString()); + ASSERT_TRUE(dh.getTarget(2)); + EXPECT_EQ("DH Inlet", dh.getTarget(2)->getTarget(OS_ConnectionFields::SourceObject)->nameString()); + ASSERT_TRUE(dh.getTarget(3)); + EXPECT_EQ("DH Outlet", dh.getTarget(3)->getTarget(OS_ConnectionFields::TargetObject)->nameString()); + EXPECT_EQ(1000.0, dh.getDouble(4).get()); + + EXPECT_EQ("Always On Continuous", dh.getTarget(5)->nameString()); +} + +TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_DistrictObjects_CapacityFracSch) { + const std::array osmPaths{ + resourcesPath() / toPath("osversion/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Create.osm"), + resourcesPath() / toPath("osversion/3_7_0/test_vt_DistrictObjects_CapacityFracSch_Get.osm"), + }; + + for (const auto& osmPath : osmPaths) { + osversion::VersionTranslator vt; + boost::optional model_ = vt.loadModel(osmPath); + ASSERT_TRUE(model_) << "Failed to load " << osmPath; + + openstudio::path outPath = osmPath.parent_path() / toPath(osmPath.stem().string() + "_updated" + osmPath.extension().string()); + model_->save(outPath, true); + + EXPECT_EQ(1, model_->getObjectsByType("OS:Schedule:Constant").size()); + EXPECT_EQ(1, model_->getObjectsByType("OS:ScheduleTypeLimits").size()); + { + std::vector dhs = model_->getObjectsByType("OS:DistrictHeating:Water"); + ASSERT_EQ(1, dhs.size()); + const auto& dh = dhs.front(); + + EXPECT_EQ(1000.0, dh.getDouble(4).get()); + ASSERT_TRUE(dh.getTarget(5)); + EXPECT_EQ("Always On Continuous", dh.getTarget(5)->nameString()); + } + { + std::vector dcs = model_->getObjectsByType("OS:DistrictCooling"); + ASSERT_EQ(1, dcs.size()); + const auto& dc = dcs.front(); + + EXPECT_EQ(1000.0, dc.getDouble(4).get()); + ASSERT_TRUE(dc.getTarget(5)); + EXPECT_EQ("Always On Continuous", dc.getTarget(5)->nameString()); + } + } +} diff --git a/src/utilities/data/DataEnums.hpp b/src/utilities/data/DataEnums.hpp index 69c109fe9ef..c64d977243d 100644 --- a/src/utilities/data/DataEnums.hpp +++ b/src/utilities/data/DataEnums.hpp @@ -298,9 +298,9 @@ inline UTILITIES_API AppGFuelType convertFuelTypeToAppG(FuelType fuelType) { return AppGFuelType::Electric; } else if ((fuelType == FuelType::Gas) || (fuelType == FuelType::Gasoline) || (fuelType == FuelType::Diesel) || (fuelType == FuelType::Coal) || (fuelType == FuelType::FuelOil_1) || (fuelType == FuelType::FuelOil_2) || (fuelType == FuelType::Propane) - || (fuelType == FuelType::Steam) || (fuelType == FuelType::OtherFuel_1) || (fuelType == FuelType::OtherFuel_2)) { + || (fuelType == FuelType::OtherFuel_1) || (fuelType == FuelType::OtherFuel_2)) { return AppGFuelType::Fuel; - } else if ((fuelType == FuelType::DistrictCooling) || (fuelType == FuelType::DistrictHeating)) { + } else if ((fuelType == FuelType::DistrictCooling) || (fuelType == FuelType::DistrictHeating) || (fuelType == FuelType::Steam)) { return AppGFuelType::District; } diff --git a/src/utilities/sql/Test/SqlFile_GTest.cpp b/src/utilities/sql/Test/SqlFile_GTest.cpp index 5ba31c4f62e..f7f1799a2c8 100644 --- a/src/utilities/sql/Test/SqlFile_GTest.cpp +++ b/src/utilities/sql/Test/SqlFile_GTest.cpp @@ -23,6 +23,8 @@ #include #include +#include + #include #include #include @@ -73,10 +75,15 @@ TEST_F(SqlFileFixture, FuelTypes) { EXPECT_NEAR(409.97, *(sqlFile3.districtCoolingTotalEndUses()), 2); EXPECT_NEAR(378.43, *(sqlFile3.districtHeatingWaterExteriorEquipment()), 2); EXPECT_NEAR(378.43, *(sqlFile3.districtHeatingWaterTotalEndUses()), 2); - EXPECT_NEAR(346.90, *(sqlFile3.districtHeatingSteamExteriorEquipment()), 2); - EXPECT_NEAR(346.90, *(sqlFile3.districtHeatingSteamTotalEndUses()), 2); - EXPECT_NEAR(725.33, *(sqlFile3.districtHeatingExteriorEquipment()), 2); - EXPECT_NEAR(725.33, *(sqlFile3.districtHeatingTotalEndUses()), 2); + if (energyPlusBuildSHA() == "c854ba6bfe") { + GTEST_SKIP() << "\nFIXME: Skip the checks for DistrictHeatingSteam pending new E+ package after https://github.com/NREL/EnergyPlus/pull/10212\n"; + } else { + EXPECT_TRUE(false) << "Please come remove the special check now that a new E+ package is out"; + EXPECT_NEAR(346.90, *(sqlFile3.districtHeatingSteamExteriorEquipment()), 2); + EXPECT_NEAR(346.90, *(sqlFile3.districtHeatingSteamTotalEndUses()), 2); + EXPECT_NEAR(725.33, *(sqlFile3.districtHeatingExteriorEquipment()), 2); + EXPECT_NEAR(725.33, *(sqlFile3.districtHeatingTotalEndUses()), 2); + } } TEST_F(SqlFileFixture, EnvPeriods) {