Skip to content
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

Wrap ZoneHVAC:ExhaustControl and AirLoopHVAC:ExhaustSystem #5348

Draft
wants to merge 18 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 81 additions & 2 deletions resources/model/OpenStudio.idd
Original file line number Diff line number Diff line change
Expand Up @@ -11205,6 +11205,27 @@ OS:AirLoopHVAC:DedicatedOutdoorAirSystem,
\type object-list
\object-list AirPrimaryLoops

OS:AirLoopHVAC:ExhaustSystem,
\memo Defines a general exhaust system with a central exhaust fan drawing from one or more
\memo ZoneHVAC:ExhaustControl outlet nodes via an AirLoopHVAC:ZoneMixer.
\min-fields 4
A1, \field Handle
\type handle
\required-field
A2, \field Name
\required-field
\note Name of the exhaust system
A3, \field Zone Mixer Name
\required-field
\type object-list
\note The name of the exhaust system AirLoopHVAC:ZoneMixer
\object-list ZoneMixers
A4; \field Fan Name
\required-field
\type object-list
\object-list FansSystemModel
\object-list FansComponentModel

OS:AirLoopHVAC:ReturnPlenum,
\extensible:1 Just duplicate last field and comments (changing numbering, please)
\min-fields 1
Expand Down Expand Up @@ -12894,7 +12915,6 @@ OS:AirTerminal:SingleDuct:ConstantVolume:NoReheat,
\units m3/s
\minimum 0


OS:AirTerminal:SingleDuct:VAV:NoReheat,
\min-fields 1
A1, \field Handle
Expand Down Expand Up @@ -29152,7 +29172,6 @@ OS:ZoneHVAC:EquipmentList,
\type object-list
\object-list ScheduleNames


OS:ZoneVentilation:DesignFlowRate,
A1, \field Handle
\type handle
Expand Down Expand Up @@ -29474,6 +29493,66 @@ OS:ZoneHVAC:Baseboard:Convective:Water,
\required-field
\object-list BaseboardHeatingCoil

OS:ZoneHVAC:ExhaustControl,
\memo Defines a controlled exhaust flow from a zone which finally feeds into
\memo one of AirLoopHVAC:ZoneMixer's inlets, which are part of an AirLoopHVAC:ExhaustSystem.
A1 , \field Handle
\type handle
\required-field
A2 , \field Name
\required-field
A3 , \field Availability Schedule Name
\note Availability schedule name for this exhaust system. Schedule value > 0 means it is available.
\note If this field is blank, the exhaust system is always available. If the attached
\note AirLoopHVAC:ExhaustSystem is off, then the flow will be zero.
\required-field
\type object-list
\object-list ScheduleNames
A4 , \field Inlet Node Name
\note Inlet node name for the exhaust. Must be a zone exhaust node.
\required-field
\type object-list
\object-list ConnectionNames
A5 , \field Outlet Node Name
\note Outlet node name for the exhaust
\required-field
\type object-list
\object-list ConnectionNames
N1 , \field Design Exhaust Flow Rate
\autosizable
\units m3/s
\minimum> 0
\required-field
A6 , \field Flow Control Type
\note Control type of the zone exhaust flow
\type choice
\key Scheduled
\key FollowSupply
\required-field
A7 , \field Exhaust Flow Fraction Schedule Name
\note Schedule name of the exhaust flow fraction. Used only with Scheduled control type.
\note If this field is blank, the flow fraction is always 1.0.
\type object-list
\object-list ScheduleNames
A8 , \field Supply Node or NodeList Name
\note Used only with FollowSupply control type.
\type object-list
\object-list ConnectionNames
A9, \field Minimum Zone Temperature Limit Schedule Name
\note Schedule name of the Minimum Zone Temperature Limit in degree Celsius
\note If this field is blank, there is no limit.
\type object-list
\object-list ScheduleNames
A10, \field Minimum Exhaust Flow Fraction Schedule Name
\note Schedule name of the minimum exhaust flow fraction.
\note Applied when the zone temperature falls below the Minimum Zone Temperature Limit.
\type object-list
\object-list ScheduleNames
A11; \field Balanced Exhaust Fraction Schedule Name
\note Schedule name of the Balanced Exhaust Fraction.
\type object-list
\object-list ScheduleNames

