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

ZoneHVAC:HybridUnitaryHVAC ERR object type output #8326

Merged
merged 15 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from 10 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
Original file line number Diff line number Diff line change
Expand Up @@ -4241,7 +4241,7 @@ \subsubsection{Inputs}
This alpha input field specifies the name of the HVAC system node from which the hybrid unit draws return air. This node name must also be specified as a zone return air node in a \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. It may also be included in \hyperref[nodelist]{NodeList} object that is specified as a zone return air node in a \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. (Ref. Group - Zone Equipment \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} and Group - Node-Branch Management \hyperref[nodelist]{NodeList}).

\paragraph{Field: Outdoor Air Node Name}
This alpha input field specifies the name of the HVAC system node from which the hybrid unit draws outdoor air. This node name must also be specified in an \hyperref[outdoorairnode]{OutdoorAir:Node} or \hyperref[outdoorairnodelist]{OutdoorAir:NodeList} object. If this field is blank, a node name will be created internally. (Ref. Group - Node-Branch Management \hyperref[outdoorairnode]{OutdoorAir:Node} and \hyperref[outdoorairnodelist]{OutdoorAir:NodeList}).
This alpha input field specifies the name of the HVAC system node from which the hybrid unit draws outdoor air. This node name must also be specified in an \hyperref[outdoorairnode]{OutdoorAir:Node} or \hyperref[outdoorairnodelist]{OutdoorAir:NodeList} object. (Ref. Group - Node-Branch Management \hyperref[outdoorairnode]{OutdoorAir:Node} and \hyperref[outdoorairnodelist]{OutdoorAir:NodeList}).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IDD has this as a required field so I just removed the statement about leaving the field blank.

Copy link
Contributor

@mjwitte mjwitte Oct 28, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. But the code for this input is wrong. See comment below.


\paragraph{Field: Supply Air Node Name}
This alpha input field specifies the name of the HVAC system node to which the hybrid unit sends supply air. This node name must also be specified as zone inlet node in a \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. It may also be included in \hyperref[nodelist]{NodeList} object that is specified as a zone inlet node in a \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} object. (Ref. Group - Zone Equipment \hyperref[zonehvacequipmentconnections]{ZoneHVAC:EquipmentConnections} and Group - Node-Branch Management \hyperref[nodelist]{NodeList}).
Expand Down
98 changes: 54 additions & 44 deletions src/EnergyPlus/HybridUnitaryAirConditioners.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ namespace HybridUnitaryAirConditioners {
using namespace DataIPShortCuts; // Data for field names, blank numerics
using namespace DataLoopNode;
using DataSizing::OARequirements; // to find DesignSpecification:OutdoorAir pointer
std::string CurrentModuleObject; // Object type for getting and error messages
std::string cCurrentModuleObject; // Object type for getting and error messages
Array1D_string Alphas; // Alpha items for object
Array1D<Real64> Numbers; // Numeric items for object
Array1D_string cAlphaFields; // Alpha field names
Expand All @@ -486,9 +486,9 @@ namespace HybridUnitaryAirConditioners {

// SUBROUTINE PARAMETER DEFINITIONS:
static std::string const RoutineName("GetInputZoneHybridUnitaryAirConditioners: ");
CurrentModuleObject = "ZoneHVAC:HybridUnitaryHVAC";
NumZoneHybridEvap = inputProcessor->getNumObjectsFound(CurrentModuleObject);
inputProcessor->getObjectDefMaxArgs(CurrentModuleObject, NumFields, NumAlphas, NumNumbers);
cCurrentModuleObject = "ZoneHVAC:HybridUnitaryHVAC";
NumZoneHybridEvap = inputProcessor->getNumObjectsFound(cCurrentModuleObject);
inputProcessor->getObjectDefMaxArgs(cCurrentModuleObject, NumFields, NumAlphas, NumNumbers);
int MaxNumbers = max(0, NumNumbers); // Maximum number of numeric fields in all objects
int MaxAlphas = max(0, NumAlphas); // Maximum number of alpha fields in all objects
Alphas.allocate(MaxAlphas);
Expand All @@ -506,7 +506,7 @@ namespace HybridUnitaryAirConditioners {

for (UnitLoop = 1; UnitLoop <= NumZoneHybridEvap; ++UnitLoop) {
inputProcessor->getObjectItem(state,
CurrentModuleObject,
cCurrentModuleObject,
UnitLoop,
Alphas,
NumAlphas,
Expand All @@ -521,7 +521,7 @@ namespace HybridUnitaryAirConditioners {
IsNotOK = false;
IsBlank = false;
UtilityRoutines::VerifyName(
Alphas(1), ZoneHybridUnitaryAirConditioner, UnitLoop - 1, IsNotOK, IsBlank, CurrentModuleObject + " Name");
Alphas(1), ZoneHybridUnitaryAirConditioner, UnitLoop - 1, IsNotOK, IsBlank, cCurrentModuleObject + " Name");

// A1, \field Name
ZoneHybridUnitaryAirConditioner(UnitLoop).Name = Alphas(1);
Expand All @@ -543,32 +543,40 @@ namespace HybridUnitaryAirConditioners {
}

// A4, \field Minimum Supply Air Temperature Schedule Named
ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMin_schedule_pointer = GetScheduleIndex(state, Alphas(4));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMin_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(4) + '=' + Alphas(4));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
if (!lAlphaBlanks(4)) {
ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMin_schedule_pointer = GetScheduleIndex(state, Alphas(4));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMin_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(4) + '=' + Alphas(4));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
}
}
// A5, \field Maximum Supply Air Temperature Schedule Name
ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMax_schedule_pointer = GetScheduleIndex(state, Alphas(5));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMax_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(5) + '=' + Alphas(5));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
if (!lAlphaBlanks(5)) {
ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMax_schedule_pointer = GetScheduleIndex(state, Alphas(5));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).TsaMax_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(5) + '=' + Alphas(5));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a test file with bad inputs in a bunch of fields, and some of the error messages are still broken:

   ** Severe  ** Invalid Minimum Supply Air Temperature Schedule Name=XMINSUPPLYT
   **   ~~~   ** Entered in ZoneHVAC:HybridUnitaryHVAC=MAIN ZONE BASEBOARD

