diff --git a/openstudiocore/resources/energyplus/ProposedEnergy+.idd b/openstudiocore/resources/energyplus/ProposedEnergy+.idd index a8a376b0d79..c0fd9aca460 100644 --- a/openstudiocore/resources/energyplus/ProposedEnergy+.idd +++ b/openstudiocore/resources/energyplus/ProposedEnergy+.idd @@ -26439,6 +26439,7 @@ Coil:Heating:Gas:MultiStage, \note capacity and Gas Burner Efficiency. N3, \field Stage 1 Gas Burner Efficiency \required-field + \begin-extensible \type real \units W/W \minimum> 0.0 @@ -26448,57 +26449,12 @@ Coil:Heating:Gas:MultiStage, \units W \minimum> 0.0 \autosizable - N5, \field Stage 1 Parasitic Electric Load + N5; \field Stage 1 Parasitic Electric Load \units W \note Stage 1 parasitic electric load associated with the gas coil operation \note such as an inducer fan, etc. This will be modified by the part \note load ratio to reflect the time of operation in a timestep. \ip-units W - N6, \field Stage 2 Gas Burner Efficiency - \type real - \units W/W - \minimum> 0.0 - N7, \field Stage 2 Nominal Capacity - \type real - \units W - \minimum> 0.0 - \autosizable - N8, \field Stage 2 Parasitic Electric Load - \units W - \note Stage 2 parasitic electric load associated with the gas coil operation - \note such as an inducer fan, etc. This will be modified by the part - \note load ratio to reflect the time of operation in a timestep. - \ip-units W - N9, \field Stage 3 Gas Burner Efficiency - \type real - \units W/W - \minimum> 0.0 - N10, \field Stage 3 Nominal Capacity - \type real - \units W - \minimum> 0.0 - \autosizable - N11, \field Stage 3 Parasitic Electric Load - \units W - \note Stage 3 parasitic electric load associated with the gas coil operation - \note such as an inducer fan, etc. This will be modified by the part - \note load ratio to reflect the time of operation in a timestep. - \ip-units W - N12, \field Stage 4 Gas Burner Efficiency - \type real - \units W/W - \minimum> 0.0 - N13, \field Stage 4 Nominal Capacity - \type real - \units W - \minimum> 0.0 - \autosizable - N14; \field Stage 4 Parasitic Electric Load - \units W - \note Stage 4 parasitic electric load associated with the gas coil operation - \note such as an inducer fan, etc. This will be modified by the part - \note load ratio to reflect the time of operation in a timestep. - \ip-units W Coil:Heating:Desuperheater, \memo Desuperheater air heating coil. The heating energy provided by this coil is reclaimed diff --git a/openstudiocore/resources/model/OpenStudio.idd b/openstudiocore/resources/model/OpenStudio.idd index 5cceb0956df..751b6cd79ab 100644 --- a/openstudiocore/resources/model/OpenStudio.idd +++ b/openstudiocore/resources/model/OpenStudio.idd @@ -7831,6 +7831,164 @@ OS:AirLoopHVAC:SupplyPlenum, \required-field \object-list ConnectionNames +OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed, + A1, \field Handle + \type handle + \required-field + A2, \field Name + \required-field + \reference ConnectionObject + A3, \field Availability Schedule + \type object-list + \object-list ScheduleNames + A4, \field Air Inlet Node + \required-field + \type object-list + \object-list ConnectionNames + A5, \field Air Outlet Node + \required-field + \type object-list + \object-list ConnectionNames + A6, \field Controlling Zone or Thermostat Location + \type object-list + \object-list ThermalZoneNames + A7, \field Supply Air Fan + \required-field + \type object-list + \object-list FansCVandOnOff + A8, \field Supply Air Fan Placement + \required-field + \type choice + \key BlowThrough + \key DrawThrough + A9 , \field Supply Air Fan Operating Mode Schedule + \type object-list + \object-list ScheduleNames + A10, \field Heating Coil + \required-field + \type object-list + \object-list HeatingCoilsElectricMultiStage + \object-list HeatingCoilsGasMultiStage + N1 , \field Minimum Outdoor Dry-Bulb Temperature for Compressor Operation + \type real + \minimum -20.0 + \units C + \required-field + A11, \field Cooling Coil + \required-field + \note Needs to match in the DX Cooling Coil object + \type object-list + \object-list CoolingCoilsDXMultiSpeed + A12, \field Supplemental Heating Coil + \type object-list + \object-list HeatingCoilName + N2 , \field Maximum Supply Air Temperature from Supplemental Heater + \type real + \units C + \autosizable + \required-field + N3 , \field Maximum Outdoor Dry-Bulb Temperature for Supplemental Heater Operation + \type real + \maximum 21.0 + \units C + \required-field + N4 , \field Auxiliary On-Cycle Electric Power + \type real + \units W + \minimum 0 + \required-field + N5 , \field Auxiliary Off-Cycle Electric Power + \type real + \units W + \minimum 0 + \required-field + N6 , \field Design Heat Recovery Water Flow Rate + \type real + \note If non-zero, then the heat recovery inlet and outlet node names must be entered. + \note Used for heat recovery to an EnergyPlus plant loop. + \units m3/s + \minimum 0.0 + \required-field + N7, \field Maximum Temperature for Heat Recovery + \units C + \maximum 100.0 + \minimum 0.0 + \required-field + A13, \field Heat Recovery Water Inlet Node + \required-field + \type object-list + \object-list ConnectionNames + A14, \field Heat Recovery Water Outlet Node + \required-field + \type object-list + \object-list ConnectionNames + N8 , \field Supply Air Flow Rate When No Cooling or Heating is Needed + \type real + \units m3/s + \minimum 0 + \autosizable + \required-field + N9, \field Number of Speeds for Heating + \required-field + \type integer + \minimum 1 + \maximum 4 + N10, \field Number of Speeds for Cooling + \required-field + \type integer + \minimum 2 + \maximum 4 + N11, \field Speed 1 Supply Air Flow Rate During Heating Operation + \required-field + \type real + \units m3/s + \autosizable + \minimum> 0 + N12, \field Speed 2 Supply Air Flow Rate During Heating Operation + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N13, \field Speed 3 Supply Air Flow Rate During Heating Operation + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N14, \field Speed 4 Supply Air Flow Rate During Heating Operation + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N15, \field Speed 1 Supply Air Flow Rate During Cooling Operation + \required-field + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N16, \field Speed 2 Supply Air Flow Rate During Cooling Operation + \required-field + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N17, \field Speed 3 Supply Air Flow Rate During Cooling Operation + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + N18; \field Speed 4 Supply Air Flow Rate During Cooling Operation + \type real + \units m3/s + \autosizable + \minimum> 0 + \required-field + OS:AirLoopHVAC:UnitaryCoolOnly, \min-fields 8 A1, \field Handle @@ -10437,6 +10595,199 @@ OS:Coil:Cooling:DX:SingleSpeed, \type object-list \object-list ScheduleNames +OS:Coil:Cooling:DX:MultiSpeed, + \extensible:1 + A1, \field Handle + \type handle + \required-field + A2 , \field Name + \required-field + \type alpha + \reference CoolingCoilsDXMultiSpeed + \reference AFNCoilNames + \reference ConnectionObject + A3 , \field Availability Schedule + \type object-list + \object-list ScheduleNames + A4 , \field Air Inlet Node + \type object-list + \required-field + \object-list ConnectionNames + A5 , \field Air Outlet Node + \type object-list + \required-field + \object-list ConnectionNames + A6 , \field Condenser Air Inlet Node + \type object-list + \object-list Node + A7 , \field Condenser Type + \type choice + \key AirCooled + \key EvaporativelyCooled + \required-field + A8 , \field Supply Water Storage Tank + A9 , \field Condensate Collection Water Storage Tank + A10 , \field Apply Part Load Fraction to Speeds Greater than 1 + \type choice + \key Yes + \key No + \required-field + A11, \field Apply Latent Degradation to Speeds Greater than 1 + \type choice + \key Yes + \key No + \default No + \required-field + N1 , \field Crankcase Heater Capacity + \type real + \minimum 0.0 + \units W + \ip-units W + \required-field + N2 , \field Maximum Outdoor Dry-Bulb Temperature for Crankcase Heater Operation + \type real + \minimum 0.0 + \units C + \required-field + N3, \field Basin Heater Capacity + \type real + \units W/K + \minimum 0.0 + \required-field + N4, \field Basin Heater Setpoint Temperature + \type real + \units C + \minimum 2.0 + \required-field + A12, \field Basin Heater Operating Schedule + \type object-list + \object-list ScheduleNames + A13, \field Fuel Type + \type choice + \key Electricity + \key NaturalGas + \key PropaneGas + \key Diesel + \key Gasoline + \key FuelOil#1 + \key FuelOil#2 + \key OtherFuel1 + \key OtherFuel2 + \required-field + A14; \field Stage 1 + \begin-extensible + \type object-list + \object-list CoilCoolingDXMultiSpeedStageData + +OS:Coil:Cooling:DX:MultiSpeed:StageData, + A1, \field Handle + \type handle + \required-field + A2 , \field Name + \required-field + \type alpha + \reference CoilCoolingDXMultiSpeedStageData + N1 , \field Gross Rated Total Cooling Capacity + \required-field + \type real + \units W + \minimum> 0.0 + \autosizable + N2 , \field Gross Rated Sensible Heat Ratio + \required-field + \type real + \minimum 0.5 + \maximum 1.0 + \autosizable + N3 , \field Gross Rated Cooling COP + \type real + \units W/W + \minimum> 0.0 + \required-field + N4 , \field Rated Air Flow Rate + \required-field + \type real + \units m3/s + \minimum> 0.0 + \autosizable + N5, \field Rated Evaporator Fan Power Per Volume Flow Rate + \type real + \units W/(m3/s) + \minimum 0.0 + \maximum 1250.0 + \required-field + A3, \field Total Cooling Capacity Function of Temperature Curve + \required-field + \type object-list + \object-list BiquadraticCurves + A4, \field Total Cooling Capacity Function of Flow Fraction Curve + \required-field + \type object-list + \object-list QuadraticCubicCurves + A5, \field Energy Input Ratio Function of Temperature Curve + \required-field + \type object-list + \object-list BiquadraticCurves + A6, \field Energy Input Ratio Function of Flow Fraction Curve + \required-field + \type object-list + \object-list QuadraticCubicCurves + A7, \field Part Load Fraction Correlation Curve + \required-field + \type object-list + \object-list QuadraticCubicCurves + N6, \field Nominal Time for Condensate Removal to Begin + \type real + \units s + \minimum 0.0 + \maximum 3000.0 + \required-field + N7, \field Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity + \type real + \units dimensionless + \minimum 0.0 + \maximum 5.0 + \required-field + N8, \field Maximum Cycling Rate + \type real + \units cycles/hr + \minimum 0.0 + \maximum 5.0 + \required-field + N9, \field Latent Capacity Time Constant + \type real + \units s + \minimum 0.0 + \maximum 500.0 + \required-field + N10, \field Rated Waste Heat Fraction of Power Input + \required-field + \type real + \units dimensionless + \minimum> 0.0 + \maximum 1.0 + A8, \field Waste Heat Function of Temperature Curve + \type object-list + \object-list BiQuadraticCurves + N11, \field Evaporative Condenser Effectiveness + \type real + \units dimensionless + \minimum 0.0 + \maximum 1.0 + \required-field + N12, \field Evaporative Condenser Air Flow Rate + \type real + \units m3/s + \minimum> 0.0 + \autosizable + \required-field + N13; \field Rated Evaporative Condenser Pump Power Consumption + \type real + \units W + \minimum 0.0 + \autosizable + \required-field + OS:Coil:Cooling:DX:TwoSpeed, \min-fields 20 A1, \field Handle @@ -11284,6 +11635,61 @@ OS:Coil:Heating:Gas, \type real \units W +OS:Coil:Heating:Gas:MultiStage, + \extensible:1 + A1, \field Handle + \type handle + \required-field + A2, \field Name + \required-field + \reference HeatingCoilsGasMultiStage + \type alpha + \reference ConnectionObject + A3, \field Availability Schedule + \type object-list + \object-list ScheduleNames + A4, \field Air Inlet Node + \type object-list + \required-field + \object-list ConnectionNames + A5, \field Air Outlet Node + \type object-list + \required-field + \object-list ConnectionNames + A6, \field Part Load Fraction Correlation Curve + \type object-list + \object-list QuadraticCubicCurves + N1, \field Parasitic Gas Load + \units W + A7; \field Stage 1 + \begin-extensible + \type object-list + \object-list CoilHeatingGasMultiStageStageData + +OS:Coil:Heating:Gas:MultiStage:StageData, + A1, \field Handle + \type handle + \required-field + A2 , \field Name + \required-field + \reference CoilHeatingGasMultiStageStageData + \type alpha + N1, \field Gas Burner Efficiency + \required-field + \type real + \units W/W + \minimum> 0.0 + N2, \field Nominal Capacity + \required-field + \type real + \units W + \minimum> 0.0 + \autosizable + N3; \field Parasitic Electric Load + \required-field + \units W + \ip-units W + OS:Coil:Heating:Desuperheater, \memo Desuperheater air heating coil. The heating energy provided by this coil is reclaimed \memo from the superheated refrigerant gas leaving a compressor and does not impact the @@ -15271,6 +15677,80 @@ OS:ThermostatSetpoint:DualSetpoint, \type object-list \object-list ScheduleNames +OS:ZoneControl:Thermostat:StagedDualSetpoint, + A1, \field Handle + \type handle + \required-field + A2 , \field Name + \required-field + \reference ThermostatNames + N1 , \field Number of Heating Stages + \required-field + \type integer + \minimum 1 + \maximum 4 + A3 , \field Heating Temperature Setpoint Schedule + \type object-list + \object-list ScheduleNames + N2 , \field Heating Throttling Temperature Range + \units deltaC + \minimum 0.0 + \required-field + N3 , \field Stage 1 Heating Temperature Offset + \required-field + \type real + \units deltaC + \maximum 0.0 + \required-field + N4 , \field Stage 2 Heating Temperature Offset + \type real + \units deltaC + \maximum 0.0 + \required-field + N5 , \field Stage 3 Heating Temperature Offset + \type real + \units deltaC + \maximum 0.0 + \required-field + N6 , \field Stage 4 Heating Temperature Offset + \type real + \units deltaC + \maximum 0.0 + \required-field + N7 , \field Number of Cooling Stages + \required-field + \type integer + \minimum 1 + \maximum 4 + \required-field + A4 , \field Cooling Temperature Setpoint Base Schedule + \type object-list + \object-list ScheduleNames + N8 , \field Cooling Throttling Temperature Range + \units deltaC + \minimum 0.0 + \required-field + N9 , \field Stage 1 Cooling Temperature Offset + \required-field + \type real + \units deltaC + \minimum 0.0 + N10, \field Stage 2 Cooling Temperature Offset + \type real + \units deltaC + \minimum 0.0 + \required-field + N11, \field Stage 3 Cooling Temperature Offset + \type real + \units deltaC + \minimum 0.0 + \required-field + N12; \field Stage 4 Cooling Temperature Offset + \type real + \units deltaC + \minimum 0.0 + \required-field + OS:ZoneHVAC:EquipmentList, \min-fields 1 \extensible:3 Duplicate the three fields Zone Equipment Object Type through Heating Priority diff --git a/openstudiocore/src/energyplus/CMakeLists.txt b/openstudiocore/src/energyplus/CMakeLists.txt index e543aa14561..8347222e626 100644 --- a/openstudiocore/src/energyplus/CMakeLists.txt +++ b/openstudiocore/src/energyplus/CMakeLists.txt @@ -19,6 +19,7 @@ set(${target_name}_src ForwardTranslator/ForwardTranslateAirLoopHVACReturnPlenum.cpp ForwardTranslator/ForwardTranslateAirLoopHVACSupplyPlenum.cpp ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAir.cpp + ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp ForwardTranslator/ForwardTranslateAirLoopHVACUnitarySystem.cpp ForwardTranslator/ForwardTranslateAirLoopHVACZoneMixer.cpp ForwardTranslator/ForwardTranslateAirLoopHVACZoneSplitter.cpp @@ -36,6 +37,7 @@ set(${target_name}_src ForwardTranslator/ForwardTranslateBuilding.cpp ForwardTranslator/ForwardTranslateCFactorUndergroundWallConstruction.cpp ForwardTranslator/ForwardTranslateChillerElectricEIR.cpp + ForwardTranslator/ForwardTranslateCoilCoolingDXMultiSpeed.cpp ForwardTranslator/ForwardTranslateCoilCoolingDXSingleSpeed.cpp ForwardTranslator/ForwardTranslateCoilCoolingDXTwoSpeed.cpp ForwardTranslator/ForwardTranslateCoilCoolingDXVariableRefrigerantFlow.cpp @@ -46,6 +48,7 @@ set(${target_name}_src ForwardTranslator/ForwardTranslateCoilHeatingDXVariableRefrigerantFlow.cpp ForwardTranslator/ForwardTranslateCoilHeatingElectric.cpp ForwardTranslator/ForwardTranslateCoilHeatingGas.cpp + ForwardTranslator/ForwardTranslateCoilHeatingGasMultiStage.cpp ForwardTranslator/ForwardTranslateCoilHeatingWater.cpp ForwardTranslator/ForwardTranslateCoilHeatingWaterToAirHeatPumpEquationFit.cpp ForwardTranslator/ForwardTranslateCoilWaterHeatingDesuperheater.cpp @@ -196,6 +199,7 @@ set(${target_name}_src ForwardTranslator/ForwardTranslateWaterUseEquipment.cpp ForwardTranslator/ForwardTranslateZoneAirHeatBalanceAlgorithm.cpp ForwardTranslator/ForwardTranslateZoneControlHumidistat.cpp + ForwardTranslator/ForwardTranslateZoneControlThermostatStagedDualSetpoint.cpp ForwardTranslator/ForwardTranslateZoneHVACBaseboardConvectiveElectric.cpp ForwardTranslator/ForwardTranslateZoneHVACBaseboardConvectiveWater.cpp ForwardTranslator/ForwardTranslateZoneHVACEquipmentList.cpp diff --git a/openstudiocore/src/energyplus/ForwardTranslator.cpp b/openstudiocore/src/energyplus/ForwardTranslator.cpp index b2b950c6e5a..6110eb12174 100644 --- a/openstudiocore/src/energyplus/ForwardTranslator.cpp +++ b/openstudiocore/src/energyplus/ForwardTranslator.cpp @@ -490,6 +490,12 @@ boost::optional ForwardTranslator::translateAndMapModelObject(ModelOb retVal = translateAirLoopHVACUnitaryHeatPumpAirToAir(unitary); break; } + case openstudio::IddObjectType::OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed : + { + model::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed unitary = modelObject.cast(); + retVal = translateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(unitary); + break; + } case openstudio::IddObjectType::OS_AirLoopHVAC_UnitarySystem : { model::AirLoopHVACUnitarySystem unitary = modelObject.cast(); @@ -567,6 +573,16 @@ boost::optional ForwardTranslator::translateAndMapModelObject(ModelOb } break; } + case openstudio::IddObjectType::OS_Coil_Cooling_DX_MultiSpeed : + { + model::CoilCoolingDXMultiSpeed coil = modelObject.cast(); + retVal = translateCoilCoolingDXMultiSpeed(coil); + break; + } + case openstudio::IddObjectType::OS_Coil_Cooling_DX_MultiSpeed_StageData : + { + return retVal; + } case openstudio::IddObjectType::OS_Coil_Cooling_DX_TwoSpeed : { model::CoilCoolingDXTwoSpeed coil = modelObject.cast(); @@ -633,6 +649,17 @@ boost::optional ForwardTranslator::translateAndMapModelObject(ModelOb retVal = translateCoilHeatingGas(coil); break; } + case openstudio::IddObjectType::OS_Coil_Heating_Gas_MultiStage : + { + model::CoilHeatingGasMultiStage coil = modelObject.cast(); + retVal = translateCoilHeatingGasMultiStage(coil); + break; + } + case openstudio::IddObjectType::OS_Coil_Heating_Gas_MultiStage_StageData : + { + // no-op + return retVal; + } case openstudio::IddObjectType::OS_Coil_Heating_LowTemperatureRadiant_ConstantFlow : { // no-op @@ -1638,6 +1665,12 @@ boost::optional ForwardTranslator::translateAndMapModelObject(ModelOb retVal = translateZoneControlHumidistat(mo); break; } + case openstudio::IddObjectType::OS_ZoneControl_Thermostat_StagedDualSetpoint : + { + model::ZoneControlThermostatStagedDualSetpoint mo = modelObject.cast(); + retVal = translateZoneControlThermostatStagedDualSetpoint(mo); + break; + } case openstudio::IddObjectType::OS_ZoneHVAC_Baseboard_Convective_Electric : { model::ZoneHVACBaseboardConvectiveElectric mo = modelObject.cast(); diff --git a/openstudiocore/src/energyplus/ForwardTranslator.hpp b/openstudiocore/src/energyplus/ForwardTranslator.hpp index 2b1e2bf69ea..4a59926f814 100644 --- a/openstudiocore/src/energyplus/ForwardTranslator.hpp +++ b/openstudiocore/src/energyplus/ForwardTranslator.hpp @@ -40,6 +40,7 @@ class AirConditionerVariableRefrigerantFlow; class AirGap; class AirLoopHVAC; class AirLoopHVACUnitaryHeatPumpAirToAir; +class AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed; class AirLoopHVACUnitarySystem; class AirLoopHVACReturnPlenum; class AirLoopHVACSupplyPlenum; @@ -60,6 +61,7 @@ class BoilerHotWater; class BoilerSteam; class CFactorUndergroundWallConstruction; class ChillerElectricEIR; +class CoilCoolingDXMultiSpeed; class CoilCoolingDXSingleSpeed; class CoilCoolingDXTwoSpeed; class CoilCoolingDXVariableRefrigerantFlow; @@ -70,6 +72,7 @@ class CoilHeatingDXSingleSpeed; class CoilHeatingDXVariableRefrigerantFlow; class CoilHeatingElectric; class CoilHeatingGas; +class CoilHeatingGasMultiStage; class CoilHeatingWater; class CoilHeatingWaterToAirHeatPumpEquationFit; class CoilWaterHeatingDesuperheater; @@ -221,6 +224,7 @@ class WaterUseConnections; class WaterUseEquipment; class ZoneAirHeatBalanceAlgorithm; class ZoneControlHumidistat; +class ZoneControlThermostatStagedDualSetpoint; class ZoneHVACBaseboardConvectiveElectric; class ZoneHVACBaseboardConvectiveWater; class ZoneHVACFourPipeFanCoil; @@ -315,6 +319,8 @@ class ENERGYPLUS_API ForwardTranslator { boost::optional translateAirLoopHVACUnitaryHeatPumpAirToAir( model::AirLoopHVACUnitaryHeatPumpAirToAir & modelObject ); + boost::optional translateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed( model::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed & modelObject ); + boost::optional translateAirLoopHVACUnitarySystem( model::AirLoopHVACUnitarySystem & modelObject ); boost::optional translateAirLoopHVACReturnPlenum( model::AirLoopHVACReturnPlenum & airLoopHVACReturnPlenum ); @@ -355,6 +361,8 @@ class ENERGYPLUS_API ForwardTranslator { boost::optional translateCoilCoolingDXSingleSpeed( model::CoilCoolingDXSingleSpeed & modelObject ); + boost::optional translateCoilCoolingDXMultiSpeed( model::CoilCoolingDXMultiSpeed & modelObject ); + boost::optional translateCoilCoolingDXSingleSpeedWithoutUnitary( model::CoilCoolingDXSingleSpeed & modelObject ); boost::optional translateCoilCoolingDXTwoSpeed( model::CoilCoolingDXTwoSpeed & modelObject ); @@ -379,6 +387,8 @@ class ENERGYPLUS_API ForwardTranslator { boost::optional translateCoilHeatingGas( model::CoilHeatingGas & modelObject ); + boost::optional translateCoilHeatingGasMultiStage( model::CoilHeatingGasMultiStage & modelObject ); + boost::optional translateCoilHeatingWater( model::CoilHeatingWater & modelObject ); boost::optional translateCoilHeatingWaterToAirHeatPumpEquationFit( model::CoilHeatingWaterToAirHeatPumpEquationFit & modelObject ); @@ -678,6 +688,8 @@ class ENERGYPLUS_API ForwardTranslator { boost::optional translateZoneAirHeatBalanceAlgorithm( model::ZoneAirHeatBalanceAlgorithm & modelObject ); boost::optional translateZoneControlHumidistat( model::ZoneControlHumidistat& modelObject ); + + boost::optional translateZoneControlThermostatStagedDualSetpoint( model::ZoneControlThermostatStagedDualSetpoint& modelObject ); boost::optional translateZoneHVACBaseboardConvectiveElectric( model::ZoneHVACBaseboardConvectiveElectric & modelObject ); diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp new file mode 100644 index 00000000000..870ec062a55 --- /dev/null +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp @@ -0,0 +1,373 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Model.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "../../model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" +#include "../../model/Node.hpp" +#include "../../model/Node_Impl.hpp" +#include "../../model/ThermalZone.hpp" +#include "../../model/ThermalZone_Impl.hpp" +#include "../../model/CoilCoolingDXMultiSpeed.hpp" +#include "../../model/CoilCoolingDXMultiSpeed_Impl.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace openstudio::model; + +namespace openstudio { + +namespace energyplus { + +boost::optional ForwardTranslator::translateAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed( AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed & modelObject ) +{ + boost::optional s; + boost::optional value; + boost::optional num; + + IdfObject idfObject(IddObjectType::AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed); + + m_idfObjects.push_back(idfObject); + + // Name + std::string baseName = modelObject.name().get(); + idfObject.setName(baseName); + + + // AvailabilityScheduleName + if( boost::optional schedule = modelObject.availabilitySchedule() ) + { + if( boost::optional _schedule = translateAndMapModelObject(schedule.get()) ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilityScheduleName,_schedule->name().get()); + } + } + + // AirInletNodeName + std::string airInletNodeName; + if( boost::optional mo = modelObject.inletModelObject() ) + { + if( boost::optional node = mo->optionalCast() ) + { + if( (s = node->name()) ) + { + airInletNodeName = s.get(); + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirInletNodeName,s.get()); + } + } + } + + // AirOutletNodeName + std::string airOutletNodeName; + if( boost::optional mo = modelObject.outletModelObject() ) + { + if( boost::optional node = mo->optionalCast() ) + { + if( (s = node->name()) ) + { + airOutletNodeName = s.get(); + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirOutletNodeName,s.get()); + } + } + } + + // MinimumOutdoorDryBulbTemperatureforCompressorOperation + if( value = modelObject.minimumOutdoorDryBulbTemperatureforCompressorOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation,value.get()); + } + + HVACComponent coolingCoil = modelObject.coolingCoil(); + boost::optional _coolingCoil = translateAndMapModelObject(coolingCoil); + if( _coolingCoil ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoilObjectType,_coolingCoil->iddObject().name() ); + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoilName,_coolingCoil->name().get()); + } + + HVACComponent heatingCoil = modelObject.heatingCoil(); + boost::optional _heatingCoil = translateAndMapModelObject(heatingCoil); + if( _heatingCoil ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoilObjectType,_heatingCoil->iddObject().name() ); + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoilName,_heatingCoil->name().get()); + } + + // ControllingZoneorThermostatLocation + if( boost::optional tz = modelObject.controllingZoneorThermostatLocation() ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation,tz->name().get() ); + } + + // SupplyAirFanName + HVACComponent fan = modelObject.supplyAirFan(); + boost::optional _fan = translateAndMapModelObject(fan); + if( _fan ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanObjectType,_fan->iddObject().name() ); + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanName,_fan->name().get()); + } + + // SupplementalHeatingCoilName + boost::optional _supplementalHeatingCoil; + boost::optional supplementalHeatingCoil = modelObject.supplementalHeatingCoil(); + if( supplementalHeatingCoil ) + { + _supplementalHeatingCoil = translateAndMapModelObject(supplementalHeatingCoil.get()); + } + if( _supplementalHeatingCoil ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoilObjectType, + _supplementalHeatingCoil->iddObject().name()); + + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoilName,_supplementalHeatingCoil->name().get()); + } + + // FanPlacement + bool t_blowThrough = true; + if( (s = modelObject.supplyAirFanPlacement()) ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanPlacement,s.get()); + if( istringEqual(s.get(),"DrawThrough") ) { + t_blowThrough = false; + } + } + + // SupplyAirFanOperatingModeScheduleName + if( boost::optional schedule = modelObject.supplyAirFanOperatingModeSchedule() ) + { + boost::optional _schedule = translateAndMapModelObject(schedule.get()); + if( _schedule ) + { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeScheduleName,_schedule->name().get()); + } + } + + // MaximumSupplyAirTemperaturefromSupplementalHeater + if( modelObject.isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater,"AutoSize"); + } else if( value = modelObject.maximumSupplyAirTemperaturefromSupplementalHeater() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater,value.get()); + } + + // MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation + if( value = modelObject.maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation,value.get()); + } + + // AuxiliaryOnCycleElectricPower + if( value = modelObject.auxiliaryOnCycleElectricPower() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOnCycleElectricPower,value.get()); + } + + // AuxiliaryOffCycleElectricPower + if( value = modelObject.auxiliaryOffCycleElectricPower() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOffCycleElectricPower,value.get()); + } + + // DesignHeatRecoveryWaterFlowRate + if( value = modelObject.designHeatRecoveryWaterFlowRate() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::DesignHeatRecoveryWaterFlowRate,value.get()); + } + + // MaximumTemperatureforHeatRecovery + if( value = modelObject.maximumTemperatureforHeatRecovery() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumTemperatureforHeatRecovery,value.get()); + } + + // HeatRecoveryWaterInletNodeName + + // HeatRecoveryWaterOutletNodeName + + // SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded + if( modelObject.isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded,"AutoSize"); + } else if( value = modelObject.supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded,value.get()); + } + + // NumberofSpeedsforHeating + if( num = modelObject.numberofSpeedsforHeating() ) { + idfObject.setInt(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforHeating,num.get()); + } + + // NumberofSpeedsforCooling + if( num = modelObject.numberofSpeedsforCooling() ) { + idfObject.setInt(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforCooling,num.get()); + } + + // Speed1SupplyAirFlowRateDuringHeatingOperation + if( modelObject.isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation,"AutoSize"); + } else if( value = modelObject.speed1SupplyAirFlowRateDuringHeatingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation,value.get()); + } + + // Speed2SupplyAirFlowRateDuringHeatingOperation + if( modelObject.isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation,"AutoSize"); + } else if( value = modelObject.speed2SupplyAirFlowRateDuringHeatingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation,value.get()); + } + + // Speed3SupplyAirFlowRateDuringHeatingOperation + if( modelObject.isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation,"AutoSize"); + } else if( value = modelObject.speed3SupplyAirFlowRateDuringHeatingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation,value.get()); + } + + // Speed4SupplyAirFlowRateDuringHeatingOperation + if( modelObject.isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation,"AutoSize"); + } else if( value = modelObject.speed4SupplyAirFlowRateDuringHeatingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation,value.get()); + } + + // Speed1SupplyAirFlowRateDuringCoolingOperation + if( modelObject.isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation,"AutoSize"); + } else if( value = modelObject.speed1SupplyAirFlowRateDuringCoolingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation,value.get()); + } + + // Speed2SupplyAirFlowRateDuringCoolingOperation + if( modelObject.isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation,"AutoSize"); + } else if( value = modelObject.speed2SupplyAirFlowRateDuringCoolingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation,value.get()); + } + + // Speed3SupplyAirFlowRateDuringCoolingOperation + if( modelObject.isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation,"AutoSize"); + } else if( value = modelObject.speed3SupplyAirFlowRateDuringCoolingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation,value.get()); + } + + // Speed4SupplyAirFlowRateDuringCoolingOperation + if( modelObject.isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized() ) { + idfObject.setString(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation,"AutoSize"); + } else if( value = modelObject.speed4SupplyAirFlowRateDuringCoolingOperation() ) { + idfObject.setDouble(AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation,value.get()); + } + + std::string fanOutletNodeName; + std::string fanInletNodeName; + std::string coolingCoilOutletNodeName; + std::string coolingCoilInletNodeName; + std::string heatingCoilOutletNodeName; + std::string heatingCoilInletNodeName; + std::string suppCoilOutletNodeName; + std::string suppCoilInletNodeName; + + if( t_blowThrough ) { + fanInletNodeName = airInletNodeName; + fanOutletNodeName = baseName + " Fan Outlet"; + + coolingCoilInletNodeName = fanInletNodeName; + coolingCoilOutletNodeName = baseName + " Cool Coil Outlet"; + + heatingCoilInletNodeName = coolingCoilOutletNodeName; + if( _supplementalHeatingCoil ) { + heatingCoilOutletNodeName = baseName + " Heat Coil Outlet"; + } else { + heatingCoilOutletNodeName = airOutletNodeName; + } + + if( _supplementalHeatingCoil ) { + suppCoilInletNodeName = heatingCoilOutletNodeName; + suppCoilOutletNodeName = airOutletNodeName; + } + } else { + coolingCoilInletNodeName = airInletNodeName; + coolingCoilOutletNodeName = baseName + " Cool Coil Outlet"; + + heatingCoilInletNodeName = coolingCoilOutletNodeName; + heatingCoilOutletNodeName = baseName + " Heat Coil Outlet"; + + if( _supplementalHeatingCoil ) { + suppCoilInletNodeName = heatingCoilOutletNodeName; + suppCoilOutletNodeName = baseName + " Supp Coil Outlet"; + } + + if( _supplementalHeatingCoil ) { + fanInletNodeName = suppCoilOutletNodeName; + } else { + fanInletNodeName = heatingCoilOutletNodeName; + } + fanOutletNodeName = airOutletNodeName; + } + + if( _fan ) { + if( _fan->iddObject().type() == IddObjectType::Fan_ConstantVolume ) { + _fan->setString(Fan_ConstantVolumeFields::AirInletNodeName,fanInletNodeName); + _fan->setString(Fan_ConstantVolumeFields::AirOutletNodeName,fanOutletNodeName); + } else if( _fan->iddObject().type() == IddObjectType::Fan_OnOff ) { + _fan->setString(Fan_OnOffFields::AirInletNodeName,fanInletNodeName); + _fan->setString(Fan_OnOffFields::AirOutletNodeName,fanOutletNodeName); + } + } + + if( _coolingCoil ) { + if( _coolingCoil->iddObject().type() == IddObjectType::Coil_Cooling_DX_MultiSpeed ) { + _coolingCoil->setString(Coil_Cooling_DX_MultiSpeedFields::AirInletNodeName,coolingCoilInletNodeName); + _coolingCoil->setString(Coil_Cooling_DX_MultiSpeedFields::AirOutletNodeName,coolingCoilOutletNodeName); + } + } + + if( _heatingCoil ) { + if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Gas_MultiStage ) { + _heatingCoil->setString(Coil_Heating_Gas_MultiStageFields::AirInletNodeName,heatingCoilInletNodeName); + _heatingCoil->setString(Coil_Heating_Gas_MultiStageFields::AirOutletNodeName,heatingCoilOutletNodeName); + } else if( _heatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water ) { + _heatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName,heatingCoilInletNodeName); + _heatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName,heatingCoilOutletNodeName); + } + } + + if( _supplementalHeatingCoil ) { + if( _supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Water ) { + _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirInletNodeName,suppCoilInletNodeName); + _supplementalHeatingCoil->setString(Coil_Heating_WaterFields::AirOutletNodeName,suppCoilOutletNodeName); + } else if( _supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Gas ) { + _supplementalHeatingCoil->setString(Coil_Heating_GasFields::AirInletNodeName,suppCoilInletNodeName); + _supplementalHeatingCoil->setString(Coil_Heating_GasFields::AirOutletNodeName,suppCoilOutletNodeName); + } else if( _supplementalHeatingCoil->iddObject().type() == IddObjectType::Coil_Heating_Electric ) { + _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirInletNodeName,suppCoilInletNodeName); + _supplementalHeatingCoil->setString(Coil_Heating_ElectricFields::AirOutletNodeName,suppCoilOutletNodeName); + } + } + + return idfObject; +} + +} // energyplus + +} // openstudio + diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXMultiSpeed.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXMultiSpeed.cpp new file mode 100644 index 00000000000..c5ee3edacd6 --- /dev/null +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilCoolingDXMultiSpeed.cpp @@ -0,0 +1,263 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Model.hpp" +#include "../../model/CoilCoolingDXMultiSpeed.hpp" +#include "../../model/CoilCoolingDXMultiSpeed_Impl.hpp" +#include "../../model/CoilCoolingDXMultiSpeedStageData.hpp" +#include "../../model/CoilCoolingDXMultiSpeedStageData_Impl.hpp" +#include "../../model/Node.hpp" +#include "../../model/Node_Impl.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../model/Curve.hpp" +#include "../../model/Curve_Impl.hpp" +#include +#include +#include +#include "../../utilities/idf/IdfExtensibleGroup.hpp" + +using namespace openstudio::model; + +namespace openstudio { + +namespace energyplus { + +boost::optional ForwardTranslator::translateCoilCoolingDXMultiSpeed( CoilCoolingDXMultiSpeed & modelObject ) +{ + boost::optional s; + boost::optional value; + + // Name + IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Coil_Cooling_DX_MultiSpeed, modelObject); + + // AvailabilityScheduleName + if( auto schedule = modelObject.availabilitySchedule() ) { + if( auto _schedule = translateAndMapModelObject(schedule.get()) ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::AvailabilityScheduleName,_schedule->name().get()); + } + } + + // AirInletNodeName + if( auto node = modelObject.inletModelObject() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::AirInletNodeName,node->name().get()); + } + + // AirOutletNodeName + if( auto node = modelObject.outletModelObject() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::AirOutletNodeName,node->name().get()); + } + + // CondenserAirInletNodeName + + // CondenserType + if( s = modelObject.condenserType() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::CondenserType,s.get()); + } + + // SupplyWaterStorageTankName + + // CondensateCollectionWaterStorageTankName + + // ApplyPartLoadFractiontoSpeedsGreaterthan1 + + if( auto boolValue = modelObject.applyPartLoadFractiontoSpeedsGreaterthan1() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1,"Yes"); + } else { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1,"No"); + } + + // ApplyLatentDegradationtoSpeedsGreaterthan1 + if( auto boolValue = modelObject.applyLatentDegradationtoSpeedsGreaterthan1() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1,"Yes"); + } else { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1,"No"); + } + + // CrankcaseHeaterCapacity + if( value = modelObject.crankcaseHeaterCapacity() ) { + idfObject.setDouble(Coil_Cooling_DX_MultiSpeedFields::CrankcaseHeaterCapacity,value.get()); + } + + // MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation + if( value = modelObject.maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() ) { + idfObject.setDouble(Coil_Cooling_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation,value.get()); + } + + // BasinHeaterCapacity + if( value = modelObject.basinHeaterCapacity() ) { + idfObject.setDouble(Coil_Cooling_DX_MultiSpeedFields::BasinHeaterCapacity,value.get()); + } + + // BasinHeaterSetpointTemperature + if( value = modelObject.basinHeaterSetpointTemperature() ) { + idfObject.setDouble(Coil_Cooling_DX_MultiSpeedFields::BasinHeaterSetpointTemperature,value.get()); + } + + // BasinHeaterOperatingScheduleName + if( auto schedule = modelObject.basinHeaterOperatingSchedule() ) { + if( auto _schedule = translateAndMapModelObject(schedule.get()) ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::BasinHeaterOperatingScheduleName,_schedule->name().get()); + } + } + + // FuelType + if( s = modelObject.fuelType() ) { + idfObject.setString(Coil_Cooling_DX_MultiSpeedFields::FuelType,s.get()); + } + + // NumberofSpeeds + if( auto num = modelObject.stages().size() ) { + idfObject.setInt(Coil_Cooling_DX_MultiSpeedFields::NumberofSpeeds,num); + } + + for( auto stage: modelObject.stages() ) { + auto eg = idfObject.pushExtensibleGroup(); + + // SpeedGrossRatedTotalCoolingCapacity + if( stage.isGrossRatedTotalCoolingCapacityAutosized() ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedGrossRatedTotalCoolingCapacity,"AutoSize"); + } else if( value = stage.grossRatedTotalCoolingCapacity() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedGrossRatedTotalCoolingCapacity,value.get()); + } + + // SpeedGrossRatedSensibleHeatRatio + if( stage.isGrossRatedSensibleHeatRatioAutosized() ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedGrossRatedSensibleHeatRatio,"AutoSize"); + } else if( value = stage.grossRatedSensibleHeatRatio() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedGrossRatedSensibleHeatRatio,value.get()); + } + + // SpeedGrossRatedCoolingCOP + if( value = stage.grossRatedCoolingCOP() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedGrossRatedCoolingCOP,value.get()); + } + + // SpeedRatedAirFlowRate + if( stage.isRatedAirFlowRateAutosized() ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatedAirFlowRate,"AutoSize"); + } else if( value = stage.ratedAirFlowRate() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatedAirFlowRate,value.get()); + } + + // RatedEvaporatorFanPowerPerVolumeFlowRate + if( value = stage.ratedEvaporatorFanPowerPerVolumeFlowRate() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::RatedEvaporatorFanPowerPerVolumeFlowRate,value.get()); + } + + // SpeedTotalCoolingCapacityFunctionofTemperatureCurveName + { + auto curve = stage.totalCoolingCapacityFunctionofTemperatureCurve(); + if( auto _curve = translateAndMapModelObject(curve) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedTotalCoolingCapacityFunctionofTemperatureCurveName,_curve->name().get()); + } + } + + // SpeedTotalCoolingCapacityFunctionofFlowFractionCurveName + { + auto curve = stage.totalCoolingCapacityFunctionofFlowFractionCurve(); + if( auto _curve = translateAndMapModelObject(curve) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedTotalCoolingCapacityFunctionofFlowFractionCurveName,_curve->name().get()); + } + } + + // SpeedEnergyInputRatioFunctionofTemperatureCurveName + { + auto curve = stage.energyInputRatioFunctionofTemperatureCurve(); + if( auto _curve = translateAndMapModelObject(curve) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedEnergyInputRatioFunctionofTemperatureCurveName,_curve->name().get()); + } + } + + // SpeedEnergyInputRatioFunctionofFlowFractionCurveName + { + auto curve = stage.energyInputRatioFunctionofFlowFractionCurve(); + if( auto _curve = translateAndMapModelObject(curve) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedEnergyInputRatioFunctionofFlowFractionCurveName,_curve->name().get()); + } + } + + // SpeedPartLoadFractionCorrelationCurveName + { + auto curve = stage.partLoadFractionCorrelationCurve(); + if( auto _curve = translateAndMapModelObject(curve) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedPartLoadFractionCorrelationCurveName,_curve->name().get()); + } + } + + // SpeedNominalTimeforCondensateRemovaltoBegin + if( value = stage.nominalTimeforCondensateRemovaltoBegin() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedNominalTimeforCondensateRemovaltoBegin,value.get()); + } + + // SpeedRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity + if( value = stage.ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity,value.get()); + } + + // SpeedMaximumCyclingRate + if( value = stage.maximumCyclingRate() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedMaximumCyclingRate,value.get()); + } + + // SpeedLatentCapacityTimeConstant + if( value = stage.latentCapacityTimeConstant() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedLatentCapacityTimeConstant,value.get()); + } + + // SpeedRatedWasteHeatFractionofPowerInput + if( value = stage.ratedWasteHeatFractionofPowerInput() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatedWasteHeatFractionofPowerInput,value.get()); + } + + // SpeedWasteHeatFunctionofTemperatureCurveName + if( auto curve = stage.wasteHeatFunctionofTemperatureCurve() ) { + if( auto _curve = translateAndMapModelObject(curve.get()) ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedWasteHeatFunctionofTemperatureCurveName,_curve->name().get()); + } + } + + // SpeedEvaporativeCondenserEffectiveness + if( value = stage.evaporativeCondenserEffectiveness() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedEvaporativeCondenserEffectiveness,value.get()); + } + + // SpeedEvaporativeCondenserAirFlowRate + if( stage.isEvaporativeCondenserAirFlowRateAutosized() ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedEvaporativeCondenserAirFlowRate,"AutoSize"); + } else if( value = stage.evaporativeCondenserAirFlowRate() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedEvaporativeCondenserAirFlowRate,value.get()); + } + + // SpeedRatedEvaporativeCondenserPumpPowerConsumption + if( stage.isRatedEvaporativeCondenserPumpPowerConsumptionAutosized() ) { + eg.setString(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatedEvaporativeCondenserPumpPowerConsumption,"AutoSize"); + } else if( value = stage.ratedEvaporativeCondenserPumpPowerConsumption() ) { + eg.setDouble(Coil_Cooling_DX_MultiSpeedExtensibleFields::SpeedRatedEvaporativeCondenserPumpPowerConsumption,value.get()); + } + } + + return idfObject; +} + +} // energyplus + +} // openstudio + diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingGasMultiStage.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingGasMultiStage.cpp new file mode 100644 index 00000000000..46323f61089 --- /dev/null +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateCoilHeatingGasMultiStage.cpp @@ -0,0 +1,115 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Model.hpp" +#include "../../model/CoilHeatingGasMultiStage.hpp" +#include "../../model/CoilHeatingGasMultiStage_Impl.hpp" +#include "../../model/CoilHeatingGasMultiStageStageData.hpp" +#include "../../model/CoilHeatingGasMultiStageStageData_Impl.hpp" +#include "../../model/Node.hpp" +#include "../../model/Node_Impl.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../model/Curve.hpp" +#include "../../model/Curve_Impl.hpp" +#include +#include +#include +#include "../../utilities/idf/IdfExtensibleGroup.hpp" + +using namespace openstudio::model; + +namespace openstudio { + +namespace energyplus { + +boost::optional ForwardTranslator::translateCoilHeatingGasMultiStage( CoilHeatingGasMultiStage & modelObject ) +{ + boost::optional s; + boost::optional value; + + // Name + IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::Coil_Heating_Gas_MultiStage, modelObject); + + // AvailabilityScheduleName + if( auto schedule = modelObject.availabilitySchedule() ) { + if( auto _schedule = translateAndMapModelObject(schedule.get()) ) { + idfObject.setString(Coil_Heating_Gas_MultiStageFields::AvailabilityScheduleName,_schedule->name().get()); + } + } + + // AirInletNodeName + if( auto node = modelObject.inletModelObject() ) { + idfObject.setString(Coil_Heating_Gas_MultiStageFields::AirInletNodeName,node->name().get()); + } + + // AirOutletNodeName + // TemperatureSetpointNodeName + if( auto node = modelObject.outletModelObject() ) { + idfObject.setString(Coil_Heating_Gas_MultiStageFields::AirOutletNodeName,node->name().get()); + idfObject.setString(Coil_Heating_Gas_MultiStageFields::TemperatureSetpointNodeName,node->name().get()); + } + + // PartLoadFractionCorrelationCurveName + if( auto curve = modelObject.partLoadFractionCorrelationCurve() ) { + if( auto _curve = translateAndMapModelObject(curve.get()) ) { + idfObject.setString(Coil_Heating_Gas_MultiStageFields::PartLoadFractionCorrelationCurveName,_curve->name().get()); + } + } + + // ParasiticGasLoad + if( value = modelObject.parasiticGasLoad() ) { + idfObject.setDouble(Coil_Heating_Gas_MultiStageFields::ParasiticGasLoad,value.get()); + } + + // NumberofStages + { + auto num = modelObject.stages().size(); + idfObject.setInt(Coil_Heating_Gas_MultiStageFields::NumberofStages,num); + } + + for( auto stage: modelObject.stages() ) { + auto eg = idfObject.pushExtensibleGroup(); + + // Stage1GasBurnerEfficiency + if( value = stage.gasBurnerEfficiency() ) { + eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::Stage1GasBurnerEfficiency,value.get()); + } + + // Stage1NominalCapacity + if( stage.isNominalCapacityAutosized() ) { + eg.setString(Coil_Heating_Gas_MultiStageExtensibleFields::Stage1NominalCapacity,"AutoSize"); + } else( value = stage.nominalCapacity() ) { + eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::Stage1NominalCapacity,value.get()); + } + + // Stage1ParasiticElectricLoad + if( value = stage.parasiticElectricLoad() ) { + eg.setDouble(Coil_Heating_Gas_MultiStageExtensibleFields::Stage1ParasiticElectricLoad,value.get()); + } + } + + return idfObject; +} + +} // energyplus + +} // openstudio + diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateZoneControlThermostatStagedDualSetpoint.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateZoneControlThermostatStagedDualSetpoint.cpp new file mode 100644 index 00000000000..bd1aa613775 --- /dev/null +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateZoneControlThermostatStagedDualSetpoint.cpp @@ -0,0 +1,135 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "../ForwardTranslator.hpp" +#include "../../model/Schedule.hpp" +#include "../../model/Schedule_Impl.hpp" +#include "../../model/ThermalZone.hpp" +#include "../../model/ThermalZone_Impl.hpp" +#include "../../model/ZoneControlThermostatStagedDualSetpoint.hpp" +#include "../../model/ZoneControlThermostatStagedDualSetpoint_Impl.hpp" +#include + +using namespace openstudio::model; + +using namespace std; + +namespace openstudio { + +namespace energyplus { + +boost::optional ForwardTranslator::translateZoneControlThermostatStagedDualSetpoint( ZoneControlThermostatStagedDualSetpoint& modelObject ) +{ + boost::optional s; + boost::optional value; + int num; + + IdfObject idfObject(openstudio::IddObjectType::ThermostatSetpoint_DualSetpoint); + + m_idfObjects.push_back(idfObject); + + s = modelObject.name(); + idfObject.setName(s.get()); + + // ZoneorZoneListName + if( auto zone = modelObject.thermalZone() ) { + if( auto _zone = translateAndMapModelObject(zone.get()) ) { + idfObject.setString(ZoneControl_Thermostat_StagedDualSetpointFields::ZoneorZoneListName,_zone->name().get()); + } + } + + // NumberofHeatingStages + num = modelObject.numberofHeatingStages(); + idfObject.setInt(ZoneControl_Thermostat_StagedDualSetpointFields::NumberofHeatingStages,num); + + // HeatingTemperatureSetpointScheduleName + if( auto schedule = modelObject.heatingTemperatureSetpointSchedule() ) { + if( auto _schedule = translateAndMapModelObject(schedule.get()) ) { + idfObject.setString(ZoneControl_Thermostat_StagedDualSetpointFields::HeatingTemperatureSetpointScheduleName,_schedule->name().get()); + } + } + + // HeatingThrottlingTemperatureRange + if( value = modelObject.heatingThrottlingTemperatureRange() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::HeatingThrottlingTemperatureRange,value.get()); + } + + // Stage1HeatingTemperatureOffset + if( value = modelObject.stage1HeatingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage1HeatingTemperatureOffset,value.get()); + } + + // Stage2HeatingTemperatureOffset + if( value = modelObject.stage2HeatingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage2HeatingTemperatureOffset,value.get()); + } + + // Stage3HeatingTemperatureOffset + if( value = modelObject.stage3HeatingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage3HeatingTemperatureOffset,value.get()); + } + + // Stage4HeatingTemperatureOffset + if( value = modelObject.stage4HeatingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage4HeatingTemperatureOffset,value.get()); + } + + // NumberofCoolingStages + num = modelObject.numberofCoolingStages(); + idfObject.setInt(ZoneControl_Thermostat_StagedDualSetpointFields::NumberofCoolingStages,num); + + // CoolingTemperatureSetpointBaseScheduleName + if( auto schedule = modelObject.coolingTemperatureSetpointBaseSchedule() ) { + if( auto _schedule = translateAndMapModelObject(schedule.get()) ) { + idfObject.setString(ZoneControl_Thermostat_StagedDualSetpointFields::CoolingTemperatureSetpointBaseScheduleName,_schedule->name().get()); + } + } + + // CoolingThrottlingTemperatureRange + if( value = modelObject.coolingThrottlingTemperatureRange() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::CoolingThrottlingTemperatureRange,value.get()); + } + + // Stage1CoolingTemperatureOffset + if( value = modelObject.stage1CoolingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage1CoolingTemperatureOffset,value.get()); + } + + // Stage2CoolingTemperatureOffset + if( value = modelObject.stage2CoolingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage2CoolingTemperatureOffset,value.get()); + } + + // Stage3CoolingTemperatureOffset + if( value = modelObject.stage3CoolingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage3CoolingTemperatureOffset,value.get()); + } + + // Stage4CoolingTemperatureOffset + if( value = modelObject.stage4CoolingTemperatureOffset() ) { + idfObject.setDouble(ZoneControl_Thermostat_StagedDualSetpointFields::Stage4CoolingTemperatureOffset,value.get()); + } + + return boost::optional(idfObject); +} + +} // energyplus + +} // openstudio + diff --git a/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp new file mode 100644 index 00000000000..cf6ecd7eaf5 --- /dev/null +++ b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp @@ -0,0 +1,979 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "Model.hpp" +#include "Model_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" +#include "ThermalZone.hpp" +#include "ThermalZone_Impl.hpp" +#include "ScheduleTypeLimits.hpp" +#include "ScheduleTypeRegistry.hpp" +#include +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::iddObjectType()); + } + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::iddObjectType()); + } + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + {} + + const std::vector& AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::iddObjectType() const { + return AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::iddObjectType(); + } + + std::vector AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::getScheduleTypeKeys(const Schedule& schedule) const + { + std::vector result; + UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + UnsignedVector::const_iterator b(fieldIndices.begin()), e(fieldIndices.end()); + if (std::find(b,e,OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilitySchedule) != e) + { + result.push_back(ScheduleTypeKey("AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed","Availability Schedule")); + } + if (std::find(b,e,OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeSchedule) != e) + { + result.push_back(ScheduleTypeKey("AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed","Supply Air Fan Operating Mode Schedule")); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::availabilitySchedule() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilitySchedule); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::controllingZoneorThermostatLocation() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation); + } + + HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::supplyAirFan() const { + boost::optional value = optionalSupplyAirFan(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Supply Air Fan attached."); + } + return value.get(); + } + + std::string AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::supplyAirFanPlacement() const { + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanPlacement,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::supplyAirFanOperatingModeSchedule() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeSchedule); + } + + HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::heatingCoil() const { + boost::optional value = optionalHeatingCoil(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Heating Coil attached."); + } + return value.get(); + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::minimumOutdoorDryBulbTemperatureforCompressorOperation() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation,true); + OS_ASSERT(value); + return value.get(); + } + + HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::coolingCoil() const { + boost::optional value = optionalCoolingCoil(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Cooling Coil attached."); + } + return value.get(); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::supplementalHeatingCoil() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoil); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::maximumSupplyAirTemperaturefromSupplementalHeater() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation,true); + OS_ASSERT(value); + return value.get(); + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::auxiliaryOnCycleElectricPower() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOnCycleElectricPower,true); + OS_ASSERT(value); + return value.get(); + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::auxiliaryOffCycleElectricPower() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOffCycleElectricPower,true); + OS_ASSERT(value); + return value.get(); + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::designHeatRecoveryWaterFlowRate() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::DesignHeatRecoveryWaterFlowRate,true); + OS_ASSERT(value); + return value.get(); + } + + double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::maximumTemperatureforHeatRecovery() const { + boost::optional value = getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumTemperatureforHeatRecovery,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + int AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::numberofSpeedsforHeating() const { + boost::optional value = getInt(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforHeating,true); + OS_ASSERT(value); + return value.get(); + } + + int AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::numberofSpeedsforCooling() const { + boost::optional value = getInt(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforCooling,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed1SupplyAirFlowRateDuringHeatingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed2SupplyAirFlowRateDuringHeatingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed3SupplyAirFlowRateDuringHeatingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed4SupplyAirFlowRateDuringHeatingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed1SupplyAirFlowRateDuringCoolingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed2SupplyAirFlowRateDuringCoolingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed3SupplyAirFlowRateDuringCoolingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::speed4SupplyAirFlowRateDuringCoolingOperation() const { + return getDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation,true); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized() const { + bool result = false; + boost::optional value = getString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setAvailabilitySchedule(Schedule& schedule) { + bool result = setSchedule(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilitySchedule, + "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed", + "Availability Schedule", + schedule); + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::resetAvailabilitySchedule() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AvailabilitySchedule, ""); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setControllingZoneorThermostatLocation(const boost::optional& thermalZone) { + bool result(false); + if (thermalZone) { + result = setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation, thermalZone.get().handle()); + } + else { + resetControllingZoneorThermostatLocation(); + result = true; + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::resetControllingZoneorThermostatLocation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::ControllingZoneorThermostatLocation, ""); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSupplyAirFan(const HVACComponent& fan) { + bool result = setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFan, fan.handle()); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSupplyAirFanPlacement(std::string supplyAirFanPlacement) { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanPlacement, supplyAirFanPlacement); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) { + bool result = setSchedule(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeSchedule, + "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed", + "Supply Air Fan Operating Mode Schedule", + schedule); + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::resetSupplyAirFanOperatingModeSchedule() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanOperatingModeSchedule, ""); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setHeatingCoil(const HVACComponent& coil) { + bool result = setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoil, coil.handle()); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setMinimumOutdoorDryBulbTemperatureforCompressorOperation(double minimumOutdoorDryBulbTemperatureforCompressorOperation) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MinimumOutdoorDryBulbTemperatureforCompressorOperation, minimumOutdoorDryBulbTemperatureforCompressorOperation); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setCoolingCoil(const HVACComponent& coil) { + bool result = setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoil, coil.handle()); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSupplementalHeatingCoil(const boost::optional& coil) { + bool result(false); + if (coil) { + result = setPointer(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoil, coil.get().handle()); + } + else { + resetSupplementalHeatingCoil(); + result = true; + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::resetSupplementalHeatingCoil() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplementalHeatingCoil, ""); + OS_ASSERT(result); + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setMaximumSupplyAirTemperaturefromSupplementalHeater(boost::optional maximumSupplyAirTemperaturefromSupplementalHeater) { + bool result(false); + if (maximumSupplyAirTemperaturefromSupplementalHeater) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater, maximumSupplyAirTemperaturefromSupplementalHeater.get()); + } + OS_ASSERT(result); + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeMaximumSupplyAirTemperaturefromSupplementalHeater() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumSupplyAirTemperaturefromSupplementalHeater, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation, maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setAuxiliaryOnCycleElectricPower(double auxiliaryOnCycleElectricPower) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOnCycleElectricPower, auxiliaryOnCycleElectricPower); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setAuxiliaryOffCycleElectricPower(double auxiliaryOffCycleElectricPower) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AuxiliaryOffCycleElectricPower, auxiliaryOffCycleElectricPower); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::DesignHeatRecoveryWaterFlowRate, designHeatRecoveryWaterFlowRate); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery) { + bool result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::MaximumTemperatureforHeatRecovery, maximumTemperatureforHeatRecovery); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) { + bool result(false); + if (supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, supplyAirFlowRateWhenNoCoolingorHeatingisNeeded.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFlowRateWhenNoCoolingorHeatingisNeeded, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setNumberofSpeedsforHeating(int numberofSpeedsforHeating) { + bool result = setInt(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforHeating, numberofSpeedsforHeating); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setNumberofSpeedsforCooling(int numberofSpeedsforCooling) { + bool result = setInt(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::NumberofSpeedsforCooling, numberofSpeedsforCooling); + return result; + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed1SupplyAirFlowRateDuringHeatingOperation(boost::optional speed1SupplyAirFlowRateDuringHeatingOperation) { + bool result(false); + if (speed1SupplyAirFlowRateDuringHeatingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation, speed1SupplyAirFlowRateDuringHeatingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringHeatingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed2SupplyAirFlowRateDuringHeatingOperation(boost::optional speed2SupplyAirFlowRateDuringHeatingOperation) { + bool result(false); + if (speed2SupplyAirFlowRateDuringHeatingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation, speed2SupplyAirFlowRateDuringHeatingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringHeatingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed3SupplyAirFlowRateDuringHeatingOperation(boost::optional speed3SupplyAirFlowRateDuringHeatingOperation) { + bool result(false); + if (speed3SupplyAirFlowRateDuringHeatingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation, speed3SupplyAirFlowRateDuringHeatingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringHeatingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed4SupplyAirFlowRateDuringHeatingOperation(boost::optional speed4SupplyAirFlowRateDuringHeatingOperation) { + bool result(false); + if (speed4SupplyAirFlowRateDuringHeatingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation, speed4SupplyAirFlowRateDuringHeatingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringHeatingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed1SupplyAirFlowRateDuringCoolingOperation(boost::optional speed1SupplyAirFlowRateDuringCoolingOperation) { + bool result(false); + if (speed1SupplyAirFlowRateDuringCoolingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation, speed1SupplyAirFlowRateDuringCoolingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed1SupplyAirFlowRateDuringCoolingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed2SupplyAirFlowRateDuringCoolingOperation(boost::optional speed2SupplyAirFlowRateDuringCoolingOperation) { + bool result(false); + if (speed2SupplyAirFlowRateDuringCoolingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation, speed2SupplyAirFlowRateDuringCoolingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed2SupplyAirFlowRateDuringCoolingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed3SupplyAirFlowRateDuringCoolingOperation(boost::optional speed3SupplyAirFlowRateDuringCoolingOperation) { + bool result(false); + if (speed3SupplyAirFlowRateDuringCoolingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation, speed3SupplyAirFlowRateDuringCoolingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed3SupplyAirFlowRateDuringCoolingOperation, "autosize"); + OS_ASSERT(result); + } + + bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::setSpeed4SupplyAirFlowRateDuringCoolingOperation(boost::optional speed4SupplyAirFlowRateDuringCoolingOperation) { + bool result(false); + if (speed4SupplyAirFlowRateDuringCoolingOperation) { + result = setDouble(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation, speed4SupplyAirFlowRateDuringCoolingOperation.get()); + } + return result; + } + + void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation() { + bool result = setString(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::Speed4SupplyAirFlowRateDuringCoolingOperation, "autosize"); + OS_ASSERT(result); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::optionalSupplyAirFan() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFan); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::optionalHeatingCoil() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::HeatingCoil); + } + + boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::optionalCoolingCoil() const { + return getObject().getModelObjectTarget(OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::CoolingCoil); + } + + unsigned AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::inletPort() { + return OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirInletNode; + } + + unsigned AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::outletPort() { + return OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::AirOutletNode; + } + + ModelObject AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::clone(Model model) const + { + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed modelObjectClone = ModelObject_Impl::clone(model).cast(); + + if( boost::optional supplyFan = this->supplyAirFan()) { + modelObjectClone.setSupplyAirFan(supplyFan->clone(model).cast()); + } + if( boost::optional coolingCoil = this->coolingCoil()) { + modelObjectClone.setCoolingCoil(coolingCoil->clone(model).cast()); + } + if( boost::optional heatingCoil = this->heatingCoil()) { + modelObjectClone.setHeatingCoil(heatingCoil->clone(model).cast()); + } + if( boost::optional supplementalHeatingCoil = this->supplementalHeatingCoil()) { + modelObjectClone.setSupplementalHeatingCoil(supplementalHeatingCoil->clone(model).cast()); + } + + return modelObjectClone; + } + + std::vector AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl::children() const + { + std::vector result; + + if( boost::optional supplyFan = this->supplyAirFan()) { + result.push_back( *supplyFan ); + } + if( boost::optional coolingCoil = this->coolingCoil()) { + result.push_back( *coolingCoil ); + } + if( boost::optional heatingCoil = this->heatingCoil()) { + result.push_back( *heatingCoil ); + } + if( boost::optional supplementalHeatingCoil = this->supplementalHeatingCoil()) { + result.push_back( *supplementalHeatingCoil ); + } + + return result; + } + +} // detail + +AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(const Model& model, + const HVACComponent& fan, + const HVACComponent& heatingCoil, + const HVACComponent& coolingCoil) + : StraightComponent(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); + + setSupplyAirFan(fan); + setSupplyAirFanPlacement("DrawThrough"); + setHeatingCoil(heatingCoil); + setMinimumOutdoorDryBulbTemperatureforCompressorOperation(-8.0); + setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(21.0); + setCoolingCoil(coolingCoil); + autosizeMaximumSupplyAirTemperaturefromSupplementalHeater(); + setAuxiliaryOnCycleElectricPower(0.0); + setAuxiliaryOffCycleElectricPower(0.0); + setDesignHeatRecoveryWaterFlowRate(0.0); + setMaximumTemperatureforHeatRecovery(80.0); + autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(); + setNumberofSpeedsforHeating(2); + setNumberofSpeedsforCooling(2); + autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation(); + autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation(); + autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation(); + autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation(); + autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation(); + autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation(); + autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation(); + autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation(); +} + +IddObjectType AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::iddObjectType() { + return IddObjectType(IddObjectType::OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeed); +} + +std::vector AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplyAirFanPlacementValues() { + return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), + OS_AirLoopHVAC_UnitaryHeatPump_AirToAir_MultiSpeedFields::SupplyAirFanPlacement); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::availabilitySchedule() const { + return getImpl()->availabilitySchedule(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::controllingZoneorThermostatLocation() const { + return getImpl()->controllingZoneorThermostatLocation(); +} + +HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplyAirFan() const { + return getImpl()->supplyAirFan(); +} + +std::string AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplyAirFanPlacement() const { + return getImpl()->supplyAirFanPlacement(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplyAirFanOperatingModeSchedule() const { + return getImpl()->supplyAirFanOperatingModeSchedule(); +} + +HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::heatingCoil() const { + return getImpl()->heatingCoil(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::minimumOutdoorDryBulbTemperatureforCompressorOperation() const { + return getImpl()->minimumOutdoorDryBulbTemperatureforCompressorOperation(); +} + +HVACComponent AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::coolingCoil() const { + return getImpl()->coolingCoil(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplementalHeatingCoil() const { + return getImpl()->supplementalHeatingCoil(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::maximumSupplyAirTemperaturefromSupplementalHeater() const { + return getImpl()->maximumSupplyAirTemperaturefromSupplementalHeater(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const { + return getImpl()->isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const { + return getImpl()->maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::auxiliaryOnCycleElectricPower() const { + return getImpl()->auxiliaryOnCycleElectricPower(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::auxiliaryOffCycleElectricPower() const { + return getImpl()->auxiliaryOffCycleElectricPower(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::designHeatRecoveryWaterFlowRate() const { + return getImpl()->designHeatRecoveryWaterFlowRate(); +} + +double AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::maximumTemperatureforHeatRecovery() const { + return getImpl()->maximumTemperatureforHeatRecovery(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const { + return getImpl()->supplyAirFlowRateWhenNoCoolingorHeatingisNeeded(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const { + return getImpl()->isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized(); +} + +int AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::numberofSpeedsforHeating() const { + return getImpl()->numberofSpeedsforHeating(); +} + +int AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::numberofSpeedsforCooling() const { + return getImpl()->numberofSpeedsforCooling(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed1SupplyAirFlowRateDuringHeatingOperation() const { + return getImpl()->speed1SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized() const { + return getImpl()->isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed2SupplyAirFlowRateDuringHeatingOperation() const { + return getImpl()->speed2SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized() const { + return getImpl()->isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed3SupplyAirFlowRateDuringHeatingOperation() const { + return getImpl()->speed3SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized() const { + return getImpl()->isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed4SupplyAirFlowRateDuringHeatingOperation() const { + return getImpl()->speed4SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized() const { + return getImpl()->isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed1SupplyAirFlowRateDuringCoolingOperation() const { + return getImpl()->speed1SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized() const { + return getImpl()->isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed2SupplyAirFlowRateDuringCoolingOperation() const { + return getImpl()->speed2SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized() const { + return getImpl()->isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed3SupplyAirFlowRateDuringCoolingOperation() const { + return getImpl()->speed3SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized() const { + return getImpl()->isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized(); +} + +boost::optional AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::speed4SupplyAirFlowRateDuringCoolingOperation() const { + return getImpl()->speed4SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized() const { + return getImpl()->isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setAvailabilitySchedule(Schedule& schedule) { + return getImpl()->setAvailabilitySchedule(schedule); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::resetAvailabilitySchedule() { + getImpl()->resetAvailabilitySchedule(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setControllingZoneorThermostatLocation(const ThermalZone& thermalZone) { + return getImpl()->setControllingZoneorThermostatLocation(thermalZone); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::resetControllingZoneorThermostatLocation() { + getImpl()->resetControllingZoneorThermostatLocation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSupplyAirFan(const HVACComponent& fan) { + return getImpl()->setSupplyAirFan(fan); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSupplyAirFanPlacement(std::string supplyAirFanPlacement) { + return getImpl()->setSupplyAirFanPlacement(supplyAirFanPlacement); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSupplyAirFanOperatingModeSchedule(Schedule& schedule) { + return getImpl()->setSupplyAirFanOperatingModeSchedule(schedule); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::resetSupplyAirFanOperatingModeSchedule() { + getImpl()->resetSupplyAirFanOperatingModeSchedule(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setHeatingCoil(const HVACComponent& coil) { + return getImpl()->setHeatingCoil(coil); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setMinimumOutdoorDryBulbTemperatureforCompressorOperation(double minimumOutdoorDryBulbTemperatureforCompressorOperation) { + return getImpl()->setMinimumOutdoorDryBulbTemperatureforCompressorOperation(minimumOutdoorDryBulbTemperatureforCompressorOperation); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setCoolingCoil(const HVACComponent& coil) { + return getImpl()->setCoolingCoil(coil); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSupplementalHeatingCoil(const HVACComponent& coil) { + return getImpl()->setSupplementalHeatingCoil(coil); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::resetSupplementalHeatingCoil() { + getImpl()->resetSupplementalHeatingCoil(); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setMaximumSupplyAirTemperaturefromSupplementalHeater(double maximumSupplyAirTemperaturefromSupplementalHeater) { + getImpl()->setMaximumSupplyAirTemperaturefromSupplementalHeater(maximumSupplyAirTemperaturefromSupplementalHeater); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeMaximumSupplyAirTemperaturefromSupplementalHeater() { + getImpl()->autosizeMaximumSupplyAirTemperaturefromSupplementalHeater(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation) { + return getImpl()->setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setAuxiliaryOnCycleElectricPower(double auxiliaryOnCycleElectricPower) { + return getImpl()->setAuxiliaryOnCycleElectricPower(auxiliaryOnCycleElectricPower); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setAuxiliaryOffCycleElectricPower(double auxiliaryOffCycleElectricPower) { + return getImpl()->setAuxiliaryOffCycleElectricPower(auxiliaryOffCycleElectricPower); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate) { + return getImpl()->setDesignHeatRecoveryWaterFlowRate(designHeatRecoveryWaterFlowRate); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery) { + return getImpl()->setMaximumTemperatureforHeatRecovery(maximumTemperatureforHeatRecovery); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(double supplyAirFlowRateWhenNoCoolingorHeatingisNeeded) { + return getImpl()->setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(supplyAirFlowRateWhenNoCoolingorHeatingisNeeded); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded() { + getImpl()->autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setNumberofSpeedsforHeating(int numberofSpeedsforHeating) { + return getImpl()->setNumberofSpeedsforHeating(numberofSpeedsforHeating); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setNumberofSpeedsforCooling(int numberofSpeedsforCooling) { + return getImpl()->setNumberofSpeedsforCooling(numberofSpeedsforCooling); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed1SupplyAirFlowRateDuringHeatingOperation(double speed1SupplyAirFlowRateDuringHeatingOperation) { + return getImpl()->setSpeed1SupplyAirFlowRateDuringHeatingOperation(speed1SupplyAirFlowRateDuringHeatingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation() { + getImpl()->autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed2SupplyAirFlowRateDuringHeatingOperation(double speed2SupplyAirFlowRateDuringHeatingOperation) { + return getImpl()->setSpeed2SupplyAirFlowRateDuringHeatingOperation(speed2SupplyAirFlowRateDuringHeatingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation() { + getImpl()->autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed3SupplyAirFlowRateDuringHeatingOperation(double speed3SupplyAirFlowRateDuringHeatingOperation) { + return getImpl()->setSpeed3SupplyAirFlowRateDuringHeatingOperation(speed3SupplyAirFlowRateDuringHeatingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation() { + getImpl()->autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed4SupplyAirFlowRateDuringHeatingOperation(double speed4SupplyAirFlowRateDuringHeatingOperation) { + return getImpl()->setSpeed4SupplyAirFlowRateDuringHeatingOperation(speed4SupplyAirFlowRateDuringHeatingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation() { + getImpl()->autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed1SupplyAirFlowRateDuringCoolingOperation(double speed1SupplyAirFlowRateDuringCoolingOperation) { + return getImpl()->setSpeed1SupplyAirFlowRateDuringCoolingOperation(speed1SupplyAirFlowRateDuringCoolingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation() { + getImpl()->autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed2SupplyAirFlowRateDuringCoolingOperation(double speed2SupplyAirFlowRateDuringCoolingOperation) { + return getImpl()->setSpeed2SupplyAirFlowRateDuringCoolingOperation(speed2SupplyAirFlowRateDuringCoolingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation() { + getImpl()->autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed3SupplyAirFlowRateDuringCoolingOperation(double speed3SupplyAirFlowRateDuringCoolingOperation) { + return getImpl()->setSpeed3SupplyAirFlowRateDuringCoolingOperation(speed3SupplyAirFlowRateDuringCoolingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation() { + getImpl()->autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation(); +} + +bool AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::setSpeed4SupplyAirFlowRateDuringCoolingOperation(double speed4SupplyAirFlowRateDuringCoolingOperation) { + return getImpl()->setSpeed4SupplyAirFlowRateDuringCoolingOperation(speed4SupplyAirFlowRateDuringCoolingOperation); +} + +void AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation() { + getImpl()->autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation(); +} + +/// @cond +AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(std::shared_ptr impl) + : StraightComponent(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp new file mode 100644 index 00000000000..18aa708b0e7 --- /dev/null +++ b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp @@ -0,0 +1,244 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_HPP +#define MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent.hpp" + +namespace openstudio { + +namespace model { + +class Schedule; +class ThermalZone; + +namespace detail { + + class AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl; + +} // detail + +/** AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed is a StraightComponent that wraps the OpenStudio IDD object 'OS:AirLoopHVAC:UnitaryHeatPump:AirToAir:MultiSpeed'. */ +class MODEL_API AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed : public StraightComponent { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(const Model& model, const HVACComponent& fan, const HVACComponent& heatingCoil, const HVACComponent& coolingCoil); + + virtual ~AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed() {} + + //@} + + static IddObjectType iddObjectType(); + + static std::vector supplyAirFanPlacementValues(); + + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + boost::optional controllingZoneorThermostatLocation() const; + + HVACComponent supplyAirFan() const; + + std::string supplyAirFanPlacement() const; + + boost::optional supplyAirFanOperatingModeSchedule() const; + + HVACComponent heatingCoil() const; + + double minimumOutdoorDryBulbTemperatureforCompressorOperation() const; + + HVACComponent coolingCoil() const; + + boost::optional supplementalHeatingCoil() const; + + boost::optional maximumSupplyAirTemperaturefromSupplementalHeater() const; + + bool isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const; + + double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const; + + double auxiliaryOnCycleElectricPower() const; + + double auxiliaryOffCycleElectricPower() const; + + double designHeatRecoveryWaterFlowRate() const; + + double maximumTemperatureforHeatRecovery() const; + + boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const; + + bool isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const; + + int numberofSpeedsforHeating() const; + + int numberofSpeedsforCooling() const; + + boost::optional speed1SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed2SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed3SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed4SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed1SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed2SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed3SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed4SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setControllingZoneorThermostatLocation(const ThermalZone& thermalZone); + + void resetControllingZoneorThermostatLocation(); + + bool setSupplyAirFan(const HVACComponent& fan); + + bool setSupplyAirFanPlacement(std::string supplyAirFanPlacement); + + bool setSupplyAirFanOperatingModeSchedule(Schedule& schedule); + + void resetSupplyAirFanOperatingModeSchedule(); + + bool setHeatingCoil(const HVACComponent& coil); + + bool setMinimumOutdoorDryBulbTemperatureforCompressorOperation(double minimumOutdoorDryBulbTemperatureforCompressorOperation); + + bool setCoolingCoil(const HVACComponent& coil); + + bool setSupplementalHeatingCoil(const HVACComponent& coil); + + void resetSupplementalHeatingCoil(); + + void setMaximumSupplyAirTemperaturefromSupplementalHeater(double maximumSupplyAirTemperaturefromSupplementalHeater); + + void autosizeMaximumSupplyAirTemperaturefromSupplementalHeater(); + + bool setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); + + bool setAuxiliaryOnCycleElectricPower(double auxiliaryOnCycleElectricPower); + + bool setAuxiliaryOffCycleElectricPower(double auxiliaryOffCycleElectricPower); + + bool setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate); + + bool setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery); + + bool setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(double supplyAirFlowRateWhenNoCoolingorHeatingisNeeded); + + void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(); + + bool setNumberofSpeedsforHeating(int numberofSpeedsforHeating); + + bool setNumberofSpeedsforCooling(int numberofSpeedsforCooling); + + bool setSpeed1SupplyAirFlowRateDuringHeatingOperation(double speed1SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed2SupplyAirFlowRateDuringHeatingOperation(double speed2SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed3SupplyAirFlowRateDuringHeatingOperation(double speed3SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed4SupplyAirFlowRateDuringHeatingOperation(double speed4SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed1SupplyAirFlowRateDuringCoolingOperation(double speed1SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed2SupplyAirFlowRateDuringCoolingOperation(double speed2SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed3SupplyAirFlowRateDuringCoolingOperation(double speed3SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed4SupplyAirFlowRateDuringCoolingOperation(double speed4SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation(); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + /// @cond + typedef detail::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl ImplType; + + explicit AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed(std::shared_ptr impl); + + friend class detail::AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed"); +}; + +/** \relates AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed*/ +typedef boost::optional OptionalAirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed; + +/** \relates AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed*/ +typedef std::vector AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeedVector; + +} // model +} // openstudio + +#endif // MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_HPP + diff --git a/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp new file mode 100644 index 00000000000..3662a6ffd67 --- /dev/null +++ b/openstudiocore/src/model/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp @@ -0,0 +1,249 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_IMPL_HPP +#define MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_IMPL_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent_Impl.hpp" + +namespace openstudio { +namespace model { + +class Schedule; +class ThermalZone; + +namespace detail { + + /** AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl is a StraightComponent_Impl that is the implementation class for AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.*/ + class MODEL_API AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl : public StraightComponent_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl(const AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + + //@} + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + boost::optional controllingZoneorThermostatLocation() const; + + HVACComponent supplyAirFan() const; + + std::string supplyAirFanPlacement() const; + + boost::optional supplyAirFanOperatingModeSchedule() const; + + HVACComponent heatingCoil() const; + + double minimumOutdoorDryBulbTemperatureforCompressorOperation() const; + + HVACComponent coolingCoil() const; + + boost::optional supplementalHeatingCoil() const; + + boost::optional maximumSupplyAirTemperaturefromSupplementalHeater() const; + + bool isMaximumSupplyAirTemperaturefromSupplementalHeaterAutosized() const; + + double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation() const; + + double auxiliaryOnCycleElectricPower() const; + + double auxiliaryOffCycleElectricPower() const; + + double designHeatRecoveryWaterFlowRate() const; + + double maximumTemperatureforHeatRecovery() const; + + boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisNeeded() const; + + bool isSupplyAirFlowRateWhenNoCoolingorHeatingisNeededAutosized() const; + + int numberofSpeedsforHeating() const; + + int numberofSpeedsforCooling() const; + + boost::optional speed1SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed1SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed2SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed2SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed3SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed3SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed4SupplyAirFlowRateDuringHeatingOperation() const; + + bool isSpeed4SupplyAirFlowRateDuringHeatingOperationAutosized() const; + + boost::optional speed1SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed1SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed2SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed2SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed3SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed3SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + boost::optional speed4SupplyAirFlowRateDuringCoolingOperation() const; + + bool isSpeed4SupplyAirFlowRateDuringCoolingOperationAutosized() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setControllingZoneorThermostatLocation(const boost::optional& thermalZone); + + void resetControllingZoneorThermostatLocation(); + + bool setSupplyAirFan(const HVACComponent& fan); + + bool setSupplyAirFanPlacement(std::string supplyAirFanPlacement); + + bool setSupplyAirFanOperatingModeSchedule(Schedule& schedule); + + void resetSupplyAirFanOperatingModeSchedule(); + + bool setHeatingCoil(const HVACComponent& coil); + + bool setMinimumOutdoorDryBulbTemperatureforCompressorOperation(double minimumOutdoorDryBulbTemperatureforCompressorOperation); + + bool setCoolingCoil(const HVACComponent& coil); + + bool setSupplementalHeatingCoil(const boost::optional& coil); + + void resetSupplementalHeatingCoil(); + + void setMaximumSupplyAirTemperaturefromSupplementalHeater(boost::optional maximumSupplyAirTemperaturefromSupplementalHeater); + + void autosizeMaximumSupplyAirTemperaturefromSupplementalHeater(); + + bool setMaximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation(double maximumOutdoorDryBulbTemperatureforSupplementalHeaterOperation); + + bool setAuxiliaryOnCycleElectricPower(double auxiliaryOnCycleElectricPower); + + bool setAuxiliaryOffCycleElectricPower(double auxiliaryOffCycleElectricPower); + + bool setDesignHeatRecoveryWaterFlowRate(double designHeatRecoveryWaterFlowRate); + + bool setMaximumTemperatureforHeatRecovery(double maximumTemperatureforHeatRecovery); + + bool setSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(boost::optional supplyAirFlowRateWhenNoCoolingorHeatingisNeeded); + + void autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisNeeded(); + + bool setNumberofSpeedsforHeating(int numberofSpeedsforHeating); + + bool setNumberofSpeedsforCooling(int numberofSpeedsforCooling); + + bool setSpeed1SupplyAirFlowRateDuringHeatingOperation(boost::optional speed1SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed1SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed2SupplyAirFlowRateDuringHeatingOperation(boost::optional speed2SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed2SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed3SupplyAirFlowRateDuringHeatingOperation(boost::optional speed3SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed3SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed4SupplyAirFlowRateDuringHeatingOperation(boost::optional speed4SupplyAirFlowRateDuringHeatingOperation); + + void autosizeSpeed4SupplyAirFlowRateDuringHeatingOperation(); + + bool setSpeed1SupplyAirFlowRateDuringCoolingOperation(boost::optional speed1SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed1SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed2SupplyAirFlowRateDuringCoolingOperation(boost::optional speed2SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed2SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed3SupplyAirFlowRateDuringCoolingOperation(boost::optional speed3SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed3SupplyAirFlowRateDuringCoolingOperation(); + + bool setSpeed4SupplyAirFlowRateDuringCoolingOperation(boost::optional speed4SupplyAirFlowRateDuringCoolingOperation); + + void autosizeSpeed4SupplyAirFlowRateDuringCoolingOperation(); + + //@} + /** @name Other */ + //@{ + + unsigned inletPort(); + unsigned outletPort(); + std::vector children() const; + ModelObject clone(Model model) const; + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed"); + + boost::optional optionalSupplyAirFan() const; + boost::optional optionalHeatingCoil() const; + boost::optional optionalCoolingCoil() const; + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_AIRLOOPHVACUNITARYHEATPUMPAIRTOAIRMULTISPEED_IMPL_HPP + diff --git a/openstudiocore/src/model/CMakeLists.txt b/openstudiocore/src/model/CMakeLists.txt index c54c2d416d1..be0b9976c10 100644 --- a/openstudiocore/src/model/CMakeLists.txt +++ b/openstudiocore/src/model/CMakeLists.txt @@ -44,6 +44,9 @@ set(${target_name}_src AirLoopHVACUnitaryHeatPumpAirToAir.hpp AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp AirLoopHVACUnitaryHeatPumpAirToAir.cpp + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp + AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.cpp AirLoopHVACUnitarySystem.hpp AirLoopHVACUnitarySystem_Impl.hpp AirLoopHVACUnitarySystem.cpp @@ -125,6 +128,12 @@ set(${target_name}_src CoilCoolingCooledBeam.hpp CoilCoolingCooledBeam_Impl.hpp CoilCoolingCooledBeam.cpp + CoilCoolingDXMultiSpeed.hpp + CoilCoolingDXMultiSpeed_Impl.hpp + CoilCoolingDXMultiSpeed.cpp + CoilCoolingDXMultiSpeedStageData.hpp + CoilCoolingDXMultiSpeedStageData_Impl.hpp + CoilCoolingDXMultiSpeedStageData.cpp CoilCoolingDXSingleSpeed.hpp CoilCoolingDXSingleSpeed_Impl.hpp CoilCoolingDXSingleSpeed.cpp @@ -161,6 +170,12 @@ set(${target_name}_src CoilHeatingGas.hpp CoilHeatingGas_Impl.hpp CoilHeatingGas.cpp + CoilHeatingGasMultiStage.hpp + CoilHeatingGasMultiStage_Impl.hpp + CoilHeatingGasMultiStage.cpp + CoilHeatingGasMultiStageStageData.hpp + CoilHeatingGasMultiStageStageData_Impl.hpp + CoilHeatingGasMultiStageStageData.cpp CoilHeatingLowTempRadiantConstFlow.hpp CoilHeatingLowTempRadiantConstFlow_Impl.hpp CoilHeatingLowTempRadiantConstFlow.cpp @@ -787,9 +802,15 @@ set(${target_name}_src ThermochromicGlazing.hpp ThermochromicGlazing_Impl.hpp ThermochromicGlazing.cpp + Thermostat.hpp + Thermostat_Impl.hpp + Thermostat.cpp ThermostatSetpointDualSetpoint.hpp ThermostatSetpointDualSetpoint_Impl.hpp ThermostatSetpointDualSetpoint.cpp + ZoneControlThermostatStagedDualSetpoint.hpp + ZoneControlThermostatStagedDualSetpoint_Impl.hpp + ZoneControlThermostatStagedDualSetpoint.cpp TimeDependentValuation.hpp TimeDependentValuation_Impl.hpp TimeDependentValuation.cpp @@ -1149,6 +1170,7 @@ set(${target_name}_test_src test/AirGap_GTest.cpp test/AirLoopHVACOutdoorAirSystem_GTest.cpp test/AirLoopHVACUnitaryHeatPumpAirToAir_GTest.cpp + test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp test/AirLoopHVACUnitarySystem_GTest.cpp test/AirLoopHVAC_GTest.cpp test/AirTerminalSingleDuctConstantVolumeCooledBeam_GTest.cpp @@ -1170,6 +1192,7 @@ set(${target_name}_test_src test/ClimateZones_GTest.cpp test/CoilCoolingCooledBeam_GTest.cpp test/CoilCoolingDXSingleSpeed_GTest.cpp + test/CoilCoolingDXMultiSpeed_GTest.cpp test/CoilCoolingDXTwoSpeed_GTest.cpp test/CoilCoolingLowTempRadiantConstFlow_GTest.cpp test/CoilCoolingLowTempRadiantVarFlow_GTest.cpp @@ -1179,6 +1202,7 @@ set(${target_name}_test_src test/CoilHeatingDXSingleSpeed_GTest.cpp test/CoilHeatingElectric_GTest.cpp test/CoilHeatingGas_GTest.cpp + test/CoilHeatingGasMultiStage_GTest.cpp test/CoilHeatingLowTempRadiantConstFlow_GTest.cpp test/CoilHeatingLowTempRadiantVarFlow_GTest.cpp test/CoilHeatingWater_GTest.cpp diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeed.cpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeed.cpp new file mode 100644 index 00000000000..313fc88ac9d --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeed.cpp @@ -0,0 +1,437 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "Model.hpp" +#include "Model_Impl.hpp" +#include "CoilCoolingDXMultiSpeed.hpp" +#include "CoilCoolingDXMultiSpeed_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" +#include "CoilCoolingDXMultiSpeedStageData.hpp" +#include "CoilCoolingDXMultiSpeedStageData_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" +#include "ScheduleTypeLimits.hpp" +#include "ScheduleTypeRegistry.hpp" +#include +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" +#include "../utilities/idf/WorkspaceExtensibleGroup.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + CoilCoolingDXMultiSpeed_Impl::CoilCoolingDXMultiSpeed_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == CoilCoolingDXMultiSpeed::iddObjectType()); + } + + CoilCoolingDXMultiSpeed_Impl::CoilCoolingDXMultiSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == CoilCoolingDXMultiSpeed::iddObjectType()); + } + + CoilCoolingDXMultiSpeed_Impl::CoilCoolingDXMultiSpeed_Impl(const CoilCoolingDXMultiSpeed_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + {} + + const std::vector& CoilCoolingDXMultiSpeed_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType CoilCoolingDXMultiSpeed_Impl::iddObjectType() const { + return CoilCoolingDXMultiSpeed::iddObjectType(); + } + + std::vector CoilCoolingDXMultiSpeed_Impl::getScheduleTypeKeys(const Schedule& schedule) const + { + // TODO: Check schedule display names. + std::vector result; + UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + UnsignedVector::const_iterator b(fieldIndices.begin()), e(fieldIndices.end()); + if (std::find(b,e,OS_Coil_Cooling_DX_MultiSpeedFields::AvailabilitySchedule) != e) + { + result.push_back(ScheduleTypeKey("CoilCoolingDXMultiSpeed","Availability Schedule")); + } + if (std::find(b,e,OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterOperatingSchedule) != e) + { + result.push_back(ScheduleTypeKey("CoilCoolingDXMultiSpeed","Basin Heater Operating Schedule")); + } + return result; + } + + boost::optional CoilCoolingDXMultiSpeed_Impl::availabilitySchedule() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeedFields::AvailabilitySchedule); + } + + std::string CoilCoolingDXMultiSpeed_Impl::condenserType() const { + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeedFields::CondenserType,true); + OS_ASSERT(value); + return value.get(); + } + + bool CoilCoolingDXMultiSpeed_Impl::applyPartLoadFractiontoSpeedsGreaterthan1() const { + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1,true); + OS_ASSERT(value); + return openstudio::istringEqual(value.get(), "Yes"); + } + + bool CoilCoolingDXMultiSpeed_Impl::applyLatentDegradationtoSpeedsGreaterthan1() const { + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1,true); + OS_ASSERT(value); + return openstudio::istringEqual(value.get(), "Yes"); + } + + bool CoilCoolingDXMultiSpeed_Impl::isApplyLatentDegradationtoSpeedsGreaterthan1Defaulted() const { + return isEmpty(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1); + } + + double CoilCoolingDXMultiSpeed_Impl::crankcaseHeaterCapacity() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeedFields::CrankcaseHeaterCapacity,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeed_Impl::maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeed_Impl::basinHeaterCapacity() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterCapacity,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeed_Impl::basinHeaterSetpointTemperature() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterSetpointTemperature,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional CoilCoolingDXMultiSpeed_Impl::basinHeaterOperatingSchedule() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterOperatingSchedule); + } + + std::string CoilCoolingDXMultiSpeed_Impl::fuelType() const { + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeedFields::FuelType,true); + OS_ASSERT(value); + return value.get(); + } + + bool CoilCoolingDXMultiSpeed_Impl::setAvailabilitySchedule(Schedule& schedule) { + bool result = setSchedule(OS_Coil_Cooling_DX_MultiSpeedFields::AvailabilitySchedule, + "CoilCoolingDXMultiSpeed", + "Availability Schedule", + schedule); + return result; + } + + void CoilCoolingDXMultiSpeed_Impl::resetAvailabilitySchedule() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeedFields::AvailabilitySchedule, ""); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeed_Impl::setCondenserType(std::string condenserType) { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeedFields::CondenserType, condenserType); + return result; + } + + void CoilCoolingDXMultiSpeed_Impl::setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1) { + if (applyPartLoadFractiontoSpeedsGreaterthan1) { + setString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1, "Yes"); + } else { + setString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyPartLoadFractiontoSpeedsGreaterthan1, "No"); + } + } + + void CoilCoolingDXMultiSpeed_Impl::setApplyLatentDegradationtoSpeedsGreaterthan1(bool applyLatentDegradationtoSpeedsGreaterthan1) { + if (applyLatentDegradationtoSpeedsGreaterthan1) { + setString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1, "Yes"); + } else { + setString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1, "No"); + } + } + + void CoilCoolingDXMultiSpeed_Impl::resetApplyLatentDegradationtoSpeedsGreaterthan1() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeedFields::ApplyLatentDegradationtoSpeedsGreaterthan1, ""); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeed_Impl::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeedFields::CrankcaseHeaterCapacity, crankcaseHeaterCapacity); + return result; + } + + bool CoilCoolingDXMultiSpeed_Impl::setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeedFields::MaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation, maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation); + return result; + } + + bool CoilCoolingDXMultiSpeed_Impl::setBasinHeaterCapacity(double basinHeaterCapacity) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterCapacity, basinHeaterCapacity); + return result; + } + + bool CoilCoolingDXMultiSpeed_Impl::setBasinHeaterSetpointTemperature(double basinHeaterSetpointTemperature) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterSetpointTemperature, basinHeaterSetpointTemperature); + return result; + } + + bool CoilCoolingDXMultiSpeed_Impl::setBasinHeaterOperatingSchedule(Schedule& schedule) { + bool result = setSchedule(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterOperatingSchedule, + "CoilCoolingDXMultiSpeed", + "Basin Heater Operating Schedule", + schedule); + return result; + } + + void CoilCoolingDXMultiSpeed_Impl::resetBasinHeaterOperatingSchedule() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeedFields::BasinHeaterOperatingSchedule, ""); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeed_Impl::setFuelType(std::string fuelType) { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeedFields::FuelType, fuelType); + return result; + } + + unsigned CoilCoolingDXMultiSpeed_Impl::inletPort() { + return OS_Coil_Cooling_DX_MultiSpeedFields::AirInletNode; + } + + unsigned CoilCoolingDXMultiSpeed_Impl::outletPort() { + return OS_Coil_Cooling_DX_MultiSpeedFields::AirOutletNode; + } + + ModelObject CoilCoolingDXMultiSpeed_Impl::clone(Model model) const { + auto t_clone = StraightComponent_Impl::clone(model).cast(); + + auto t_stages = stages(); + for( auto stage: t_stages ) { + auto stageClone = stage.clone(model).cast(); + t_clone.addStage(stageClone); + } + return t_clone; + } + + std::vector CoilCoolingDXMultiSpeed_Impl::children() const { + return subsetCastVector(stages()); + } + + std::vector CoilCoolingDXMultiSpeed_Impl::stages() const { + std::vector result; + auto groups = extensibleGroups(); + for( auto group: groups ) { + auto target = group.cast().getTarget(OS_Coil_Cooling_DX_MultiSpeedExtensibleFields::Stage); + if( target ) { + if( auto stage = target->optionalCast() ) { + result.push_back(stage.get()); + } + } + } + return result; + } + + void CoilCoolingDXMultiSpeed_Impl::addStage(CoilCoolingDXMultiSpeedStageData& stage) { + auto group = getObject().pushExtensibleGroup().cast(); + OS_ASSERT(! group.empty()); + group.setPointer(OS_Coil_Cooling_DX_MultiSpeedExtensibleFields::Stage,stage.handle()); + } + + boost::optional CoilCoolingDXMultiSpeed_Impl::containingHVACComponent() const + { + // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed + { + auto systems = this->model().getConcreteModelObjects(); + + for( const auto & system : systems ) { + auto coolingCoil = system.coolingCoil(); + if( coolingCoil.handle() == this->handle() ) { + return system; + } + } + } + return boost::none; + } + + bool CoilCoolingDXMultiSpeed_Impl::addToNode(Node & node) + { + return false; + } + +} // detail + +CoilCoolingDXMultiSpeed::CoilCoolingDXMultiSpeed(const Model& model) + : StraightComponent(CoilCoolingDXMultiSpeed::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); + + setCondenserType("AirCooled"); + setApplyPartLoadFractiontoSpeedsGreaterthan1(false); + setCrankcaseHeaterCapacity(0.0); + setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(10.0); + setBasinHeaterCapacity(0.0); + setBasinHeaterSetpointTemperature(2.0); + setFuelType("NaturalGas"); +} + +IddObjectType CoilCoolingDXMultiSpeed::iddObjectType() { + return IddObjectType(IddObjectType::OS_Coil_Cooling_DX_MultiSpeed); +} + +std::vector CoilCoolingDXMultiSpeed::condenserTypeValues() { + return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), + OS_Coil_Cooling_DX_MultiSpeedFields::CondenserType); +} + +std::vector CoilCoolingDXMultiSpeed::fuelTypeValues() { + return getIddKeyNames(IddFactory::instance().getObject(iddObjectType()).get(), + OS_Coil_Cooling_DX_MultiSpeedFields::FuelType); +} + +boost::optional CoilCoolingDXMultiSpeed::availabilitySchedule() const { + return getImpl()->availabilitySchedule(); +} + +std::string CoilCoolingDXMultiSpeed::condenserType() const { + return getImpl()->condenserType(); +} + +bool CoilCoolingDXMultiSpeed::applyPartLoadFractiontoSpeedsGreaterthan1() const { + return getImpl()->applyPartLoadFractiontoSpeedsGreaterthan1(); +} + +bool CoilCoolingDXMultiSpeed::applyLatentDegradationtoSpeedsGreaterthan1() const { + return getImpl()->applyLatentDegradationtoSpeedsGreaterthan1(); +} + +bool CoilCoolingDXMultiSpeed::isApplyLatentDegradationtoSpeedsGreaterthan1Defaulted() const { + return getImpl()->isApplyLatentDegradationtoSpeedsGreaterthan1Defaulted(); +} + +double CoilCoolingDXMultiSpeed::crankcaseHeaterCapacity() const { + return getImpl()->crankcaseHeaterCapacity(); +} + +double CoilCoolingDXMultiSpeed::maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const { + return getImpl()->maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(); +} + +double CoilCoolingDXMultiSpeed::basinHeaterCapacity() const { + return getImpl()->basinHeaterCapacity(); +} + +double CoilCoolingDXMultiSpeed::basinHeaterSetpointTemperature() const { + return getImpl()->basinHeaterSetpointTemperature(); +} + +boost::optional CoilCoolingDXMultiSpeed::basinHeaterOperatingSchedule() const { + return getImpl()->basinHeaterOperatingSchedule(); +} + +std::string CoilCoolingDXMultiSpeed::fuelType() const { + return getImpl()->fuelType(); +} + +bool CoilCoolingDXMultiSpeed::setAvailabilitySchedule(Schedule& schedule) { + return getImpl()->setAvailabilitySchedule(schedule); +} + +void CoilCoolingDXMultiSpeed::resetAvailabilitySchedule() { + getImpl()->resetAvailabilitySchedule(); +} + +bool CoilCoolingDXMultiSpeed::setCondenserType(std::string condenserType) { + return getImpl()->setCondenserType(condenserType); +} + +void CoilCoolingDXMultiSpeed::setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1) { + getImpl()->setApplyPartLoadFractiontoSpeedsGreaterthan1(applyPartLoadFractiontoSpeedsGreaterthan1); +} + +void CoilCoolingDXMultiSpeed::setApplyLatentDegradationtoSpeedsGreaterthan1(bool applyLatentDegradationtoSpeedsGreaterthan1) { + getImpl()->setApplyLatentDegradationtoSpeedsGreaterthan1(applyLatentDegradationtoSpeedsGreaterthan1); +} + +void CoilCoolingDXMultiSpeed::resetApplyLatentDegradationtoSpeedsGreaterthan1() { + getImpl()->resetApplyLatentDegradationtoSpeedsGreaterthan1(); +} + +bool CoilCoolingDXMultiSpeed::setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity) { + return getImpl()->setCrankcaseHeaterCapacity(crankcaseHeaterCapacity); +} + +bool CoilCoolingDXMultiSpeed::setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation) { + return getImpl()->setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation); +} + +bool CoilCoolingDXMultiSpeed::setBasinHeaterCapacity(double basinHeaterCapacity) { + return getImpl()->setBasinHeaterCapacity(basinHeaterCapacity); +} + +bool CoilCoolingDXMultiSpeed::setBasinHeaterSetpointTemperature(double basinHeaterSetpointTemperature) { + return getImpl()->setBasinHeaterSetpointTemperature(basinHeaterSetpointTemperature); +} + +bool CoilCoolingDXMultiSpeed::setBasinHeaterOperatingSchedule(Schedule& schedule) { + return getImpl()->setBasinHeaterOperatingSchedule(schedule); +} + +void CoilCoolingDXMultiSpeed::resetBasinHeaterOperatingSchedule() { + getImpl()->resetBasinHeaterOperatingSchedule(); +} + +bool CoilCoolingDXMultiSpeed::setFuelType(std::string fuelType) { + return getImpl()->setFuelType(fuelType); +} + +std::vector CoilCoolingDXMultiSpeed::stages() const { + return getImpl()->stages(); +} + +void CoilCoolingDXMultiSpeed::addStage(CoilCoolingDXMultiSpeedStageData& stage) { + return getImpl()->addStage(stage); +} + +/// @cond +CoilCoolingDXMultiSpeed::CoilCoolingDXMultiSpeed(std::shared_ptr impl) + : StraightComponent(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeed.hpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeed.hpp new file mode 100644 index 00000000000..35dfdfbcf61 --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeed.hpp @@ -0,0 +1,149 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILCOOLINGDXMULTISPEED_HPP +#define MODEL_COILCOOLINGDXMULTISPEED_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent.hpp" + +namespace openstudio { + +namespace model { + +class Schedule; +class CoilCoolingDXMultiSpeedStageData; + +namespace detail { + + class CoilCoolingDXMultiSpeed_Impl; + +} // detail + +/** CoilCoolingDXMultiSpeed is a StraightComponent that wraps the OpenStudio IDD object 'OS:Coil:Cooling:DX:MultiSpeed'. + * Performance data for each stage is contained in a separate ModelObject called CoilCoolingDXMultiSpeedStageData **/ +class MODEL_API CoilCoolingDXMultiSpeed : public StraightComponent { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit CoilCoolingDXMultiSpeed(const Model& model); + + virtual ~CoilCoolingDXMultiSpeed() {} + + //@} + + static IddObjectType iddObjectType(); + + static std::vector condenserTypeValues(); + + static std::vector fuelTypeValues(); + + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + std::string condenserType() const; + + bool applyPartLoadFractiontoSpeedsGreaterthan1() const; + + bool applyLatentDegradationtoSpeedsGreaterthan1() const; + + bool isApplyLatentDegradationtoSpeedsGreaterthan1Defaulted() const; + + double crankcaseHeaterCapacity() const; + + double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const; + + double basinHeaterCapacity() const; + + double basinHeaterSetpointTemperature() const; + + boost::optional basinHeaterOperatingSchedule() const; + + std::string fuelType() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setCondenserType(std::string condenserType); + + void setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1); + + void setApplyLatentDegradationtoSpeedsGreaterthan1(bool applyLatentDegradationtoSpeedsGreaterthan1); + + void resetApplyLatentDegradationtoSpeedsGreaterthan1(); + + bool setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity); + + bool setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation); + + bool setBasinHeaterCapacity(double basinHeaterCapacity); + + bool setBasinHeaterSetpointTemperature(double basinHeaterSetpointTemperature); + + bool setBasinHeaterOperatingSchedule(Schedule& schedule); + + void resetBasinHeaterOperatingSchedule(); + + bool setFuelType(std::string fuelType); + + //@} + /** @name Other */ + //@{ + + /** Return the performance data for each stage. **/ + std::vector stages() const; + + /** Add a new stage after all of the existing stages **/ + void addStage(CoilCoolingDXMultiSpeedStageData& stage); + + //@} + protected: + /// @cond + typedef detail::CoilCoolingDXMultiSpeed_Impl ImplType; + + explicit CoilCoolingDXMultiSpeed(std::shared_ptr impl); + + friend class detail::CoilCoolingDXMultiSpeed_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.CoilCoolingDXMultiSpeed"); +}; + +/** \relates CoilCoolingDXMultiSpeed*/ +typedef boost::optional OptionalCoilCoolingDXMultiSpeed; + +/** \relates CoilCoolingDXMultiSpeed*/ +typedef std::vector CoilCoolingDXMultiSpeedVector; + +} // model +} // openstudio + +#endif // MODEL_COILCOOLINGDXMULTISPEED_HPP + diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.cpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.cpp new file mode 100644 index 00000000000..ed1b7abc2c8 --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.cpp @@ -0,0 +1,674 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "../model/CoilCoolingDXMultiSpeedStageData.hpp" +#include "../model/CoilCoolingDXMultiSpeedStageData_Impl.hpp" +#include "../model/Curve.hpp" +#include "../model/Curve_Impl.hpp" +#include "../model/Model.hpp" +#include "../model/Model_Impl.hpp" +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + CoilCoolingDXMultiSpeedStageData_Impl::CoilCoolingDXMultiSpeedStageData_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : ParentObject_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == CoilCoolingDXMultiSpeedStageData::iddObjectType()); + } + + CoilCoolingDXMultiSpeedStageData_Impl::CoilCoolingDXMultiSpeedStageData_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : ParentObject_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == CoilCoolingDXMultiSpeedStageData::iddObjectType()); + } + + CoilCoolingDXMultiSpeedStageData_Impl::CoilCoolingDXMultiSpeedStageData_Impl(const CoilCoolingDXMultiSpeedStageData_Impl& other, + Model_Impl* model, + bool keepHandle) + : ParentObject_Impl(other,model,keepHandle) + {} + + const std::vector& CoilCoolingDXMultiSpeedStageData_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType CoilCoolingDXMultiSpeedStageData_Impl::iddObjectType() const { + return CoilCoolingDXMultiSpeedStageData::iddObjectType(); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::grossRatedTotalCoolingCapacity() const { + return getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedTotalCoolingCapacity,true); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::isGrossRatedTotalCoolingCapacityAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedTotalCoolingCapacity, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::grossRatedSensibleHeatRatio() const { + return getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedSensibleHeatRatio,true); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::isGrossRatedSensibleHeatRatioAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedSensibleHeatRatio, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + double CoilCoolingDXMultiSpeedStageData_Impl::grossRatedCoolingCOP() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedCoolingCOP,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::ratedAirFlowRate() const { + return getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedAirFlowRate,true); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::isRatedAirFlowRateAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedAirFlowRate, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + double CoilCoolingDXMultiSpeedStageData_Impl::ratedEvaporatorFanPowerPerVolumeFlowRate() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporatorFanPowerPerVolumeFlowRate,true); + OS_ASSERT(value); + return value.get(); + } + + Curve CoilCoolingDXMultiSpeedStageData_Impl::totalCoolingCapacityFunctionofTemperatureCurve() const { + boost::optional value = optionalTotalCoolingCapacityFunctionofTemperatureCurve(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Total Cooling Capacity Functionof Temperature Curve attached."); + } + return value.get(); + } + + Curve CoilCoolingDXMultiSpeedStageData_Impl::totalCoolingCapacityFunctionofFlowFractionCurve() const { + boost::optional value = optionalTotalCoolingCapacityFunctionofFlowFractionCurve(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Total Cooling Capacity Functionof Flow Fraction Curve attached."); + } + return value.get(); + } + + Curve CoilCoolingDXMultiSpeedStageData_Impl::energyInputRatioFunctionofTemperatureCurve() const { + boost::optional value = optionalEnergyInputRatioFunctionofTemperatureCurve(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Energy Input Ratio Functionof Temperature Curve attached."); + } + return value.get(); + } + + Curve CoilCoolingDXMultiSpeedStageData_Impl::energyInputRatioFunctionofFlowFractionCurve() const { + boost::optional value = optionalEnergyInputRatioFunctionofFlowFractionCurve(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Energy Input Ratio Functionof Flow Fraction Curve attached."); + } + return value.get(); + } + + Curve CoilCoolingDXMultiSpeedStageData_Impl::partLoadFractionCorrelationCurve() const { + boost::optional value = optionalPartLoadFractionCorrelationCurve(); + if (!value) { + LOG_AND_THROW(briefDescription() << " does not have an Part Load Fraction Correlation Curve attached."); + } + return value.get(); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::nominalTimeforCondensateRemovaltoBegin() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::NominalTimeforCondensateRemovaltoBegin,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::maximumCyclingRate() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::MaximumCyclingRate,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::latentCapacityTimeConstant() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::LatentCapacityTimeConstant,true); + OS_ASSERT(value); + return value.get(); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::ratedWasteHeatFractionofPowerInput() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedWasteHeatFractionofPowerInput,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::wasteHeatFunctionofTemperatureCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::WasteHeatFunctionofTemperatureCurve); + } + + double CoilCoolingDXMultiSpeedStageData_Impl::evaporativeCondenserEffectiveness() const { + boost::optional value = getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserEffectiveness,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::evaporativeCondenserAirFlowRate() const { + return getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserAirFlowRate,true); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::isEvaporativeCondenserAirFlowRateAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserAirFlowRate, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::ratedEvaporativeCondenserPumpPowerConsumption() const { + return getDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporativeCondenserPumpPowerConsumption,true); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::isRatedEvaporativeCondenserPumpPowerConsumptionAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporativeCondenserPumpPowerConsumption, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setGrossRatedTotalCoolingCapacity(boost::optional grossRatedTotalCoolingCapacity) { + bool result(false); + if (grossRatedTotalCoolingCapacity) { + result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedTotalCoolingCapacity, grossRatedTotalCoolingCapacity.get()); + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::autosizeGrossRatedTotalCoolingCapacity() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedTotalCoolingCapacity, "autosize"); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setGrossRatedSensibleHeatRatio(boost::optional grossRatedSensibleHeatRatio) { + bool result(false); + if (grossRatedSensibleHeatRatio) { + result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedSensibleHeatRatio, grossRatedSensibleHeatRatio.get()); + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::autosizeGrossRatedSensibleHeatRatio() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedSensibleHeatRatio, "autosize"); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setGrossRatedCoolingCOP(double grossRatedCoolingCOP) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::GrossRatedCoolingCOP, grossRatedCoolingCOP); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setRatedAirFlowRate(boost::optional ratedAirFlowRate) { + bool result(false); + if (ratedAirFlowRate) { + result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedAirFlowRate, ratedAirFlowRate.get()); + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::autosizeRatedAirFlowRate() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedAirFlowRate, "autosize"); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setRatedEvaporatorFanPowerPerVolumeFlowRate(double ratedEvaporatorFanPowerPerVolumeFlowRate) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporatorFanPowerPerVolumeFlowRate, ratedEvaporatorFanPowerPerVolumeFlowRate); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setTotalCoolingCapacityFunctionofTemperatureCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::TotalCoolingCapacityFunctionofTemperatureCurve, curve.handle()); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setTotalCoolingCapacityFunctionofFlowFractionCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::TotalCoolingCapacityFunctionofFlowFractionCurve, curve.handle()); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setEnergyInputRatioFunctionofTemperatureCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EnergyInputRatioFunctionofTemperatureCurve, curve.handle()); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setEnergyInputRatioFunctionofFlowFractionCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EnergyInputRatioFunctionofFlowFractionCurve, curve.handle()); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setPartLoadFractionCorrelationCurve(const Curve& curve) { + bool result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::PartLoadFractionCorrelationCurve, curve.handle()); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::NominalTimeforCondensateRemovaltoBegin, nominalTimeforCondensateRemovaltoBegin); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity, ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setMaximumCyclingRate(double maximumCyclingRate) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::MaximumCyclingRate, maximumCyclingRate); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setLatentCapacityTimeConstant(double latentCapacityTimeConstant) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::LatentCapacityTimeConstant, latentCapacityTimeConstant); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setRatedWasteHeatFractionofPowerInput(double ratedWasteHeatFractionofPowerInput) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedWasteHeatFractionofPowerInput, ratedWasteHeatFractionofPowerInput); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setWasteHeatFunctionofTemperatureCurve(const boost::optional& curve) { + bool result(false); + if (curve) { + result = setPointer(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::WasteHeatFunctionofTemperatureCurve, curve.get().handle()); + } + else { + resetWasteHeatFunctionofTemperatureCurve(); + result = true; + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::resetWasteHeatFunctionofTemperatureCurve() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::WasteHeatFunctionofTemperatureCurve, ""); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setEvaporativeCondenserEffectiveness(double evaporativeCondenserEffectiveness) { + bool result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserEffectiveness, evaporativeCondenserEffectiveness); + return result; + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setEvaporativeCondenserAirFlowRate(boost::optional evaporativeCondenserAirFlowRate) { + bool result(false); + if (evaporativeCondenserAirFlowRate) { + result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserAirFlowRate, evaporativeCondenserAirFlowRate.get()); + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::autosizeEvaporativeCondenserAirFlowRate() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EvaporativeCondenserAirFlowRate, "autosize"); + OS_ASSERT(result); + } + + bool CoilCoolingDXMultiSpeedStageData_Impl::setRatedEvaporativeCondenserPumpPowerConsumption(boost::optional ratedEvaporativeCondenserPumpPowerConsumption) { + bool result(false); + if (ratedEvaporativeCondenserPumpPowerConsumption) { + result = setDouble(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporativeCondenserPumpPowerConsumption, ratedEvaporativeCondenserPumpPowerConsumption.get()); + } + return result; + } + + void CoilCoolingDXMultiSpeedStageData_Impl::autosizeRatedEvaporativeCondenserPumpPowerConsumption() { + bool result = setString(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::RatedEvaporativeCondenserPumpPowerConsumption, "autosize"); + OS_ASSERT(result); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::optionalTotalCoolingCapacityFunctionofTemperatureCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::TotalCoolingCapacityFunctionofTemperatureCurve); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::optionalTotalCoolingCapacityFunctionofFlowFractionCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::TotalCoolingCapacityFunctionofFlowFractionCurve); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::optionalEnergyInputRatioFunctionofTemperatureCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EnergyInputRatioFunctionofTemperatureCurve); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::optionalEnergyInputRatioFunctionofFlowFractionCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::EnergyInputRatioFunctionofFlowFractionCurve); + } + + boost::optional CoilCoolingDXMultiSpeedStageData_Impl::optionalPartLoadFractionCorrelationCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Cooling_DX_MultiSpeed_StageDataFields::PartLoadFractionCorrelationCurve); + } + + std::vector CoilCoolingDXMultiSpeedStageData_Impl::children() const { + std::vector result; + + result.push_back(totalCoolingCapacityFunctionofTemperatureCurve()); + result.push_back(totalCoolingCapacityFunctionofFlowFractionCurve()); + result.push_back(energyInputRatioFunctionofTemperatureCurve()); + result.push_back(energyInputRatioFunctionofFlowFractionCurve()); + result.push_back(partLoadFractionCorrelationCurve()); + if( auto curve = wasteHeatFunctionofTemperatureCurve() ) { + result.push_back(curve.get()); + } + + return result; + } + + ModelObject CoilCoolingDXMultiSpeedStageData_Impl::clone(Model model) const { + auto t_clone = ModelObject_Impl::clone(model).cast(); + + auto curve = totalCoolingCapacityFunctionofTemperatureCurve().clone(model).cast(); + t_clone.setTotalCoolingCapacityFunctionofTemperatureCurve(curve); + + curve = totalCoolingCapacityFunctionofFlowFractionCurve().clone(model).cast(); + t_clone.setTotalCoolingCapacityFunctionofFlowFractionCurve(curve); + + curve = energyInputRatioFunctionofTemperatureCurve().clone(model).cast(); + t_clone.setEnergyInputRatioFunctionofTemperatureCurve(curve); + + curve = energyInputRatioFunctionofFlowFractionCurve().clone(model).cast(); + t_clone.setEnergyInputRatioFunctionofFlowFractionCurve(curve); + + curve = partLoadFractionCorrelationCurve().clone(model).cast(); + t_clone.setPartLoadFractionCorrelationCurve(curve); + + if( auto optionalCurve = wasteHeatFunctionofTemperatureCurve() ) { + curve = optionalCurve->clone(model).cast(); + t_clone.setWasteHeatFunctionofTemperatureCurve(curve); + } + + return t_clone; + } + +} // detail + +CoilCoolingDXMultiSpeedStageData::CoilCoolingDXMultiSpeedStageData(const Model& model, + Curve& coolingCapacityFunctionofTemperature, + Curve& coolingCapacityFuncionofFlowFraction, + Curve& energyInputRatioFunctionofTemperature, + Curve& energyInputRatioFunctionofFlowFraction, + Curve& partLoadFractionCorrelation) + : ParentObject(CoilCoolingDXMultiSpeedStageData::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); + + autosizeGrossRatedTotalCoolingCapacity(); + autosizeGrossRatedSensibleHeatRatio(); + setGrossRatedCoolingCOP(3.0); + autosizeRatedAirFlowRate(); + autosizeRatedEvaporativeCondenserPumpPowerConsumption(); + setTotalCoolingCapacityFunctionofTemperatureCurve(coolingCapacityFunctionofTemperature); + setTotalCoolingCapacityFunctionofFlowFractionCurve(coolingCapacityFuncionofFlowFraction); + setEnergyInputRatioFunctionofTemperatureCurve(energyInputRatioFunctionofTemperature); + setEnergyInputRatioFunctionofFlowFractionCurve(energyInputRatioFunctionofFlowFraction); + setPartLoadFractionCorrelationCurve(partLoadFractionCorrelation); + setNominalTimeforCondensateRemovaltoBegin(0.0); + setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(0.0); + setMaximumCyclingRate(0.0); + setLatentCapacityTimeConstant(0.0); + setRatedWasteHeatFractionofPowerInput(0.0); + setEvaporativeCondenserEffectiveness(0.9); + autosizeEvaporativeCondenserAirFlowRate(); + autosizeRatedEvaporativeCondenserPumpPowerConsumption(); +} + +IddObjectType CoilCoolingDXMultiSpeedStageData::iddObjectType() { + return IddObjectType(IddObjectType::OS_Coil_Cooling_DX_MultiSpeed_StageData); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::grossRatedTotalCoolingCapacity() const { + return getImpl()->grossRatedTotalCoolingCapacity(); +} + +bool CoilCoolingDXMultiSpeedStageData::isGrossRatedTotalCoolingCapacityAutosized() const { + return getImpl()->isGrossRatedTotalCoolingCapacityAutosized(); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::grossRatedSensibleHeatRatio() const { + return getImpl()->grossRatedSensibleHeatRatio(); +} + +bool CoilCoolingDXMultiSpeedStageData::isGrossRatedSensibleHeatRatioAutosized() const { + return getImpl()->isGrossRatedSensibleHeatRatioAutosized(); +} + +double CoilCoolingDXMultiSpeedStageData::grossRatedCoolingCOP() const { + return getImpl()->grossRatedCoolingCOP(); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::ratedAirFlowRate() const { + return getImpl()->ratedAirFlowRate(); +} + +bool CoilCoolingDXMultiSpeedStageData::isRatedAirFlowRateAutosized() const { + return getImpl()->isRatedAirFlowRateAutosized(); +} + +double CoilCoolingDXMultiSpeedStageData::ratedEvaporatorFanPowerPerVolumeFlowRate() const { + return getImpl()->ratedEvaporatorFanPowerPerVolumeFlowRate(); +} + +Curve CoilCoolingDXMultiSpeedStageData::totalCoolingCapacityFunctionofTemperatureCurve() const { + return getImpl()->totalCoolingCapacityFunctionofTemperatureCurve(); +} + +Curve CoilCoolingDXMultiSpeedStageData::totalCoolingCapacityFunctionofFlowFractionCurve() const { + return getImpl()->totalCoolingCapacityFunctionofFlowFractionCurve(); +} + +Curve CoilCoolingDXMultiSpeedStageData::energyInputRatioFunctionofTemperatureCurve() const { + return getImpl()->energyInputRatioFunctionofTemperatureCurve(); +} + +Curve CoilCoolingDXMultiSpeedStageData::energyInputRatioFunctionofFlowFractionCurve() const { + return getImpl()->energyInputRatioFunctionofFlowFractionCurve(); +} + +Curve CoilCoolingDXMultiSpeedStageData::partLoadFractionCorrelationCurve() const { + return getImpl()->partLoadFractionCorrelationCurve(); +} + +double CoilCoolingDXMultiSpeedStageData::nominalTimeforCondensateRemovaltoBegin() const { + return getImpl()->nominalTimeforCondensateRemovaltoBegin(); +} + +double CoilCoolingDXMultiSpeedStageData::ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity() const { + return getImpl()->ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(); +} + +double CoilCoolingDXMultiSpeedStageData::maximumCyclingRate() const { + return getImpl()->maximumCyclingRate(); +} + +double CoilCoolingDXMultiSpeedStageData::latentCapacityTimeConstant() const { + return getImpl()->latentCapacityTimeConstant(); +} + +double CoilCoolingDXMultiSpeedStageData::ratedWasteHeatFractionofPowerInput() const { + return getImpl()->ratedWasteHeatFractionofPowerInput(); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::wasteHeatFunctionofTemperatureCurve() const { + return getImpl()->wasteHeatFunctionofTemperatureCurve(); +} + +double CoilCoolingDXMultiSpeedStageData::evaporativeCondenserEffectiveness() const { + return getImpl()->evaporativeCondenserEffectiveness(); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::evaporativeCondenserAirFlowRate() const { + return getImpl()->evaporativeCondenserAirFlowRate(); +} + +bool CoilCoolingDXMultiSpeedStageData::isEvaporativeCondenserAirFlowRateAutosized() const { + return getImpl()->isEvaporativeCondenserAirFlowRateAutosized(); +} + +boost::optional CoilCoolingDXMultiSpeedStageData::ratedEvaporativeCondenserPumpPowerConsumption() const { + return getImpl()->ratedEvaporativeCondenserPumpPowerConsumption(); +} + +bool CoilCoolingDXMultiSpeedStageData::isRatedEvaporativeCondenserPumpPowerConsumptionAutosized() const { + return getImpl()->isRatedEvaporativeCondenserPumpPowerConsumptionAutosized(); +} + +bool CoilCoolingDXMultiSpeedStageData::setGrossRatedTotalCoolingCapacity(double grossRatedTotalCoolingCapacity) { + return getImpl()->setGrossRatedTotalCoolingCapacity(grossRatedTotalCoolingCapacity); +} + +void CoilCoolingDXMultiSpeedStageData::autosizeGrossRatedTotalCoolingCapacity() { + getImpl()->autosizeGrossRatedTotalCoolingCapacity(); +} + +bool CoilCoolingDXMultiSpeedStageData::setGrossRatedSensibleHeatRatio(double grossRatedSensibleHeatRatio) { + return getImpl()->setGrossRatedSensibleHeatRatio(grossRatedSensibleHeatRatio); +} + +void CoilCoolingDXMultiSpeedStageData::autosizeGrossRatedSensibleHeatRatio() { + getImpl()->autosizeGrossRatedSensibleHeatRatio(); +} + +bool CoilCoolingDXMultiSpeedStageData::setGrossRatedCoolingCOP(double grossRatedCoolingCOP) { + return getImpl()->setGrossRatedCoolingCOP(grossRatedCoolingCOP); +} + +bool CoilCoolingDXMultiSpeedStageData::setRatedAirFlowRate(double ratedAirFlowRate) { + return getImpl()->setRatedAirFlowRate(ratedAirFlowRate); +} + +void CoilCoolingDXMultiSpeedStageData::autosizeRatedAirFlowRate() { + getImpl()->autosizeRatedAirFlowRate(); +} + +bool CoilCoolingDXMultiSpeedStageData::setRatedEvaporatorFanPowerPerVolumeFlowRate(double ratedEvaporatorFanPowerPerVolumeFlowRate) { + return getImpl()->setRatedEvaporatorFanPowerPerVolumeFlowRate(ratedEvaporatorFanPowerPerVolumeFlowRate); +} + +bool CoilCoolingDXMultiSpeedStageData::setTotalCoolingCapacityFunctionofTemperatureCurve(const Curve& curve) { + return getImpl()->setTotalCoolingCapacityFunctionofTemperatureCurve(curve); +} + +bool CoilCoolingDXMultiSpeedStageData::setTotalCoolingCapacityFunctionofFlowFractionCurve(const Curve& curve) { + return getImpl()->setTotalCoolingCapacityFunctionofFlowFractionCurve(curve); +} + +bool CoilCoolingDXMultiSpeedStageData::setEnergyInputRatioFunctionofTemperatureCurve(const Curve& curve) { + return getImpl()->setEnergyInputRatioFunctionofTemperatureCurve(curve); +} + +bool CoilCoolingDXMultiSpeedStageData::setEnergyInputRatioFunctionofFlowFractionCurve(const Curve& curve) { + return getImpl()->setEnergyInputRatioFunctionofFlowFractionCurve(curve); +} + +bool CoilCoolingDXMultiSpeedStageData::setPartLoadFractionCorrelationCurve(const Curve& curve) { + return getImpl()->setPartLoadFractionCorrelationCurve(curve); +} + +bool CoilCoolingDXMultiSpeedStageData::setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin) { + return getImpl()->setNominalTimeforCondensateRemovaltoBegin(nominalTimeforCondensateRemovaltoBegin); +} + +bool CoilCoolingDXMultiSpeedStageData::setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity) { + return getImpl()->setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity); +} + +bool CoilCoolingDXMultiSpeedStageData::setMaximumCyclingRate(double maximumCyclingRate) { + return getImpl()->setMaximumCyclingRate(maximumCyclingRate); +} + +bool CoilCoolingDXMultiSpeedStageData::setLatentCapacityTimeConstant(double latentCapacityTimeConstant) { + return getImpl()->setLatentCapacityTimeConstant(latentCapacityTimeConstant); +} + +bool CoilCoolingDXMultiSpeedStageData::setRatedWasteHeatFractionofPowerInput(double ratedWasteHeatFractionofPowerInput) { + return getImpl()->setRatedWasteHeatFractionofPowerInput(ratedWasteHeatFractionofPowerInput); +} + +bool CoilCoolingDXMultiSpeedStageData::setWasteHeatFunctionofTemperatureCurve(const Curve& curve) { + return getImpl()->setWasteHeatFunctionofTemperatureCurve(curve); +} + +void CoilCoolingDXMultiSpeedStageData::resetWasteHeatFunctionofTemperatureCurve() { + getImpl()->resetWasteHeatFunctionofTemperatureCurve(); +} + +bool CoilCoolingDXMultiSpeedStageData::setEvaporativeCondenserEffectiveness(double evaporativeCondenserEffectiveness) { + return getImpl()->setEvaporativeCondenserEffectiveness(evaporativeCondenserEffectiveness); +} + +bool CoilCoolingDXMultiSpeedStageData::setEvaporativeCondenserAirFlowRate(double evaporativeCondenserAirFlowRate) { + return getImpl()->setEvaporativeCondenserAirFlowRate(evaporativeCondenserAirFlowRate); +} + +void CoilCoolingDXMultiSpeedStageData::autosizeEvaporativeCondenserAirFlowRate() { + getImpl()->autosizeEvaporativeCondenserAirFlowRate(); +} + +bool CoilCoolingDXMultiSpeedStageData::setRatedEvaporativeCondenserPumpPowerConsumption(double ratedEvaporativeCondenserPumpPowerConsumption) { + return getImpl()->setRatedEvaporativeCondenserPumpPowerConsumption(ratedEvaporativeCondenserPumpPowerConsumption); +} + +void CoilCoolingDXMultiSpeedStageData::autosizeRatedEvaporativeCondenserPumpPowerConsumption() { + getImpl()->autosizeRatedEvaporativeCondenserPumpPowerConsumption(); +} + +/// @cond +CoilCoolingDXMultiSpeedStageData::CoilCoolingDXMultiSpeedStageData(std::shared_ptr impl) + : ParentObject(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.hpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.hpp new file mode 100644 index 00000000000..a26fd17553a --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData.hpp @@ -0,0 +1,192 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_HPP +#define MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_HPP + +#include "ModelAPI.hpp" +#include "ParentObject.hpp" + +namespace openstudio { + +namespace model { + +class Curve; + +namespace detail { + + class CoilCoolingDXMultiSpeedStageData_Impl; + +} // detail + +/** CoilCoolingDXMultiSpeedStageData is a ModelObject that wraps the OpenStudio IDD object 'OS:Coil:Cooling:DX:MultiSpeed:StageData'. */ +class MODEL_API CoilCoolingDXMultiSpeedStageData : public ParentObject { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit CoilCoolingDXMultiSpeedStageData(const Model& model, + Curve& coolingCapacityFunctionofTemperature, + Curve& coolingCapacityFuncionofFlowFraction, + Curve& energyInputRatioFunctionofTemperature, + Curve& energyInputRatioFunctionofFlowFraction, + Curve& partLoadFractionCorrelation); + + virtual ~CoilCoolingDXMultiSpeedStageData() {} + + //@} + + static IddObjectType iddObjectType(); + + /** @name Getters */ + //@{ + + boost::optional grossRatedTotalCoolingCapacity() const; + + bool isGrossRatedTotalCoolingCapacityAutosized() const; + + boost::optional grossRatedSensibleHeatRatio() const; + + bool isGrossRatedSensibleHeatRatioAutosized() const; + + double grossRatedCoolingCOP() const; + + boost::optional ratedAirFlowRate() const; + + bool isRatedAirFlowRateAutosized() const; + + double ratedEvaporatorFanPowerPerVolumeFlowRate() const; + + Curve totalCoolingCapacityFunctionofTemperatureCurve() const; + + Curve totalCoolingCapacityFunctionofFlowFractionCurve() const; + + Curve energyInputRatioFunctionofTemperatureCurve() const; + + Curve energyInputRatioFunctionofFlowFractionCurve() const; + + Curve partLoadFractionCorrelationCurve() const; + + double nominalTimeforCondensateRemovaltoBegin() const; + + double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity() const; + + double maximumCyclingRate() const; + + double latentCapacityTimeConstant() const; + + double ratedWasteHeatFractionofPowerInput() const; + + boost::optional wasteHeatFunctionofTemperatureCurve() const; + + double evaporativeCondenserEffectiveness() const; + + boost::optional evaporativeCondenserAirFlowRate() const; + + bool isEvaporativeCondenserAirFlowRateAutosized() const; + + boost::optional ratedEvaporativeCondenserPumpPowerConsumption() const; + + bool isRatedEvaporativeCondenserPumpPowerConsumptionAutosized() const; + + //@} + /** @name Setters */ + //@{ + + bool setGrossRatedTotalCoolingCapacity(double grossRatedTotalCoolingCapacity); + + void autosizeGrossRatedTotalCoolingCapacity(); + + bool setGrossRatedSensibleHeatRatio(double grossRatedSensibleHeatRatio); + + void autosizeGrossRatedSensibleHeatRatio(); + + bool setGrossRatedCoolingCOP(double grossRatedCoolingCOP); + + bool setRatedAirFlowRate(double ratedAirFlowRate); + + void autosizeRatedAirFlowRate(); + + bool setRatedEvaporatorFanPowerPerVolumeFlowRate(double ratedEvaporatorFanPowerPerVolumeFlowRate); + + bool setTotalCoolingCapacityFunctionofTemperatureCurve(const Curve& curve); + + bool setTotalCoolingCapacityFunctionofFlowFractionCurve(const Curve& curve); + + bool setEnergyInputRatioFunctionofTemperatureCurve(const Curve& curve); + + bool setEnergyInputRatioFunctionofFlowFractionCurve(const Curve& curve); + + bool setPartLoadFractionCorrelationCurve(const Curve& curve); + + bool setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin); + + bool setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity); + + bool setMaximumCyclingRate(double maximumCyclingRate); + + bool setLatentCapacityTimeConstant(double latentCapacityTimeConstant); + + bool setRatedWasteHeatFractionofPowerInput(double ratedWasteHeatFractionofPowerInput); + + bool setWasteHeatFunctionofTemperatureCurve(const Curve& curve); + + void resetWasteHeatFunctionofTemperatureCurve(); + + bool setEvaporativeCondenserEffectiveness(double evaporativeCondenserEffectiveness); + + bool setEvaporativeCondenserAirFlowRate(double evaporativeCondenserAirFlowRate); + + void autosizeEvaporativeCondenserAirFlowRate(); + + bool setRatedEvaporativeCondenserPumpPowerConsumption(double ratedEvaporativeCondenserPumpPowerConsumption); + + void autosizeRatedEvaporativeCondenserPumpPowerConsumption(); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + /// @cond + typedef detail::CoilCoolingDXMultiSpeedStageData_Impl ImplType; + + explicit CoilCoolingDXMultiSpeedStageData(std::shared_ptr impl); + + friend class detail::CoilCoolingDXMultiSpeedStageData_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.CoilCoolingDXMultiSpeedStageData"); +}; + +/** \relates CoilCoolingDXMultiSpeedStageData*/ +typedef boost::optional OptionalCoilCoolingDXMultiSpeedStageData; + +/** \relates CoilCoolingDXMultiSpeedStageData*/ +typedef std::vector CoilCoolingDXMultiSpeedStageDataVector; + +} // model +} // openstudio + +#endif // MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_HPP + diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData_Impl.hpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData_Impl.hpp new file mode 100644 index 00000000000..0782efbd569 --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeedStageData_Impl.hpp @@ -0,0 +1,192 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_IMPL_HPP +#define MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_IMPL_HPP + +#include "ModelAPI.hpp" +#include "ParentObject_Impl.hpp" + +namespace openstudio { +namespace model { + +class Curve; + +namespace detail { + + /** CoilCoolingDXMultiSpeedStageData_Impl is a ModelObject_Impl that is the implementation class for CoilCoolingDXMultiSpeedStageData.*/ + class MODEL_API CoilCoolingDXMultiSpeedStageData_Impl : public ParentObject_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + CoilCoolingDXMultiSpeedStageData_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + CoilCoolingDXMultiSpeedStageData_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + CoilCoolingDXMultiSpeedStageData_Impl(const CoilCoolingDXMultiSpeedStageData_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~CoilCoolingDXMultiSpeedStageData_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + //@} + /** @name Getters */ + //@{ + + boost::optional grossRatedTotalCoolingCapacity() const; + + bool isGrossRatedTotalCoolingCapacityAutosized() const; + + boost::optional grossRatedSensibleHeatRatio() const; + + bool isGrossRatedSensibleHeatRatioAutosized() const; + + double grossRatedCoolingCOP() const; + + boost::optional ratedAirFlowRate() const; + + bool isRatedAirFlowRateAutosized() const; + + double ratedEvaporatorFanPowerPerVolumeFlowRate() const; + + Curve totalCoolingCapacityFunctionofTemperatureCurve() const; + + Curve totalCoolingCapacityFunctionofFlowFractionCurve() const; + + Curve energyInputRatioFunctionofTemperatureCurve() const; + + Curve energyInputRatioFunctionofFlowFractionCurve() const; + + Curve partLoadFractionCorrelationCurve() const; + + double nominalTimeforCondensateRemovaltoBegin() const; + + double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity() const; + + double maximumCyclingRate() const; + + double latentCapacityTimeConstant() const; + + double ratedWasteHeatFractionofPowerInput() const; + + boost::optional wasteHeatFunctionofTemperatureCurve() const; + + double evaporativeCondenserEffectiveness() const; + + boost::optional evaporativeCondenserAirFlowRate() const; + + bool isEvaporativeCondenserAirFlowRateAutosized() const; + + boost::optional ratedEvaporativeCondenserPumpPowerConsumption() const; + + bool isRatedEvaporativeCondenserPumpPowerConsumptionAutosized() const; + + //@} + /** @name Setters */ + //@{ + + bool setGrossRatedTotalCoolingCapacity(boost::optional grossRatedTotalCoolingCapacity); + + void autosizeGrossRatedTotalCoolingCapacity(); + + bool setGrossRatedSensibleHeatRatio(boost::optional grossRatedSensibleHeatRatio); + + void autosizeGrossRatedSensibleHeatRatio(); + + bool setGrossRatedCoolingCOP(double grossRatedCoolingCOP); + + bool setRatedAirFlowRate(boost::optional ratedAirFlowRate); + + void autosizeRatedAirFlowRate(); + + bool setRatedEvaporatorFanPowerPerVolumeFlowRate(double ratedEvaporatorFanPowerPerVolumeFlowRate); + + bool setTotalCoolingCapacityFunctionofTemperatureCurve(const Curve& curve); + + bool setTotalCoolingCapacityFunctionofFlowFractionCurve(const Curve& curve); + + bool setEnergyInputRatioFunctionofTemperatureCurve(const Curve& curve); + + bool setEnergyInputRatioFunctionofFlowFractionCurve(const Curve& curve); + + bool setPartLoadFractionCorrelationCurve(const Curve& curve); + + bool setNominalTimeforCondensateRemovaltoBegin(double nominalTimeforCondensateRemovaltoBegin); + + bool setRatioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity(double ratioofInitialMoistureEvaporationRateandSteadyStateLatentCapacity); + + bool setMaximumCyclingRate(double maximumCyclingRate); + + bool setLatentCapacityTimeConstant(double latentCapacityTimeConstant); + + bool setRatedWasteHeatFractionofPowerInput(double ratedWasteHeatFractionofPowerInput); + + bool setWasteHeatFunctionofTemperatureCurve(const boost::optional& curve); + + void resetWasteHeatFunctionofTemperatureCurve(); + + bool setEvaporativeCondenserEffectiveness(double evaporativeCondenserEffectiveness); + + bool setEvaporativeCondenserAirFlowRate(boost::optional evaporativeCondenserAirFlowRate); + + void autosizeEvaporativeCondenserAirFlowRate(); + + bool setRatedEvaporativeCondenserPumpPowerConsumption(boost::optional ratedEvaporativeCondenserPumpPowerConsumption); + + void autosizeRatedEvaporativeCondenserPumpPowerConsumption(); + + //@} + /** @name Other */ + //@{ + + virtual std::vector children() const; + virtual ModelObject clone(Model model) const; + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.CoilCoolingDXMultiSpeedStageData"); + + boost::optional optionalTotalCoolingCapacityFunctionofTemperatureCurve() const; + boost::optional optionalTotalCoolingCapacityFunctionofFlowFractionCurve() const; + boost::optional optionalEnergyInputRatioFunctionofTemperatureCurve() const; + boost::optional optionalEnergyInputRatioFunctionofFlowFractionCurve() const; + boost::optional optionalPartLoadFractionCorrelationCurve() const; + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_COILCOOLINGDXMULTISPEEDSTAGEDATA_IMPL_HPP + diff --git a/openstudiocore/src/model/CoilCoolingDXMultiSpeed_Impl.hpp b/openstudiocore/src/model/CoilCoolingDXMultiSpeed_Impl.hpp new file mode 100644 index 00000000000..1c01a422fa4 --- /dev/null +++ b/openstudiocore/src/model/CoilCoolingDXMultiSpeed_Impl.hpp @@ -0,0 +1,155 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILCOOLINGDXMULTISPEED_IMPL_HPP +#define MODEL_COILCOOLINGDXMULTISPEED_IMPL_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent_Impl.hpp" + +namespace openstudio { +namespace model { + +class Schedule; +class CoilCoolingDXMultiSpeedStageData; + +namespace detail { + + /** CoilCoolingDXMultiSpeed_Impl is a StraightComponent_Impl that is the implementation class for CoilCoolingDXMultiSpeed.*/ + class MODEL_API CoilCoolingDXMultiSpeed_Impl : public StraightComponent_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + CoilCoolingDXMultiSpeed_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + CoilCoolingDXMultiSpeed_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + CoilCoolingDXMultiSpeed_Impl(const CoilCoolingDXMultiSpeed_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~CoilCoolingDXMultiSpeed_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + + //@} + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + std::string condenserType() const; + + bool applyPartLoadFractiontoSpeedsGreaterthan1() const; + + bool applyLatentDegradationtoSpeedsGreaterthan1() const; + + bool isApplyLatentDegradationtoSpeedsGreaterthan1Defaulted() const; + + double crankcaseHeaterCapacity() const; + + double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation() const; + + double basinHeaterCapacity() const; + + double basinHeaterSetpointTemperature() const; + + boost::optional basinHeaterOperatingSchedule() const; + + std::string fuelType() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setCondenserType(std::string condenserType); + + void setApplyPartLoadFractiontoSpeedsGreaterthan1(bool applyPartLoadFractiontoSpeedsGreaterthan1); + + void setApplyLatentDegradationtoSpeedsGreaterthan1(bool applyLatentDegradationtoSpeedsGreaterthan1); + + void resetApplyLatentDegradationtoSpeedsGreaterthan1(); + + bool setCrankcaseHeaterCapacity(double crankcaseHeaterCapacity); + + bool setMaximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation(double maximumOutdoorDryBulbTemperatureforCrankcaseHeaterOperation); + + bool setBasinHeaterCapacity(double basinHeaterCapacity); + + bool setBasinHeaterSetpointTemperature(double basinHeaterSetpointTemperature); + + bool setBasinHeaterOperatingSchedule(Schedule& schedule); + + void resetBasinHeaterOperatingSchedule(); + + bool setFuelType(std::string fuelType); + + //@} + /** @name Other */ + //@{ + + unsigned inletPort(); + + unsigned outletPort(); + + ModelObject clone(Model model) const; + + std::vector children() const; + + std::vector stages() const; + + void addStage(CoilCoolingDXMultiSpeedStageData& stage); + + boost::optional containingHVACComponent() const; + + bool addToNode(Node & node); + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.CoilCoolingDXMultiSpeed"); + + boost::optional optionalAirInletNode() const; + boost::optional optionalAirOutletNode() const; + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_COILCOOLINGDXMULTISPEED_IMPL_HPP + diff --git a/openstudiocore/src/model/CoilHeatingElectric.cpp b/openstudiocore/src/model/CoilHeatingElectric.cpp index 59705a476ec..d767fd29edf 100644 --- a/openstudiocore/src/model/CoilHeatingElectric.cpp +++ b/openstudiocore/src/model/CoilHeatingElectric.cpp @@ -30,6 +30,8 @@ #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp" #include "AirLoopHVACUnitarySystem.hpp" #include "AirLoopHVACUnitarySystem_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" #include "ZoneHVACComponent.hpp" #include "ZoneHVACComponent_Impl.hpp" #include "ZoneHVACPackagedTerminalHeatPump.hpp" @@ -289,6 +291,23 @@ namespace detail { } } + // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed + { + auto systems = this->model().getConcreteModelObjects(); + + for( const auto & system : systems ) { + auto heatingCoil = system.heatingCoil(); + if( heatingCoil.handle() == this->handle() ) { + return system; + } + if( auto supHeatingCoil = system.supplementalHeatingCoil() ) { + if( supHeatingCoil->handle() == this->handle() ) { + return system; + } + } + } + } + return boost::none; } diff --git a/openstudiocore/src/model/CoilHeatingGas.cpp b/openstudiocore/src/model/CoilHeatingGas.cpp index 38d5e6d4a1a..fa8b8905fdc 100644 --- a/openstudiocore/src/model/CoilHeatingGas.cpp +++ b/openstudiocore/src/model/CoilHeatingGas.cpp @@ -30,6 +30,8 @@ #include "ZoneHVACWaterToAirHeatPump_Impl.hpp" #include "AirLoopHVACUnitarySystem.hpp" #include "AirLoopHVACUnitarySystem_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" #include "Schedule.hpp" #include "Schedule_Impl.hpp" #include "CurveCubic.hpp" @@ -234,6 +236,23 @@ namespace detail{ } } + // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed + { + auto systems = this->model().getConcreteModelObjects(); + + for( const auto & system : systems ) { + auto heatingCoil = system.heatingCoil(); + if( heatingCoil.handle() == this->handle() ) { + return system; + } + if( auto supHeatingCoil = system.supplementalHeatingCoil() ) { + if( supHeatingCoil->handle() == this->handle() ) { + return system; + } + } + } + } + return boost::none; } diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStage.cpp b/openstudiocore/src/model/CoilHeatingGasMultiStage.cpp new file mode 100644 index 00000000000..1473bbaeb9e --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStage.cpp @@ -0,0 +1,277 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "Model.hpp" +#include "Model_Impl.hpp" +#include "CoilHeatingGasMultiStage.hpp" +#include "CoilHeatingGasMultiStage_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" +#include "Curve.hpp" +#include "Curve_Impl.hpp" +#include "CoilHeatingGasMultiStageStageData.hpp" +#include "CoilHeatingGasMultiStageStageData_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" +#include "ScheduleTypeLimits.hpp" +#include "ScheduleTypeRegistry.hpp" +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" +#include "../utilities/idf/WorkspaceExtensibleGroup.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + CoilHeatingGasMultiStage_Impl::CoilHeatingGasMultiStage_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == CoilHeatingGasMultiStage::iddObjectType()); + } + + CoilHeatingGasMultiStage_Impl::CoilHeatingGasMultiStage_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == CoilHeatingGasMultiStage::iddObjectType()); + } + + CoilHeatingGasMultiStage_Impl::CoilHeatingGasMultiStage_Impl(const CoilHeatingGasMultiStage_Impl& other, + Model_Impl* model, + bool keepHandle) + : StraightComponent_Impl(other,model,keepHandle) + {} + + const std::vector& CoilHeatingGasMultiStage_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType CoilHeatingGasMultiStage_Impl::iddObjectType() const { + return CoilHeatingGasMultiStage::iddObjectType(); + } + + std::vector CoilHeatingGasMultiStage_Impl::getScheduleTypeKeys(const Schedule& schedule) const + { + std::vector result; + UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + UnsignedVector::const_iterator b(fieldIndices.begin()), e(fieldIndices.end()); + if (std::find(b,e,OS_Coil_Heating_Gas_MultiStageFields::AvailabilitySchedule) != e) + { + result.push_back(ScheduleTypeKey("CoilHeatingGasMultiStage","Availability Schedule")); + } + return result; + } + + boost::optional CoilHeatingGasMultiStage_Impl::availabilitySchedule() const { + return getObject().getModelObjectTarget(OS_Coil_Heating_Gas_MultiStageFields::AvailabilitySchedule); + } + + boost::optional CoilHeatingGasMultiStage_Impl::partLoadFractionCorrelationCurve() const { + return getObject().getModelObjectTarget(OS_Coil_Heating_Gas_MultiStageFields::PartLoadFractionCorrelationCurve); + } + + boost::optional CoilHeatingGasMultiStage_Impl::parasiticGasLoad() const { + return getDouble(OS_Coil_Heating_Gas_MultiStageFields::ParasiticGasLoad,true); + } + + bool CoilHeatingGasMultiStage_Impl::setAvailabilitySchedule(Schedule& schedule) { + bool result = setSchedule(OS_Coil_Heating_Gas_MultiStageFields::AvailabilitySchedule, + "CoilHeatingGasMultiStage", + "Availability Schedule", + schedule); + return result; + } + + void CoilHeatingGasMultiStage_Impl::resetAvailabilitySchedule() { + bool result = setString(OS_Coil_Heating_Gas_MultiStageFields::AvailabilitySchedule, ""); + OS_ASSERT(result); + } + + bool CoilHeatingGasMultiStage_Impl::setPartLoadFractionCorrelationCurve(const boost::optional& curve) { + bool result(false); + if (curve) { + result = setPointer(OS_Coil_Heating_Gas_MultiStageFields::PartLoadFractionCorrelationCurve, curve.get().handle()); + } + else { + resetPartLoadFractionCorrelationCurve(); + result = true; + } + return result; + } + + void CoilHeatingGasMultiStage_Impl::resetPartLoadFractionCorrelationCurve() { + bool result = setString(OS_Coil_Heating_Gas_MultiStageFields::PartLoadFractionCorrelationCurve, ""); + OS_ASSERT(result); + } + + void CoilHeatingGasMultiStage_Impl::setParasiticGasLoad(boost::optional parasiticGasLoad) { + bool result(false); + if (parasiticGasLoad) { + result = setDouble(OS_Coil_Heating_Gas_MultiStageFields::ParasiticGasLoad, parasiticGasLoad.get()); + } + else { + resetParasiticGasLoad(); + result = true; + } + OS_ASSERT(result); + } + + void CoilHeatingGasMultiStage_Impl::resetParasiticGasLoad() { + bool result = setString(OS_Coil_Heating_Gas_MultiStageFields::ParasiticGasLoad, ""); + OS_ASSERT(result); + } + + unsigned CoilHeatingGasMultiStage_Impl::inletPort() { + return OS_Coil_Heating_Gas_MultiStageFields::AirInletNode; + } + + unsigned CoilHeatingGasMultiStage_Impl::outletPort() { + return OS_Coil_Heating_Gas_MultiStageFields::AirOutletNode; + } + + ModelObject CoilHeatingGasMultiStage_Impl::clone(Model model) const { + auto t_clone = StraightComponent_Impl::clone(model).cast(); + + auto t_stages = stages(); + for( auto stage: t_stages ) { + auto stageClone = stage.clone(model).cast(); + t_clone.addStage(stageClone); + } + return t_clone; + } + + std::vector CoilHeatingGasMultiStage_Impl::children() const { + return subsetCastVector(stages()); + } + + std::vector CoilHeatingGasMultiStage_Impl::stages() const { + std::vector result; + auto groups = extensibleGroups(); + for( auto group: groups ) { + auto target = group.cast().getTarget(OS_Coil_Heating_Gas_MultiStageExtensibleFields::Stage); + if( target ) { + if( auto stage = target->optionalCast() ) { + result.push_back(stage.get()); + } + } + } + return result; + } + + void CoilHeatingGasMultiStage_Impl::addStage(CoilHeatingGasMultiStageStageData& stage) { + auto group = getObject().pushExtensibleGroup().cast(); + group.setPointer(OS_Coil_Heating_Gas_MultiStageExtensibleFields::Stage,stage.handle()); + } + + boost::optional CoilHeatingGasMultiStage_Impl::containingHVACComponent() const + { + // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed + { + auto systems = this->model().getConcreteModelObjects(); + + for( const auto & system : systems ) { + auto coolingCoil = system.coolingCoil(); + if( coolingCoil.handle() == this->handle() ) { + return system; + } + } + } + + return boost::none; + } + + bool CoilHeatingGasMultiStage_Impl::addToNode(Node & node) + { + return false; + } + +} // detail + +CoilHeatingGasMultiStage::CoilHeatingGasMultiStage(const Model& model) + : StraightComponent(CoilHeatingGasMultiStage::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); +} + +IddObjectType CoilHeatingGasMultiStage::iddObjectType() { + return IddObjectType(IddObjectType::OS_Coil_Heating_Gas_MultiStage); +} + +boost::optional CoilHeatingGasMultiStage::availabilitySchedule() const { + return getImpl()->availabilitySchedule(); +} + +boost::optional CoilHeatingGasMultiStage::partLoadFractionCorrelationCurve() const { + return getImpl()->partLoadFractionCorrelationCurve(); +} + +boost::optional CoilHeatingGasMultiStage::parasiticGasLoad() const { + return getImpl()->parasiticGasLoad(); +} + +bool CoilHeatingGasMultiStage::setAvailabilitySchedule(Schedule& schedule) { + return getImpl()->setAvailabilitySchedule(schedule); +} + +void CoilHeatingGasMultiStage::resetAvailabilitySchedule() { + getImpl()->resetAvailabilitySchedule(); +} + +bool CoilHeatingGasMultiStage::setPartLoadFractionCorrelationCurve(const Curve& curve) { + return getImpl()->setPartLoadFractionCorrelationCurve(curve); +} + +void CoilHeatingGasMultiStage::resetPartLoadFractionCorrelationCurve() { + getImpl()->resetPartLoadFractionCorrelationCurve(); +} + +void CoilHeatingGasMultiStage::setParasiticGasLoad(double parasiticGasLoad) { + getImpl()->setParasiticGasLoad(parasiticGasLoad); +} + +void CoilHeatingGasMultiStage::resetParasiticGasLoad() { + getImpl()->resetParasiticGasLoad(); +} + +std::vector CoilHeatingGasMultiStage::stages() const { + return getImpl()->stages(); +} + +void CoilHeatingGasMultiStage::addStage(CoilHeatingGasMultiStageStageData& stage) { + getImpl()->addStage(stage); +} + +/// @cond +CoilHeatingGasMultiStage::CoilHeatingGasMultiStage(std::shared_ptr impl) + : StraightComponent(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStage.hpp b/openstudiocore/src/model/CoilHeatingGasMultiStage.hpp new file mode 100644 index 00000000000..78613b1ccf5 --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStage.hpp @@ -0,0 +1,114 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILHEATINGGASMULTISTAGE_HPP +#define MODEL_COILHEATINGGASMULTISTAGE_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent.hpp" + +namespace openstudio { + +namespace model { + +class Schedule; +class CoilHeatingGasMultiStageStageData; +class Curve; + +namespace detail { + + class CoilHeatingGasMultiStage_Impl; + +} // detail + +/** CoilHeatingGasMultiStage is a StraightComponent that wraps the OpenStudio IDD object 'OS:Coil:Heating:Gas:MultiStage'. + * Performance data for each stage is contained in a separate ModelObject called OS:Coil:Heating:Gas:MultiStage:StageData **/ +class MODEL_API CoilHeatingGasMultiStage : public StraightComponent { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit CoilHeatingGasMultiStage(const Model& model); + + virtual ~CoilHeatingGasMultiStage() {} + + //@} + + static IddObjectType iddObjectType(); + + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + boost::optional partLoadFractionCorrelationCurve() const; + + boost::optional parasiticGasLoad() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setPartLoadFractionCorrelationCurve(const Curve& curve); + + void resetPartLoadFractionCorrelationCurve(); + + void setParasiticGasLoad(double parasiticGasLoad); + + void resetParasiticGasLoad(); + + //@} + /** @name Other */ + //@{ + + std::vector stages() const; + + void addStage(CoilHeatingGasMultiStageStageData& stage); + + //@} + protected: + /// @cond + typedef detail::CoilHeatingGasMultiStage_Impl ImplType; + + explicit CoilHeatingGasMultiStage(std::shared_ptr impl); + + friend class detail::CoilHeatingGasMultiStage_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.CoilHeatingGasMultiStage"); +}; + +/** \relates CoilHeatingGasMultiStage*/ +typedef boost::optional OptionalCoilHeatingGasMultiStage; + +/** \relates CoilHeatingGasMultiStage*/ +typedef std::vector CoilHeatingGasMultiStageVector; + +} // model +} // openstudio + +#endif // MODEL_COILHEATINGGASMULTISTAGE_HPP + diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.cpp b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.cpp new file mode 100644 index 00000000000..6b32b4c8a5a --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.cpp @@ -0,0 +1,169 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "CoilHeatingGasMultiStageStageData.hpp" +#include "CoilHeatingGasMultiStageStageData_Impl.hpp" +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + CoilHeatingGasMultiStageStageData_Impl::CoilHeatingGasMultiStageStageData_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : ModelObject_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == CoilHeatingGasMultiStageStageData::iddObjectType()); + } + + CoilHeatingGasMultiStageStageData_Impl::CoilHeatingGasMultiStageStageData_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : ModelObject_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == CoilHeatingGasMultiStageStageData::iddObjectType()); + } + + CoilHeatingGasMultiStageStageData_Impl::CoilHeatingGasMultiStageStageData_Impl(const CoilHeatingGasMultiStageStageData_Impl& other, + Model_Impl* model, + bool keepHandle) + : ModelObject_Impl(other,model,keepHandle) + {} + + const std::vector& CoilHeatingGasMultiStageStageData_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType CoilHeatingGasMultiStageStageData_Impl::iddObjectType() const { + return CoilHeatingGasMultiStageStageData::iddObjectType(); + } + + double CoilHeatingGasMultiStageStageData_Impl::gasBurnerEfficiency() const { + boost::optional value = getDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::GasBurnerEfficiency,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional CoilHeatingGasMultiStageStageData_Impl::nominalCapacity() const { + return getDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::NominalCapacity,true); + } + + bool CoilHeatingGasMultiStageStageData_Impl::isNominalCapacityAutosized() const { + bool result = false; + boost::optional value = getString(OS_Coil_Heating_Gas_MultiStage_StageDataFields::NominalCapacity, true); + if (value) { + result = openstudio::istringEqual(value.get(), "autosize"); + } + return result; + } + + double CoilHeatingGasMultiStageStageData_Impl::parasiticElectricLoad() const { + boost::optional value = getDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::ParasiticElectricLoad,true); + OS_ASSERT(value); + return value.get(); + } + + bool CoilHeatingGasMultiStageStageData_Impl::setGasBurnerEfficiency(double GasBurnerEfficiency) { + bool result = setDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::GasBurnerEfficiency, GasBurnerEfficiency); + return result; + } + + bool CoilHeatingGasMultiStageStageData_Impl::setNominalCapacity(boost::optional NominalCapacity) { + bool result(false); + if (NominalCapacity) { + result = setDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::NominalCapacity, NominalCapacity.get()); + } + return result; + } + + void CoilHeatingGasMultiStageStageData_Impl::autosizeNominalCapacity() { + bool result = setString(OS_Coil_Heating_Gas_MultiStage_StageDataFields::NominalCapacity, "autosize"); + OS_ASSERT(result); + } + + void CoilHeatingGasMultiStageStageData_Impl::setParasiticElectricLoad(double ParasiticElectricLoad) { + bool result = setDouble(OS_Coil_Heating_Gas_MultiStage_StageDataFields::ParasiticElectricLoad, ParasiticElectricLoad); + OS_ASSERT(result); + } + +} // detail + +CoilHeatingGasMultiStageStageData::CoilHeatingGasMultiStageStageData(const Model& model) + : ModelObject(CoilHeatingGasMultiStageStageData::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); + + setGasBurnerEfficiency(0.80); + autosizeNominalCapacity(); + setParasiticElectricLoad(0.0); +} + +IddObjectType CoilHeatingGasMultiStageStageData::iddObjectType() { + return IddObjectType(IddObjectType::OS_Coil_Heating_Gas_MultiStage_StageData); +} + +double CoilHeatingGasMultiStageStageData::gasBurnerEfficiency() const { + return getImpl()->gasBurnerEfficiency(); +} + +boost::optional CoilHeatingGasMultiStageStageData::nominalCapacity() const { + return getImpl()->nominalCapacity(); +} + +bool CoilHeatingGasMultiStageStageData::isNominalCapacityAutosized() const { + return getImpl()->isNominalCapacityAutosized(); +} + +double CoilHeatingGasMultiStageStageData::parasiticElectricLoad() const { + return getImpl()->parasiticElectricLoad(); +} + +bool CoilHeatingGasMultiStageStageData::setGasBurnerEfficiency(double GasBurnerEfficiency) { + return getImpl()->setGasBurnerEfficiency(GasBurnerEfficiency); +} + +bool CoilHeatingGasMultiStageStageData::setNominalCapacity(double NominalCapacity) { + return getImpl()->setNominalCapacity(NominalCapacity); +} + +void CoilHeatingGasMultiStageStageData::autosizeNominalCapacity() { + getImpl()->autosizeNominalCapacity(); +} + +void CoilHeatingGasMultiStageStageData::setParasiticElectricLoad(double ParasiticElectricLoad) { + getImpl()->setParasiticElectricLoad(ParasiticElectricLoad); +} + +/// @cond +CoilHeatingGasMultiStageStageData::CoilHeatingGasMultiStageStageData(std::shared_ptr impl) + : ModelObject(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.hpp b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.hpp new file mode 100644 index 00000000000..2665a4f42c6 --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData.hpp @@ -0,0 +1,103 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_HPP +#define MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_HPP + +#include "ModelAPI.hpp" +#include "ModelObject.hpp" + +namespace openstudio { + +namespace model { + +namespace detail { + + class CoilHeatingGasMultiStageStageData_Impl; + +} // detail + +/** CoilHeatingGasMultiStageStageData is a ModelObject that wraps the OpenStudio IDD object 'OS:Coil:Heating:Gas:MultiStage:StageData'. */ +class MODEL_API CoilHeatingGasMultiStageStageData : public ModelObject { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit CoilHeatingGasMultiStageStageData(const Model& model); + + virtual ~CoilHeatingGasMultiStageStageData() {} + + //@} + + static IddObjectType iddObjectType(); + + /** @name Getters */ + //@{ + + double gasBurnerEfficiency() const; + + boost::optional nominalCapacity() const; + + bool isNominalCapacityAutosized() const; + + double parasiticElectricLoad() const; + + //@} + /** @name Setters */ + //@{ + + bool setGasBurnerEfficiency(double GasBurnerEfficiency); + + bool setNominalCapacity(double StageNominalCapacity); + + void autosizeNominalCapacity(); + + void setParasiticElectricLoad(double StageParasiticElectricLoad); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + /// @cond + typedef detail::CoilHeatingGasMultiStageStageData_Impl ImplType; + + explicit CoilHeatingGasMultiStageStageData(std::shared_ptr impl); + + friend class detail::CoilHeatingGasMultiStageStageData_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.CoilHeatingGasMultiStageStageData"); +}; + +/** \relates CoilHeatingGasMultiStageStageData*/ +typedef boost::optional OptionalCoilHeatingGasMultiStageStageData; + +/** \relates CoilHeatingGasMultiStageStageData*/ +typedef std::vector CoilHeatingGasMultiStageStageDataVector; + +} // model +} // openstudio + +#endif // MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_HPP + diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStageStageData_Impl.hpp b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData_Impl.hpp new file mode 100644 index 00000000000..3c8d5275066 --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStageStageData_Impl.hpp @@ -0,0 +1,99 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_IMPL_HPP +#define MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_IMPL_HPP + +#include "ModelAPI.hpp" +#include "ModelObject_Impl.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + /** CoilHeatingGasMultiStageStageData_Impl is a ModelObject_Impl that is the implementation class for CoilHeatingGasMultiStageStageData.*/ + class MODEL_API CoilHeatingGasMultiStageStageData_Impl : public ModelObject_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + CoilHeatingGasMultiStageStageData_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + CoilHeatingGasMultiStageStageData_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + CoilHeatingGasMultiStageStageData_Impl(const CoilHeatingGasMultiStageStageData_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~CoilHeatingGasMultiStageStageData_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + //@} + /** @name Getters */ + //@{ + + double gasBurnerEfficiency() const; + + boost::optional nominalCapacity() const; + + bool isNominalCapacityAutosized() const; + + double parasiticElectricLoad() const; + + //@} + /** @name Setters */ + //@{ + + bool setGasBurnerEfficiency(double StageGasBurnerEfficiency); + + bool setNominalCapacity(boost::optional StageNominalCapacity); + + void autosizeNominalCapacity(); + + void setParasiticElectricLoad(double StageParasiticElectricLoad); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.CoilHeatingGasMultiStageStageData"); + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_COILHEATINGGASMULTISTAGESTAGEDATA_IMPL_HPP + diff --git a/openstudiocore/src/model/CoilHeatingGasMultiStage_Impl.hpp b/openstudiocore/src/model/CoilHeatingGasMultiStage_Impl.hpp new file mode 100644 index 00000000000..ee2e02b0a23 --- /dev/null +++ b/openstudiocore/src/model/CoilHeatingGasMultiStage_Impl.hpp @@ -0,0 +1,124 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_COILHEATINGGASMULTISTAGE_IMPL_HPP +#define MODEL_COILHEATINGGASMULTISTAGE_IMPL_HPP + +#include "ModelAPI.hpp" +#include "StraightComponent_Impl.hpp" + +namespace openstudio { +namespace model { + +class Schedule; +class Curve; +class CoilHeatingGasMultiStageStageData; + +namespace detail { + + /** CoilHeatingGasMultiStage_Impl is a StraightComponent_Impl that is the implementation class for CoilHeatingGasMultiStage.*/ + class MODEL_API CoilHeatingGasMultiStage_Impl : public StraightComponent_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + CoilHeatingGasMultiStage_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + CoilHeatingGasMultiStage_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + CoilHeatingGasMultiStage_Impl(const CoilHeatingGasMultiStage_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~CoilHeatingGasMultiStage_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + + //@} + /** @name Getters */ + //@{ + + boost::optional availabilitySchedule() const; + + boost::optional partLoadFractionCorrelationCurve() const; + + boost::optional parasiticGasLoad() const; + + //@} + /** @name Setters */ + //@{ + + bool setAvailabilitySchedule(Schedule& schedule); + + void resetAvailabilitySchedule(); + + bool setPartLoadFractionCorrelationCurve(const boost::optional& curve); + + void resetPartLoadFractionCorrelationCurve(); + + void setParasiticGasLoad(boost::optional parasiticGasLoad); + + void resetParasiticGasLoad(); + + //@} + /** @name Other */ + //@{ + + unsigned inletPort(); + + unsigned outletPort(); + + ModelObject clone(Model model) const; + + std::vector children() const; + + std::vector stages() const; + + void addStage(CoilHeatingGasMultiStageStageData& stage); + + boost::optional containingHVACComponent() const; + + bool addToNode(Node & node); + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.CoilHeatingGasMultiStage"); + + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_COILHEATINGGASMULTISTAGE_IMPL_HPP + diff --git a/openstudiocore/src/model/CoilHeatingWater.cpp b/openstudiocore/src/model/CoilHeatingWater.cpp index 71bc234d181..b2023aa11b2 100644 --- a/openstudiocore/src/model/CoilHeatingWater.cpp +++ b/openstudiocore/src/model/CoilHeatingWater.cpp @@ -35,6 +35,8 @@ #include "ZoneHVACUnitHeater_Impl.hpp" #include "AirLoopHVACUnitarySystem.hpp" #include "AirLoopHVACUnitarySystem_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" #include "Node.hpp" #include "Node_Impl.hpp" #include "ScheduleCompact.hpp" @@ -436,6 +438,23 @@ namespace detail{ } } + // AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed + { + auto systems = this->model().getConcreteModelObjects(); + + for( const auto & system : systems ) { + auto heatingCoil = system.heatingCoil(); + if( heatingCoil.handle() == this->handle() ) { + return system; + } + if( auto supHeatingCoil = system.supplementalHeatingCoil() ) { + if( supHeatingCoil->handle() == this->handle() ) { + return system; + } + } + } + } + return boost::none; } diff --git a/openstudiocore/src/model/ConcreteModelObjects.hpp b/openstudiocore/src/model/ConcreteModelObjects.hpp index 5fe64e9e99a..404ff856a8d 100644 --- a/openstudiocore/src/model/ConcreteModelObjects.hpp +++ b/openstudiocore/src/model/ConcreteModelObjects.hpp @@ -25,6 +25,7 @@ #include "AirLoopHVAC.hpp" #include "AirLoopHVACOutdoorAirSystem.hpp" #include "AirLoopHVACUnitaryHeatPumpAirToAir.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed.hpp" #include "AirLoopHVACReturnPlenum.hpp" #include "AirLoopHVACSupplyPlenum.hpp" #include "AirLoopHVACUnitarySystem.hpp" @@ -50,6 +51,8 @@ #include "ClimateZones.hpp" #include "ChillerElectricEIR.hpp" #include "CoilCoolingCooledBeam.hpp" +#include "CoilCoolingDXMultiSpeed.hpp" +#include "coilCoolingDXMultiSpeedStageData.hpp" #include "CoilCoolingDXSingleSpeed.hpp" #include "CoilCoolingDXTwoSpeed.hpp" #include "CoilCoolingDXVariableRefrigerantFlow.hpp" @@ -62,6 +65,8 @@ #include "CoilHeatingDXVariableRefrigerantFlow.hpp" #include "CoilHeatingElectric.hpp" #include "CoilHeatingGas.hpp" +#include "CoilHeatingGasMultiStage.hpp" +#include "CoilHeatingGasMultiStageStageData.hpp" #include "CoilHeatingLowTempRadiantConstFlow.hpp" #include "CoilHeatingLowTempRadiantVarFlow.hpp" #include "CoilHeatingWater.hpp" @@ -268,6 +273,7 @@ #include "ZoneAirHeatBalanceAlgorithm.hpp" #include "ZoneCapacitanceMultiplierResearchSpecial.hpp" #include "ZoneControlHumidistat.hpp" +#include "ZoneControlThermostatStagedDualSetpoint.hpp" #include "ZoneHVACBaseboardConvectiveElectric.hpp" #include "ZoneHVACBaseboardConvectiveWater.hpp" #include "ZoneHVACEquipmentList.hpp" @@ -287,6 +293,7 @@ #include "AirGap_Impl.hpp" #include "AirLoopHVAC_Impl.hpp" #include "AirLoopHVACUnitaryHeatPumpAirToAir_Impl.hpp" +#include "AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_Impl.hpp" #include "AirLoopHVACOutdoorAirSystem_Impl.hpp" #include "AirLoopHVACReturnPlenum_Impl.hpp" #include "AirLoopHVACSupplyPlenum_Impl.hpp" @@ -313,6 +320,8 @@ #include "ChillerElectricEIR_Impl.hpp" #include "ClimateZones_Impl.hpp" #include "CoilCoolingCooledBeam_Impl.hpp" +#include "CoilCoolingDXMultiSpeed_Impl.hpp" +#include "CoilCoolingDXMultiSpeedStageData_Impl.hpp" #include "CoilCoolingDXSingleSpeed_Impl.hpp" #include "CoilCoolingDXTwoSpeed_Impl.hpp" #include "CoilCoolingDXVariableRefrigerantFlow_Impl.hpp" @@ -325,6 +334,8 @@ #include "CoilHeatingDXVariableRefrigerantFlow_Impl.hpp" #include "CoilHeatingElectric_Impl.hpp" #include "CoilHeatingGas_Impl.hpp" +#include "CoilHeatingGasMultiStage_Impl.hpp" +#include "CoilHeatingGasMultiStageStageData_Impl.hpp" #include "CoilHeatingLowTempRadiantConstFlow_Impl.hpp" #include "CoilHeatingLowTempRadiantVarFlow_Impl.hpp" #include "CoilHeatingWater_Impl.hpp" @@ -531,6 +542,7 @@ #include "ZoneAirHeatBalanceAlgorithm_Impl.hpp" #include "ZoneCapacitanceMultiplierResearchSpecial_Impl.hpp" #include "ZoneControlHumidistat_Impl.hpp" +#include "ZoneControlThermostatStagedDualSetpoint_Impl.hpp" #include "ZoneHVACBaseboardConvectiveElectric_Impl.hpp" #include "ZoneHVACBaseboardConvectiveWater_Impl.hpp" #include "ZoneHVACEquipmentList_Impl.hpp" diff --git a/openstudiocore/src/model/Model.cpp b/openstudiocore/src/model/Model.cpp index 0dc92341ed4..e45757d9fb5 100644 --- a/openstudiocore/src/model/Model.cpp +++ b/openstudiocore/src/model/Model.cpp @@ -189,6 +189,7 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_CONSTRUCTOR(EvaporativeFluidCoolerSingleSpeed); REGISTER_CONSTRUCTOR(AirGap); REGISTER_CONSTRUCTOR(AirLoopHVAC); + REGISTER_CONSTRUCTOR(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed); REGISTER_CONSTRUCTOR(AirLoopHVACUnitaryHeatPumpAirToAir); REGISTER_CONSTRUCTOR(AirLoopHVACOutdoorAirSystem); REGISTER_CONSTRUCTOR(AirLoopHVACReturnPlenum); @@ -216,6 +217,8 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_CONSTRUCTOR(ChillerElectricEIR); REGISTER_CONSTRUCTOR(ClimateZones); REGISTER_CONSTRUCTOR(CoilCoolingCooledBeam); + REGISTER_CONSTRUCTOR(CoilCoolingDXMultiSpeed); + REGISTER_CONSTRUCTOR(CoilCoolingDXMultiSpeedStageData); REGISTER_CONSTRUCTOR(CoilCoolingDXSingleSpeed); REGISTER_CONSTRUCTOR(CoilCoolingDXTwoSpeed); REGISTER_CONSTRUCTOR(CoilCoolingDXVariableRefrigerantFlow); @@ -228,6 +231,8 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_CONSTRUCTOR(CoilHeatingDXVariableRefrigerantFlow); REGISTER_CONSTRUCTOR(CoilHeatingElectric); REGISTER_CONSTRUCTOR(CoilHeatingGas); + REGISTER_CONSTRUCTOR(CoilHeatingGasMultiStage); + REGISTER_CONSTRUCTOR(CoilHeatingGasMultiStageStageData); REGISTER_CONSTRUCTOR(CoilHeatingLowTempRadiantConstFlow); REGISTER_CONSTRUCTOR(CoilHeatingLowTempRadiantVarFlow); REGISTER_CONSTRUCTOR(CoilHeatingWater); @@ -432,6 +437,7 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_CONSTRUCTOR(ZoneAirHeatBalanceAlgorithm); REGISTER_CONSTRUCTOR(ZoneCapacitanceMultiplierResearchSpecial); REGISTER_CONSTRUCTOR(ZoneControlHumidistat); + REGISTER_CONSTRUCTOR(ZoneControlThermostatStagedDualSetpoint); REGISTER_CONSTRUCTOR(ZoneHVACEquipmentList); REGISTER_CONSTRUCTOR(ZoneHVACBaseboardConvectiveElectric); REGISTER_CONSTRUCTOR(ZoneHVACBaseboardConvectiveWater); @@ -485,6 +491,7 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_COPYCONSTRUCTORS(AirGap); REGISTER_COPYCONSTRUCTORS(AirLoopHVAC); REGISTER_COPYCONSTRUCTORS(AirLoopHVACUnitaryHeatPumpAirToAir); + REGISTER_COPYCONSTRUCTORS(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed); REGISTER_COPYCONSTRUCTORS(AirLoopHVACOutdoorAirSystem); REGISTER_COPYCONSTRUCTORS(AirLoopHVACReturnPlenum); REGISTER_COPYCONSTRUCTORS(AirLoopHVACSupplyPlenum); @@ -511,6 +518,8 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_COPYCONSTRUCTORS(ClimateZones); REGISTER_COPYCONSTRUCTORS(ChillerElectricEIR); REGISTER_COPYCONSTRUCTORS(CoilCoolingCooledBeam); + REGISTER_COPYCONSTRUCTORS(CoilCoolingDXMultiSpeed); + REGISTER_COPYCONSTRUCTORS(CoilCoolingDXMultiSpeedStageData); REGISTER_COPYCONSTRUCTORS(CoilCoolingDXSingleSpeed); REGISTER_COPYCONSTRUCTORS(CoilCoolingDXTwoSpeed); REGISTER_COPYCONSTRUCTORS(CoilCoolingDXVariableRefrigerantFlow); @@ -523,6 +532,8 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_COPYCONSTRUCTORS(CoilHeatingDXVariableRefrigerantFlow); REGISTER_COPYCONSTRUCTORS(CoilHeatingElectric); REGISTER_COPYCONSTRUCTORS(CoilHeatingGas); + REGISTER_COPYCONSTRUCTORS(CoilHeatingGasMultiStage); + REGISTER_COPYCONSTRUCTORS(CoilHeatingGasMultiStageStageData); REGISTER_COPYCONSTRUCTORS(CoilHeatingLowTempRadiantConstFlow); REGISTER_COPYCONSTRUCTORS(CoilHeatingLowTempRadiantVarFlow); REGISTER_COPYCONSTRUCTORS(CoilHeatingWater); @@ -727,6 +738,7 @@ if (_className::iddObjectType() == typeToCreate) { \ REGISTER_COPYCONSTRUCTORS(ZoneAirHeatBalanceAlgorithm); REGISTER_COPYCONSTRUCTORS(ZoneCapacitanceMultiplierResearchSpecial); REGISTER_COPYCONSTRUCTORS(ZoneControlHumidistat); + REGISTER_COPYCONSTRUCTORS(ZoneControlThermostatStagedDualSetpoint); REGISTER_COPYCONSTRUCTORS(ZoneHVACEquipmentList); REGISTER_COPYCONSTRUCTORS(ZoneHVACBaseboardConvectiveElectric); REGISTER_COPYCONSTRUCTORS(ZoneHVACBaseboardConvectiveWater); diff --git a/openstudiocore/src/model/ModelHVAC.i b/openstudiocore/src/model/ModelHVAC.i index 01a7a1a25b5..6f388a498b6 100644 --- a/openstudiocore/src/model/ModelHVAC.i +++ b/openstudiocore/src/model/ModelHVAC.i @@ -27,6 +27,7 @@ MODELOBJECT_TEMPLATES(PortList); MODELOBJECT_TEMPLATES(Loop); MODELOBJECT_TEMPLATES(ZoneHVACComponent); MODELOBJECT_TEMPLATES(ZoneHVACEquipmentList); +MODELOBJECT_TEMPLATES(Thermostat); MODELOBJECT_TEMPLATES(HVACComponent); MODELOBJECT_TEMPLATES(SetpointManager); MODELOBJECT_TEMPLATES(StraightComponent); @@ -39,6 +40,7 @@ MODELOBJECT_TEMPLATES(SizingSystem); MODELOBJECT_TEMPLATES(ThermalZone); MODELOBJECT_TEMPLATES(ThermostatSetpointDualSetpoint); MODELOBJECT_TEMPLATES(ZoneControlHumidistat); +MODELOBJECT_TEMPLATES(ZoneControlThermostatStagedDualSetpoint); MODELOBJECT_TEMPLATES(AirConditionerVariableRefrigerantFlow); MODELOBJECT_TEMPLATES(AirLoopHVAC); MODELOBJECT_TEMPLATES(SizingPlant); @@ -77,6 +79,8 @@ MODELOBJECT_TEMPLATES(BoilerSteam); MODELOBJECT_TEMPLATES(ChillerElectricEIR); MODELOBJECT_TEMPLATES(CoilCoolingCooledBeam); MODELOBJECT_TEMPLATES(CoilCoolingDXSingleSpeed); +MODELOBJECT_TEMPLATES(CoilCoolingDXMultiSpeed); +MODELOBJECT_TEMPLATES(CoilCoolingDXMultiSpeedStageData); MODELOBJECT_TEMPLATES(CoilCoolingDXTwoSpeed); MODELOBJECT_TEMPLATES(CoilCoolingDXVariableRefrigerantFlow); MODELOBJECT_TEMPLATES(CoilCoolingLowTempRadiantConstFlow); @@ -87,6 +91,8 @@ MODELOBJECT_TEMPLATES(CoilHeatingDXSingleSpeed); MODELOBJECT_TEMPLATES(CoilHeatingDXVariableRefrigerantFlow); MODELOBJECT_TEMPLATES(CoilHeatingElectric); MODELOBJECT_TEMPLATES(CoilHeatingGas); +MODELOBJECT_TEMPLATES(CoilHeatingGasMultiStage); +MODELOBJECT_TEMPLATES(CoilHeatingGasMultiStageStageData); MODELOBJECT_TEMPLATES(CoilHeatingLowTempRadiantConstFlow); MODELOBJECT_TEMPLATES(CoilHeatingLowTempRadiantVarFlow); MODELOBJECT_TEMPLATES(CoilWaterHeatingDesuperheater); @@ -108,6 +114,7 @@ MODELOBJECT_TEMPLATES(CoilHeatingWater); MODELOBJECT_TEMPLATES(CoilHeatingWaterToAirHeatPumpEquationFit); MODELOBJECT_TEMPLATES(CoilHeatingWaterBaseboard); MODELOBJECT_TEMPLATES(AirLoopHVACUnitaryHeatPumpAirToAir); +MODELOBJECT_TEMPLATES(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed); MODELOBJECT_TEMPLATES(AirLoopHVACUnitarySystem); MODELOBJECT_TEMPLATES(ZoneHVACBaseboardConvectiveElectric); MODELOBJECT_TEMPLATES(ZoneHVACBaseboardConvectiveWater); @@ -136,6 +143,7 @@ SWIG_MODELOBJECT(PortList, 1); SWIG_MODELOBJECT(Loop, 0); SWIG_MODELOBJECT(ZoneHVACComponent, 0); SWIG_MODELOBJECT(ZoneHVACEquipmentList, 1); +SWIG_MODELOBJECT(Thermostat, 0); SWIG_MODELOBJECT(HVACComponent, 0); SWIG_MODELOBJECT(SetpointManager, 0); SWIG_MODELOBJECT(StraightComponent, 0); @@ -148,6 +156,7 @@ SWIG_MODELOBJECT(SizingSystem, 1); SWIG_MODELOBJECT(ThermalZone, 1); SWIG_MODELOBJECT(ThermostatSetpointDualSetpoint, 1); SWIG_MODELOBJECT(ZoneControlHumidistat,1); +SWIG_MODELOBJECT(ZoneControlThermostatStagedDualSetpoint,1); SWIG_MODELOBJECT(AirConditionerVariableRefrigerantFlow, 1); SWIG_MODELOBJECT(AirLoopHVAC, 1); SWIG_MODELOBJECT(SizingPlant, 1); @@ -186,6 +195,8 @@ SWIG_MODELOBJECT(BoilerSteam, 1); SWIG_MODELOBJECT(ChillerElectricEIR, 1); SWIG_MODELOBJECT(CoilCoolingCooledBeam, 1); SWIG_MODELOBJECT(CoilCoolingDXSingleSpeed, 1); +SWIG_MODELOBJECT(CoilCoolingDXMultiSpeed, 1); +SWIG_MODELOBJECT(CoilCoolingDXMultiSpeedStageData, 1); SWIG_MODELOBJECT(CoilCoolingDXTwoSpeed, 1); SWIG_MODELOBJECT(CoilCoolingDXVariableRefrigerantFlow, 1); SWIG_MODELOBJECT(CoilCoolingLowTempRadiantConstFlow, 1); @@ -196,6 +207,8 @@ SWIG_MODELOBJECT(CoilHeatingDXSingleSpeed, 1); SWIG_MODELOBJECT(CoilHeatingDXVariableRefrigerantFlow, 1); SWIG_MODELOBJECT(CoilHeatingElectric, 1); SWIG_MODELOBJECT(CoilHeatingGas, 1); +SWIG_MODELOBJECT(CoilHeatingGasMultiStage, 1); +SWIG_MODELOBJECT(CoilHeatingGasMultiStageStageData, 1); SWIG_MODELOBJECT(CoilHeatingLowTempRadiantConstFlow, 1); SWIG_MODELOBJECT(CoilHeatingLowTempRadiantVarFlow, 1); SWIG_MODELOBJECT(CoilWaterHeatingDesuperheater, 1); @@ -217,6 +230,7 @@ SWIG_MODELOBJECT(CoilHeatingWater, 1); SWIG_MODELOBJECT(CoilHeatingWaterToAirHeatPumpEquationFit, 1); SWIG_MODELOBJECT(CoilHeatingWaterBaseboard, 1); SWIG_MODELOBJECT(AirLoopHVACUnitaryHeatPumpAirToAir, 1); +SWIG_MODELOBJECT(AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed, 1); SWIG_MODELOBJECT(AirLoopHVACUnitarySystem, 1); SWIG_MODELOBJECT(ZoneHVACBaseboardConvectiveElectric, 1); SWIG_MODELOBJECT(ZoneHVACBaseboardConvectiveWater, 1); diff --git a/openstudiocore/src/model/ScheduleTypeRegistry.cpp b/openstudiocore/src/model/ScheduleTypeRegistry.cpp index 0d884972d0a..f6ae21c637f 100644 --- a/openstudiocore/src/model/ScheduleTypeRegistry.cpp +++ b/openstudiocore/src/model/ScheduleTypeRegistry.cpp @@ -135,6 +135,8 @@ ScheduleTypeRegistrySingleton::ScheduleTypeRegistrySingleton() {"AirConditionerVariableRefrigerantFlow","Basin Heater Operating Schedule","basinHeaterOperatingSchedule",false,"Availability",0.0,1.0}, {"AirLoopHVACUnitaryHeatPumpAirToAir","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, {"AirLoopHVACUnitaryHeatPumpAirToAir","Supply Air Fan Operating Mode","supplyAirFanOperatingModeSchedule",false,"ControlMode",0.0,1.0}, + {"AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed","Availability Schedule","availabilitySchedule",false,"Availability",0.0,1.0}, + {"AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed","Supply Air Fan Operating Mode Schedule","supplyAirFanOperatingModeSchedule",false,"ControlMode",0.0,1.0}, {"AirLoopHVACUnitarySystem","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, {"AirLoopHVACUnitarySystem","Supply Air Fan Operating Mode","supplyAirFanOperatingModeSchedule",false,"ControlMode",0.0,1.0}, {"AirTerminalSingleDuctConstantVolumeCooledBeam","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, @@ -153,6 +155,8 @@ ScheduleTypeRegistrySingleton::ScheduleTypeRegistrySingleton() {"CoilCoolingDXSingleSpeed","Basin Heater Operation","basinHeaterOperatingSchedule",false,"Availability",0.0,1.0}, {"CoilCoolingDXTwoSpeed","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, {"CoilCoolingDXTwoSpeed","Basin Heater Operation","basinHeaterOperatingSchedule",false,"Availability",0.0,1.0}, + {"CoilCoolingDXMultiSpeed","Availability Schedule","availabilitySchedule",false,"Availability",0.0,1.0}, + {"CoilCoolingDXMultiSpeed","Basin Heater Operating Schedule","basinHeaterOperatingSchedule",false,"Availability",0.0,1.0}, {"CoilCoolingDXVariableRefrigerantFlow","Availability Schedule","availabilitySchedule",false,"Availability",0.0,1.0}, {"CoilCoolingLowTempRadiantConstFlow","Cooling High Water Temperature","coolingHighWaterTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"CoilCoolingLowTempRadiantConstFlow","Cooling Low Water Temperature","coolingLowWaterTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, @@ -165,6 +169,7 @@ ScheduleTypeRegistrySingleton::ScheduleTypeRegistrySingleton() {"CoilHeatingDXVariableRefrigerantFlow","Availability Schedule","availabilitySchedule",false,"Availability",0.0,1.0}, {"CoilHeatingElectric","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, {"CoilHeatingGas","Availability","availabilitySchedule",false,"Availability",0.0,1.0}, + {"CoilHeatingGasMultiStage","Availability Schedule","availabilitySchedule",false,"Availability",0.0,1.0}, {"CoilHeatingLowTempRadiantConstFlow","Heating High Water Temperature","heatingHighWaterTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"CoilHeatingLowTempRadiantConstFlow","Heating Low Water Temperature","heatingLowWaterTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"CoilHeatingLowTempRadiantConstFlow","Heating High Control Temperature","heatingHighControlTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, @@ -255,6 +260,8 @@ ScheduleTypeRegistrySingleton::ScheduleTypeRegistrySingleton() {"SteamEquipment","Steam Equipment","schedule",true,"",0.0,1.0}, {"ThermostatSetpointDualSetpoint","Heating Setpoint Temperature","heatingSetpointTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"ThermostatSetpointDualSetpoint","Cooling Setpoint Temperature","coolingSetpointTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, + {"ZoneControlThermostatStagedDualSetpoint","Heating Temperature Setpoint Schedule","heatingTemperatureSetpointSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, + {"ZoneControlThermostatStagedDualSetpoint","Cooling Temperature Setpoint Base Schedule","coolingTemperatureSetpointBaseSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"WaterHeaterMixed","Setpoint Temperature","setpointTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"WaterHeaterMixed","Ambient Temperature","ambientTemperatureSchedule",true,"Temperature",OptionalDouble(),OptionalDouble()}, {"WaterHeaterMixed","Use Flow Rate Fraction","useFlowRateFractionSchedule",true,"",0.0,1.0}, diff --git a/openstudiocore/src/model/ThermalZone.cpp b/openstudiocore/src/model/ThermalZone.cpp index 3fc46d9aeb6..62d7b2f2b91 100644 --- a/openstudiocore/src/model/ThermalZone.cpp +++ b/openstudiocore/src/model/ThermalZone.cpp @@ -65,6 +65,8 @@ #include "PortList_Impl.hpp" #include "AirLoopHVAC.hpp" #include "AirLoopHVAC_Impl.hpp" +#include "Thermostat.hpp" +#include "Thermostat_Impl.hpp" #include "ThermostatSetpointDualSetpoint.hpp" #include "ThermostatSetpointDualSetpoint_Impl.hpp" #include "ZoneControlHumidistat.hpp" @@ -154,6 +156,7 @@ namespace detail { { std::vector result; result.push_back(IddObjectType::OS_ThermostatSetpoint_DualSetpoint); + result.push_back(IddObjectType::OS_ZoneControl_Thermostat_StagedDualSetpoint); return result; } @@ -961,6 +964,7 @@ namespace detail { bool ThermalZone_Impl::setThermostatSetpointDualSetpoint(const ThermostatSetpointDualSetpoint & thermostat) { + resetThermostat(); return setPointer(OS_ThermalZoneFields::ThermostatName, thermostat.handle()); } @@ -974,6 +978,27 @@ namespace detail { setString(OS_ThermalZoneFields::ThermostatName, ""); } + boost::optional ThermalZone_Impl::thermostat() const + { + return getObject().getModelObjectTarget(OS_ThermalZoneFields::ThermostatName); + } + + bool ThermalZone_Impl::setThermostat(const Thermostat & thermostat) + { + resetThermostat(); + return setPointer(OS_ThermalZoneFields::ThermostatName, thermostat.handle()); + } + + void ThermalZone_Impl::resetThermostat() + { + if( boost::optional thermostat = this->thermostat() ) + { + thermostat->remove(); + } + + setString(OS_ThermalZoneFields::ThermostatName, ""); + } + boost::optional ThermalZone_Impl::zoneControlHumidistat() const { return getObject().getModelObjectTarget(OS_ThermalZoneFields::HumidistatName); @@ -2534,6 +2559,21 @@ void ThermalZone::resetThermostatSetpointDualSetpoint() getImpl()->resetThermostatSetpointDualSetpoint(); } +boost::optional ThermalZone::thermostat() const +{ + return getImpl()->thermostat(); +} + +bool ThermalZone::setThermostat(const Thermostat & thermostat) +{ + return getImpl()->setThermostat(thermostat); +} + +void ThermalZone::resetThermostat() +{ + getImpl()->resetThermostat(); +} + boost::optional ThermalZone::zoneControlHumidistat() const { return getImpl()->zoneControlHumidistat(); diff --git a/openstudiocore/src/model/ThermalZone.hpp b/openstudiocore/src/model/ThermalZone.hpp index ce074d0565b..6c0af7acf7e 100644 --- a/openstudiocore/src/model/ThermalZone.hpp +++ b/openstudiocore/src/model/ThermalZone.hpp @@ -35,6 +35,7 @@ class DaylightingControl; class IlluminanceMap; class RenderingColor; class ThermostatSetpointDualSetpoint; +class Thermostat; class ZoneControlHumidistat; class SizingZone; class PortList; @@ -92,6 +93,8 @@ class MODEL_API ThermalZone : public HVACComponent { std::string zoneConditioningEquipmentListName() const; + boost::optional thermostat() const; + boost::optional thermostatSetpointDualSetpoint() const; boost::optional zoneControlHumidistat() const; @@ -152,10 +155,16 @@ class MODEL_API ThermalZone : public HVACComponent { void setZoneConditioningEquipmentListName(std::string zoneConditioningEquipmentListName); + /** \deprecated */ bool setThermostatSetpointDualSetpoint(const ThermostatSetpointDualSetpoint & thermostat); + /** \deprecated */ void resetThermostatSetpointDualSetpoint(); + bool setThermostat(const Thermostat & thermostat); + + void resetThermostat(); + bool setZoneControlHumidistat(const ZoneControlHumidistat & humidistat); void resetZoneControlHumidistat(); diff --git a/openstudiocore/src/model/ThermalZone_Impl.hpp b/openstudiocore/src/model/ThermalZone_Impl.hpp index d7c2fba0118..c0b5fcf4ed5 100644 --- a/openstudiocore/src/model/ThermalZone_Impl.hpp +++ b/openstudiocore/src/model/ThermalZone_Impl.hpp @@ -35,6 +35,7 @@ class IlluminanceMap; class RenderingColor; class HVACTemplateZoneIdealLoadsAirSystem; class ThermostatSetpointDualSetpoint; +class Thermostat; class ZoneControlHumidistat; class ThermalZone; class SizingZone; @@ -173,6 +174,8 @@ namespace detail { boost::optional thermostatSetpointDualSetpoint() const; + boost::optional thermostat() const; + boost::optional zoneControlHumidistat() const; double fractionofZoneControlledbyPrimaryDaylightingControl() const; @@ -233,6 +236,10 @@ namespace detail { void resetThermostatSetpointDualSetpoint(); + bool setThermostat(const Thermostat& thermostat); + + void resetThermostat(); + bool setZoneControlHumidistat(const ZoneControlHumidistat & humidistat); void resetZoneControlHumidistat(); diff --git a/openstudiocore/src/model/Thermostat.cpp b/openstudiocore/src/model/Thermostat.cpp new file mode 100644 index 00000000000..de746577b98 --- /dev/null +++ b/openstudiocore/src/model/Thermostat.cpp @@ -0,0 +1,92 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "Thermostat.hpp" +#include "Thermostat_Impl.hpp" +#include "Model.hpp" +#include "Model_Impl.hpp" +#include "ThermalZone.hpp" +#include "ThermalZone_Impl.hpp" +#include "../utilities/core/Assert.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + Thermostat_Impl::Thermostat_Impl(IddObjectType type, Model_Impl* model) + : ModelObject_Impl(type,model) + { + } + + Thermostat_Impl::Thermostat_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : ModelObject_Impl(idfObject, model, keepHandle) + { + } + + Thermostat_Impl::Thermostat_Impl( + const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : ModelObject_Impl(other,model,keepHandle) + { + } + + Thermostat_Impl::Thermostat_Impl(const Thermostat_Impl& other, + Model_Impl* model, + bool keepHandles) + : ModelObject_Impl(other,model,keepHandles) + { + } + + boost::optional Thermostat_Impl::thermalZone() const + { + Handle h = handle(); + auto zones = model().getModelObjects(); + for( const auto & zone: zones ) { + if( zone.handle() == h ) { + return zone; + } + } + return boost::none; + } + +} // detail + +Thermostat::Thermostat(std::shared_ptr p) + : ModelObject(p) +{} + +Thermostat::Thermostat(IddObjectType type,const Model& model) + : ModelObject(type,model) +{ + OS_ASSERT(getImpl()); +} + +boost::optional Thermostat::thermalZone() const +{ + return getImpl()->thermalZone(); +} + +} // model + +} // openstudio + diff --git a/openstudiocore/src/model/Thermostat.hpp b/openstudiocore/src/model/Thermostat.hpp new file mode 100644 index 00000000000..1fbb7f342fd --- /dev/null +++ b/openstudiocore/src/model/Thermostat.hpp @@ -0,0 +1,69 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_THERMOSTAT_HPP +#define MODEL_THERMOSTAT_HPP + +#include "ModelAPI.hpp" +#include "ModelObject.hpp" + +namespace openstudio { + +namespace model { + +class ThermalZone; + +namespace detail { + class Thermostat_Impl; +}; + +/** Thermostat is the base class for all types of thermostats. + */ +class MODEL_API Thermostat : public ModelObject +{ + public: + + virtual ~Thermostat() {} + + boost::optional thermalZone() const; + + protected: + + Thermostat(IddObjectType type,const Model& model); + + typedef detail::Thermostat_Impl ImplType; + + friend class Model; + friend class openstudio::IdfObject; + friend class openstudio::detail::IdfObject_Impl; + explicit Thermostat(std::shared_ptr impl); + + private: + + REGISTER_LOGGER("openstudio.model.Thermostat"); + +}; + +typedef boost::optional OptionalThermostat; + +} // model +} // openstudio + +#endif // MODEL_THERMOSTAT_HPP + diff --git a/openstudiocore/src/model/ThermostatSetpointDualSetpoint.cpp b/openstudiocore/src/model/ThermostatSetpointDualSetpoint.cpp index 768157393e9..a84d8b6a52e 100644 --- a/openstudiocore/src/model/ThermostatSetpointDualSetpoint.cpp +++ b/openstudiocore/src/model/ThermostatSetpointDualSetpoint.cpp @@ -35,7 +35,7 @@ namespace detail { ThermostatSetpointDualSetpoint_Impl::ThermostatSetpointDualSetpoint_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle): - ModelObject_Impl(idfObject,model,keepHandle) + Thermostat_Impl(idfObject,model,keepHandle) { OS_ASSERT(idfObject.iddObject().type() == ThermostatSetpointDualSetpoint::iddObjectType()); } @@ -43,7 +43,7 @@ namespace detail { ThermostatSetpointDualSetpoint_Impl::ThermostatSetpointDualSetpoint_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle): - ModelObject_Impl(other,model,keepHandle) + Thermostat_Impl(other,model,keepHandle) { OS_ASSERT(other.iddObject().type() == ThermostatSetpointDualSetpoint::iddObjectType()); } @@ -52,7 +52,7 @@ namespace detail { ThermostatSetpointDualSetpoint_Impl::ThermostatSetpointDualSetpoint_Impl(const ThermostatSetpointDualSetpoint_Impl& other, Model_Impl* model, bool keepHandle): - ModelObject_Impl(other,model,keepHandle) + Thermostat_Impl(other,model,keepHandle) {} // Get all output variable names that could be associated with this object. @@ -174,13 +174,13 @@ namespace detail { } // detail ThermostatSetpointDualSetpoint::ThermostatSetpointDualSetpoint( const Model& model ): - ModelObject(ThermostatSetpointDualSetpoint::iddObjectType(),model) + Thermostat(ThermostatSetpointDualSetpoint::iddObjectType(),model) { OS_ASSERT(getImpl()); } ThermostatSetpointDualSetpoint::ThermostatSetpointDualSetpoint(std::shared_ptr impl): - ModelObject(impl) + Thermostat(impl) {} IddObjectType ThermostatSetpointDualSetpoint::iddObjectType() diff --git a/openstudiocore/src/model/ThermostatSetpointDualSetpoint.hpp b/openstudiocore/src/model/ThermostatSetpointDualSetpoint.hpp index 3d54aeff8d7..f1d184a875f 100644 --- a/openstudiocore/src/model/ThermostatSetpointDualSetpoint.hpp +++ b/openstudiocore/src/model/ThermostatSetpointDualSetpoint.hpp @@ -19,7 +19,7 @@ #ifndef MODEL_THERMOSTATSETPOINTDUALSETPOINT_HPP #define MODEL_THERMOSTATSETPOINTDUALSETPOINT_HPP -#include "ModelObject.hpp" +#include "Thermostat.hpp" namespace openstudio { namespace model { @@ -33,7 +33,7 @@ class Schedule; /** ThermostatSetpointDualSetpoint is a ModelObject that wraps the OpenStudio IDD object * 'OS:ThermostatSetpoint:DualSetpoint'. */ -class MODEL_API ThermostatSetpointDualSetpoint : public ModelObject { +class MODEL_API ThermostatSetpointDualSetpoint : public Thermostat { public: /** @name Constructors and Destructors */ //@{ diff --git a/openstudiocore/src/model/ThermostatSetpointDualSetpoint_Impl.hpp b/openstudiocore/src/model/ThermostatSetpointDualSetpoint_Impl.hpp index 61fdcfbb9b1..cdb91635529 100644 --- a/openstudiocore/src/model/ThermostatSetpointDualSetpoint_Impl.hpp +++ b/openstudiocore/src/model/ThermostatSetpointDualSetpoint_Impl.hpp @@ -19,7 +19,7 @@ #ifndef MODEL_THERMOSTATSETPOINTDUALSETPOINT_IMPL_HPP #define MODEL_THERMOSTATSETPOINTDUALSETPOINT_IMPL_HPP -#include "ModelObject_Impl.hpp" +#include "Thermostat_Impl.hpp" namespace openstudio { namespace model { @@ -27,7 +27,7 @@ namespace model { class Schedule; namespace detail { - class MODEL_API ThermostatSetpointDualSetpoint_Impl : public ModelObject_Impl { + class MODEL_API ThermostatSetpointDualSetpoint_Impl : public Thermostat_Impl { Q_OBJECT; Q_PROPERTY(boost::optional heatingSetpointTemperatureSchedule READ heatingSetpointTemperatureScheduleAsModelObject WRITE setHeatingSetpointTemperatureScheduleAsModelObject RESET resetHeatingSetpointTemperatureSchedule); diff --git a/openstudiocore/src/model/Thermostat_Impl.hpp b/openstudiocore/src/model/Thermostat_Impl.hpp new file mode 100644 index 00000000000..8ad61d4bf38 --- /dev/null +++ b/openstudiocore/src/model/Thermostat_Impl.hpp @@ -0,0 +1,65 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ +#ifndef MODEL_THERMOSTAT_IMPL_HPP +#define MODEL_THERMOSTAT_IMPL_HPP + + +#include "ModelObject_Impl.hpp" + +namespace openstudio { + +namespace model { + +class ThermalZone; + +namespace detail { + +class MODEL_API Thermostat_Impl : public ModelObject_Impl { + + public: + + Thermostat_Impl( IddObjectType type, Model_Impl* model); + + Thermostat_Impl( const IdfObject& idfObject, Model_Impl* model, bool keepHandle); + + Thermostat_Impl( const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle ); + + Thermostat_Impl( const Thermostat_Impl& other, Model_Impl* model, bool keepHandles ); + + boost::optional thermalZone() const; + + virtual ~Thermostat_Impl() {} + + protected: + + friend class Model_Impl; + + private: + + REGISTER_LOGGER("openstudio.model.Thermostat"); +}; + +} // detail + +} // model +} // openstudio + +#endif diff --git a/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.cpp b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.cpp new file mode 100644 index 00000000000..5e532cb3c83 --- /dev/null +++ b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.cpp @@ -0,0 +1,404 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include "ZoneControlThermostatStagedDualSetpoint.hpp" +#include "ZoneControlThermostatStagedDualSetpoint_Impl.hpp" +#include "Schedule.hpp" +#include "Schedule_Impl.hpp" +#include "ScheduleTypeLimits.hpp" +#include "ScheduleTypeRegistry.hpp" +#include +#include "../utilities/units/Unit.hpp" +#include "../utilities/core/Assert.hpp" + +namespace openstudio { +namespace model { + +namespace detail { + + ZoneControlThermostatStagedDualSetpoint_Impl::ZoneControlThermostatStagedDualSetpoint_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle) + : Thermostat_Impl(idfObject,model,keepHandle) + { + OS_ASSERT(idfObject.iddObject().type() == ZoneControlThermostatStagedDualSetpoint::iddObjectType()); + } + + ZoneControlThermostatStagedDualSetpoint_Impl::ZoneControlThermostatStagedDualSetpoint_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle) + : Thermostat_Impl(other,model,keepHandle) + { + OS_ASSERT(other.iddObject().type() == ZoneControlThermostatStagedDualSetpoint::iddObjectType()); + } + + ZoneControlThermostatStagedDualSetpoint_Impl::ZoneControlThermostatStagedDualSetpoint_Impl(const ZoneControlThermostatStagedDualSetpoint_Impl& other, + Model_Impl* model, + bool keepHandle) + : Thermostat_Impl(other,model,keepHandle) + {} + + const std::vector& ZoneControlThermostatStagedDualSetpoint_Impl::outputVariableNames() const + { + static std::vector result; + if (result.empty()){ + } + return result; + } + + IddObjectType ZoneControlThermostatStagedDualSetpoint_Impl::iddObjectType() const { + return ZoneControlThermostatStagedDualSetpoint::iddObjectType(); + } + + std::vector ZoneControlThermostatStagedDualSetpoint_Impl::getScheduleTypeKeys(const Schedule& schedule) const + { + std::vector result; + UnsignedVector fieldIndices = getSourceIndices(schedule.handle()); + UnsignedVector::const_iterator b(fieldIndices.begin()), e(fieldIndices.end()); + if (std::find(b,e,OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingTemperatureSetpointSchedule) != e) + { + result.push_back(ScheduleTypeKey("ZoneControlThermostatStagedDualSetpoint","Heating Temperature Setpoint Schedule")); + } + if (std::find(b,e,OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingTemperatureSetpointBaseSchedule) != e) + { + result.push_back(ScheduleTypeKey("ZoneControlThermostatStagedDualSetpoint","Cooling Temperature Setpoint Base Schedule")); + } + return result; + } + + int ZoneControlThermostatStagedDualSetpoint_Impl::numberofHeatingStages() const { + boost::optional value = getInt(OS_ZoneControl_Thermostat_StagedDualSetpointFields::NumberofHeatingStages,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional ZoneControlThermostatStagedDualSetpoint_Impl::heatingTemperatureSetpointSchedule() const { + return getObject().getModelObjectTarget(OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingTemperatureSetpointSchedule); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::heatingThrottlingTemperatureRange() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingThrottlingTemperatureRange,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage1HeatingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage1HeatingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage2HeatingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage2HeatingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage3HeatingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage3HeatingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage4HeatingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage4HeatingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + int ZoneControlThermostatStagedDualSetpoint_Impl::numberofCoolingStages() const { + boost::optional value = getInt(OS_ZoneControl_Thermostat_StagedDualSetpointFields::NumberofCoolingStages,true); + OS_ASSERT(value); + return value.get(); + } + + boost::optional ZoneControlThermostatStagedDualSetpoint_Impl::coolingTemperatureSetpointBaseSchedule() const { + return getObject().getModelObjectTarget(OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingTemperatureSetpointBaseSchedule); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::coolingThrottlingTemperatureRange() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingThrottlingTemperatureRange,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage1CoolingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage1CoolingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage2CoolingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage2CoolingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage3CoolingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage3CoolingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + double ZoneControlThermostatStagedDualSetpoint_Impl::stage4CoolingTemperatureOffset() const { + boost::optional value = getDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage4CoolingTemperatureOffset,true); + OS_ASSERT(value); + return value.get(); + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setNumberofHeatingStages(int numberofHeatingStages) { + bool result = setInt(OS_ZoneControl_Thermostat_StagedDualSetpointFields::NumberofHeatingStages, numberofHeatingStages); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setHeatingTemperatureSetpointSchedule(Schedule& schedule) { + bool result = setSchedule(OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingTemperatureSetpointSchedule, + "ZoneControlThermostatStagedDualSetpoint", + "Heating Temperature Setpoint Schedule", + schedule); + return result; + } + + void ZoneControlThermostatStagedDualSetpoint_Impl::resetHeatingTemperatureSetpointSchedule() { + bool result = setString(OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingTemperatureSetpointSchedule, ""); + OS_ASSERT(result); + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setHeatingThrottlingTemperatureRange(double heatingThrottlingTemperatureRange) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::HeatingThrottlingTemperatureRange, heatingThrottlingTemperatureRange); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage1HeatingTemperatureOffset(double stage1HeatingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage1HeatingTemperatureOffset, stage1HeatingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage2HeatingTemperatureOffset(double stage2HeatingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage2HeatingTemperatureOffset, stage2HeatingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage3HeatingTemperatureOffset(double stage3HeatingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage3HeatingTemperatureOffset, stage3HeatingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage4HeatingTemperatureOffset(double stage4HeatingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage4HeatingTemperatureOffset, stage4HeatingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setNumberofCoolingStages(int numberofCoolingStages) { + bool result = setInt(OS_ZoneControl_Thermostat_StagedDualSetpointFields::NumberofCoolingStages, numberofCoolingStages); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setCoolingTemperatureSetpointBaseSchedule(Schedule& schedule) { + bool result = setSchedule(OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingTemperatureSetpointBaseSchedule, + "ZoneControlThermostatStagedDualSetpoint", + "Cooling Temperature Setpoint Base Schedule", + schedule); + return result; + } + + void ZoneControlThermostatStagedDualSetpoint_Impl::resetCoolingTemperatureSetpointBaseSchedule() { + bool result = setString(OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingTemperatureSetpointBaseSchedule, ""); + OS_ASSERT(result); + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setCoolingThrottlingTemperatureRange(double coolingThrottlingTemperatureRange) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::CoolingThrottlingTemperatureRange, coolingThrottlingTemperatureRange); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage1CoolingTemperatureOffset(double stage1CoolingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage1CoolingTemperatureOffset, stage1CoolingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage2CoolingTemperatureOffset(double stage2CoolingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage2CoolingTemperatureOffset, stage2CoolingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage3CoolingTemperatureOffset(double stage3CoolingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage3CoolingTemperatureOffset, stage3CoolingTemperatureOffset); + return result; + } + + bool ZoneControlThermostatStagedDualSetpoint_Impl::setStage4CoolingTemperatureOffset(double stage4CoolingTemperatureOffset) { + bool result = setDouble(OS_ZoneControl_Thermostat_StagedDualSetpointFields::Stage4CoolingTemperatureOffset, stage4CoolingTemperatureOffset); + return result; + } + +} // detail + +ZoneControlThermostatStagedDualSetpoint::ZoneControlThermostatStagedDualSetpoint(const Model& model) + : Thermostat(ZoneControlThermostatStagedDualSetpoint::iddObjectType(),model) +{ + OS_ASSERT(getImpl()); + + setNumberofHeatingStages(2); + setHeatingThrottlingTemperatureRange(1.1); + setStage1HeatingTemperatureOffset(0.0); + setStage2HeatingTemperatureOffset(-0.5); + setStage3HeatingTemperatureOffset(-1.0); + setStage4HeatingTemperatureOffset(-1.5); + setNumberofCoolingStages(4); + setCoolingThrottlingTemperatureRange(1.1); + setStage1CoolingTemperatureOffset(0.0); + setStage2CoolingTemperatureOffset(1.0); + setStage3CoolingTemperatureOffset(2.0); + setStage4CoolingTemperatureOffset(3.0); +} + +IddObjectType ZoneControlThermostatStagedDualSetpoint::iddObjectType() { + return IddObjectType(IddObjectType::OS_ZoneControl_Thermostat_StagedDualSetpoint); +} + +int ZoneControlThermostatStagedDualSetpoint::numberofHeatingStages() const { + return getImpl()->numberofHeatingStages(); +} + +boost::optional ZoneControlThermostatStagedDualSetpoint::heatingTemperatureSetpointSchedule() const { + return getImpl()->heatingTemperatureSetpointSchedule(); +} + +double ZoneControlThermostatStagedDualSetpoint::heatingThrottlingTemperatureRange() const { + return getImpl()->heatingThrottlingTemperatureRange(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage1HeatingTemperatureOffset() const { + return getImpl()->stage1HeatingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage2HeatingTemperatureOffset() const { + return getImpl()->stage2HeatingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage3HeatingTemperatureOffset() const { + return getImpl()->stage3HeatingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage4HeatingTemperatureOffset() const { + return getImpl()->stage4HeatingTemperatureOffset(); +} + +int ZoneControlThermostatStagedDualSetpoint::numberofCoolingStages() const { + return getImpl()->numberofCoolingStages(); +} + +boost::optional ZoneControlThermostatStagedDualSetpoint::coolingTemperatureSetpointBaseSchedule() const { + return getImpl()->coolingTemperatureSetpointBaseSchedule(); +} + +double ZoneControlThermostatStagedDualSetpoint::coolingThrottlingTemperatureRange() const { + return getImpl()->coolingThrottlingTemperatureRange(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage1CoolingTemperatureOffset() const { + return getImpl()->stage1CoolingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage2CoolingTemperatureOffset() const { + return getImpl()->stage2CoolingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage3CoolingTemperatureOffset() const { + return getImpl()->stage3CoolingTemperatureOffset(); +} + +double ZoneControlThermostatStagedDualSetpoint::stage4CoolingTemperatureOffset() const { + return getImpl()->stage4CoolingTemperatureOffset(); +} + +bool ZoneControlThermostatStagedDualSetpoint::setNumberofHeatingStages(int numberofHeatingStages) { + return getImpl()->setNumberofHeatingStages(numberofHeatingStages); +} + +bool ZoneControlThermostatStagedDualSetpoint::setHeatingTemperatureSetpointSchedule(Schedule& schedule) { + return getImpl()->setHeatingTemperatureSetpointSchedule(schedule); +} + +void ZoneControlThermostatStagedDualSetpoint::resetHeatingTemperatureSetpointSchedule() { + getImpl()->resetHeatingTemperatureSetpointSchedule(); +} + +bool ZoneControlThermostatStagedDualSetpoint::setHeatingThrottlingTemperatureRange(double heatingThrottlingTemperatureRange) { + return getImpl()->setHeatingThrottlingTemperatureRange(heatingThrottlingTemperatureRange); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage1HeatingTemperatureOffset(double stage1HeatingTemperatureOffset) { + return getImpl()->setStage1HeatingTemperatureOffset(stage1HeatingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage2HeatingTemperatureOffset(double stage2HeatingTemperatureOffset) { + return getImpl()->setStage2HeatingTemperatureOffset(stage2HeatingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage3HeatingTemperatureOffset(double stage3HeatingTemperatureOffset) { + return getImpl()->setStage3HeatingTemperatureOffset(stage3HeatingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage4HeatingTemperatureOffset(double stage4HeatingTemperatureOffset) { + return getImpl()->setStage4HeatingTemperatureOffset(stage4HeatingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setNumberofCoolingStages(int numberofCoolingStages) { + return getImpl()->setNumberofCoolingStages(numberofCoolingStages); +} + +bool ZoneControlThermostatStagedDualSetpoint::setCoolingTemperatureSetpointBaseSchedule(Schedule& schedule) { + return getImpl()->setCoolingTemperatureSetpointBaseSchedule(schedule); +} + +void ZoneControlThermostatStagedDualSetpoint::resetCoolingTemperatureSetpointBaseSchedule() { + getImpl()->resetCoolingTemperatureSetpointBaseSchedule(); +} + +bool ZoneControlThermostatStagedDualSetpoint::setCoolingThrottlingTemperatureRange(double coolingThrottlingTemperatureRange) { + return getImpl()->setCoolingThrottlingTemperatureRange(coolingThrottlingTemperatureRange); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage1CoolingTemperatureOffset(double stage1CoolingTemperatureOffset) { + return getImpl()->setStage1CoolingTemperatureOffset(stage1CoolingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage2CoolingTemperatureOffset(double stage2CoolingTemperatureOffset) { + return getImpl()->setStage2CoolingTemperatureOffset(stage2CoolingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage3CoolingTemperatureOffset(double stage3CoolingTemperatureOffset) { + return getImpl()->setStage3CoolingTemperatureOffset(stage3CoolingTemperatureOffset); +} + +bool ZoneControlThermostatStagedDualSetpoint::setStage4CoolingTemperatureOffset(double stage4CoolingTemperatureOffset) { + return getImpl()->setStage4CoolingTemperatureOffset(stage4CoolingTemperatureOffset); +} + +/// @cond +ZoneControlThermostatStagedDualSetpoint::ZoneControlThermostatStagedDualSetpoint(std::shared_ptr impl) + : Thermostat(impl) +{} +/// @endcond + +} // model +} // openstudio + diff --git a/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.hpp b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.hpp new file mode 100644 index 00000000000..eb9cc37286c --- /dev/null +++ b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint.hpp @@ -0,0 +1,149 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_HPP +#define MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_HPP + +#include "ModelAPI.hpp" +#include "Thermostat.hpp" + +namespace openstudio { + +namespace model { + +class Schedule; + +namespace detail { + + class ZoneControlThermostatStagedDualSetpoint_Impl; + +} // detail + +/** ZoneControlThermostatStagedDualSetpoint is a ModelObject that wraps the OpenStudio IDD object 'OS:ZoneControl:Thermostat:StagedDualSetpoint'. */ +class MODEL_API ZoneControlThermostatStagedDualSetpoint : public Thermostat { + public: + /** @name Constructors and Destructors */ + //@{ + + explicit ZoneControlThermostatStagedDualSetpoint(const Model& model); + + virtual ~ZoneControlThermostatStagedDualSetpoint() {} + + //@} + + static IddObjectType iddObjectType(); + + /** @name Getters */ + //@{ + + int numberofHeatingStages() const; + + boost::optional heatingTemperatureSetpointSchedule() const; + + double heatingThrottlingTemperatureRange() const; + + double stage1HeatingTemperatureOffset() const; + + double stage2HeatingTemperatureOffset() const; + + double stage3HeatingTemperatureOffset() const; + + double stage4HeatingTemperatureOffset() const; + + int numberofCoolingStages() const; + + boost::optional coolingTemperatureSetpointBaseSchedule() const; + + double coolingThrottlingTemperatureRange() const; + + double stage1CoolingTemperatureOffset() const; + + double stage2CoolingTemperatureOffset() const; + + double stage3CoolingTemperatureOffset() const; + + double stage4CoolingTemperatureOffset() const; + + //@} + /** @name Setters */ + //@{ + + bool setNumberofHeatingStages(int numberofHeatingStages); + + bool setHeatingTemperatureSetpointSchedule(Schedule& schedule); + + void resetHeatingTemperatureSetpointSchedule(); + + bool setHeatingThrottlingTemperatureRange(double heatingThrottlingTemperatureRange); + + bool setStage1HeatingTemperatureOffset(double stage1HeatingTemperatureOffset); + + bool setStage2HeatingTemperatureOffset(double stage2HeatingTemperatureOffset); + + bool setStage3HeatingTemperatureOffset(double stage3HeatingTemperatureOffset); + + bool setStage4HeatingTemperatureOffset(double stage4HeatingTemperatureOffset); + + bool setNumberofCoolingStages(int numberofCoolingStages); + + bool setCoolingTemperatureSetpointBaseSchedule(Schedule& schedule); + + void resetCoolingTemperatureSetpointBaseSchedule(); + + bool setCoolingThrottlingTemperatureRange(double coolingThrottlingTemperatureRange); + + bool setStage1CoolingTemperatureOffset(double stage1CoolingTemperatureOffset); + + bool setStage2CoolingTemperatureOffset(double stage2CoolingTemperatureOffset); + + bool setStage3CoolingTemperatureOffset(double stage3CoolingTemperatureOffset); + + bool setStage4CoolingTemperatureOffset(double stage4CoolingTemperatureOffset); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + /// @cond + typedef detail::ZoneControlThermostatStagedDualSetpoint_Impl ImplType; + + explicit ZoneControlThermostatStagedDualSetpoint(std::shared_ptr impl); + + friend class detail::ZoneControlThermostatStagedDualSetpoint_Impl; + friend class Model; + friend class IdfObject; + friend class openstudio::detail::IdfObject_Impl; + /// @endcond + private: + REGISTER_LOGGER("openstudio.model.ZoneControlThermostatStagedDualSetpoint"); +}; + +/** \relates ZoneControlThermostatStagedDualSetpoint*/ +typedef boost::optional OptionalZoneControlThermostatStagedDualSetpoint; + +/** \relates ZoneControlThermostatStagedDualSetpoint*/ +typedef std::vector ZoneControlThermostatStagedDualSetpointVector; + +} // model +} // openstudio + +#endif // MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_HPP + diff --git a/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint_Impl.hpp b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint_Impl.hpp new file mode 100644 index 00000000000..18cf37c333d --- /dev/null +++ b/openstudiocore/src/model/ZoneControlThermostatStagedDualSetpoint_Impl.hpp @@ -0,0 +1,147 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#ifndef MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_IMPL_HPP +#define MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_IMPL_HPP + +#include +#include + +namespace openstudio { +namespace model { + +class Schedule; + +namespace detail { + + /** ZoneControlThermostatStagedDualSetpoint_Impl is a ModelObject_Impl that is the implementation class for ZoneControlThermostatStagedDualSetpoint.*/ + class MODEL_API ZoneControlThermostatStagedDualSetpoint_Impl : public Thermostat_Impl { + public: + /** @name Constructors and Destructors */ + //@{ + + ZoneControlThermostatStagedDualSetpoint_Impl(const IdfObject& idfObject, + Model_Impl* model, + bool keepHandle); + + ZoneControlThermostatStagedDualSetpoint_Impl(const openstudio::detail::WorkspaceObject_Impl& other, + Model_Impl* model, + bool keepHandle); + + ZoneControlThermostatStagedDualSetpoint_Impl(const ZoneControlThermostatStagedDualSetpoint_Impl& other, + Model_Impl* model, + bool keepHandle); + + virtual ~ZoneControlThermostatStagedDualSetpoint_Impl() {} + + //@} + /** @name Virtual Methods */ + //@{ + + virtual const std::vector& outputVariableNames() const; + + virtual IddObjectType iddObjectType() const; + + virtual std::vector getScheduleTypeKeys(const Schedule& schedule) const; + + //@} + /** @name Getters */ + //@{ + + int numberofHeatingStages() const; + + boost::optional heatingTemperatureSetpointSchedule() const; + + double heatingThrottlingTemperatureRange() const; + + double stage1HeatingTemperatureOffset() const; + + double stage2HeatingTemperatureOffset() const; + + double stage3HeatingTemperatureOffset() const; + + double stage4HeatingTemperatureOffset() const; + + int numberofCoolingStages() const; + + boost::optional coolingTemperatureSetpointBaseSchedule() const; + + double coolingThrottlingTemperatureRange() const; + + double stage1CoolingTemperatureOffset() const; + + double stage2CoolingTemperatureOffset() const; + + double stage3CoolingTemperatureOffset() const; + + double stage4CoolingTemperatureOffset() const; + + //@} + /** @name Setters */ + //@{ + + bool setNumberofHeatingStages(int numberofHeatingStages); + + bool setHeatingTemperatureSetpointSchedule(Schedule& schedule); + + void resetHeatingTemperatureSetpointSchedule(); + + bool setHeatingThrottlingTemperatureRange(double heatingThrottlingTemperatureRange); + + bool setStage1HeatingTemperatureOffset(double stage1HeatingTemperatureOffset); + + bool setStage2HeatingTemperatureOffset(double stage2HeatingTemperatureOffset); + + bool setStage3HeatingTemperatureOffset(double stage3HeatingTemperatureOffset); + + bool setStage4HeatingTemperatureOffset(double stage4HeatingTemperatureOffset); + + bool setNumberofCoolingStages(int numberofCoolingStages); + + bool setCoolingTemperatureSetpointBaseSchedule(Schedule& schedule); + + void resetCoolingTemperatureSetpointBaseSchedule(); + + bool setCoolingThrottlingTemperatureRange(double coolingThrottlingTemperatureRange); + + bool setStage1CoolingTemperatureOffset(double stage1CoolingTemperatureOffset); + + bool setStage2CoolingTemperatureOffset(double stage2CoolingTemperatureOffset); + + bool setStage3CoolingTemperatureOffset(double stage3CoolingTemperatureOffset); + + bool setStage4CoolingTemperatureOffset(double stage4CoolingTemperatureOffset); + + //@} + /** @name Other */ + //@{ + + //@} + protected: + private: + REGISTER_LOGGER("openstudio.model.ZoneControlThermostatStagedDualSetpoint"); + }; + +} // detail + +} // model +} // openstudio + +#endif // MODEL_ZONECONTROLTHERMOSTATSTAGEDDUALSETPOINT_IMPL_HPP + diff --git a/openstudiocore/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp b/openstudiocore/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp new file mode 100644 index 00000000000..3869dbdebf1 --- /dev/null +++ b/openstudiocore/src/model/test/AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed_GTest.cpp @@ -0,0 +1,29 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include + +#include + +#include +#include + +using namespace openstudio; +using namespace openstudio::model; + diff --git a/openstudiocore/src/model/test/CoilCoolingDXMultiSpeedStageData_GTest.cpp b/openstudiocore/src/model/test/CoilCoolingDXMultiSpeedStageData_GTest.cpp new file mode 100644 index 00000000000..d4a5f8d8fe6 --- /dev/null +++ b/openstudiocore/src/model/test/CoilCoolingDXMultiSpeedStageData_GTest.cpp @@ -0,0 +1,29 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include + +#include + +#include +#include + +using namespace openstudio; +using namespace openstudio::model; + diff --git a/openstudiocore/src/model/test/CoilCoolingDXMultiSpeed_GTest.cpp b/openstudiocore/src/model/test/CoilCoolingDXMultiSpeed_GTest.cpp new file mode 100644 index 00000000000..43253744a2e --- /dev/null +++ b/openstudiocore/src/model/test/CoilCoolingDXMultiSpeed_GTest.cpp @@ -0,0 +1,119 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace openstudio; +using namespace openstudio::model; + +CoilCoolingDXMultiSpeedStageData makeStage(Model & model) { + CurveBiquadratic cooling_curve_1(model); + cooling_curve_1.setCoefficient1Constant(0.766956); + cooling_curve_1.setCoefficient2x(0.0107756); + cooling_curve_1.setCoefficient3xPOW2(-0.0000414703); + cooling_curve_1.setCoefficient4y(0.00134961); + cooling_curve_1.setCoefficient5yPOW2(-0.000261144); + cooling_curve_1.setCoefficient6xTIMESY(0.000457488); + cooling_curve_1.setMinimumValueofx(17.0); + cooling_curve_1.setMaximumValueofx(22.0); + cooling_curve_1.setMinimumValueofy(13.0); + cooling_curve_1.setMaximumValueofy(46.0); + + CurveQuadratic cooling_curve_2(model); + cooling_curve_2.setCoefficient1Constant(0.8); + cooling_curve_2.setCoefficient2x(0.2); + cooling_curve_2.setCoefficient3xPOW2(0.0); + cooling_curve_2.setMinimumValueofx(0.5); + cooling_curve_2.setMaximumValueofx(1.5); + + CurveBiquadratic cooling_curve_3(model); + cooling_curve_3.setCoefficient1Constant(0.297145); + cooling_curve_3.setCoefficient2x(0.0430933); + cooling_curve_3.setCoefficient3xPOW2(-0.000748766); + cooling_curve_3.setCoefficient4y(0.00597727); + cooling_curve_3.setCoefficient5yPOW2(0.000482112); + cooling_curve_3.setCoefficient6xTIMESY(-0.000956448); + cooling_curve_3.setMinimumValueofx(17.0); + cooling_curve_3.setMaximumValueofx(22.0); + cooling_curve_3.setMinimumValueofy(13.0); + cooling_curve_3.setMaximumValueofy(46.0); + + CurveQuadratic cooling_curve_4(model); + cooling_curve_4.setCoefficient1Constant(1.156); + cooling_curve_4.setCoefficient2x(-0.1816); + cooling_curve_4.setCoefficient3xPOW2(0.0256); + cooling_curve_4.setMinimumValueofx(0.5); + cooling_curve_4.setMaximumValueofx(1.5); + + CurveQuadratic cooling_curve_5(model); + cooling_curve_5.setCoefficient1Constant(0.75); + cooling_curve_5.setCoefficient2x(0.25); + cooling_curve_5.setCoefficient3xPOW2(0.0); + cooling_curve_5.setMinimumValueofx(0.0); + cooling_curve_5.setMaximumValueofx(1.0); + + CoilCoolingDXMultiSpeedStageData stage(model, + cooling_curve_1, + cooling_curve_2, + cooling_curve_3, + cooling_curve_4, + cooling_curve_5); + + return stage; +} + +TEST_F(ModelFixture, CoilCoolingDXMultiSpeed_DefaultConstructors) +{ + ::testing::FLAGS_gtest_death_test_style = "threadsafe"; + + ASSERT_EXIT ( + { + Model m; + CoilCoolingDXMultiSpeed coil(m); + + exit(0); + } , + ::testing::ExitedWithCode(0), "" ); +} + +TEST_F(ModelFixture, CoilCoolingDXMultiSpeed_Stages) +{ + Model m; + CoilCoolingDXMultiSpeed coil(m); + + auto stage1 = makeStage(m); + coil.addStage(stage1); + + auto stage2 = makeStage(m); + coil.addStage(stage2); + + ASSERT_EQ(2u,coil.stages().size()); + +} + + diff --git a/openstudiocore/src/model/test/CoilHeatingGasMultiStageStageData_GTest.cpp b/openstudiocore/src/model/test/CoilHeatingGasMultiStageStageData_GTest.cpp new file mode 100644 index 00000000000..98d19b3a481 --- /dev/null +++ b/openstudiocore/src/model/test/CoilHeatingGasMultiStageStageData_GTest.cpp @@ -0,0 +1,29 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include + +#include + +#include +#include + +using namespace openstudio; +using namespace openstudio::model; + diff --git a/openstudiocore/src/model/test/CoilHeatingGasMultiStage_GTest.cpp b/openstudiocore/src/model/test/CoilHeatingGasMultiStage_GTest.cpp new file mode 100644 index 00000000000..0dfd5c4f677 --- /dev/null +++ b/openstudiocore/src/model/test/CoilHeatingGasMultiStage_GTest.cpp @@ -0,0 +1,29 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include + +#include + +#include +#include + +using namespace openstudio; +using namespace openstudio::model; + diff --git a/openstudiocore/src/model/test/ZoneControlThermostatStagedDualSetpoint_GTest.cpp b/openstudiocore/src/model/test/ZoneControlThermostatStagedDualSetpoint_GTest.cpp new file mode 100644 index 00000000000..3cb378c675a --- /dev/null +++ b/openstudiocore/src/model/test/ZoneControlThermostatStagedDualSetpoint_GTest.cpp @@ -0,0 +1,29 @@ +/********************************************************************** + * Copyright (c) 2008-2014, Alliance for Sustainable Energy. + * All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + **********************************************************************/ + +#include + +#include + +#include +#include + +using namespace openstudio; +using namespace openstudio::model; +