OS:ZoneHVAC:HighTemperatureRadiant,
A1, \field Handle
\type handle
Expand Down
4 changes: 4 additions & 0 deletions src/energyplus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateAirflowNetwork.cpp
ForwardTranslator/ForwardTranslateAirGap.cpp
ForwardTranslator/ForwardTranslateAirLoopHVAC.cpp
ForwardTranslator/ForwardTranslateAirLoopHVACExhaustSystem.cpp
ForwardTranslator/ForwardTranslateAirLoopHVACOutdoorAirSystem.cpp
ForwardTranslator/ForwardTranslateAirLoopHVACDedicatedOutdoorAirSystem.cpp
ForwardTranslator/ForwardTranslateAirLoopHVACReturnPlenum.cpp
Expand Down Expand Up @@ -444,6 +445,7 @@ set(${target_name}_src
ForwardTranslator/ForwardTranslateZoneHVACEnergyRecoveryVentilator.cpp
ForwardTranslator/ForwardTranslateZoneHVACEnergyRecoveryVentilatorController.cpp
ForwardTranslator/ForwardTranslateZoneHVACEquipmentList.cpp
ForwardTranslator/ForwardTranslateZoneHVACExhaustControl.cpp
ForwardTranslator/ForwardTranslateZoneHVACFourPipeFanCoil.cpp
ForwardTranslator/ForwardTranslateZoneHVACHighTemperatureRadiant.cpp
ForwardTranslator/ForwardTranslateZoneHVACIdealLoadsAirSystem.cpp
Expand Down Expand Up @@ -674,6 +676,7 @@ set(${target_name}_test_src
Test/AirTerminalSingleDuctVAVHeatAndCoolReheat_GTest.cpp

Test/AirLoopHVAC_GTest.cpp
Test/AirLoopHVACExhaustSystem_GTest.cpp
Test/AirLoopHVACDedicatedOutdoorAirSystem_GTest.cpp
Test/PlantLoop_GTest.cpp

Expand Down Expand Up @@ -840,6 +843,7 @@ set(${target_name}_test_src
Test/WaterUseConnections_GTest.cpp
Test/ZoneAirHeatBalanceAlgorithm_GTest.cpp
Test/ZoneHVACBaseboardRadiantConvectiveWater_GTest.cpp
Test/ZoneHVACExhaustControl_GTest.cpp
Test/ZoneHVACLowTemperatureRadiantElectric_GTest.cpp
Test/ZoneHVACLowTempRadiantConstFlow_GTest.cpp
Test/ZoneHVACLowTempRadiantVarFlow_GTest.cpp
Expand Down
10 changes: 10 additions & 0 deletions src/energyplus/ForwardTranslator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,11 @@ namespace energyplus {
retVal = translateAirLoopHVAC(airLoopHVAC);
break;
}
case openstudio::IddObjectType::OS_AirLoopHVAC_ExhaustSystem: {
auto airLoopHVACExhaustSystem = modelObject.cast<AirLoopHVACExhaustSystem>();
retVal = translateAirLoopHVACExhaustSystem(airLoopHVACExhaustSystem);
break;
}
case openstudio::IddObjectType::OS_AirLoopHVAC_ReturnPlenum: {
auto airLoopHVACReturnPlenum = modelObject.cast<AirLoopHVACReturnPlenum>();
retVal = translateAirLoopHVACReturnPlenum(airLoopHVACReturnPlenum);
Expand Down Expand Up @@ -3204,6 +3209,11 @@ namespace energyplus {
retVal = translateZoneHVACEquipmentList(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneHVAC_ExhaustControl: {
auto mo = modelObject.cast<ZoneHVACExhaustControl>();
retVal = translateZoneHVACExhaustControl(mo);
break;
}
case openstudio::IddObjectType::OS_ZoneHVAC_FourPipeFanCoil: {
auto mo = modelObject.cast<ZoneHVACFourPipeFanCoil>();
retVal = translateZoneHVACFourPipeFanCoil(mo);
Expand Down
6 changes: 6 additions & 0 deletions src/energyplus/ForwardTranslator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ namespace model {
class AirflowNetworkOccupantVentilationControl;
class AirGap;
class AirLoopHVAC;
class AirLoopHVACExhaustSystem;
class AirLoopHVACUnitaryHeatCoolVAVChangeoverBypass;
class AirLoopHVACUnitaryHeatPumpAirToAir;
class AirLoopHVACUnitaryHeatPumpAirToAirMultiSpeed;
Expand Down Expand Up @@ -481,6 +482,7 @@ namespace model {
class ZoneHVACEnergyRecoveryVentilator;
class ZoneHVACEnergyRecoveryVentilatorController;
class ZoneHVACEquipmentList;
class ZoneHVACExhaustControl;
class ZoneHVACFourPipeFanCoil;
class ZoneHVACHighTemperatureRadiant;
class ZoneHVACIdealLoadsAirSystem;
Expand Down Expand Up @@ -652,6 +654,8 @@ namespace energyplus {

boost::optional<IdfObject> translateAirLoopHVAC(model::AirLoopHVAC& modelObject);

boost::optional<IdfObject> translateAirLoopHVACExhaustSystem(model::AirLoopHVACExhaustSystem& modelObject);

boost::optional<IdfObject> translateAirLoopHVACOutdoorAirSystem(model::AirLoopHVACOutdoorAirSystem& modelObject);

boost::optional<IdfObject> translateAirLoopHVACDedicatedOutdoorAirSystem(model::AirLoopHVACDedicatedOutdoorAirSystem& modelObject);
Expand Down Expand Up @@ -1551,6 +1555,8 @@ namespace energyplus {

boost::optional<IdfObject> translateZoneHVACEquipmentList(model::ZoneHVACEquipmentList& modelObject);

boost::optional<IdfObject> translateZoneHVACExhaustControl(model::ZoneHVACExhaustControl& modelObject);

boost::optional<IdfObject> translateZoneHVACFourPipeFanCoil(model::ZoneHVACFourPipeFanCoil& modelObject);

boost::optional<IdfObject> translateZoneHVACHighTemperatureRadiant(model::ZoneHVACHighTemperatureRadiant& modelObject);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
*
* (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
* derived from this software without specific prior written permission from the respective party.
*
* (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
* may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
* written permission from Alliance for Sustainable Energy, LLC.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
* STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"
#include "../../model/Model.hpp"
#include "../../model/AirLoopHVACExhaustSystem.hpp"
#include "../../model/AirLoopHVACExhaustSystem_Impl.hpp"
#include "../../model/HVACComponent.hpp"
#include "../../model/HVACComponent_Impl.hpp"

#include <utilities/idd/AirLoopHVAC_ExhaustSystem_FieldEnums.hxx>
#include <utilities/idd/IddEnums.hxx>

using namespace openstudio::model;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateAirLoopHVACExhaustSystem(model::AirLoopHVACExhaustSystem& modelObject) {

// Instantiate an IdfObject of the class to store the values
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::AirLoopHVAC_ExhaustSystem, modelObject);

// Fan Object Type: Required String
// Fan Name: Required Object
HVACComponent fan = modelObject.fan();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(fan)) {
idfObject.setString(AirLoopHVAC_ExhaustSystemFields::FanObjectType, wo_->iddObject().name());
idfObject.setString(AirLoopHVAC_ExhaustSystemFields::FanName, wo_->nameString());
}

return idfObject;
} // End of translate function

} // end namespace energyplus
} // end namespace openstudio
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/***********************************************************************************************************************
* OpenStudio(R), Copyright (c) 2008-2023, Alliance for Sustainable Energy, LLC, and other contributors. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* (1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.
*
* (2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.
*
* (3) Neither the name of the copyright holder nor the names of any contributors may be used to endorse or promote products
* derived from this software without specific prior written permission from the respective party.
*
* (4) Other than as required in clauses (1) and (2), distributions in any form of modifications or other derivative works
* may not use the "OpenStudio" trademark, "OS", "os", or any other confusingly similar designation without specific prior
* written permission from Alliance for Sustainable Energy, LLC.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER(S) AND ANY CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER(S), ANY CONTRIBUTORS, THE UNITED STATES GOVERNMENT, OR THE UNITED
* STATES DEPARTMENT OF ENERGY, NOR ANY OF THEIR EMPLOYEES, BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
***********************************************************************************************************************/

#include "../ForwardTranslator.hpp"
#include "../../model/Model.hpp"
#include "../../model/ZoneHVACExhaustControl.hpp"
#include "../../model/ZoneHVACExhaustControl_Impl.hpp"
#include "../../model/Schedule.hpp"
#include "../../model/Schedule_Impl.hpp"
#include "../../model/ThermalZone.hpp"
#include "../../model/ThermalZone_Impl.hpp"
#include "../../model/Node.hpp"
#include "../../model/Node_Impl.hpp"

#include <utilities/idd/ZoneHVAC_ExhaustControl_FieldEnums.hxx>
#include <utilities/idd/IddEnums.hxx>

using namespace openstudio::model;

namespace openstudio {

namespace energyplus {

boost::optional<IdfObject> ForwardTranslator::translateZoneHVACExhaustControl(model::ZoneHVACExhaustControl& modelObject) {

// Instantiate an IdfObject of the class to store the values
IdfObject idfObject = createRegisterAndNameIdfObject(openstudio::IddObjectType::ZoneHVAC_ExhaustControl, modelObject);

// Availability Schedule Name: Required Object
Schedule availabilitySchedule_ = modelObject.availabilitySchedule();
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(availabilitySchedule_)) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::AvailabilityScheduleName, wo_->nameString());
}

// Zone Name: Required Object
if (boost::optional<ThermalZone> zone = modelObject.thermalZone()) {
if (boost::optional<std::string> thermalZoneName = zone->name()) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::ZoneName, thermalZoneName.get());
}
}

// InletNodeName
if (auto node = modelObject.inletNode()) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::InletNodeName, node->name().get());
}

// OutletNodeName
if (auto node = modelObject.outletNode()) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::OutletNodeName, node->name().get());
}

if (modelObject.isDesignExhaustFlowRateAutosized()) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::DesignExhaustFlowRate, "Autosize");
} else {
// Design Exhaust Flow Rate: boost::optional<double>
if (boost::optional<double> designExhaustFlowRate_ = modelObject.designExhaustFlowRate()) {
idfObject.setDouble(ZoneHVAC_ExhaustControlFields::DesignExhaustFlowRate, designExhaustFlowRate_.get());
}
}

// Flow Control Type: Optional String
const std::string flowControlType = modelObject.flowControlType();
idfObject.setString(ZoneHVAC_ExhaustControlFields::FlowControlType, flowControlType);

// Exhaust Flow Fraction Schedule Name: Optional Object
if (boost::optional<Schedule> exhaustFlowFractionSchedule_ = modelObject.exhaustFlowFractionSchedule()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(exhaustFlowFractionSchedule_.get())) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::ExhaustFlowFractionScheduleName, wo_->nameString());
}
}

