| 10463 | } |
| 10464 | |
| 10465 | void UnitarySys::initLoadBasedControl(EnergyPlusData &state, |
| 10466 | int const AirLoopNum, // number of the current air loop being simulated |
| 10467 | bool const FirstHVACIteration, |
| 10468 | Real64 &OnOffAirFlowRatio, |
| 10469 | Real64 &ZoneLoad) |
| 10470 | { |
| 10471 | |
| 10472 | // SUBROUTINE INFORMATION: |
| 10473 | // AUTHOR Richard Raustad, FSEC |
| 10474 | // DATE WRITTEN February 2013 |
| 10475 | |
| 10476 | // PURPOSE OF THIS SUBROUTINE: |
| 10477 | // This subroutine is for initializations of the load controlled Unitary Systems. |
| 10478 | |
| 10479 | // METHODOLOGY EMPLOYED: |
| 10480 | // Initialize mass flow rates and speed ratios. Calculate loads and adjust if necessary when using constant fan. |
| 10481 | |
| 10482 | // SUBROUTINE PARAMETER DEFINITIONS: |
| 10483 | static constexpr std::string_view routineName("InitUnitarySystems"); |
| 10484 | Real64 QZnReq = 0.0; |
| 10485 | Real64 QActual = 0.0; |
| 10486 | Real64 SensOutputOff = 0.0; |
| 10487 | Real64 LatOutputOff = 0.0; |
| 10488 | Real64 HeatCoilLoad = 0.0; |
| 10489 | Real64 SupHeaterLoad = 0.0; |
| 10490 | HVAC::CompressorOp CompressorOn = HVAC::CompressorOp::Off; |
| 10491 | |
| 10492 | // do the Begin Environment initializations |
| 10493 | if (state.dataGlobal->BeginEnvrnFlag && this->m_MyEnvrnFlag2) { |
| 10494 | |
| 10495 | bool errorsFound = false; |
| 10496 | // set fluid-side hardware limits |
| 10497 | if (this->HeatCoilFluidInletNode > 0) { |
| 10498 | |
| 10499 | if (this->MaxHeatCoilFluidFlow == DataSizing::AutoSize) { |
| 10500 | // IF water coil max water flow rate is DataSizing::AutoSized, simulate once in order to mine max flow rate |
| 10501 | if (this->m_heatCoilType == HVAC::CoilType::HeatingWater) { |
| 10502 | WaterCoils::SimulateWaterCoilComponents(state, this->m_HeatingCoilName, FirstHVACIteration, this->m_HeatingCoilIndex); |
| 10503 | Real64 CoilMaxVolFlowRate = |
| 10504 | WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", this->m_HeatingCoilName, errorsFound); |
| 10505 | if (CoilMaxVolFlowRate != DataSizing::AutoSize) { |
| 10506 | Real64 rho = this->HeatCoilPlantLoc.loop->glycol->getDensity(state, Constant::CWInitConvTemp, routineName); |
| 10507 | this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * rho; |
| 10508 | } |
| 10509 | } |
| 10510 | // IF steam coil max steam flow rate is DataSizing::AutoSized, simulate once in order to mine max flow rate |
| 10511 | if (this->m_heatCoilType == HVAC::CoilType::HeatingSteam) { |
| 10512 | SteamCoils::SimulateSteamCoilComponents(state, |
| 10513 | this->m_HeatingCoilName, |
| 10514 | FirstHVACIteration, |
| 10515 | this->m_HeatingCoilIndex, |
| 10516 | 1.0, |
| 10517 | QActual); // QCoilReq, simulate any load > 0 to get max capacity |
| 10518 | Real64 CoilMaxVolFlowRate = SteamCoils::GetCoilMaxSteamFlowRate(state, this->m_HeatingCoilIndex, errorsFound); |
| 10519 | if (CoilMaxVolFlowRate != DataSizing::AutoSize) { |
| 10520 | Real64 TempSteamIn = 100.0; |
| 10521 | Real64 SteamDensity = Fluid::GetSteam(state)->getSatDensity(state, TempSteamIn, 1.0, routineName); |
| 10522 | this->MaxHeatCoilFluidFlow = CoilMaxVolFlowRate * SteamDensity; |
no test coverage detected