LCOV - code coverage report
Current view: top level - EnergyPlus - CrossVentMgr.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 18.1 % 514 93
Test Date: 2025-06-02 12:03:30 Functions: 20.0 % 5 1

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : // C++ Headers
      49              : #include <cassert>
      50              : #include <cmath>
      51              : 
      52              : // ObjexxFCL Headers
      53              : #include <ObjexxFCL/Fmath.hh>
      54              : 
      55              : // EnergyPlus Headers
      56              : #include <AirflowNetwork/Solver.hpp>
      57              : #include <EnergyPlus/ConvectionCoefficients.hh>
      58              : #include <EnergyPlus/CrossVentMgr.hh>
      59              : #include <EnergyPlus/Data/EnergyPlusData.hh>
      60              : #include <EnergyPlus/DataEnvironment.hh>
      61              : #include <EnergyPlus/DataGlobals.hh>
      62              : #include <EnergyPlus/DataHeatBalFanSys.hh>
      63              : #include <EnergyPlus/DataHeatBalSurface.hh>
      64              : #include <EnergyPlus/DataHeatBalance.hh>
      65              : #include <EnergyPlus/DataRoomAirModel.hh>
      66              : #include <EnergyPlus/DataSurfaces.hh>
      67              : #include <EnergyPlus/InternalHeatGains.hh>
      68              : #include <EnergyPlus/Psychrometrics.hh>
      69              : #include <EnergyPlus/ScheduleManager.hh>
      70              : #include <EnergyPlus/UtilityRoutines.hh>
      71              : #include <EnergyPlus/ZoneTempPredictorCorrector.hh>
      72              : 
      73              : namespace EnergyPlus {
      74              : 
      75              : namespace RoomAir {
      76              : 
      77              :     // MODULE INFORMATION:
      78              :     //       AUTHOR         G. Carrilho da Graca
      79              :     //       DATE WRITTEN   October 2004
      80              : 
      81              :     // PURPOSE OF THIS MODULE:
      82              :     // Routines that implement the UCSD Cross Ventilation
      83              : 
      84              :     using namespace DataEnvironment;
      85              :     using namespace DataHeatBalance;
      86              :     using namespace DataHeatBalSurface;
      87              :     using namespace DataSurfaces;
      88              :     using Convect::CalcDetailedHcInForDVModel;
      89              : 
      90              :     Real64 constexpr Cjet1(1.873);     // First correlation constant for the jet velocity
      91              :     Real64 constexpr Cjet2(0.243);     // Second correlation constant for the jet velocity
      92              :     Real64 constexpr Crec1(0.591);     // First correlation constant for the recirculation velocity
      93              :     Real64 constexpr Crec2(0.070);     // Second correlation constant for the recirculation velocity
      94              :     Real64 constexpr CjetTemp(0.849);  // Correlation constant for the jet temperature rise
      95              :     Real64 constexpr CrecTemp(1.385);  // Correlation constant for the recirculation temperature rise
      96              :     Real64 constexpr CrecFlow1(0.415); // First correlation constant for the recirculation flow rate
      97              :     Real64 constexpr CrecFlow2(0.466); // Second correlation constant for the recirculation flow rate
      98              : 
      99            0 :     void ManageCrossVent(EnergyPlusData &state,
     100              :                          int const ZoneNum) // index number for the specified zone
     101              :     {
     102              : 
     103              :         // SUBROUTINE INFORMATION:
     104              :         //       AUTHOR         G. Carrilho da Graca
     105              :         //       DATE WRITTEN   October 2004
     106              : 
     107              :         // PURPOSE OF THIS SUBROUTINE:
     108              :         //   manage the UCSD Cross Ventilation model
     109              : 
     110            0 :         InitCrossVent(state, ZoneNum);
     111              : 
     112              :         // perform Cross Ventilation model calculations
     113            0 :         CalcCrossVent(state, ZoneNum);
     114            0 :     }
     115              : 
     116            0 :     void InitCrossVent(EnergyPlusData &state, int const ZoneNum)
     117              :     {
     118              : 
     119              :         // SUBROUTINE INFORMATION:
     120              :         //       AUTHOR         G. Carrilho da Graca
     121              :         //       DATE WRITTEN   October 2004
     122              : 
     123              :         // PURPOSE OF THIS SUBROUTINE:
     124              :         // Low Energy Cooling by Ventilation initialization subroutine.
     125              :         // All the data preparation needed to run the LECV models.
     126              :         // The subroutines sets up arrays with the locations in the main EnergyPlus surface array of
     127              :         // ceiling, windows, doors and walls. The zone maximum and minimum height is calculated.
     128              : 
     129              :         // Do the one time initializations
     130            0 :         if (state.dataCrossVentMgr->InitUCSDCV_MyOneTimeFlag) {
     131            0 :             state.dataCrossVentMgr->InitUCSDCV_MyEnvrnFlag.dimension(state.dataGlobal->NumOfZones, true);
     132            0 :             state.dataCrossVentMgr->InitUCSDCV_MyOneTimeFlag = false;
     133              :         }
     134              : 
     135              :         // Do the begin environment initializations
     136            0 :         if (state.dataGlobal->BeginEnvrnFlag && state.dataCrossVentMgr->InitUCSDCV_MyEnvrnFlag(ZoneNum)) {
     137            0 :             state.dataCrossVentMgr->InitUCSDCV_MyEnvrnFlag(ZoneNum) = false;
     138              :         }
     139              : 
     140            0 :         if (!state.dataGlobal->BeginEnvrnFlag) {
     141            0 :             state.dataCrossVentMgr->InitUCSDCV_MyEnvrnFlag(ZoneNum) = true;
     142              :         }
     143            0 :     }
     144              : 
     145            0 :     void HcCrossVent(EnergyPlusData &state, int const ZoneNum)
     146              :     {
     147              : 
     148              :         // SUBROUTINE INFORMATION:
     149              :         //       AUTHOR         G. Carrilho da Graca
     150              :         //       DATE WRITTEN   October 2004
     151              :         //       MODIFIED       8/2013 - Sam Brunswick
     152              :         //                      To improve convection coefficient calculation
     153              : 
     154              :         // PURPOSE OF THIS SUBROUTINE:
     155              :         // Main subroutine for convection calculation in the UCSD Cross Ventilation model.
     156              :         // It calls CalcDetailedHcInForDVModel for convection coefficient
     157              :         // initial calculations and averages the final result comparing the position of the surface with
     158              :         // the interface subzone height.
     159              : 
     160              :         // Initialize HAT and HA
     161            0 :         state.dataCrossVentMgr->HAT_J = 0.0;
     162            0 :         state.dataCrossVentMgr->HAT_R = 0.0;
     163            0 :         state.dataCrossVentMgr->HA_J = 0.0;
     164            0 :         state.dataCrossVentMgr->HA_R = 0.0;
     165              : 
     166              :         // Is the air flow model for this zone set to UCSDCV Cross Ventilation?
     167            0 :         if (state.dataRoomAir->IsZoneCrossVent(ZoneNum)) {
     168              : 
     169            0 :             Real64 zoneJetRecAreaRatio = state.dataRoomAir->JetRecAreaRatio(ZoneNum);
     170              : 
     171              :             // WALL Hc, HA and HAT calculation
     172            0 :             for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) {
     173            0 :                 int SurfNum = state.dataRoomAir->APos_Wall(Ctd);
     174            0 :                 if (SurfNum == 0) {
     175            0 :                     continue;
     176              :                 }
     177              : 
     178            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     179            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     180            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     181            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     182            0 :                 CalcDetailedHcInForDVModel(
     183            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     184            0 :                 state.dataRoomAir->HWall(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
     185            0 :                 state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWall(Ctd);
     186            0 :                 state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWall(Ctd);
     187              :             } // END WALL
     188              :             // WINDOW Hc, HA and HAT CALCULATION
     189            0 :             for (int Ctd = state.dataRoomAir->PosZ_Window(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Window(ZoneNum).end; ++Ctd) {
     190            0 :                 int SurfNum = state.dataRoomAir->APos_Window(Ctd);
     191            0 :                 if (SurfNum == 0) {
     192            0 :                     continue;
     193              :                 }
     194              : 
     195            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     196            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     197            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     198            0 :                 if (surf.Tilt > 10.0 && surf.Tilt < 170.0) { // Window Wall
     199            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     200            0 :                     CalcDetailedHcInForDVModel(
     201            0 :                         state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     202            0 :                     state.dataRoomAir->HWindow(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
     203            0 :                     state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HWindow(Ctd);
     204            0 :                     state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HWindow(Ctd);
     205              :                 }
     206            0 :                 if (surf.Tilt <= 10.0) { // Window Ceiling
     207            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
     208            0 :                     CalcDetailedHcInForDVModel(
     209            0 :                         state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
     210            0 :                     Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
     211            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     212            0 :                     CalcDetailedHcInForDVModel(
     213            0 :                         state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     214            0 :                     Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
     215            0 :                     state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
     216            0 :                     state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
     217            0 :                     state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec;
     218            0 :                     state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
     219            0 :                     state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
     220            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
     221            0 :                         zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
     222              :                 }
     223            0 :                 if (surf.Tilt >= 170.0) { // Window Floor
     224            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
     225            0 :                     CalcDetailedHcInForDVModel(
     226            0 :                         state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
     227            0 :                     Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
     228            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     229            0 :                     CalcDetailedHcInForDVModel(
     230            0 :                         state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     231            0 :                     Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
     232            0 :                     state.dataRoomAir->HWindow(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
     233            0 :                     state.dataCrossVentMgr->HAT_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
     234            0 :                     state.dataCrossVentMgr->HA_R += surf.Area * (1.0 - zoneJetRecAreaRatio) * Hrec;
     235            0 :                     state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
     236            0 :                     state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
     237            0 :                     state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
     238            0 :                         zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
     239              :                 }
     240            0 :                 state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HWindow(Ctd);
     241              :             } // END WINDOW
     242              :             // DOOR Hc, HA and HAT CALCULATION
     243            0 :             for (int Ctd = state.dataRoomAir->PosZ_Door(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Door(ZoneNum).end; ++Ctd) { // DOOR
     244            0 :                 int SurfNum = state.dataRoomAir->APos_Door(Ctd);
     245            0 :                 if (SurfNum == 0) {
     246            0 :                     continue;
     247              :                 }
     248              : 
     249            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     250            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     251            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     252            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     253            0 :                 CalcDetailedHcInForDVModel(
     254            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     255            0 :                 state.dataRoomAir->HDoor(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
     256            0 :                 state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HDoor(Ctd);
     257            0 :                 state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HDoor(Ctd);
     258              :             } // END DOOR
     259              : 
     260              :             // INTERNAL Hc, HA and HAT CALCULATION
     261            0 :             for (int Ctd = state.dataRoomAir->PosZ_Internal(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Internal(ZoneNum).end; ++Ctd) {
     262            0 :                 int SurfNum = state.dataRoomAir->APos_Internal(Ctd);
     263            0 :                 if (SurfNum == 0) {
     264            0 :                     continue;
     265              :                 }
     266              : 
     267            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     268            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     269            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     270            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     271            0 :                 CalcDetailedHcInForDVModel(
     272            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     273            0 :                 state.dataRoomAir->HInternal(Ctd) = state.dataRoomAir->CrossVentHcIn(SurfNum);
     274            0 :                 state.dataCrossVentMgr->HAT_R += surf.Area * state.dataHeatBalSurf->SurfTempIn(SurfNum) * state.dataRoomAir->HInternal(Ctd);
     275            0 :                 state.dataCrossVentMgr->HA_R += surf.Area * state.dataRoomAir->HInternal(Ctd);
     276              :             } // END INTERNAL
     277              : 
     278              :             // CEILING Hc, HA and HAT CALCULATION
     279            0 :             for (int Ctd = state.dataRoomAir->PosZ_Ceiling(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Ceiling(ZoneNum).end; ++Ctd) {
     280            0 :                 int SurfNum = state.dataRoomAir->APos_Ceiling(Ctd);
     281            0 :                 if (SurfNum == 0) {
     282            0 :                     continue;
     283              :                 }
     284              : 
     285            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     286            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     287            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     288            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
     289            0 :                 CalcDetailedHcInForDVModel(
     290            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
     291            0 :                 Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
     292            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     293            0 :                 CalcDetailedHcInForDVModel(
     294            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     295            0 :                 Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
     296              : 
     297            0 :                 state.dataRoomAir->HCeiling(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
     298            0 :                 state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
     299            0 :                 state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec;
     300            0 :                 state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
     301            0 :                 state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
     302            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
     303            0 :                     zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
     304            0 :                 state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HCeiling(Ctd);
     305              :             } // END CEILING
     306              :             // FLOOR Hc, HA and HAT CALCULATION
     307            0 :             for (int Ctd = state.dataRoomAir->PosZ_Floor(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Floor(ZoneNum).end; ++Ctd) {
     308            0 :                 int SurfNum = state.dataRoomAir->APos_Floor(Ctd);
     309            0 :                 if (SurfNum == 0) {
     310            0 :                     continue;
     311              :                 }
     312              : 
     313            0 :                 auto const &surf = state.dataSurface->Surface(SurfNum);
     314            0 :                 state.dataSurface->SurfTAirRef(SurfNum) = DataSurfaces::RefAirTemp::AdjacentAirTemp;
     315            0 :                 state.dataSurface->SurfTAirRefRpt(SurfNum) = DataSurfaces::SurfTAirRefReportVals[state.dataSurface->SurfTAirRef(SurfNum)];
     316            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTJET(ZoneNum);
     317            0 :                 CalcDetailedHcInForDVModel(
     318            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Ujet);
     319            0 :                 Real64 Hjet = state.dataRoomAir->CrossVentHcIn(SurfNum);
     320            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) = state.dataRoomAir->ZTREC(ZoneNum);
     321            0 :                 CalcDetailedHcInForDVModel(
     322            0 :                     state, SurfNum, state.dataHeatBalSurf->SurfTempIn, state.dataRoomAir->CrossVentHcIn, state.dataRoomAir->Urec);
     323            0 :                 Real64 Hrec = state.dataRoomAir->CrossVentHcIn(SurfNum);
     324            0 :                 state.dataRoomAir->HFloor(Ctd) = zoneJetRecAreaRatio * Hjet + (1 - zoneJetRecAreaRatio) * Hrec;
     325            0 :                 state.dataCrossVentMgr->HAT_R += surf.Area * (1 - zoneJetRecAreaRatio) * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hrec;
     326            0 :                 state.dataCrossVentMgr->HA_R += surf.Area * (1 - zoneJetRecAreaRatio) * Hrec;
     327            0 :                 state.dataCrossVentMgr->HAT_J += surf.Area * zoneJetRecAreaRatio * state.dataHeatBalSurf->SurfTempIn(SurfNum) * Hjet;
     328            0 :                 state.dataCrossVentMgr->HA_J += surf.Area * zoneJetRecAreaRatio * Hjet;
     329            0 :                 state.dataHeatBal->SurfTempEffBulkAir(SurfNum) =
     330            0 :                     zoneJetRecAreaRatio * state.dataRoomAir->ZTJET(ZoneNum) + (1 - zoneJetRecAreaRatio) * state.dataRoomAir->ZTREC(ZoneNum);
     331            0 :                 state.dataRoomAir->CrossVentHcIn(SurfNum) = state.dataRoomAir->HFloor(Ctd);
     332              :             } // END FLOOR
     333              :         }
     334            0 :     }
     335              : 
     336            1 :     void EvolveParaCrossVent(EnergyPlusData &state, int const ZoneNum)
     337              :     {
     338              : 
     339              :         // SUBROUTINE INFORMATION:
     340              :         //       AUTHOR         G. Carrilho da Graca
     341              :         //       DATE WRITTEN   October 2004
     342              :         //       MODIFIED       8/2013 - Sam Brunswick
     343              :         //                      To incorporate an improved model
     344              :         //                      and add modeling of multiple jets
     345              : 
     346              :         // PURPOSE OF THIS SUBROUTINE:
     347              :         // Subroutine for parameter actualization in the UCSD Cross Ventilation model.
     348              : 
     349            1 :         Real64 constexpr MinUin(0.2);
     350              : 
     351              :         Real64 Uin;            // Inflow air velocity [m/s]
     352              :         Real64 CosPhi;         // Angle (in degrees) between the wind and the outward normal of the dominant surface
     353              :         Real64 SurfNorm;       // Outward normal of surface
     354            1 :         Real64 SumToZone(0.0); // Sum of velocities through
     355            1 :         Real64 MaxFlux(0.0);
     356            1 :         int MaxSurf(0);
     357              :         Real64 ActiveSurfNum;
     358              :         int NSides;   // Number of sides in surface
     359              :         Real64 Wroom; // Room width
     360              :         Real64 Aroom; // Room area cross section
     361              : 
     362            1 :         assert(state.dataRoomAir->AirModel.allocated());
     363            1 :         state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
     364            1 :         auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum);
     365              : 
     366              :         // Identify the dominant aperture:
     367            1 :         MaxSurf = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum);
     368            1 :         int const surfNum = state.afn->MultizoneSurfaceData(MaxSurf).SurfNum;
     369            1 :         auto const &thisSurface = state.dataSurface->Surface(surfNum);
     370              : 
     371            1 :         int afnSurfNum1 = state.dataRoomAir->AFNSurfaceCrossVent(1, ZoneNum);
     372              : 
     373            1 :         if (thisSurface.Zone == ZoneNum) {
     374              :             // this is a direct airflow network aperture
     375            1 :             SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2;
     376            1 :             MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW2;
     377              :         } else {
     378              :             // this is an indirect airflow network aperture
     379            0 :             SumToZone = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW;
     380            0 :             MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum1).VolFLOW;
     381              :         }
     382              : 
     383            1 :         for (int Ctd2 = 2; Ctd2 <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd2) {
     384            0 :             int afnSurfNum = state.dataRoomAir->AFNSurfaceCrossVent(Ctd2, ZoneNum);
     385            0 :             if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(afnSurfNum).SurfNum).Zone == ZoneNum) {
     386            0 :                 if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2 > MaxFlux) {
     387            0 :                     MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2;
     388            0 :                     MaxSurf = afnSurfNum;
     389              :                 }
     390            0 :                 SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW2;
     391              :             } else {
     392            0 :                 if (state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW > MaxFlux) {
     393            0 :                     MaxFlux = state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW;
     394            0 :                     MaxSurf = afnSurfNum;
     395              :                 }
     396            0 :                 SumToZone += state.afn->AirflowNetworkLinkSimu(afnSurfNum).VolFLOW;
     397              :             }
     398              :         }
     399              : 
     400              :         // Check if wind direction is within +/- 90 degrees of the outward normal of the dominant surface
     401            1 :         SurfNorm = thisSurface.Azimuth;
     402            1 :         CosPhi = std::cos((state.dataEnvrn->WindDir - SurfNorm) * Constant::DegToRad);
     403            1 :         if (CosPhi <= 0) {
     404            0 :             state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
     405            0 :             auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
     406            0 :             for (int i = 1, u = flows.u(); i <= u; ++i) {
     407            0 :                 auto &e(flows(i));
     408            0 :                 e.Ujet = e.Urec = 0.0;
     409              :             }
     410            0 :             state.dataRoomAir->Urec(ZoneNum) = 0.0;
     411            0 :             state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     412            0 :             state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     413            0 :             if (thisSurface.ExtBoundCond > 0) {
     414            0 :                 state.dataRoomAir->Tin(ZoneNum) =
     415            0 :                     state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
     416            0 :             } else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
     417            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     418            0 :             } else if (thisSurface.ExtBoundCond == Ground) {
     419            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     420            0 :             } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
     421            0 :                 auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
     422            0 :                 thisOSC.OSCTempCalc =
     423            0 :                     (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
     424            0 :                      thisOSC.ConstTempCoef * thisOSC.ConstTemp +
     425            0 :                      thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp[(int)DataEnvironment::GroundTempType::BuildingSurface] +
     426            0 :                      thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
     427            0 :                 state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
     428            0 :             } else {
     429            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     430              :             }
     431            0 :             return;
     432            0 :         }
     433              : 
     434              :         // Calculate the opening area for all apertures
     435            2 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
     436            1 :             auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
     437            1 :             auto const &surfParams = state.dataRoomAir->SurfParametersCrossDispVent(Ctd);
     438            1 :             int cCompNum = state.afn->AirflowNetworkLinkageData(Ctd).CompNum;
     439            1 :             if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::DOP) {
     440            1 :                 jetRecFlows.Area = surfParams.Width * surfParams.Height * state.afn->MultizoneSurfaceData(Ctd).OpenFactor;
     441            0 :             } else if (state.afn->AirflowNetworkCompData(cCompNum).CompTypeNum == AirflowNetwork::iComponentTypeNum::SCR) {
     442            0 :                 jetRecFlows.Area = surfParams.Width * surfParams.Height;
     443              :             } else {
     444            0 :                 ShowSevereError(
     445              :                     state, "RoomAirModelCrossVent:EvolveParaUCSDCV: Illegal leakage component referenced in the cross ventilation room air model");
     446            0 :                 ShowContinueError(state,
     447            0 :                                   format("Surface {} in zone {} uses leakage component {}",
     448            0 :                                          state.afn->AirflowNetworkLinkageData(Ctd).Name,
     449            0 :                                          state.dataHeatBal->Zone(ZoneNum).Name,
     450            0 :                                          state.afn->AirflowNetworkLinkageData(Ctd).CompName));
     451            0 :                 ShowContinueError(state, "Only leakage component types AirflowNetwork:MultiZone:Component:DetailedOpening and ");
     452            0 :                 ShowContinueError(state, "AirflowNetwork:MultiZone:Surface:Crack can be used with the cross ventilation room air model");
     453            0 :                 ShowFatalError(state, "Previous severe error causes program termination");
     454              :             }
     455              :         }
     456              : 
     457              :         // Calculate Droom, Wroom, Dstar
     458              :         // Droom the distance between the average point of the base surface of the airflow network Surface (if the base surface
     459              :         // is a Window or Door it looks for the second base surface).
     460              :         // Dstar is Droom corrected for wind angle
     461              : 
     462            1 :         Vector3<Real64> baseCentroid;
     463              : 
     464            1 :         Wroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataHeatBal->Zone(ZoneNum).FloorArea;
     465            1 :         auto const &baseSurface = state.dataSurface->Surface(thisSurface.BaseSurf);
     466            1 :         if ((baseSurface.Sides == 3) || (baseSurface.Sides == 4)) {
     467            1 :             baseCentroid = baseSurface.Centroid;
     468              :         } else {
     469              :             // If the surface has more than 4 vertex then average the vertex coordinates in X, Y and Z.
     470            0 :             NSides = baseSurface.Sides;
     471            0 :             assert(NSides > 0);
     472            0 :             baseCentroid = {0.0, 0.0, 0.0};
     473            0 :             for (int i = 1; i <= NSides; ++i) {
     474            0 :                 baseCentroid += baseSurface.Vertex(i);
     475              :             }
     476            0 :             baseCentroid /= double(NSides);
     477              :         }
     478              : 
     479            1 :         Vector3<Real64> wallCentroid;
     480            1 :         Real64 const Wroom_2(pow_2(Wroom));
     481            5 :         for (int Ctd = state.dataRoomAir->PosZ_Wall(ZoneNum).beg; Ctd <= state.dataRoomAir->PosZ_Wall(ZoneNum).end; ++Ctd) {
     482            8 :             if ((state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 3) ||
     483            4 :                 (state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides == 4)) {
     484            4 :                 wallCentroid = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Centroid;
     485              :             } else {
     486            0 :                 NSides = state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Sides;
     487            0 :                 assert(NSides > 0);
     488            0 :                 wallCentroid = {0.0, 0.0, 0.0};
     489            0 :                 for (int i = 1; i <= NSides; ++i) {
     490            0 :                     wallCentroid += state.dataSurface->Surface(state.dataRoomAir->APos_Wall(Ctd)).Vertex(i);
     491              :                 }
     492            0 :                 wallCentroid /= double(NSides);
     493              :             }
     494              :             double DroomTemp =
     495            4 :                 std::sqrt(pow_2(baseCentroid.x - wallCentroid.x) + pow_2(baseCentroid.y - wallCentroid.y) + pow_2(baseCentroid.z - wallCentroid.z));
     496            4 :             if (DroomTemp > state.dataRoomAir->Droom(ZoneNum)) {
     497            1 :                 state.dataRoomAir->Droom(ZoneNum) = DroomTemp;
     498              :             }
     499            4 :             state.dataRoomAir->Dstar(ZoneNum) =
     500            4 :                 min(state.dataRoomAir->Droom(ZoneNum) / CosPhi, std::sqrt(Wroom_2 + pow_2(state.dataRoomAir->Droom(ZoneNum))));
     501              :         }
     502              : 
     503              :         // Room area
     504            1 :         Aroom = state.dataHeatBal->Zone(ZoneNum).Volume / state.dataRoomAir->Droom(ZoneNum);
     505              : 
     506              :         // Populate an array of inflow volume fluxes (Fin) for all apertures in the zone
     507              :         // Calculate inflow velocity (%Uin) for each aperture in the zone
     508            2 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
     509            1 :             auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
     510            1 :             if (state.dataSurface->Surface(state.afn->MultizoneSurfaceData(Ctd).SurfNum).Zone == ZoneNum) {
     511              :                 // this is a direct airflow network aperture
     512            1 :                 jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW2;
     513              :             } else {
     514              :                 // this is an indirect airflow network aperture
     515            0 :                 jetRecFlows.Fin = state.afn->AirflowNetworkLinkSimu(state.dataRoomAir->AFNSurfaceCrossVent(Ctd, ZoneNum)).VolFLOW;
     516              :             }
     517            1 :             if (jetRecFlows.Area != 0) {
     518            1 :                 jetRecFlows.Uin = jetRecFlows.Fin / jetRecFlows.Area;
     519              :             } else {
     520            0 :                 jetRecFlows.Uin = 0.0;
     521              :             }
     522              :         }
     523              : 
     524              :         // Verify if Uin is higher than minimum for each aperture
     525              :         // Create a flow flag for each aperture
     526              :         // Calculate the total area of all active apertures
     527            1 :         ActiveSurfNum = 0.0;
     528            1 :         state.dataRoomAir->Ain(ZoneNum) = 0.0;
     529            2 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
     530            1 :             auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
     531            1 :             jetRecFlows.FlowFlag = (int)(jetRecFlows.Uin > MinUin);
     532              : 
     533            1 :             ActiveSurfNum += jetRecFlows.FlowFlag;
     534            1 :             state.dataRoomAir->Ain(ZoneNum) += jetRecFlows.Area * jetRecFlows.FlowFlag;
     535              :         }
     536              : 
     537              :         // Verify if any of the apertures have minimum flow
     538            1 :         if (ActiveSurfNum == 0) {
     539            0 :             state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
     540            0 :             if (thisSurface.ExtBoundCond > 0) {
     541            0 :                 state.dataRoomAir->Tin(ZoneNum) =
     542            0 :                     state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
     543            0 :             } else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
     544            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     545            0 :             } else if (thisSurface.ExtBoundCond == Ground) {
     546            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     547            0 :             } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
     548            0 :                 auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
     549            0 :                 thisOSC.OSCTempCalc =
     550            0 :                     (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
     551            0 :                      thisOSC.ConstTempCoef * thisOSC.ConstTemp +
     552            0 :                      thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp[(int)DataEnvironment::GroundTempType::BuildingSurface] +
     553            0 :                      thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
     554            0 :                 state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
     555            0 :             } else {
     556            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     557              :             }
     558            0 :             state.dataRoomAir->Urec(ZoneNum) = 0.0;
     559            0 :             state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     560            0 :             state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     561            0 :             auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
     562            0 :             for (int i = 1, u = flows.u(); i <= u; ++i) {
     563            0 :                 auto &e(flows(i));
     564            0 :                 e.Ujet = e.Urec = 0.0;
     565              :             }
     566            0 :             return;
     567            0 :         }
     568              : 
     569              :         // Calculate Uin, the area weighted average velocity of all the active apertures in the zone
     570              :         // Calculate Qtot, the total volumetric flow rate through all active openings in the zone
     571            1 :         Uin = 0.0;
     572              : 
     573            2 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
     574            1 :             auto const &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
     575            1 :             Uin += jetRecFlows.Area * jetRecFlows.Uin * jetRecFlows.FlowFlag / state.dataRoomAir->Ain(ZoneNum);
     576              :         }
     577              : 
     578              :         // Verify if Uin is higher than minimum:
     579            1 :         if (Uin < MinUin) {
     580            0 :             state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
     581            0 :             state.dataRoomAir->Urec(ZoneNum) = 0.0;
     582            0 :             state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     583            0 :             state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     584            0 :             state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
     585            0 :             auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
     586            0 :             for (int i = 1, u = flows.u(); i <= u; ++i) {
     587            0 :                 auto &e(flows(i));
     588            0 :                 e.Ujet = e.Urec = 0.0;
     589              :             }
     590            0 :             if (thisSurface.ExtBoundCond > 0) {
     591            0 :                 state.dataRoomAir->Tin(ZoneNum) =
     592            0 :                     state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
     593            0 :             } else if (thisSurface.ExtBoundCond == ExternalEnvironment) {
     594            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     595            0 :             } else if (thisSurface.ExtBoundCond == Ground) {
     596            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     597            0 :             } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
     598            0 :                 auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
     599            0 :                 thisOSC.OSCTempCalc =
     600            0 :                     (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
     601            0 :                      thisOSC.ConstTempCoef * thisOSC.ConstTemp +
     602            0 :                      thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp[(int)DataEnvironment::GroundTempType::BuildingSurface] +
     603            0 :                      thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
     604            0 :                 state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
     605              : 
     606            0 :             } else {
     607            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     608              :             }
     609            0 :             return;
     610            0 :         }
     611              : 
     612              :         // Evaluate parameter that determines whether recirculations are present
     613            1 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) {
     614            0 :             if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) {
     615            0 :                 if (state.dataRoomAir->Ain(ZoneNum) / Aroom > 1.0 / 2.0) {
     616            0 :                     state.dataRoomAir->JetRecAreaRatio(ZoneNum) = 1.0;
     617              :                 } else {
     618            0 :                     state.dataRoomAir->JetRecAreaRatio(ZoneNum) = std::sqrt(state.dataRoomAir->Ain(ZoneNum) / Aroom);
     619              :                 }
     620              :             }
     621              :         }
     622              : 
     623            1 :         state.dataRoomAir->AirModel(ZoneNum).SimAirModel = true;
     624              :         // Calculate jet and recirculation velocities for all active apertures
     625            1 :         state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     626            1 :         state.dataRoomAir->Urec(ZoneNum) = 0.0;
     627            1 :         state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     628            1 :         state.dataRoomAir->Qtot(ZoneNum) = 0.0;
     629            1 :         auto flows(state.dataRoomAir->CrossVentJetRecFlows(_, ZoneNum)); // This is an array slice, need to get rid of this (THIS_AUTO_OK)
     630            4 :         for (int i = 1, u = flows.u(); i <= u; ++i) {
     631            3 :             auto &e(flows(i));
     632            3 :             e.Ujet = e.Urec = e.Qrec = 0.0;
     633              :         }
     634            2 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->AFNSurfaceCrossVent(0, ZoneNum); ++Ctd) {
     635            1 :             auto &jetRecFlows = state.dataRoomAir->CrossVentJetRecFlows(Ctd, ZoneNum);
     636            1 :             if (jetRecFlows.Uin == 0) {
     637            0 :                 continue;
     638              :             }
     639              : 
     640            1 :             Real64 dstarexp = max(state.dataRoomAir->Dstar(ZoneNum) / (6.0 * std::sqrt(jetRecFlows.Area)), 1.0);
     641            1 :             jetRecFlows.Vjet = jetRecFlows.Uin * std::sqrt(jetRecFlows.Area) * 6.3 * std::log(dstarexp) / state.dataRoomAir->Dstar(ZoneNum);
     642            1 :             jetRecFlows.Yjet = Cjet1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Cjet2;
     643            1 :             jetRecFlows.Yrec = Crec1 * std::sqrt(jetRecFlows.Area / Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + Crec2;
     644            1 :             jetRecFlows.YQrec = CrecFlow1 * std::sqrt(jetRecFlows.Area * Aroom) * jetRecFlows.Vjet / jetRecFlows.Uin + CrecFlow2;
     645            1 :             jetRecFlows.Ujet = jetRecFlows.FlowFlag * jetRecFlows.Yjet / jetRecFlows.Uin;
     646            1 :             jetRecFlows.Urec = jetRecFlows.FlowFlag * jetRecFlows.Yrec / jetRecFlows.Uin;
     647            1 :             jetRecFlows.Qrec = jetRecFlows.FlowFlag * jetRecFlows.YQrec / jetRecFlows.Uin;
     648            1 :             state.dataRoomAir->Ujet(ZoneNum) += jetRecFlows.Area * jetRecFlows.Ujet / state.dataRoomAir->Ain(ZoneNum);
     649            1 :             state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum);
     650            1 :             state.dataRoomAir->Qrec(ZoneNum) += jetRecFlows.Qrec;
     651            1 :             state.dataRoomAir->Qtot(ZoneNum) += jetRecFlows.Fin * jetRecFlows.FlowFlag;
     652            1 :             state.dataRoomAir->Urec(ZoneNum) += jetRecFlows.Area * jetRecFlows.Urec / state.dataRoomAir->Ain(ZoneNum);
     653              :         }
     654              : 
     655              :         // Ratio between recirculation flow rate and total inflow rate
     656            1 :         if (state.dataRoomAir->Qtot(ZoneNum) != 0) {
     657            1 :             state.dataRoomAir->RecInflowRatio(ZoneNum) = state.dataRoomAir->Qrec(ZoneNum) / state.dataRoomAir->Qtot(ZoneNum);
     658              :         } else {
     659            0 :             state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
     660              :         }
     661              : 
     662              :         // Set Tin based on external conditions of the dominant aperture
     663            1 :         if (thisSurface.ExtBoundCond <= 0) {
     664            1 :             if (thisSurface.ExtBoundCond == ExternalEnvironment) {
     665            1 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     666            0 :             } else if (thisSurface.ExtBoundCond == Ground) {
     667            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     668            0 :             } else if (thisSurface.ExtBoundCond == OtherSideCoefNoCalcExt || thisSurface.ExtBoundCond == OtherSideCoefCalcExt) {
     669            0 :                 auto &thisOSC = state.dataSurface->OSC(thisSurface.OSCPtr);
     670            0 :                 thisOSC.OSCTempCalc =
     671            0 :                     (thisOSC.ZoneAirTempCoef * thisZoneHB.MAT + thisOSC.ExtDryBulbCoef * state.dataSurface->SurfOutDryBulbTemp(surfNum) +
     672            0 :                      thisOSC.ConstTempCoef * thisOSC.ConstTemp +
     673            0 :                      thisOSC.GroundTempCoef * state.dataEnvrn->GroundTemp[(int)DataEnvironment::GroundTempType::BuildingSurface] +
     674            0 :                      thisOSC.WindSpeedCoef * state.dataSurface->SurfOutWindSpeed(surfNum) * state.dataSurface->SurfOutDryBulbTemp(surfNum));
     675            0 :                 state.dataRoomAir->Tin(ZoneNum) = thisOSC.OSCTempCalc;
     676            0 :             } else {
     677            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     678              :             }
     679              :         } else {
     680              :             // adiabatic surface
     681            0 :             if (surfNum == thisSurface.ExtBoundCond) {
     682            0 :                 int NodeNum1 = state.afn->AirflowNetworkLinkageData(MaxSurf).NodeNums[0];
     683            0 :                 int NodeNum2 = state.afn->AirflowNetworkLinkageData(MaxSurf).NodeNums[1];
     684            0 :                 if (thisSurface.Zone == ZoneNum) {
     685            0 :                     if (state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum <= 0) {
     686            0 :                         state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     687            0 :                     } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).AirModel ==
     688              :                                RoomAir::RoomAirModel::CrossVent) {
     689            0 :                         state.dataRoomAir->Tin(ZoneNum) =
     690            0 :                             state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum);
     691              :                     } else {
     692            0 :                         state.dataRoomAir->Tin(ZoneNum) =
     693            0 :                             state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum1).EPlusZoneNum).MAT;
     694              :                     }
     695              : 
     696              :                 } else {
     697              : 
     698            0 :                     if (state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum <= 0) {
     699            0 :                         state.dataRoomAir->Tin(ZoneNum) = state.dataSurface->SurfOutDryBulbTemp(surfNum);
     700            0 :                     } else if (state.dataRoomAir->AirModel(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).AirModel ==
     701              :                                RoomAir::RoomAirModel::CrossVent) {
     702            0 :                         state.dataRoomAir->Tin(ZoneNum) =
     703            0 :                             state.dataRoomAir->RoomOutflowTemp(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum);
     704              :                     } else {
     705            0 :                         state.dataRoomAir->Tin(ZoneNum) =
     706            0 :                             state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.afn->AirflowNetworkNodeData(NodeNum2).EPlusZoneNum).MAT;
     707              :                     }
     708              :                 }
     709            0 :             } else if ((thisSurface.Zone == ZoneNum) &&
     710            0 :                        (state.dataRoomAir->AirModel(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).AirModel ==
     711              :                         RoomAir::RoomAirModel::CrossVent)) {
     712            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone);
     713            0 :             } else if ((thisSurface.Zone != ZoneNum) &&
     714            0 :                        (state.dataRoomAir->AirModel(thisSurface.Zone).AirModel == RoomAir::RoomAirModel::CrossVent)) {
     715            0 :                 state.dataRoomAir->Tin(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(surfNum);
     716              :             } else {
     717            0 :                 if (thisSurface.Zone == ZoneNum) {
     718            0 :                     state.dataRoomAir->Tin(ZoneNum) =
     719            0 :                         state.dataZoneTempPredictorCorrector->zoneHeatBalance(state.dataSurface->Surface(thisSurface.ExtBoundCond).Zone).MAT;
     720              :                 } else {
     721            0 :                     state.dataRoomAir->Tin(ZoneNum) = state.dataZoneTempPredictorCorrector->zoneHeatBalance(thisSurface.Zone).MAT;
     722              :                 }
     723              :             }
     724              :         }
     725            1 :     }
     726              : 
     727            0 :     void CalcCrossVent(EnergyPlusData &state,
     728              :                        int const ZoneNum) // Which Zonenum
     729              :     {
     730              : 
     731              :         // SUBROUTINE INFORMATION:
     732              :         //       AUTHOR         G. Carrilho da Graca
     733              :         //       DATE WRITTEN   October 2004
     734              :         //       MODIFIED       8/2013 - Sam Brunswick
     735              :         //                      To incorporate improved temperature calculations
     736              : 
     737              :         // PURPOSE OF THIS SUBROUTINE:
     738              :         // Subroutine for cross ventilation modelling.
     739              : 
     740              :         // REFERENCES:
     741              :         // Model developed by Paul Linden (UCSD), G. Carrilho da Graca (UCSD) and P. Haves (LBL).
     742              :         // Work funded by the California Energy Comission. More information on the model can found in:
     743              :         // "Simplified Models for Heat Transfer in Rooms" G. Carrilho da Graca, Ph.D. thesis UCSD. December 2003.
     744              : 
     745            0 :         auto const &zone = state.dataHeatBal->Zone(ZoneNum);
     746              : 
     747            0 :         Real64 GainsFrac = 0.0;                                  // Fraction of lower subzone internal gains that mix as opposed to forming plumes
     748            0 :         Real64 ZoneMult = zone.Multiplier * zone.ListMultiplier; // total zone multiplier
     749            0 :         auto const &thisZoneHB = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum);
     750              : 
     751            0 :         for (int Ctd = 1; Ctd <= state.dataRoomAir->TotCrossVent; ++Ctd) {
     752            0 :             if (ZoneNum == state.dataRoomAir->ZoneCrossVent(Ctd).ZonePtr) {
     753            0 :                 GainsFrac = state.dataRoomAir->ZoneCrossVent(Ctd).gainsSched->getCurrentVal();
     754              :             }
     755              :         }
     756              : 
     757              :         // Total convective gains in the room
     758            0 :         Real64 ConvGains = InternalHeatGains::zoneSumAllInternalConvectionGains(state, ZoneNum);
     759            0 :         ConvGains += state.dataHeatBalFanSys->SumConvHTRadSys(ZoneNum) + state.dataHeatBalFanSys->SumConvPool(ZoneNum) +
     760            0 :                      thisZoneHB.SysDepZoneLoadsLagged + thisZoneHB.NonAirSystemResponse / ZoneMult;
     761              : 
     762              :         // Add heat to return air if zonal system (no return air) or cycling system (return air frequently very low or zero)
     763            0 :         if (zone.NoHeatToReturnAir) {
     764            0 :             Real64 RetAirConvGain = InternalHeatGains::zoneSumAllReturnAirConvectionGains(state, ZoneNum, 0);
     765            0 :             ConvGains += RetAirConvGain;
     766              :         }
     767              : 
     768            0 :         Real64 ConvGainsJet = ConvGains * GainsFrac;         // Total convective gains released in jet subzone
     769            0 :         Real64 ConvGainsRec = ConvGains * (1.0 - GainsFrac); // Total convective gains released in recirculation subzone
     770            0 :         Real64 MCp_Total = thisZoneHB.MCPI + thisZoneHB.MCPV + thisZoneHB.MCPM + thisZoneHB.MCPE + thisZoneHB.MCPC + thisZoneHB.MDotCPOA;
     771            0 :         Real64 MCpT_Total =
     772            0 :             thisZoneHB.MCPTI + thisZoneHB.MCPTV + thisZoneHB.MCPTM + thisZoneHB.MCPTE + thisZoneHB.MCPTC + thisZoneHB.MDotCPOA * zone.OutDryBulbTemp;
     773              : 
     774            0 :         if (state.afn->simulation_control.type == AirflowNetwork::ControlType::MultizoneWithoutDistribution) {
     775            0 :             MCp_Total = state.afn->exchangeData(ZoneNum).SumMCp + state.afn->exchangeData(ZoneNum).SumMVCp + state.afn->exchangeData(ZoneNum).SumMMCp;
     776            0 :             MCpT_Total =
     777            0 :                 state.afn->exchangeData(ZoneNum).SumMCpT + state.afn->exchangeData(ZoneNum).SumMVCpT + state.afn->exchangeData(ZoneNum).SumMMCpT;
     778              :         }
     779              : 
     780            0 :         EvolveParaCrossVent(state, ZoneNum);
     781              :         // Real64 L = state.dataRoomAir->Droom(ZoneNum);
     782              : 
     783            0 :         if (state.dataRoomAir->AirModel(ZoneNum).SimAirModel) {
     784              :             //=============================== CROSS VENTILATION  Calculation ==============================================
     785            0 :             state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 0.0;
     786            0 :             state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 1.0;
     787            0 :             for (int Ctd = 1; Ctd <= 4; ++Ctd) {
     788            0 :                 HcCrossVent(state, ZoneNum);
     789            0 :                 if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) != 1.0) {
     790            0 :                     state.dataRoomAir->ZTREC(ZoneNum) =
     791            0 :                         (ConvGainsRec * CrecTemp + CrecTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total) /
     792            0 :                         (CrecTemp * state.dataCrossVentMgr->HA_R + MCp_Total);
     793              :                 }
     794            0 :                 state.dataRoomAir->ZTJET(ZoneNum) = (ConvGainsJet * CjetTemp + ConvGainsRec * CjetTemp + CjetTemp * state.dataCrossVentMgr->HAT_J +
     795            0 :                                                      CjetTemp * state.dataCrossVentMgr->HAT_R + state.dataRoomAir->Tin(ZoneNum) * MCp_Total -
     796            0 :                                                      CjetTemp * state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) /
     797            0 :                                                     (CjetTemp * state.dataCrossVentMgr->HA_J + MCp_Total);
     798            0 :                 state.dataRoomAir->RoomOutflowTemp(ZoneNum) =
     799            0 :                     (ConvGainsJet + ConvGainsRec + state.dataCrossVentMgr->HAT_J + state.dataCrossVentMgr->HAT_R +
     800            0 :                      state.dataRoomAir->Tin(ZoneNum) * MCp_Total - state.dataCrossVentMgr->HA_J * state.dataRoomAir->ZTJET(ZoneNum) -
     801            0 :                      state.dataCrossVentMgr->HA_R * state.dataRoomAir->ZTREC(ZoneNum)) /
     802              :                     MCp_Total;
     803              :             }
     804            0 :             if (state.dataRoomAir->JetRecAreaRatio(ZoneNum) == 1.0) {
     805            0 :                 state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
     806            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->RoomOutflowTemp(ZoneNum);
     807            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum);
     808            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = state.dataRoomAir->ZTJET(ZoneNum);
     809              :             }
     810              :             // If temperature increase is above 1.5C then go to mixing
     811            0 :             if (state.dataRoomAir->RoomOutflowTemp(ZoneNum) - state.dataRoomAir->Tin(ZoneNum) > 1.5) {
     812            0 :                 state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0;
     813            0 :                 state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
     814            0 :                 state.dataRoomAir->AirModel(ZoneNum).SimAirModel = false;
     815            0 :                 state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     816            0 :                 state.dataRoomAir->Urec(ZoneNum) = 0.0;
     817            0 :                 state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     818            0 :                 state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
     819            0 :                 for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) {
     820            0 :                     e.Ujet = 0.0;
     821            0 :                     e.Urec = 0.0;
     822              :                 }
     823            0 :                 for (int Ctd = 1; Ctd <= 3; ++Ctd) {
     824            0 :                     Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
     825            0 :                     state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     826            0 :                     state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     827            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     828            0 :                     state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     829            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     830            0 :                     state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     831            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     832            0 :                     HcCrossVent(state, ZoneNum);
     833            0 :                     ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
     834            0 :                     state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     835            0 :                     state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     836            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     837            0 :                     state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     838            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     839            0 :                     state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     840            0 :                     state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     841              :                 }
     842              :             }
     843              :         } else {
     844              :             //=============================== M I X E D  Calculation ======================================================
     845            0 :             state.dataRoomAir->ZoneCrossVentIsMixing(ZoneNum) = 1.0;
     846            0 :             state.dataRoomAir->ZoneCrossVentHasREC(ZoneNum) = 0.0;
     847            0 :             state.dataRoomAir->Ujet(ZoneNum) = 0.0;
     848            0 :             state.dataRoomAir->Urec(ZoneNum) = 0.0;
     849            0 :             state.dataRoomAir->Qrec(ZoneNum) = 0.0;
     850            0 :             state.dataRoomAir->RecInflowRatio(ZoneNum) = 0.0;
     851            0 :             for (auto &e : state.dataRoomAir->CrossVentJetRecFlows) {
     852            0 :                 e.Ujet = 0.0;
     853            0 :                 e.Urec = 0.0;
     854              :             }
     855            0 :             for (int Ctd = 1; Ctd <= 3; ++Ctd) {
     856            0 :                 Real64 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
     857            0 :                 state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     858            0 :                 state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     859            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     860            0 :                 state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     861            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     862            0 :                 state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     863            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     864            0 :                 HcCrossVent(state, ZoneNum);
     865            0 :                 ZTAveraged = state.dataZoneTempPredictorCorrector->zoneHeatBalance(ZoneNum).MAT;
     866            0 :                 state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     867            0 :                 state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     868            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     869            0 :                 state.dataRoomAir->RoomOutflowTemp(ZoneNum) = ZTAveraged;
     870            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     871            0 :                 state.dataRoomAir->ZTJET(ZoneNum) = ZTAveraged;
     872            0 :                 state.dataRoomAir->ZTREC(ZoneNum) = ZTAveraged;
     873              :             }
     874              :         }
     875            0 :     }
     876              : 
     877              : } // namespace RoomAir
     878              : 
     879              : } // namespace EnergyPlus
        

Generated by: LCOV version 2.0-1