// Minimum Zone Temperature Limit Schedule Name: Optional Object
if (boost::optional<Schedule> minimumZoneTemperatureLimitSchedule_ = modelObject.minimumZoneTemperatureLimitSchedule()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(minimumZoneTemperatureLimitSchedule_.get())) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::MinimumZoneTemperatureLimitScheduleName, wo_->nameString());
}
}

// Minimum Exhaust Flow Fraction Schedule Name: Optional Object
if (boost::optional<Schedule> minimumExhaustFlowFractionSchedule_ = modelObject.minimumExhaustFlowFractionSchedule()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(minimumExhaustFlowFractionSchedule_.get())) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::MinimumExhaustFlowFractionScheduleName, wo_->nameString());
}
}

// Balanced Exhaust Fraction Schedule Name: Optional Object
if (boost::optional<Schedule> balancedExhaustFractionSchedule_ = modelObject.balancedExhaustFractionSchedule()) {
if (boost::optional<IdfObject> wo_ = translateAndMapModelObject(balancedExhaustFractionSchedule_.get())) {
idfObject.setString(ZoneHVAC_ExhaustControlFields::BalancedExhaustFractionScheduleName, wo_->nameString());
}
}

return idfObject;
} // End of translate function

} // end namespace energyplus
} // end namespace openstudio
Loading
Loading