| 1304 | } |
| 1305 | |
| 1306 | bool UnitarySys::checkNodeSetPoint(EnergyPlusData &state, |
| 1307 | int const AirLoopNum, // number of the current air loop being simulated |
| 1308 | int const ControlNode, // Node to test for set point |
| 1309 | int const CoilType, // True if cooling coil, then test for HumRatMax set point |
| 1310 | Real64 const OAUCoilOutTemp // the coil inlet temperature of OutdoorAirUnit |
| 1311 | ) |
| 1312 | { |
| 1313 | |
| 1314 | // SUBROUTINE INFORMATION: |
| 1315 | // AUTHOR Richard Raustad |
| 1316 | // DATE WRITTEN March 2013 |
| 1317 | |
| 1318 | // PURPOSE OF THIS SUBROUTINE: |
| 1319 | // This subroutine checks for proper set point at control node. |
| 1320 | constexpr static std::array<std::string_view, 3> coilTypes = {"cooling", "heating", "supplemental"}; |
| 1321 | bool SetPointErrorFlag = false; |
| 1322 | |
| 1323 | if (ControlNode == 0) { |
| 1324 | if (this->m_ControlType == UnitarySysCtrlType::Setpoint) { |
| 1325 | int coilOutNode = this->CoolCoilOutletNodeNum; |
| 1326 | if (CoilType == HeatingCoil) { |
| 1327 | coilOutNode = this->HeatCoilOutletNodeNum; |
| 1328 | } |
| 1329 | if (CoilType == SuppHeatCoil) { |
| 1330 | coilOutNode = this->SuppCoilOutletNodeNum; |
| 1331 | } |
| 1332 | |
| 1333 | ShowSevereError( |
| 1334 | state, EnergyPlus::format("checkNodeSetPoint: Missing {} set point in {} = {}", coilTypes[CoilType], this->UnitType, this->Name)); |
| 1335 | ShowContinueError(state, |
| 1336 | EnergyPlus::format("...Setpoint is required at system air outlet node = {} or {} coil air outlet node = {}", |
| 1337 | state.dataLoopNodes->NodeID(this->AirOutNode), |
| 1338 | coilTypes[CoilType], |
| 1339 | state.dataLoopNodes->NodeID(coilOutNode))); |
| 1340 | SetPointErrorFlag = true; |
| 1341 | } |
| 1342 | return SetPointErrorFlag; |
| 1343 | } |
| 1344 | |
| 1345 | if (AirLoopNum == -1) { // Outdoor Air Unit |
| 1346 | state.dataLoopNodes->Node(ControlNode).TempSetPoint = OAUCoilOutTemp; // Set the coil outlet temperature |
| 1347 | if (this->m_ISHundredPercentDOASDXCoil) { |
| 1348 | this->frostControlSetPointLimit(state, |
| 1349 | this->m_DesiredOutletTemp, |
| 1350 | state.dataLoopNodes->Node(ControlNode).HumRatMax, |
| 1351 | state.dataEnvrn->OutBaroPress, |
| 1352 | this->DesignMinOutletTemp, |
| 1353 | 1); |
| 1354 | } |
| 1355 | } else { // Not an Outdoor air unit |
| 1356 | |
| 1357 | if (state.dataLoopNodes->Node(ControlNode).TempSetPoint == Node::SensedNodeFlagValue && |
| 1358 | this->m_ControlType == UnitarySysCtrlType::Setpoint) { |
| 1359 | if (!state.dataGlobal->AnyEnergyManagementSystemInModel) { |
| 1360 | ShowSevereError(state, |
| 1361 | EnergyPlus::format("{}: Missing temperature setpoint for unitary system = {}", this->UnitType, this->Name)); |
| 1362 | ShowContinueError(state, " use a Setpoint Manager to establish a setpoint at the coil control node."); |
| 1363 | SetPointErrorFlag = true; |
no test coverage detected