-
Notifications
You must be signed in to change notification settings - Fork 192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZoneHVAC:*: new Design Specification Multispeed Object fields #4964
base: develop
Are you sure you want to change the base?
Changes from all commits
5cafd02
aab22b6
3580d6f
23f16fa
b0b9add
f7db3c1
4cf55c5
f754205
d79407a
bb209bb
2e1fd84
d036c67
6f8f111
546dd32
8a869a1
0e48fed
268eb05
ff2593b
2aa530f
ea58fd9
98ccc33
58b3c9b
c347caf
592f486
7cecbc9
73f1545
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ | |
#include "../../model/UnitarySystemPerformanceMultispeed_Impl.hpp" | ||
#include "../../model/AirLoopHVACUnitarySystem.hpp" | ||
#include "../../model/AirLoopHVACUnitarySystem_Impl.hpp" | ||
#include "../../model/ZoneHVACTerminalUnitVariableRefrigerantFlow.hpp" | ||
#include "../../model/ZoneHVACTerminalUnitVariableRefrigerantFlow_Impl.hpp" | ||
#include "../../model/ZoneHVACWaterToAirHeatPump.hpp" | ||
#include "../../model/ZoneHVACWaterToAirHeatPump_Impl.hpp" | ||
#include "../../model/CoilHeatingDXMultiSpeed.hpp" | ||
#include "../../model/CoilHeatingDXMultiSpeed_Impl.hpp" | ||
#include "../../model/CoilHeatingDXMultiSpeedStageData.hpp" | ||
|
@@ -19,10 +23,26 @@ | |
#include "../../model/CoilHeatingGasMultiStage_Impl.hpp" | ||
#include "../../model/CoilHeatingGasMultiStageStageData.hpp" | ||
#include "../../model/CoilHeatingGasMultiStageStageData_Impl.hpp" | ||
#include "../../model/CoilHeatingDXVariableSpeed.hpp" | ||
#include "../../model/CoilHeatingDXVariableSpeed_Impl.hpp" | ||
#include "../../model/CoilHeatingDXVariableSpeedSpeedData.hpp" | ||
#include "../../model/CoilHeatingDXVariableSpeedSpeedData_Impl.hpp" | ||
#include "../../model/CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit.hpp" | ||
#include "../../model/CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit_Impl.hpp" | ||
#include "../../model/CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData.hpp" | ||
#include "../../model/CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData_Impl.hpp" | ||
#include "../../model/CoilCoolingDXMultiSpeed.hpp" | ||
#include "../../model/CoilCoolingDXMultiSpeed_Impl.hpp" | ||
#include "../../model/CoilCoolingDXMultiSpeedStageData.hpp" | ||
#include "../../model/CoilCoolingDXMultiSpeedStageData_Impl.hpp" | ||
#include "../../model/CoilCoolingDXVariableSpeed.hpp" | ||
#include "../../model/CoilCoolingDXVariableSpeed_Impl.hpp" | ||
#include "../../model/CoilCoolingDXVariableSpeedSpeedData.hpp" | ||
#include "../../model/CoilCoolingDXVariableSpeedSpeedData_Impl.hpp" | ||
#include "../../model/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit.hpp" | ||
#include "../../model/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit_Impl.hpp" | ||
#include "../../model/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData.hpp" | ||
#include "../../model/CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFitSpeedData_Impl.hpp" | ||
#include <utilities/idd/UnitarySystemPerformance_Multispeed_FieldEnums.hxx> | ||
#include "../../utilities/idd/IddEnums.hpp" | ||
#include "../../utilities/idf/IdfExtensibleGroup.hpp" | ||
|
@@ -34,44 +54,78 @@ namespace openstudio { | |
namespace energyplus { | ||
|
||
boost::optional<IdfObject> ForwardTranslator::translateUnitarySystemPerformanceMultispeed(UnitarySystemPerformanceMultispeed& modelObject) { | ||
boost::optional<std::string> s; | ||
boost::optional<double> d; | ||
|
||
// Name | ||
IdfObject sysPerf = createRegisterAndNameIdfObject(openstudio::IddObjectType::UnitarySystemPerformance_Multispeed, modelObject); | ||
|
||
// Find the associated AirLoopHVACUnitarySystem | ||
boost::optional<HVACComponent> heatingCoil; | ||
boost::optional<HVACComponent> coolingCoil; | ||
|
||
// Find the associated AirLoopHVACUnitarySystem, ZoneHVACTerminalUnitVariableRefrigerantFlow, or ZoneHVACWaterToAirHeatPump | ||
std::vector<AirLoopHVACUnitarySystem> unitarySystems = modelObject.getModelObjectSources<AirLoopHVACUnitarySystem>(); | ||
if (unitarySystems.size() != 1) { | ||
LOG(Error, "OS:UnitarySystemPerformance:Multispeed should be referenced by one and only one OS:AirLoopHVAC:UnitarySystem, " | ||
<< modelObject.nameString() << " is referenced by " << unitarySystems.size() << ".") | ||
std::vector<ZoneHVACTerminalUnitVariableRefrigerantFlow> tuVRFs = | ||
modelObject.getModelObjectSources<ZoneHVACTerminalUnitVariableRefrigerantFlow>(); | ||
std::vector<ZoneHVACWaterToAirHeatPump> hps = modelObject.getModelObjectSources<ZoneHVACWaterToAirHeatPump>(); | ||
|
||
if (((unitarySystems.size() + tuVRFs.size() + hps.size()) != 1)) { | ||
LOG(Error, "OS:UnitarySystemPerformance:Multispeed should be referenced by one and only one OS:AirLoopHVAC:UnitarySystem or " | ||
"OS:ZoneHVAC:TerminalUnit:VariableRefrigerantFlow or OS:ZoneHVAC:WaterToAirHeatPump, " | ||
<< modelObject.nameString() << " is referenced by " << unitarySystems.size() << " OS:AirLoopHVAC:UnitarySystem, " << tuVRFs.size() | ||
<< " OS:ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, " << hps.size() << " OS:ZoneHVAC:WaterToAirHeatPump.") | ||
return boost::none; | ||
} | ||
AirLoopHVACUnitarySystem& unitarySystem = unitarySystems[0]; | ||
|
||
if (unitarySystems.size() == 1) { | ||
AirLoopHVACUnitarySystem& unitarySystem = unitarySystems[0]; | ||
heatingCoil = unitarySystem.heatingCoil(); | ||
coolingCoil = unitarySystem.coolingCoil(); | ||
} | ||
|
||
if (tuVRFs.size() == 1) { | ||
ZoneHVACTerminalUnitVariableRefrigerantFlow& tuVRF = tuVRFs[0]; | ||
heatingCoil = tuVRF.heatingCoil(); | ||
coolingCoil = tuVRF.coolingCoil(); | ||
} | ||
|
||
if (hps.size() == 1) { | ||
ZoneHVACWaterToAirHeatPump& hp = hps[0]; | ||
heatingCoil = hp.heatingCoil().optionalCast<HVACComponent>(); | ||
coolingCoil = hp.coolingCoil().optionalCast<HVACComponent>(); | ||
} | ||
|
||
// Number of speeds for heating | ||
boost::optional<HVACComponent> heatingCoil = unitarySystem.heatingCoil(); | ||
if (heatingCoil) { | ||
if (heatingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Heating_DX_MultiSpeed) { | ||
auto heatingCoilDXMultispeed = heatingCoil->cast<CoilHeatingDXMultiSpeed>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, heatingCoilDXMultispeed.stages().size()); | ||
} else if (heatingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Heating_Gas_MultiStage) { | ||
auto heatingCoilGasMultiStage = heatingCoil->cast<CoilHeatingGasMultiStage>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, heatingCoilGasMultiStage.stages().size()); | ||
} else { | ||
} else if (heatingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Heating_DX_VariableSpeed) { | ||
auto heatingCoilDXVarspeed = heatingCoil->cast<CoilHeatingDXVariableSpeed>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, heatingCoilDXVarspeed.speeds().size()); | ||
} else if (heatingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Heating_WaterToAirHeatPump_VariableSpeedEquationFit) { | ||
auto heatingCoilWaterToAirHeatingVar = heatingCoil->cast<CoilHeatingWaterToAirHeatPumpVariableSpeedEquationFit>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, heatingCoilWaterToAirHeatingVar.speeds().size()); | ||
} else { // e.g., CoilHeatingWaterToAirHeatPumpEquationFit, CoilHeatingDXVariableRefrigerantFlow, CoilHeatingDXVariableRefrigerantFlowFluidTemperatureControl | ||
Comment on lines
+104
to
+110
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you run an AirLoopHVACUnitarySystem (or a ZoneHVACWAHP) with these coils and no UnitarySystemPerformance object, does E+ throw? Just curious if you tested it, and same question for the below cooling coils below |
||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, 1); | ||
} | ||
} else { | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforHeating, 0); | ||
} | ||
|
||
// Number of speeds for cooling | ||
boost::optional<HVACComponent> coolingCoil = unitarySystem.coolingCoil(); | ||
if (coolingCoil) { | ||
if (coolingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Cooling_DX_MultiSpeed) { | ||
auto coolingCoilDXMultispeed = coolingCoil->cast<CoilCoolingDXMultiSpeed>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforCooling, coolingCoilDXMultispeed.stages().size()); | ||
} else { | ||
} else if (coolingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Cooling_DX_VariableSpeed) { | ||
auto coolingCoilDXVarspeed = coolingCoil->cast<CoilCoolingDXVariableSpeed>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforCooling, coolingCoilDXVarspeed.speeds().size()); | ||
} else if (coolingCoil->iddObjectType() == openstudio::IddObjectType::OS_Coil_Cooling_WaterToAirHeatPump_VariableSpeedEquationFit) { | ||
auto coolingCoilWaterToAirHeatingVar = coolingCoil->cast<CoilCoolingWaterToAirHeatPumpVariableSpeedEquationFit>(); | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforCooling, coolingCoilWaterToAirHeatingVar.speeds().size()); | ||
} else { // e.g., CoilCoolingWaterToAirHeatPumpEquationFit, CoilCoolingDXVariableRefrigerantFlow, CoilCoolingDXVariableRefrigerantFlowFluidTemperatureControl | ||
sysPerf.setInt(UnitarySystemPerformance_MultispeedFields::NumberofSpeedsforCooling, 1); | ||
} | ||
} else { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,8 @@ | |
#include "../../model/CoilCoolingDXVariableRefrigerantFlow_Impl.hpp" | ||
#include "../../model/CoilHeatingDXVariableRefrigerantFlow.hpp" | ||
#include "../../model/CoilHeatingDXVariableRefrigerantFlow_Impl.hpp" | ||
#include "../../model/UnitarySystemPerformanceMultispeed.hpp" | ||
#include "../../model/UnitarySystemPerformanceMultispeed_Impl.hpp" | ||
#include "../../utilities/core/Logger.hpp" | ||
#include "../../utilities/core/Assert.hpp" | ||
#include "../../utilities/math/FloatCompare.hpp" | ||
|
@@ -432,6 +434,18 @@ namespace energyplus { | |
} | ||
} | ||
|
||
// Design Specification Multispeed Object Name | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any FT testing for this one? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmarrec I didn't get too far on this PR yet. I sort of got tripped up on FT. Appears that for AirLoopHVACUnitarySystem, it FTs the UnitarySystemPerformanceMultispeed object, but also creates one if one doesn't exist. Under what conditions should we create one for ZoneHVACWaterToAirHeatPump and ZoneHVACTerminalUnitTVariableRefrigerantFlow? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AirLoopHVACUnitarySystem I believe throws if you use multispeed / variable speed coils without a UnitarySystemPerformanceMultispeed object, hence why the FT creates one if needed. I'm not 100% sure whether the VRF TU and the ZoneHVAC:WaterToAirHeatPump have the same behavior now. If so, we should create one in FT. In that case, should move the default creation to a helper function so we can reuse in other modules. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oh, that's quite confusing, but it seems that this applies not to the coils but to the fans. The original NFP proposed a new object "FanPerformance:Multispeed", but apparently UnistarySystemPerformance:Multispeed was kept. https://github.com/NREL/EnergyPlus/blob/develop/design/FY2023/NFP_MultispeedFans.md My understanding is that this is purely optional, regardless of the coils you use for the ZoneHVAC:WAHP or ZoneHVAC:TU:VRF objects. We should probably make some dummy IDF tests to confirm. I'll ask the E+ dev team right now too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jmarrec I stubbed UnitarySystemPerformance FT to handle additional coil types There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My earlier post was misleading I think. The object varies the fan airflow in conjunction with the heating/cooling capacity. I don't think we need to create a UnitarySystemPerformance object for VRF / ZoneHVACWaterToAirHeatPump if they don't throw when one isn't present. In that case, we're just left translating whatever the user chose to specify. Also, take There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm looking at
Where does the "2" come from? Should this value be hardcoded when coil object types are There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is arbitrary I believe. |
||
if (boost::optional<UnitarySystemPerformanceMultispeed> designSpecificationMultispeedObject = modelObject.designSpecificationMultispeedObject()) { | ||
boost::optional<IdfObject> _unitarySystemPerformance = translateAndMapModelObject(designSpecificationMultispeedObject.get()); | ||
|
||
if (_unitarySystemPerformance && _unitarySystemPerformance->name()) { | ||
idfObject.setString(ZoneHVAC_TerminalUnit_VariableRefrigerantFlowFields::DesignSpecificationMultispeedObjectType, | ||
_unitarySystemPerformance->iddObject().name()); | ||
idfObject.setString(ZoneHVAC_TerminalUnit_VariableRefrigerantFlowFields::DesignSpecificationMultispeedObjectName, | ||
_unitarySystemPerformance->name().get()); | ||
} | ||
} | ||
Comment on lines
+438
to
+447
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is pointless here for the VRF object, because you don't have a way to set the number of Speeds during Heating/Cooling, and the VRF coils do not bear the requested information to autofill them. Given what we see in
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Couple of things: But generally speaking, yes, I agree that we should probably punt on this new feature until later. |
||
|
||
return idfObject; | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ | |
#include "../../model/CoilHeatingGas_Impl.hpp" | ||
#include "../../model/CoilHeatingWater.hpp" | ||
#include "../../model/CoilHeatingWater_Impl.hpp" | ||
#include "../../model/UnitarySystemPerformanceMultispeed.hpp" | ||
#include "../../model/UnitarySystemPerformanceMultispeed_Impl.hpp" | ||
#include <utilities/idd/ZoneHVAC_WaterToAirHeatPump_FieldEnums.hxx> | ||
#include <utilities/idd/OutdoorAir_Mixer_FieldEnums.hxx> | ||
#include <utilities/idd/Fan_OnOff_FieldEnums.hxx> | ||
|
@@ -355,6 +357,17 @@ namespace energyplus { | |
|
||
// TODO: field 'Design Specification ZoneHVAC Sizing' isn't implemented since the object isn't wrapped in SDK | ||
|
||
// Design Specification Multispeed Object Name | ||
if (boost::optional<UnitarySystemPerformanceMultispeed> designSpecificationMultispeedObject = modelObject.designSpecificationMultispeedObject()) { | ||
boost::optional<IdfObject> _unitarySystemPerformance = translateAndMapModelObject(designSpecificationMultispeedObject.get()); | ||
|
||
if (_unitarySystemPerformance && _unitarySystemPerformance->name()) { | ||
idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::DesignSpecificationMultispeedObjectType, | ||
_unitarySystemPerformance->iddObject().name()); | ||
idfObject.setString(ZoneHVAC_WaterToAirHeatPumpFields::DesignSpecificationMultispeedObjectName, _unitarySystemPerformance->name().get()); | ||
} | ||
} | ||
Comment on lines
+361
to
+369
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unlike VRF, there are a varierty of coils when we can autofill the |
||
|
||
return idfObject; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of the
if (((unitarySystems.size() + tuVRFs.size() + hps.size()) != 1)) {
line above, yes, I think we'd be able to collapse to your suggestion.