cAlphaArgs should be Alphas here and elsewhere. Here's the test file:
UnitaryHybridAC_bug-ForceErrors1.idf.txt

ErrorsFound = true;
}
}
// A6, \field Minimum Supply Air Humidity Ratio Schedule Name
ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMin_schedule_pointer = GetScheduleIndex(state, Alphas(6));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMin_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(6) + '=' + Alphas(6));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
if (!lAlphaBlanks(6)) {
ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMin_schedule_pointer = GetScheduleIndex(state, Alphas(6));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMin_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(6) + '=' + Alphas(6));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
}
}
// A7, \field Maximum Supply Air Humidity Ratio Schedule Name
ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMax_schedule_pointer = GetScheduleIndex(state, Alphas(7));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMax_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(7) + '=' + Alphas(7));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
if (!lAlphaBlanks(7)) {
ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMax_schedule_pointer = GetScheduleIndex(state, Alphas(7));
if (ZoneHybridUnitaryAirConditioner(UnitLoop).RHsaMax_schedule_pointer == 0) {
ShowSevereError("Invalid " + cAlphaFields(7) + '=' + Alphas(7));
ShowContinueError("Entered in " + cCurrentModuleObject + '=' + cAlphaArgs(1));
ErrorsFound = true;
}
}

// A8, \field Method to Choose Value of Controlled Inputs
Expand All @@ -578,21 +586,21 @@ namespace HybridUnitaryAirConditioners {
// A11, \field Supply Air Node Name
// A12, \field Relief Node Name
ZoneHybridUnitaryAirConditioner(UnitLoop).InletNode = GetOnlySingleNode(state,
Alphas(9), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent);
Alphas(9), ErrorsFound, cCurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_Inlet, 1, ObjectIsNotParent);
ZoneHybridUnitaryAirConditioner(UnitLoop).SecondaryInletNode = GetOnlySingleNode(state, Alphas(10),
ErrorsFound,
CurrentModuleObject,
cCurrentModuleObject,
Alphas(1),
NodeType_Air,
NodeConnectionType_OutsideAirReference,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is kind of nit-picky, but NodeConnectionType_OutsideAirReference should be NodeConnectionType_OutsideAir because this node is a real outdoor air node with flow, not just a sensor.

1,
ObjectIsNotParent);
ZoneHybridUnitaryAirConditioner(UnitLoop).OutletNode = GetOnlySingleNode(state,
Alphas(11), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent);
Alphas(11), ErrorsFound, cCurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_Outlet, 1, ObjectIsNotParent);
ZoneHybridUnitaryAirConditioner(UnitLoop).SecondaryOutletNode = GetOnlySingleNode(state,
Alphas(12), ErrorsFound, CurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_ReliefAir, 1, ObjectIsNotParent);
TestCompSet(CurrentModuleObject, Alphas(1), Alphas(9), Alphas(11), "Hybrid Evap Air Zone Nodes");
TestCompSet(CurrentModuleObject, Alphas(1), Alphas(10), Alphas(12), "Hybrid Evap Air Zone Secondary Nodes");
Alphas(12), ErrorsFound, cCurrentModuleObject, Alphas(1), NodeType_Air, NodeConnectionType_ReliefAir, 1, ObjectIsNotParent);
TestCompSet(cCurrentModuleObject, Alphas(1), Alphas(9), Alphas(11), "Hybrid Evap Air Zone Nodes");
TestCompSet(cCurrentModuleObject, Alphas(1), Alphas(10), Alphas(12), "Hybrid Evap Air Zone Secondary Nodes");

