MCPcopy Create free account
hub / github.com/NatLabRockies/EnergyPlus / updateUnitarySystemControl

Method updateUnitarySystemControl

src/EnergyPlus/UnitarySystem.cc:8398–8631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8396 }
8397
8398 void UnitarySys::updateUnitarySystemControl(EnergyPlusData &state,
8399 int const AirLoopNum, // number of the current air loop being simulated
8400 int const OutNode, // coil outlet node number
8401 int const ControlNode, // control node number
8402 Real64 &OnOffAirFlowRatio,
8403 bool const FirstHVACIteration,
8404 Real64 const OAUCoilOutletTemp, // "ONLY" for zoneHVAC:OutdoorAirUnit
8405 Real64 &ZoneLoad,
8406 Real64 const MaxOutletTemp // limits heating coil outlet temp [C]
8407 )
8408 {
8409
8410 // SUBROUTINE INFORMATION:
8411 // AUTHOR Richard Raustad, FSEC
8412 // DATE WRITTEN February 2013
8413
8414 // PURPOSE OF THIS SUBROUTINE:
8415 // This subroutine is for sizing unitary systems.
8416
8417 // METHODOLOGY EMPLOYED:
8418 // Either CALL the coil model to get the size or size coil.
8419 // Current method is to use same methodology as is used in coil objects.
8420 // Future changes will include a common sizing algorithm and push the calculated
8421 // size to the coil object prior to first call (so the coil will not DataSizing::AutoSize).
8422
8423 // These initializations are done every iteration
8424
8425 {
8426 state.dataUnitarySystems->MoistureLoad = 0.0;
8427 this->LoadSHR = 0.0;
8428 this->CoilSHR = 0.0;
8429 switch (this->m_ControlType) {
8430 case UnitarySysCtrlType::Load:
8431 case UnitarySysCtrlType::CCMASHRAE: {
8432 if (AirLoopNum == -1) { // This IF-THEN routine is just for ZoneHVAC:OutdoorAirUnit
8433 ShowWarningError(state, std::format("{} \"{}\"", this->UnitType, this->Name));
8434 ShowFatalError(state, "...Load based control is not allowed when used with ZoneHVAC:OutdoorAirUnit");
8435 }
8436
8437 // here we need to deal with sequenced zone equip
8438 state.dataUnitarySystems->HeatingLoad = false;
8439 state.dataUnitarySystems->CoolingLoad = false;
8440 if (this->m_ZoneSequenceCoolingNum > 0 && this->m_ZoneSequenceHeatingNum > 0 && this->m_AirLoopEquipment) {
8441 // air loop equipment uses sequenced variables
8442 state.dataUnitarySystems->QToCoolSetPt = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(this->ControlZoneNum)
8443 .SequencedOutputRequiredToCoolingSP(this->m_ZoneSequenceCoolingNum);
8444 state.dataUnitarySystems->QToHeatSetPt = state.dataZoneEnergyDemand->ZoneSysEnergyDemand(this->ControlZoneNum)
8445 .SequencedOutputRequiredToHeatingSP(this->m_ZoneSequenceHeatingNum);
8446 if (state.dataUnitarySystems->QToHeatSetPt > 0.0 && state.dataUnitarySystems->QToCoolSetPt > 0.0 &&
8447 state.dataHeatBalFanSys->TempControlType(this->ControlZoneNum) != HVAC::SetptType::SingleCool) {
8448 ZoneLoad = state.dataUnitarySystems->QToHeatSetPt;
8449 state.dataUnitarySystems->HeatingLoad = true;
8450 } else if (state.dataUnitarySystems->QToHeatSetPt > 0.0 && state.dataUnitarySystems->QToCoolSetPt > 0.0 &&
8451 state.dataHeatBalFanSys->TempControlType(this->ControlZoneNum) == HVAC::SetptType::SingleCool) {
8452 ZoneLoad = 0.0;
8453 } else if (state.dataUnitarySystems->QToHeatSetPt < 0.0 && state.dataUnitarySystems->QToCoolSetPt < 0.0 &&
8454 state.dataHeatBalFanSys->TempControlType(this->ControlZoneNum) != HVAC::SetptType::SingleHeat) {
8455 ZoneLoad = state.dataUnitarySystems->QToCoolSetPt;

Callers 2

Calls 7

initLoadBasedControlMethod · 0.95
ShowWarningErrorFunction · 0.85
formatFunction · 0.85
ShowFatalErrorFunction · 0.85
PsyHgAirFnWTdbFunction · 0.85
PsyHfgAirFnWTdbFunction · 0.85

Tested by

no test coverage detected