-
Notifications
You must be signed in to change notification settings - Fork 222
#5350 - Changes to Support CoilSystem:Cooling:Water #5404
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
Changes from all commits
041adbd
310a14f
d0cc34b
ba57cda
4f3e2d4
63acda6
b264a56
53780c8
14c7357
95c4727
3d6d145
868633a
64dd179
51a0ae3
61ea54d
e1705d9
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 |
|---|---|---|
|
|
@@ -74,36 +74,32 @@ namespace energyplus { | |
| idf->setString(Coil_Cooling_WaterFields::AirInletNodeName, airInletNodeName); | ||
| idf->setString(Coil_Cooling_WaterFields::AirOutletNodeName, airOutletNodeName); | ||
| // Add IddObjectType::Coil_Cooling_Water_DetailedGeometry if implemented | ||
| } else if (idf->iddObject().type() == IddObjectType::CoilSystem_Cooling_Water_HeatExchangerAssisted) { | ||
| // The logic is built in the translateCoilSystemCoolingWaterHeatExchangerAssisted method | ||
| // Essentially it's the same as getting the HX (CoilSystem_Cooling_Water_HeatExchangerAssistedFields::HeatExchangerName) | ||
| // and setting HeatExchanger_AirToAir_SensibleAndLatentFields::SupplyAirInletNodeName & ExhaustAirOutletNodeName | ||
| } else { | ||
| // Shouldn't happen, accepts only Coil:Cooling:Water or Coil:Cooling:Water:DetailedGeometry | ||
| // Shouldn't happen, accepts only Coil:Cooling:DX:SingleSpeed or Coil:Cooling:DX:VariableSpeed | ||
| LOG(Fatal, modelObject.briefDescription() | ||
| << " appears to have a cooling coil that shouldn't have been accepted: " << coolingCoil.briefDescription()); | ||
| OS_ASSERT(false); | ||
| } | ||
| } | ||
| if (auto coilCoolingWater = coolingCoil.optionalCast<CoilCoolingWater>()) { | ||
| if (auto controller = coilCoolingWater->controllerWaterCoil()) { | ||
| if (auto idf = translateAndMapModelObject(controller.get())) { | ||
| idf->setString(Controller_WaterCoilFields::SensorNodeName, airOutletNodeName); | ||
| } | ||
| // Shouldn't happen, accepts only Coil:Cooling:Water CoilSystem:Cooling:Water:HeatExchangerAssisted (or Coil:Cooling:Water:DetailedGeometry, not wrapped) | ||
| LOG_AND_THROW(modelObject.briefDescription() | ||
| << " appears to have a cooling coil that shouldn't have been accepted: " << coolingCoil.briefDescription()); | ||
| } | ||
| } | ||
|
|
||
| // Need a SPM:MixedAir on the Coil:Cooling:Water outlet node (that we **created** just above in IDF directly, so it won't get picked up by the | ||
| // TODO: is that true?! | ||
| // Need a SPM:MixedAir on the outlet node (that we **created** just above in IDF directly, so it won't get picked up by the | ||
|
Comment on lines
+88
to
+89
Collaborator
Author
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. @joseph-robertson not sure if that's just copy pasted fromCoilSystem_Cooling_Water_HeatExchangerAssisted or actually required. |
||
| // ForwardTranslateAirLoopHVAC method) | ||
| if (boost::optional<AirLoopHVAC> airLoop_ = modelObject.airLoopHVAC()) { | ||
| std::vector<StraightComponent> fans; | ||
| std::vector<ModelObject> supplyComponents = airLoop_->supplyComponents(); | ||
|
|
||
| for (auto it = supplyComponents.begin(); it != supplyComponents.end(); ++it) { | ||
| if (auto fan_ = it->optionalCast<FanVariableVolume>()) { | ||
| for (auto& supplyComponent : supplyComponents) { | ||
| if (auto fan_ = supplyComponent.optionalCast<FanVariableVolume>()) { | ||
| fans.insert(fans.begin(), std::move(*fan_)); | ||
| } else if (auto fan_ = it->optionalCast<FanConstantVolume>()) { | ||
| } else if (auto fan_ = supplyComponent.optionalCast<FanConstantVolume>()) { | ||
| fans.insert(fans.begin(), std::move(*fan_)); | ||
| } else if (auto fan_ = it->optionalCast<FanSystemModel>()) { | ||
| } else if (auto fan_ = supplyComponent.optionalCast<FanSystemModel>()) { | ||
| fans.insert(fans.begin(), std::move(*fan_)); | ||
| } else if (auto fan_ = it->optionalCast<FanOnOff>()) { | ||
| } else if (auto fan_ = supplyComponent.optionalCast<FanOnOff>()) { | ||
| fans.insert(fans.begin(), std::move(*fan_)); | ||
| } | ||
| } | ||
|
|
@@ -177,20 +173,21 @@ namespace energyplus { | |
| idfObject.setDouble(CoilSystem_Cooling_WaterFields::MinimumWaterLoopTemperatureForHeatRecovery, minimumWaterLoopTemperatureForHeatRecovery); | ||
|
|
||
| // Companion Coil Used For Heat Recovery: Optional Object | ||
| if (boost::optional<WaterToAirComponent> companionCoilUsedForHeatRecovery_ = modelObject.companionCoilUsedForHeatRecovery()) { | ||
| if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(companionCoilUsedForHeatRecovery_.get())) { | ||
| idfObject.setString(CoilSystem_Cooling_WaterFields::CompanionCoilUsedForHeatRecovery, wo_->nameString()); | ||
| if (wo_->iddObject().type() == IddObjectType::Coil_Cooling_Water) { | ||
| wo_->setString(Coil_Cooling_WaterFields::AirInletNodeName, modelObject.airLoopHVACOutdoorAirSystem()->reliefAirModelObject()->nameString()); | ||
| wo_->setString(Coil_Cooling_WaterFields::AirOutletNodeName, wo_->nameString() + " Exhaust Outlet Node"); // FIXME | ||
| // Add IddObjectType::Coil_Cooling_Water_DetailedGeometry if implemented | ||
| if (boost::optional<HVACComponent> companionCoilUsedForHeatRecovery_ = modelObject.companionCoilUsedForHeatRecovery()) { | ||
| if (auto comp_ = companionCoilUsedForHeatRecovery_->optionalCast<CoilCoolingWater>()) { | ||
| if (comp_->airInletModelObject()) { | ||
| if (boost::optional<IdfObject> idf_ = translateAndMapModelObject(companionCoilUsedForHeatRecovery_.get())) { | ||
| idfObject.setString(CoilSystem_Cooling_WaterFields::CompanionCoilUsedForHeatRecovery, idf_->nameString()); | ||
| } | ||
| } else { | ||
| // Shouldn't happen, accepts only Coil:Cooling:Water or Coil:Cooling:Water:DetailedGeometry | ||
| // Shouldn't happen, accepts only Coil:Cooling:DX:SingleSpeed or Coil:Cooling:DX:VariableSpeed | ||
| LOG(Fatal, modelObject.briefDescription() << " appears to have a companion coil used for heat recovery that shouldn't have been accepted: " | ||
| << companionCoilUsedForHeatRecovery_.get().briefDescription()); | ||
| OS_ASSERT(false); | ||
| LOG(Warn, modelObject.briefDescription() | ||
| << " has a companion coil used for heat recovery that is not connected to an AirLoopHVAC / AirLoopHVACOutdoorAirSystem" | ||
| << " and will not be translated:" << comp_->briefDescription()); | ||
| } | ||
| } else { | ||
| // Shouldn't happen, accepts only Coil:Cooling:Water | ||
| LOG_AND_THROW(modelObject.briefDescription() << " appears to have a companion coil used for heat recovery that shouldn't have been accepted: " | ||
| << companionCoilUsedForHeatRecovery_.get().briefDescription()); | ||
|
Comment on lines
+176
to
+190
Collaborator
Author
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. No translating the companion coil if it's not connected by itself on an AirLoopHVAC/AirLoopHVACOutdoorAIrSystem |
||
| } | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,6 +14,8 @@ | |
| #include "../../model/CoilCoolingWater_Impl.hpp" | ||
| #include "../../model/ControllerWaterCoil.hpp" | ||
| #include "../../model/ControllerWaterCoil_Impl.hpp" | ||
| #include "../../model/CoilSystemCoolingWater.hpp" | ||
| #include "../../model/CoilSystemCoolingWater_Impl.hpp" | ||
|
|
||
| #include "../../model/AirLoopHVAC.hpp" | ||
| #include "../../model/FanVariableVolume.hpp" | ||
|
|
@@ -47,18 +49,30 @@ namespace energyplus { | |
| IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::CoilSystem_Cooling_Water_HeatExchangerAssisted, modelObject); | ||
|
|
||
| std::string hxSupplyAirInletNodeName; | ||
| std::string hxExhaustAirOutletNodeName; | ||
| // InletNodeName | ||
| if (auto mo = modelObject.inletModelObject()) { | ||
| if (auto node = mo->optionalCast<Node>()) { | ||
| hxSupplyAirInletNodeName = node->nameString(); | ||
| } | ||
| } | ||
|
|
||
| std::string hxExhaustAirOutletNodeName; | ||
| // OutletNodeName | ||
| if (auto mo = modelObject.outletModelObject()) { | ||
| if (auto node = mo->optionalCast<Node>()) { | ||
| hxExhaustAirOutletNodeName = node->nameString(); | ||
| // OutletNodeName | ||
| if (auto mo = modelObject.outletModelObject()) { | ||
| if (auto node = mo->optionalCast<Node>()) { | ||
| hxExhaustAirOutletNodeName = node->nameString(); | ||
| } | ||
| } | ||
| } else if (auto comp_ = modelObject.containingHVACComponent()) { | ||
| if (auto coilSystem_ = comp_->optionalCast<CoilSystemCoolingWater>()) { | ||
| if (auto mo = coilSystem_->inletModelObject()) { | ||
| if (auto node = mo->optionalCast<Node>()) { | ||
| hxSupplyAirInletNodeName = node->nameString(); | ||
| } | ||
| } | ||
| if (auto mo = coilSystem_->outletModelObject()) { | ||
| if (auto node = mo->optionalCast<Node>()) { | ||
| hxExhaustAirOutletNodeName = node->nameString(); | ||
| } | ||
| } | ||
|
Comment on lines
+52
to
+75
Collaborator
Author
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. CoilSystem_Cooling_Water_HeatExchangerAssisted: when translating it, we check if there's a inletModelobject, in which case this is directly added onto an AirLoopHVAC. Otherwise, get the inlet/outlet air nodes from the parent CoilSystemCoolingWater object if any |
||
| } | ||
| } | ||
|
|
||
|
|
||
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.
We gotta handle the
CoilSystem_Cooling_Water_HeatExchangerAssistedcase. I'm not doing it here because it's too complicated/awkward because we work with IdfObject, not WorkspaceObject, so theree isn't a getTarget available to set the HX Nodes