// N1, \field System Maximum Supply AirFlow Rate
ZoneHybridUnitaryAirConditioner(UnitLoop).SystemMaximumSupplyAirFlowRate = Numbers(1);
Expand Down Expand Up @@ -643,13 +651,15 @@ namespace HybridUnitaryAirConditioners {
// A18, \field Objective Function Minimizes

// A19, \ OA requirement pointer
ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(19), OARequirements);
if (ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr == 0) {
ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + Alphas(1) + " invalid data");
ShowContinueError("Invalid-not found" + cAlphaFieldNames(19) + "=\"" + Alphas(19) + "\".");
ErrorsFound = true;
} else {
ZoneHybridUnitaryAirConditioner(UnitLoop).OutdoorAir = true;
if (!lAlphaBlanks(19)) {
ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr = UtilityRoutines::FindItemInList(Alphas(19), OARequirements);
if (ZoneHybridUnitaryAirConditioner(UnitLoop).OARequirementsPtr == 0) {
ShowSevereError(RoutineName + cCurrentModuleObject + " = " + Alphas(1) + " invalid data");
ShowContinueError("Invalid-not found " + cAlphaFields(19) + "=\"" + Alphas(19) + "\".");
ErrorsFound = true;
} else {
ZoneHybridUnitaryAirConditioner(UnitLoop).OutdoorAir = true;
}
}

int FirstModeAlphaNumber = 20;
Expand All @@ -673,7 +683,7 @@ namespace HybridUnitaryAirConditioners {
}
}
// add the ZoneHVAC:HybridUnitaryHVAC Scaled Maximum Supply Air Volume Flow Rate to the Component Sizing Report Summary
BaseSizer::reportSizerOutput(CurrentModuleObject,
BaseSizer::reportSizerOutput(cCurrentModuleObject,
ZoneHybridUnitaryAirConditioner(UnitLoop).Name,
"Scaled Maximum Supply Air Volume Flow Rate [m3/s]",
ZoneHybridUnitaryAirConditioner(UnitLoop).ScaledSystemMaximumSupplyAirVolumeFlowRate);
Expand All @@ -683,16 +693,16 @@ namespace HybridUnitaryAirConditioners {
// setup output variables
for (UnitLoop = 1; UnitLoop <= NumZoneHybridEvap; ++UnitLoop) {

SetUpCompSets(CurrentModuleObject,
SetUpCompSets(cCurrentModuleObject,
ZoneHybridUnitaryAirConditioner(UnitLoop).Name,
CurrentModuleObject,
cCurrentModuleObject,
ZoneHybridUnitaryAirConditioner(UnitLoop).Name,
NodeID(ZoneHybridUnitaryAirConditioner(UnitLoop).InletNode),
NodeID(ZoneHybridUnitaryAirConditioner(UnitLoop).OutletNode));

SetUpCompSets(CurrentModuleObject,
SetUpCompSets(cCurrentModuleObject,
ZoneHybridUnitaryAirConditioner(UnitLoop).Name,
CurrentModuleObject,
cCurrentModuleObject,
ZoneHybridUnitaryAirConditioner(UnitLoop).Name,
NodeID(ZoneHybridUnitaryAirConditioner(UnitLoop).SecondaryInletNode),
NodeID(ZoneHybridUnitaryAirConditioner(UnitLoop).SecondaryOutletNode));
Expand Down
Loading