LCOV - code coverage report
Current view: top level - EnergyPlus - HeatBalanceHAMTManager.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 0.0 % 865 0
Test Date: 2025-06-02 12:03:30 Functions: 0.0 % 8 0

            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 <cmath>
      50              : #include <string>
      51              : 
      52              : // ObjexxFCL Headers
      53              : #include <ObjexxFCL/Fmath.hh>
      54              : #include <ObjexxFCL/member.functions.hh>
      55              : 
      56              : // EnergyPlus Headers
      57              : #include <EnergyPlus/Construction.hh>
      58              : #include <EnergyPlus/Data/EnergyPlusData.hh>
      59              : #include <EnergyPlus/DataEnvironment.hh>
      60              : #include <EnergyPlus/DataHeatBalSurface.hh>
      61              : #include <EnergyPlus/DataHeatBalance.hh>
      62              : #include <EnergyPlus/DataIPShortCuts.hh>
      63              : #include <EnergyPlus/DataMoistureBalance.hh>
      64              : #include <EnergyPlus/DataSurfaces.hh>
      65              : #include <EnergyPlus/DisplayRoutines.hh>
      66              : #include <EnergyPlus/General.hh>
      67              : #include <EnergyPlus/HeatBalanceHAMTManager.hh>
      68              : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
      69              : #include <EnergyPlus/Material.hh>
      70              : #include <EnergyPlus/OutputProcessor.hh>
      71              : #include <EnergyPlus/Psychrometrics.hh>
      72              : #include <EnergyPlus/UtilityRoutines.hh>
      73              : #include <EnergyPlus/ZoneTempPredictorCorrector.hh>
      74              : 
      75              : namespace EnergyPlus {
      76              : 
      77              : namespace HeatBalanceHAMTManager {
      78              : 
      79              :     // MODULE INFORMATION:
      80              :     //       AUTHOR      Phillip Biddulph
      81              :     //       DATE WRITTEN   June 2008
      82              :     //       MODIFIED
      83              :     //       Bug fixes to make sure HAMT can cope with data limits  ! PDB August 2009
      84              :     //       RE-ENGINEERED
      85              : 
      86              :     // PURPOSE OF THIS MODULE:
      87              :     // Calculate, record and report the one dimentional heat and moisture transfer
      88              :     // through a surface given the material composition of the building surface and
      89              :     // the external and internal Temperatures and Relative Humidities.
      90              : 
      91              :     // METHODOLOGY EMPLOYED:
      92              :     // Each surface is split into "cells", where all characteristics are initiallised.
      93              :     // Cells are matched and links created in the initialisation routine.
      94              :     // The internal and external "surfaces" of the surface are virtual cells to allow for the
      95              :     // input of heat and vapor via heat transfer coefficients, radiation,
      96              :     // and vapor transfer coefficients
      97              :     // Uses Forward (implicit) finite difference alogorithm. Heat transfer is caclulated first,
      98              :     // with the option of including the latent heat, then liquid and vapor transfer. The process is ittereated.
      99              :     // Once the temperatures have converged the internal surface
     100              :     // temperature and vapor densities are passed back to EnergyPlus.
     101              : 
     102              :     // Temperatures and relative humidities are updated once EnergyPlus has checked that
     103              :     // the zone temperatures have converged.
     104              : 
     105              :     // REFERENCES:
     106              :     // K?zel, H.M. (1995) Simultaneous Heat and Moisture Transport in Building Components.
     107              :     // One- and two-dimensional calculation using simple parameters. IRB Verlag 1995
     108              :     // Holman, J.P. (2002) Heat Transfer, Ninth Edition. McGraw-Hill
     109              :     // Winterton, R.H.S. (1997) Heat Transfer. (Oxford Chemistry Primers; 50) Oxford University Press
     110              :     // Kumar Kumaran, M. (1996) IEA ANNEX 24, Final Report, Volume 3
     111              : 
     112              :     // USE STATEMENTS:
     113              : 
     114              :     // Using/Aliasing
     115              :     using namespace DataSurfaces;
     116              :     using DataHeatBalSurface::MinSurfaceTempLimit;
     117              :     using DataHeatBalSurface::MinSurfaceTempLimitBeforeFatal;
     118              :     using namespace DataHeatBalance;
     119              :     using namespace Psychrometrics;
     120              : 
     121            0 :     void ManageHeatBalHAMT(EnergyPlusData &state, int const SurfNum, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp)
     122              :     {
     123              : 
     124              :         // SUBROUTINE INFORMATION:
     125              :         //       AUTHOR         Phillip Biddulph
     126              :         //       DATE WRITTEN   June 2008
     127              :         //       MODIFIED       na
     128              :         //       RE-ENGINEERED  na
     129              : 
     130              :         // PURPOSE OF THIS SUBROUTINE:
     131              :         // Manages the Heat and Moisture Transfer calculations.
     132              : 
     133              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     134            0 :         if (state.dataHeatBalHAMTMgr->OneTimeFlag) {
     135            0 :             state.dataHeatBalHAMTMgr->OneTimeFlag = false;
     136            0 :             DisplayString(state, "Initialising Heat and Moisture Transfer Model");
     137            0 :             GetHeatBalHAMTInput(state);
     138            0 :             InitHeatBalHAMT(state);
     139              :         }
     140              : 
     141            0 :         CalcHeatBalHAMT(state, SurfNum, SurfTempInTmp, TempSurfOutTmp);
     142            0 :     }
     143              : 
     144            0 :     void GetHeatBalHAMTInput(EnergyPlusData &state)
     145              :     {
     146              : 
     147              :         // SUBROUTINE INFORMATION:
     148              :         //       AUTHOR         Phillip Biddulph
     149              :         //       DATE WRITTEN   June 2008
     150              :         //       MODIFIED       na
     151              :         //       RE-ENGINEERED  na
     152              : 
     153              :         // PURPOSE OF THIS SUBROUTINE:
     154              :         // gets input for the HAMT model
     155              :         static constexpr std::string_view routineName = "GetHeatBalHAMTInput";
     156              : 
     157              :         // SUBROUTINE PARAMETER DEFINITIONS:
     158            0 :         static std::string const cHAMTObject1("MaterialProperty:HeatAndMoistureTransfer:Settings");
     159            0 :         static std::string const cHAMTObject2("MaterialProperty:HeatAndMoistureTransfer:SorptionIsotherm");
     160            0 :         static std::string const cHAMTObject3("MaterialProperty:HeatAndMoistureTransfer:Suction");
     161            0 :         static std::string const cHAMTObject4("MaterialProperty:HeatAndMoistureTransfer:Redistribution");
     162            0 :         static std::string const cHAMTObject5("MaterialProperty:HeatAndMoistureTransfer:Diffusion");
     163            0 :         static std::string const cHAMTObject6("MaterialProperty:HeatAndMoistureTransfer:ThermalConductivity");
     164            0 :         static std::string const cHAMTObject7("SurfaceProperties:VaporCoefficients");
     165              : 
     166              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     167              : 
     168            0 :         Array1D_string AlphaArray;
     169            0 :         Array1D_string cAlphaFieldNames;
     170            0 :         Array1D_string cNumericFieldNames;
     171              : 
     172            0 :         Array1D_bool lAlphaBlanks;
     173            0 :         Array1D_bool lNumericBlanks;
     174              : 
     175            0 :         Array1D<Real64> NumArray;
     176              : 
     177              :         Real64 avdata;
     178              : 
     179              :         int MaxNums;
     180              :         int MaxAlphas;
     181              :         int NumParams;
     182              :         int NumNums;
     183              :         int NumAlphas;
     184              :         int status;
     185              :         int Numid;
     186              : 
     187              :         int HAMTitems;
     188              :         int vtcsid;
     189              : 
     190              :         bool ErrorsFound;
     191              : 
     192            0 :         auto &s_ip = state.dataInputProcessing->inputProcessor;
     193            0 :         auto &s_mat = state.dataMaterial;
     194              : 
     195            0 :         state.dataHeatBalHAMTMgr->watertot.allocate(state.dataSurface->TotSurfaces);
     196            0 :         state.dataHeatBalHAMTMgr->surfrh.allocate(state.dataSurface->TotSurfaces);
     197            0 :         state.dataHeatBalHAMTMgr->surfextrh.allocate(state.dataSurface->TotSurfaces);
     198            0 :         state.dataHeatBalHAMTMgr->surftemp.allocate(state.dataSurface->TotSurfaces);
     199            0 :         state.dataHeatBalHAMTMgr->surfexttemp.allocate(state.dataSurface->TotSurfaces);
     200            0 :         state.dataHeatBalHAMTMgr->surfvp.allocate(state.dataSurface->TotSurfaces);
     201              : 
     202            0 :         state.dataHeatBalHAMTMgr->firstcell.allocate(state.dataSurface->TotSurfaces);
     203            0 :         state.dataHeatBalHAMTMgr->lastcell.allocate(state.dataSurface->TotSurfaces);
     204            0 :         state.dataHeatBalHAMTMgr->Extcell.allocate(state.dataSurface->TotSurfaces);
     205            0 :         state.dataHeatBalHAMTMgr->ExtRadcell.allocate(state.dataSurface->TotSurfaces);
     206            0 :         state.dataHeatBalHAMTMgr->ExtConcell.allocate(state.dataSurface->TotSurfaces);
     207            0 :         state.dataHeatBalHAMTMgr->ExtSkycell.allocate(state.dataSurface->TotSurfaces);
     208            0 :         state.dataHeatBalHAMTMgr->ExtGrncell.allocate(state.dataSurface->TotSurfaces);
     209            0 :         state.dataHeatBalHAMTMgr->Intcell.allocate(state.dataSurface->TotSurfaces);
     210            0 :         state.dataHeatBalHAMTMgr->IntConcell.allocate(state.dataSurface->TotSurfaces);
     211              : 
     212            0 :         state.dataHeatBalHAMTMgr->extvtc.allocate(state.dataSurface->TotSurfaces);
     213            0 :         state.dataHeatBalHAMTMgr->intvtc.allocate(state.dataSurface->TotSurfaces);
     214            0 :         state.dataHeatBalHAMTMgr->extvtcflag.allocate(state.dataSurface->TotSurfaces);
     215            0 :         state.dataHeatBalHAMTMgr->intvtcflag.allocate(state.dataSurface->TotSurfaces);
     216            0 :         state.dataHeatBalHAMTMgr->MyEnvrnFlag.allocate(state.dataSurface->TotSurfaces);
     217              : 
     218            0 :         state.dataHeatBalHAMTMgr->extvtc = -1.0;
     219            0 :         state.dataHeatBalHAMTMgr->intvtc = -1.0;
     220            0 :         state.dataHeatBalHAMTMgr->extvtcflag = false;
     221            0 :         state.dataHeatBalHAMTMgr->intvtcflag = false;
     222            0 :         state.dataHeatBalHAMTMgr->MyEnvrnFlag = true;
     223              : 
     224            0 :         state.dataHeatBalHAMTMgr->latswitch = true;
     225            0 :         state.dataHeatBalHAMTMgr->rainswitch = true;
     226              : 
     227            0 :         MaxAlphas = 0;
     228            0 :         MaxNums = 0;
     229            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject1, NumParams, NumAlphas, NumNums);
     230            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     231            0 :         MaxNums = max(MaxNums, NumNums);
     232            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject2, NumParams, NumAlphas, NumNums);
     233            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     234            0 :         MaxNums = max(MaxNums, NumNums);
     235            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject3, NumParams, NumAlphas, NumNums);
     236            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     237            0 :         MaxNums = max(MaxNums, NumNums);
     238            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject4, NumParams, NumAlphas, NumNums);
     239            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     240            0 :         MaxNums = max(MaxNums, NumNums);
     241            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject5, NumParams, NumAlphas, NumNums);
     242            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     243            0 :         MaxNums = max(MaxNums, NumNums);
     244            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject6, NumParams, NumAlphas, NumNums);
     245            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     246            0 :         MaxNums = max(MaxNums, NumNums);
     247            0 :         s_ip->getObjectDefMaxArgs(state, cHAMTObject7, NumParams, NumAlphas, NumNums);
     248            0 :         MaxAlphas = max(MaxAlphas, NumAlphas);
     249            0 :         MaxNums = max(MaxNums, NumNums);
     250              : 
     251            0 :         ErrorsFound = false;
     252              : 
     253            0 :         AlphaArray.allocate(MaxAlphas);
     254            0 :         cAlphaFieldNames.allocate(MaxAlphas);
     255            0 :         cNumericFieldNames.allocate(MaxNums);
     256            0 :         NumArray.dimension(MaxNums, 0.0);
     257            0 :         lAlphaBlanks.dimension(MaxAlphas, false);
     258            0 :         lNumericBlanks.dimension(MaxNums, false);
     259              : 
     260            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject1); // MaterialProperty:HeatAndMoistureTransfer:Settings
     261            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     262            0 :             s_ip->getObjectItem(state,
     263              :                                 cHAMTObject1,
     264              :                                 item,
     265              :                                 AlphaArray,
     266              :                                 NumAlphas,
     267              :                                 NumArray,
     268              :                                 NumNums,
     269              :                                 status,
     270              :                                 lNumericBlanks,
     271              :                                 lAlphaBlanks,
     272              :                                 cAlphaFieldNames,
     273              :                                 cNumericFieldNames);
     274              : 
     275            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject1, AlphaArray(1)};
     276            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     277              : 
     278            0 :             if (matNum == 0) {
     279            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     280            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     281            0 :                 ErrorsFound = true;
     282            0 :                 continue;
     283              :             }
     284              : 
     285            0 :             auto *mat = s_mat->materials(matNum);
     286              : 
     287            0 :             if (mat->group != Material::Group::Regular) {
     288            0 :                 ShowSevereCustom(state, eoh, format("{} = \"{}\" is not a regular material.", cAlphaFieldNames(1), AlphaArray(1)));
     289            0 :                 ErrorsFound = true;
     290            0 :                 continue;
     291              :             }
     292              : 
     293            0 :             if (mat->ROnly) {
     294            0 :                 ShowWarningError(state,
     295            0 :                                  format("{} {}=\"{}\" is defined as an R-only value material.", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     296            0 :                 continue;
     297              :             }
     298              : 
     299            0 :             auto *matHAMT = new MaterialHAMT;
     300            0 :             matHAMT->Material::MaterialBase::operator=(*mat); // deep copy
     301              : 
     302            0 :             delete mat;
     303            0 :             s_mat->materials(matNum) = matHAMT;
     304              : 
     305            0 :             matHAMT->hasHAMT = true;
     306            0 :             matHAMT->Porosity = NumArray(1);
     307            0 :             matHAMT->iwater = NumArray(2);
     308              :         }
     309              : 
     310            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject2); // MaterialProperty:HeatAndMoistureTransfer:SorptionIsotherm
     311            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     312            0 :             s_ip->getObjectItem(state,
     313              :                                 cHAMTObject2,
     314              :                                 item,
     315              :                                 AlphaArray,
     316              :                                 NumAlphas,
     317              :                                 NumArray,
     318              :                                 NumNums,
     319              :                                 status,
     320              :                                 lNumericBlanks,
     321              :                                 lAlphaBlanks,
     322              :                                 cAlphaFieldNames,
     323              :                                 cNumericFieldNames);
     324              : 
     325            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject2, AlphaArray(1)};
     326            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     327              : 
     328            0 :             if (matNum == 0) {
     329            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     330            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     331            0 :                 ErrorsFound = true;
     332            0 :                 continue;
     333              :             }
     334              : 
     335            0 :             auto *mat = s_mat->materials(matNum);
     336            0 :             if (!mat->hasHAMT) {
     337            0 :                 ShowSevereCustom(state, eoh, format("{} is not defined for {} = \"{}\"", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     338            0 :                 ErrorsFound = true;
     339            0 :                 continue;
     340              :             }
     341              : 
     342            0 :             auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     343            0 :             assert(matHAMT != nullptr);
     344              : 
     345            0 :             Numid = 1;
     346              : 
     347            0 :             matHAMT->niso = int(NumArray(Numid));
     348              : 
     349            0 :             for (int iso = 1; iso <= matHAMT->niso; ++iso) {
     350            0 :                 matHAMT->isorh(iso) = NumArray(++Numid);
     351            0 :                 matHAMT->isodata(iso) = NumArray(++Numid);
     352              :             }
     353              : 
     354            0 :             ++matHAMT->niso;
     355            0 :             matHAMT->isorh(matHAMT->niso) = rhmax;
     356            0 :             matHAMT->isodata(matHAMT->niso) = matHAMT->Porosity * wdensity;
     357              : 
     358            0 :             ++matHAMT->niso;
     359            0 :             matHAMT->isorh(matHAMT->niso) = 0.0;
     360            0 :             matHAMT->isodata(matHAMT->niso) = 0.0;
     361              : 
     362              :             // check the isotherm
     363              : 
     364              :             // - First sort
     365            0 :             for (int jj = 1; jj <= matHAMT->niso - 1; ++jj) {
     366            0 :                 for (int ii = jj + 1; ii <= matHAMT->niso; ++ii) {
     367            0 :                     if (matHAMT->isorh(jj) > matHAMT->isorh(ii)) {
     368              : 
     369            0 :                         Real64 dumrh = matHAMT->isorh(jj);
     370            0 :                         Real64 dumdata = matHAMT->isodata(jj);
     371              : 
     372            0 :                         matHAMT->isorh(jj) = matHAMT->isorh(ii);
     373            0 :                         matHAMT->isodata(jj) = matHAMT->isodata(ii);
     374              : 
     375            0 :                         matHAMT->isorh(ii) = dumrh;
     376            0 :                         matHAMT->isodata(ii) = dumdata;
     377              :                     }
     378              :                 }
     379              :             }
     380              : 
     381              :             //- Now make sure the data rises
     382            0 :             bool isoerrrise = false;
     383            0 :             for (int ii = 1; ii <= 100; ++ii) {
     384            0 :                 bool avflag = true;
     385            0 :                 for (int jj = 1; jj <= matHAMT->niso - 1; ++jj) {
     386            0 :                     if (matHAMT->isodata(jj) > matHAMT->isodata(jj + 1)) {
     387            0 :                         isoerrrise = true;
     388            0 :                         avdata = (matHAMT->isodata(jj) + matHAMT->isodata(jj + 1)) / 2.0;
     389            0 :                         matHAMT->isodata(jj) = avdata;
     390            0 :                         matHAMT->isodata(jj + 1) = avdata;
     391            0 :                         avflag = false;
     392              :                     }
     393              :                 }
     394            0 :                 if (avflag) {
     395            0 :                     break;
     396              :                 }
     397              :             }
     398            0 :             if (isoerrrise) {
     399            0 :                 ShowWarningError(state, format("{}: data not rising - Check material {}", cHAMTObject2, matHAMT->Name));
     400            0 :                 ShowContinueError(state, "Isotherm data has been fixed, and the simulation continues.");
     401              :             }
     402              :         }
     403              : 
     404            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject3); // MaterialProperty:HeatAndMoistureTransfer:Suction
     405            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     406            0 :             s_ip->getObjectItem(state,
     407              :                                 cHAMTObject3,
     408              :                                 item,
     409              :                                 AlphaArray,
     410              :                                 NumAlphas,
     411              :                                 NumArray,
     412              :                                 NumNums,
     413              :                                 status,
     414              :                                 lNumericBlanks,
     415              :                                 lAlphaBlanks,
     416              :                                 cAlphaFieldNames,
     417              :                                 cNumericFieldNames);
     418              : 
     419            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject3, AlphaArray(1)};
     420            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     421              : 
     422            0 :             if (matNum == 0) {
     423            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     424            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     425            0 :                 ErrorsFound = true;
     426            0 :                 continue;
     427              :             }
     428              : 
     429            0 :             auto *mat = s_mat->materials(matNum);
     430            0 :             if (!mat->hasHAMT) {
     431            0 :                 ShowSevereCustom(state, eoh, format("{} is not defined for {} = \"{}\"", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     432            0 :                 ErrorsFound = true;
     433            0 :                 continue;
     434              :             }
     435              : 
     436            0 :             auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     437            0 :             assert(matHAMT != nullptr);
     438              : 
     439            0 :             Numid = 1;
     440              : 
     441            0 :             matHAMT->nsuc = NumArray(Numid);
     442            0 :             for (int suc = 1; suc <= matHAMT->nsuc; ++suc) {
     443            0 :                 matHAMT->sucwater(suc) = NumArray(++Numid);
     444            0 :                 matHAMT->sucdata(suc) = NumArray(++Numid);
     445              :             }
     446              : 
     447            0 :             ++matHAMT->nsuc;
     448            0 :             matHAMT->sucwater(matHAMT->nsuc) = matHAMT->isodata(matHAMT->niso);
     449            0 :             matHAMT->sucdata(matHAMT->nsuc) = matHAMT->sucdata(matHAMT->nsuc - 1);
     450              :         }
     451              : 
     452            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject4); // MaterialProperty:HeatAndMoistureTransfer:Redistribution
     453            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     454            0 :             s_ip->getObjectItem(state,
     455              :                                 cHAMTObject4,
     456              :                                 item,
     457              :                                 AlphaArray,
     458              :                                 NumAlphas,
     459              :                                 NumArray,
     460              :                                 NumNums,
     461              :                                 status,
     462              :                                 lNumericBlanks,
     463              :                                 lAlphaBlanks,
     464              :                                 cAlphaFieldNames,
     465              :                                 cNumericFieldNames);
     466              : 
     467            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject4, AlphaArray(1)};
     468            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     469            0 :             if (matNum == 0) {
     470            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     471            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     472            0 :                 ErrorsFound = true;
     473            0 :                 continue;
     474              :             }
     475              : 
     476            0 :             auto *mat = s_mat->materials(matNum);
     477            0 :             if (!mat->hasHAMT) {
     478            0 :                 ShowSevereCustom(state, eoh, format("{} is not defined for {} = \"{}\"", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     479            0 :                 ErrorsFound = true;
     480            0 :                 continue;
     481              :             }
     482              : 
     483            0 :             auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     484            0 :             assert(matHAMT != nullptr);
     485              : 
     486            0 :             Numid = 1;
     487              : 
     488            0 :             matHAMT->nred = NumArray(Numid);
     489            0 :             for (int red = 1; red <= matHAMT->nred; ++red) {
     490            0 :                 matHAMT->redwater(red) = NumArray(++Numid);
     491            0 :                 matHAMT->reddata(red) = NumArray(++Numid);
     492              :             }
     493              : 
     494            0 :             ++matHAMT->nred;
     495            0 :             matHAMT->redwater(matHAMT->nred) = matHAMT->isodata(matHAMT->niso);
     496            0 :             matHAMT->reddata(matHAMT->nred) = matHAMT->reddata(matHAMT->nred - 1);
     497              :         }
     498              : 
     499            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject5); // MaterialProperty:HeatAndMoistureTransfer:Diffusion
     500            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     501            0 :             s_ip->getObjectItem(state,
     502              :                                 cHAMTObject5,
     503              :                                 item,
     504              :                                 AlphaArray,
     505              :                                 NumAlphas,
     506              :                                 NumArray,
     507              :                                 NumNums,
     508              :                                 status,
     509              :                                 lNumericBlanks,
     510              :                                 lAlphaBlanks,
     511              :                                 cAlphaFieldNames,
     512              :                                 cNumericFieldNames);
     513              : 
     514            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject5, AlphaArray(1)};
     515            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     516            0 :             if (matNum == 0) {
     517            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     518            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     519            0 :                 ErrorsFound = true;
     520            0 :                 continue;
     521              :             }
     522              : 
     523            0 :             auto *mat = s_mat->materials(matNum);
     524            0 :             if (!mat->hasHAMT) {
     525            0 :                 ShowSevereCustom(state, eoh, format("{} is not defined for {} = \"{}\"", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     526            0 :                 ErrorsFound = true;
     527            0 :                 continue;
     528              :             }
     529              : 
     530            0 :             auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     531            0 :             assert(matHAMT != nullptr);
     532              : 
     533            0 :             Numid = 1;
     534              : 
     535            0 :             matHAMT->nmu = NumArray(Numid);
     536            0 :             if (matHAMT->nmu > 0) {
     537            0 :                 for (int mu = 1; mu <= matHAMT->nmu; ++mu) {
     538            0 :                     matHAMT->murh(mu) = NumArray(++Numid);
     539            0 :                     matHAMT->mudata(mu) = NumArray(++Numid);
     540              :                 }
     541              : 
     542            0 :                 ++matHAMT->nmu;
     543            0 :                 matHAMT->murh(matHAMT->nmu) = matHAMT->isorh(matHAMT->niso);
     544            0 :                 matHAMT->mudata(matHAMT->nmu) = matHAMT->mudata(matHAMT->nmu - 1);
     545              :             }
     546              :         }
     547              : 
     548            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject6); // MaterialProperty:HeatAndMoistureTransfer:ThermalConductivity
     549            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     550            0 :             s_ip->getObjectItem(state,
     551              :                                 cHAMTObject6,
     552              :                                 item,
     553              :                                 AlphaArray,
     554              :                                 NumAlphas,
     555              :                                 NumArray,
     556              :                                 NumNums,
     557              :                                 status,
     558              :                                 lNumericBlanks,
     559              :                                 lAlphaBlanks,
     560              :                                 cAlphaFieldNames,
     561              :                                 cNumericFieldNames);
     562              : 
     563            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject6, AlphaArray(1)};
     564            0 :             int matNum = Material::GetMaterialNum(state, AlphaArray(1));
     565            0 :             if (matNum == 0) {
     566            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     567            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     568            0 :                 ErrorsFound = true;
     569            0 :                 continue;
     570              :             }
     571              : 
     572            0 :             auto *mat = s_mat->materials(matNum);
     573            0 :             if (!mat->hasHAMT) {
     574            0 :                 ShowSevereCustom(state, eoh, format("{} is not defined for {} = \"{}\"", cHAMTObject1, cAlphaFieldNames(1), AlphaArray(1)));
     575            0 :                 ErrorsFound = true;
     576            0 :                 continue;
     577              :             }
     578              : 
     579            0 :             auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     580            0 :             assert(matHAMT != nullptr);
     581              : 
     582            0 :             Numid = 1;
     583              : 
     584            0 :             matHAMT->ntc = NumArray(Numid);
     585            0 :             if (matHAMT->ntc > 0) {
     586            0 :                 for (int tc = 1; tc <= matHAMT->ntc; ++tc) {
     587            0 :                     ++Numid;
     588            0 :                     matHAMT->tcwater(tc) = NumArray(Numid);
     589            0 :                     ++Numid;
     590            0 :                     matHAMT->tcdata(tc) = NumArray(Numid);
     591              :                 }
     592              : 
     593            0 :                 ++matHAMT->ntc;
     594            0 :                 matHAMT->tcwater(matHAMT->ntc) = matHAMT->isodata(matHAMT->niso);
     595            0 :                 matHAMT->tcdata(matHAMT->ntc) = matHAMT->tcdata(matHAMT->ntc - 1);
     596              :             }
     597              :         }
     598              : 
     599              :         // Vapor Transfer coefficients
     600            0 :         HAMTitems = s_ip->getNumObjectsFound(state, cHAMTObject7); // SurfaceProperties:VaporCoefficients
     601            0 :         for (int item = 1; item <= HAMTitems; ++item) {
     602            0 :             s_ip->getObjectItem(state,
     603              :                                 cHAMTObject7,
     604              :                                 item,
     605              :                                 AlphaArray,
     606              :                                 NumAlphas,
     607              :                                 NumArray,
     608              :                                 NumNums,
     609              :                                 status,
     610              :                                 lNumericBlanks,
     611              :                                 lAlphaBlanks,
     612              :                                 cAlphaFieldNames,
     613              :                                 cNumericFieldNames);
     614              : 
     615            0 :             ErrorObjectHeader eoh{routineName, cHAMTObject7, AlphaArray(1)};
     616            0 :             vtcsid = Util::FindItemInList(AlphaArray(1), state.dataSurface->Surface);
     617            0 :             if (vtcsid == 0) {
     618            0 :                 ShowSevereItemNotFound(state, eoh, cAlphaFieldNames(1), AlphaArray(1));
     619            0 :                 ShowContinueError(state, "The basic material must be defined in addition to specifying HeatAndMoistureTransfer properties.");
     620            0 :                 ErrorsFound = true;
     621            0 :                 continue;
     622              :             }
     623              : 
     624            0 :             if (AlphaArray(2) == "YES") {
     625            0 :                 state.dataHeatBalHAMTMgr->extvtcflag(vtcsid) = true;
     626            0 :                 state.dataHeatBalHAMTMgr->extvtc(vtcsid) = NumArray(1);
     627              :             }
     628              : 
     629            0 :             if (AlphaArray(3) == "YES") {
     630            0 :                 state.dataHeatBalHAMTMgr->intvtcflag(vtcsid) = true;
     631            0 :                 state.dataHeatBalHAMTMgr->intvtc(vtcsid) = NumArray(2);
     632              :             }
     633              :         }
     634              : 
     635            0 :         AlphaArray.deallocate();
     636            0 :         cAlphaFieldNames.deallocate();
     637            0 :         cNumericFieldNames.deallocate();
     638            0 :         NumArray.deallocate();
     639            0 :         lAlphaBlanks.deallocate();
     640            0 :         lNumericBlanks.deallocate();
     641              : 
     642            0 :         if (ErrorsFound) {
     643            0 :             ShowFatalError(state, "GetHeatBalHAMTInput: Errors found getting input.  Program terminates.");
     644              :         }
     645            0 :     }
     646              : 
     647            0 :     void InitHeatBalHAMT(EnergyPlusData &state)
     648              :     {
     649              :         // SUBROUTINE INFORMATION:
     650              :         //       AUTHOR         Phillip Biddulph
     651              :         //       DATE WRITTEN   June 2008
     652              :         //       MODIFIED       B. Griffith, Aug 2012 for surface-specific algorithms
     653              :         //       RE-ENGINEERED  na
     654              : 
     655              :         // Using/Aliasing
     656              :         using General::ScanForReports;
     657              : 
     658              :         // Locals
     659              :         // SUBROUTINE PARAMETER DEFINITIONS:
     660            0 :         Real64 constexpr adjdist(0.00005); // Allowable distance between two cells, also used as limit on cell length
     661              :         static constexpr std::string_view RoutineName("InitCombinedHeatAndMoistureFiniteElement: ");
     662              : 
     663              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     664              :         int sid;
     665              :         int conid;
     666              :         int errorCount;
     667              : 
     668              :         Real64 runor;
     669              :         Real64 testlen;
     670              :         Real64 waterd; // water density
     671              :         bool DoReport;
     672              : 
     673            0 :         auto &s_mat = state.dataMaterial;
     674            0 :         auto &s_hbh = state.dataHeatBalHAMTMgr;
     675              : 
     676            0 :         s_hbh->deltat = state.dataGlobal->TimeStepZone * 3600.0;
     677              : 
     678              :         // Check the materials information and work out how many cells are required.
     679            0 :         errorCount = 0;
     680            0 :         s_hbh->TotCellsMax = 0;
     681            0 :         for (int sid = 1; sid <= state.dataSurface->TotSurfaces; ++sid) {
     682            0 :             auto const &surf = state.dataSurface->Surface(sid);
     683            0 :             if (surf.Class == SurfaceClass::Window) {
     684            0 :                 continue;
     685              :             }
     686            0 :             if (surf.HeatTransferAlgorithm != DataSurfaces::HeatTransferModel::HAMT) {
     687            0 :                 continue;
     688              :             }
     689              : 
     690            0 :             if (surf.Construction == 0) {
     691            0 :                 continue;
     692              :             }
     693            0 :             auto const &constr = state.dataConstruction->Construct(surf.Construction);
     694              : 
     695            0 :             for (int lid = 1; lid <= constr.TotLayers; ++lid) {
     696            0 :                 auto *mat = s_mat->materials(constr.LayerPoint(lid));
     697            0 :                 if (mat->ROnly) {
     698            0 :                     ShowSevereError(state, format("{}Construction={} cannot contain R-only value materials.", RoutineName, constr.Name));
     699            0 :                     ShowContinueError(state, format("Reference Material=\"{}\".", mat->Name));
     700            0 :                     ++errorCount;
     701            0 :                     continue;
     702              :                 }
     703              : 
     704            0 :                 auto *matHAMT = dynamic_cast<MaterialHAMT *>(mat);
     705            0 :                 assert(matHAMT != nullptr);
     706              : 
     707            0 :                 if (matHAMT->nmu < 0) {
     708            0 :                     ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     709            0 :                     ShowContinueError(
     710              :                         state,
     711            0 :                         format("Reference Material=\"{}\" does not have required Water Vapor Diffusion Resistance Factor (mu) data.", matHAMT->Name));
     712            0 :                     ++errorCount;
     713              :                 }
     714              : 
     715            0 :                 if (matHAMT->niso < 0) {
     716            0 :                     ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     717            0 :                     ShowContinueError(state, format("Reference Material=\"{}\" does not have required isotherm data.", matHAMT->Name));
     718            0 :                     ++errorCount;
     719              :                 }
     720            0 :                 if (matHAMT->nsuc < 0) {
     721            0 :                     ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     722            0 :                     ShowContinueError(
     723            0 :                         state, format("Reference Material=\"{}\" does not have required liquid transport coefficient (suction) data.", mat->Name));
     724            0 :                     ++errorCount;
     725              :                 }
     726            0 :                 if (matHAMT->nred < 0) {
     727            0 :                     ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     728            0 :                     ShowContinueError(
     729              :                         state,
     730            0 :                         format("Reference Material=\"{}\" does not have required liquid transport coefficient (redistribution) data.", mat->Name));
     731            0 :                     ++errorCount;
     732              :                 }
     733            0 :                 if (matHAMT->ntc < 0) {
     734            0 :                     if (mat->Conductivity > 0) {
     735            0 :                         ShowWarningError(state, format("{}Construction={}", RoutineName, constr.Name));
     736            0 :                         ShowContinueError(
     737            0 :                             state, format("Reference Material=\"{}\" does not have thermal conductivity data. Using fixed value.", matHAMT->Name));
     738            0 :                         matHAMT->ntc = 2;
     739            0 :                         matHAMT->tcwater(1) = 0.0;
     740            0 :                         matHAMT->tcdata(1) = matHAMT->Conductivity;
     741            0 :                         matHAMT->tcwater(2) = matHAMT->isodata(matHAMT->niso);
     742            0 :                         matHAMT->tcdata(2) = matHAMT->Conductivity;
     743              :                     } else {
     744            0 :                         ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     745            0 :                         ShowContinueError(state,
     746            0 :                                           format("Reference Material=\"{}\" does not have required thermal conductivity data.", matHAMT->Name));
     747            0 :                         ++errorCount;
     748              :                     }
     749              :                 }
     750              : 
     751              :                 // convert material water content to RH
     752              : 
     753            0 :                 waterd = matHAMT->iwater * matHAMT->Density;
     754            0 :                 interp(matHAMT->niso, matHAMT->isodata, matHAMT->isorh, waterd, matHAMT->irh);
     755              : 
     756            0 :                 matHAMT->divs = int(matHAMT->Thickness / matHAMT->divsize) + matHAMT->divmin;
     757            0 :                 if (matHAMT->divs > matHAMT->divmax) {
     758            0 :                     matHAMT->divs = matHAMT->divmax;
     759              :                 }
     760              :                 // Check length of cell - reduce number of divisions if necessary
     761            0 :                 Real64 const sin_negPIOvr2 = std::sin(-Constant::Pi / 2.0);
     762              :                 while (true) {
     763            0 :                     testlen = matHAMT->Thickness *
     764            0 :                               ((std::sin(Constant::Pi * (-1.0 / double(matHAMT->divs)) - Constant::Pi / 2.0) / 2.0) - (sin_negPIOvr2 / 2.0));
     765            0 :                     if (testlen > adjdist) {
     766            0 :                         break;
     767              :                     }
     768            0 :                     --matHAMT->divs;
     769            0 :                     if (matHAMT->divs < 1) {
     770            0 :                         ShowSevereError(state, format("{}Construction={}", RoutineName, constr.Name));
     771            0 :                         ShowContinueError(state, format("Reference Material=\"{}\" is too thin.", matHAMT->Name));
     772            0 :                         ++errorCount;
     773            0 :                         break;
     774              :                     }
     775              :                 }
     776            0 :                 s_hbh->TotCellsMax += matHAMT->divs;
     777              :             }
     778            0 :             s_hbh->TotCellsMax += 7;
     779              :         }
     780              : 
     781            0 :         if (errorCount > 0) {
     782            0 :             ShowFatalError(state, "CombinedHeatAndMoistureFiniteElement: Incomplete data to start solution, program terminates.");
     783              :         }
     784              : 
     785              :         // Make the cells and initialize
     786            0 :         s_hbh->cells.allocate(s_hbh->TotCellsMax);
     787            0 :         for (auto &e : s_hbh->cells) {
     788            0 :             e.adjs = -1;
     789            0 :             e.adjsl = -1;
     790              :         }
     791              : 
     792            0 :         int cid = 0;
     793              : 
     794              :         // Set up surface cell structure
     795            0 :         for (int sid = 1; sid <= state.dataSurface->TotSurfaces; ++sid) {
     796            0 :             auto &surf = state.dataSurface->Surface(sid);
     797            0 :             if (!surf.HeatTransSurf) {
     798            0 :                 continue;
     799              :             }
     800            0 :             if (surf.Class == SurfaceClass::Window) {
     801            0 :                 continue;
     802              :             }
     803            0 :             if (surf.HeatTransferAlgorithm != DataSurfaces::HeatTransferModel::HAMT) {
     804            0 :                 continue;
     805              :             }
     806              :             // Boundary Cells
     807            0 :             runor = -0.02;
     808              :             // Air Convection Cell
     809            0 :             ++cid;
     810            0 :             s_hbh->firstcell(sid) = cid;
     811            0 :             s_hbh->ExtConcell(sid) = cid;
     812            0 :             auto &airConvCell = s_hbh->cells(cid);
     813            0 :             airConvCell.rh = 0.0;
     814            0 :             airConvCell.sid = sid;
     815            0 :             airConvCell.length(1) = 0.01;
     816            0 :             airConvCell.origin(1) = airConvCell.length(1) / 2.0 + runor;
     817              : 
     818              :             // Air Radiation Cell
     819            0 :             ++cid;
     820            0 :             s_hbh->ExtRadcell(sid) = cid;
     821            0 :             auto &airRadCell = s_hbh->cells(cid);
     822            0 :             airRadCell.rh = 0.0;
     823            0 :             airRadCell.sid = sid;
     824            0 :             airRadCell.length(1) = 0.01;
     825            0 :             airRadCell.origin(1) = airRadCell.length(1) / 2.0 + runor;
     826              : 
     827              :             // Sky Cell
     828            0 :             ++cid;
     829            0 :             s_hbh->ExtSkycell(sid) = cid;
     830            0 :             auto &skyCell = s_hbh->cells(cid);
     831            0 :             skyCell.rh = 0.0;
     832            0 :             skyCell.sid = sid;
     833            0 :             skyCell.length(1) = 0.01;
     834            0 :             skyCell.origin(1) = skyCell.length(1) / 2.0 + runor;
     835              : 
     836              :             // Ground Cell
     837            0 :             ++cid;
     838            0 :             s_hbh->ExtGrncell(sid) = cid;
     839            0 :             auto &groundCell = s_hbh->cells(cid);
     840            0 :             groundCell.rh = 0.0;
     841            0 :             groundCell.sid = sid;
     842            0 :             groundCell.length(1) = 0.01;
     843            0 :             groundCell.origin(1) = groundCell.length(1) / 2.0 + runor;
     844            0 :             runor += groundCell.length(1);
     845              : 
     846              :             // External Virtual Cell
     847            0 :             ++cid;
     848            0 :             s_hbh->Extcell(sid) = cid;
     849            0 :             auto &extVirtCell = s_hbh->cells(cid);
     850            0 :             extVirtCell.rh = 0.0;
     851            0 :             extVirtCell.sid = sid;
     852            0 :             extVirtCell.length(1) = 0.01;
     853            0 :             extVirtCell.origin(1) = extVirtCell.length(1) / 2.0 + runor;
     854            0 :             runor += extVirtCell.length(1);
     855              : 
     856              :             // Material Cells
     857            0 :             auto const &constr = state.dataConstruction->Construct(surf.Construction);
     858            0 :             for (int lid = 1; lid <= constr.TotLayers; ++lid) {
     859            0 :                 auto const *mat = dynamic_cast<const MaterialHAMT *>(s_mat->materials(constr.LayerPoint(lid)));
     860            0 :                 assert(mat != nullptr);
     861              : 
     862            0 :                 for (int did = 1; did <= mat->divs; ++did) {
     863            0 :                     ++cid;
     864              : 
     865            0 :                     auto &matCell = s_hbh->cells(cid);
     866            0 :                     matCell.matid = mat->Num;
     867            0 :                     matCell.sid = sid;
     868              : 
     869            0 :                     matCell.temp = mat->itemp;
     870            0 :                     matCell.tempp1 = mat->itemp;
     871            0 :                     matCell.tempp2 = mat->itemp;
     872              : 
     873            0 :                     matCell.rh = mat->irh;
     874            0 :                     matCell.rhp1 = mat->irh;
     875            0 :                     matCell.rhp2 = mat->irh;
     876              : 
     877            0 :                     matCell.density = mat->Density;
     878            0 :                     matCell.spech = mat->SpecHeat;
     879              : 
     880              :                     // Make cells smaller near the surface
     881            0 :                     matCell.length(1) =
     882            0 :                         mat->Thickness * ((std::sin(Constant::Pi * (-double(did) / double(mat->divs)) - Constant::Pi / 2.0) / 2.0) -
     883            0 :                                           (std::sin(Constant::Pi * (-double(did - 1) / double(mat->divs)) - Constant::Pi / 2.0) / 2.0));
     884              : 
     885            0 :                     matCell.origin(1) = runor + matCell.length(1) / 2.0;
     886            0 :                     runor += matCell.length(1);
     887              : 
     888            0 :                     matCell.volume = matCell.length(1) * state.dataSurface->Surface(sid).Area;
     889              :                 }
     890              :             }
     891              : 
     892              :             // Interior Virtual Cell
     893            0 :             ++cid;
     894            0 :             s_hbh->Intcell(sid) = cid;
     895            0 :             auto &intVirtCell = s_hbh->cells(cid);
     896            0 :             intVirtCell.sid = sid;
     897            0 :             intVirtCell.rh = 0.0;
     898            0 :             intVirtCell.length(1) = 0.01;
     899            0 :             intVirtCell.origin(1) = intVirtCell.length(1) / 2.0 + runor;
     900            0 :             runor += intVirtCell.length(1);
     901              : 
     902              :             // Air Convection Cell
     903            0 :             ++cid;
     904            0 :             s_hbh->lastcell(sid) = cid;
     905            0 :             s_hbh->IntConcell(sid) = cid;
     906            0 :             auto &airConvCell2 = s_hbh->cells(cid);
     907            0 :             airConvCell2.rh = 0.0;
     908            0 :             airConvCell2.sid = sid;
     909            0 :             airConvCell2.length(1) = 0.01;
     910            0 :             airConvCell2.origin(1) = airConvCell2.length(1) / 2.0 + runor;
     911              :         }
     912              : 
     913              :         // Find adjacent cells.
     914            0 :         for (int cid1 = 1; cid1 <= s_hbh->TotCellsMax; ++cid1) {
     915            0 :             for (int cid2 = 1; cid2 <= s_hbh->TotCellsMax; ++cid2) {
     916            0 :                 if (cid1 == cid2) {
     917            0 :                     continue;
     918              :                 }
     919              : 
     920            0 :                 auto &cell1 = s_hbh->cells(cid1);
     921            0 :                 auto &cell2 = s_hbh->cells(cid2);
     922              : 
     923            0 :                 if (cell1.sid != cell2.sid) {
     924            0 :                     continue;
     925              :                 }
     926              : 
     927            0 :                 Real64 high1 = cell1.origin(1) + cell1.length(1) / 2.0;
     928            0 :                 Real64 low2 = cell2.origin(1) - cell2.length(1) / 2.0;
     929            0 :                 if (std::abs(low2 - high1) < adjdist) {
     930            0 :                     int adj1 = 0;
     931            0 :                     for (int ii = 1; ii <= adjmax; ++ii) {
     932            0 :                         ++adj1;
     933            0 :                         if (cell1.adjs(adj1) == -1) {
     934            0 :                             break;
     935              :                         }
     936              :                     }
     937            0 :                     int adj2 = 0;
     938            0 :                     for (int ii = 1; ii <= adjmax; ++ii) {
     939            0 :                         ++adj2;
     940            0 :                         if (cell2.adjs(adj2) == -1) {
     941            0 :                             break;
     942              :                         }
     943              :                     }
     944            0 :                     cell1.adjs(adj1) = cid2;
     945            0 :                     cell2.adjs(adj2) = cid1;
     946              : 
     947            0 :                     cell1.adjsl(adj1) = adj2;
     948            0 :                     cell2.adjsl(adj2) = adj1;
     949              : 
     950            0 :                     sid = cell1.sid;
     951            0 :                     cell1.overlap(adj1) = state.dataSurface->Surface(sid).Area;
     952            0 :                     cell2.overlap(adj2) = state.dataSurface->Surface(sid).Area;
     953            0 :                     cell1.dist(adj1) = cell1.length(1) / 2.0;
     954            0 :                     cell2.dist(adj2) = cell2.length(1) / 2.0;
     955              :                 }
     956              :             }
     957              :         }
     958              : 
     959              :         // Reset surface virtual cell origins and volumes. Initialize report variables.
     960              :         static constexpr std::string_view Format_1966("! <HAMT cells>, Surface Name, Construction Name, Cell Numbers\n");
     961            0 :         print(state.files.eio, Format_1966);
     962              :         static constexpr std::string_view Format_1965("! <HAMT origins>, Surface Name, Construction Name, Cell origins (m) \n");
     963            0 :         print(state.files.eio, Format_1965);
     964              :         // cCurrentModuleObject='MaterialProperty:HeatAndMoistureTransfer:*'
     965            0 :         for (int sid = 1; sid <= state.dataSurface->TotSurfaces; ++sid) {
     966            0 :             if (!state.dataSurface->Surface(sid).HeatTransSurf) {
     967            0 :                 continue;
     968              :             }
     969            0 :             if (state.dataSurface->Surface(sid).Class == SurfaceClass::Window) {
     970            0 :                 continue;
     971              :             }
     972            0 :             if (state.dataSurface->Surface(sid).HeatTransferAlgorithm != DataSurfaces::HeatTransferModel::HAMT) {
     973            0 :                 continue;
     974              :             }
     975            0 :             s_hbh->cells(s_hbh->Extcell(sid)).origin(1) += s_hbh->cells(s_hbh->Extcell(sid)).length(1) / 2.0;
     976            0 :             s_hbh->cells(s_hbh->Intcell(sid)).origin(1) -= s_hbh->cells(s_hbh->Intcell(sid)).length(1) / 2.0;
     977            0 :             s_hbh->cells(s_hbh->Extcell(sid)).volume = 0.0;
     978            0 :             s_hbh->cells(s_hbh->Intcell(sid)).volume = 0.0;
     979            0 :             s_hbh->watertot(sid) = 0.0;
     980            0 :             s_hbh->surfrh(sid) = 0.0;
     981            0 :             s_hbh->surfextrh(sid) = 0.0;
     982            0 :             s_hbh->surftemp(sid) = 0.0;
     983            0 :             s_hbh->surfexttemp(sid) = 0.0;
     984            0 :             s_hbh->surfvp(sid) = 0.0;
     985            0 :             SetupOutputVariable(state,
     986              :                                 "HAMT Surface Average Water Content Ratio",
     987              :                                 Constant::Units::kg_kg,
     988            0 :                                 s_hbh->watertot(sid),
     989              :                                 OutputProcessor::TimeStepType::Zone,
     990              :                                 OutputProcessor::StoreType::Average,
     991            0 :                                 state.dataSurface->Surface(sid).Name);
     992            0 :             SetupOutputVariable(state,
     993              :                                 "HAMT Surface Inside Face Temperature",
     994              :                                 Constant::Units::C,
     995            0 :                                 s_hbh->surftemp(sid),
     996              :                                 OutputProcessor::TimeStepType::Zone,
     997              :                                 OutputProcessor::StoreType::Average,
     998            0 :                                 state.dataSurface->Surface(sid).Name);
     999            0 :             SetupOutputVariable(state,
    1000              :                                 "HAMT Surface Inside Face Relative Humidity",
    1001              :                                 Constant::Units::Perc,
    1002            0 :                                 s_hbh->surfrh(sid),
    1003              :                                 OutputProcessor::TimeStepType::Zone,
    1004              :                                 OutputProcessor::StoreType::Average,
    1005            0 :                                 state.dataSurface->Surface(sid).Name);
    1006            0 :             SetupOutputVariable(state,
    1007              :                                 "HAMT Surface Inside Face Vapor Pressure",
    1008              :                                 Constant::Units::Pa,
    1009            0 :                                 s_hbh->surfvp(sid),
    1010              :                                 OutputProcessor::TimeStepType::Zone,
    1011              :                                 OutputProcessor::StoreType::Average,
    1012            0 :                                 state.dataSurface->Surface(sid).Name);
    1013            0 :             SetupOutputVariable(state,
    1014              :                                 "HAMT Surface Outside Face Temperature",
    1015              :                                 Constant::Units::C,
    1016            0 :                                 s_hbh->surfexttemp(sid),
    1017              :                                 OutputProcessor::TimeStepType::Zone,
    1018              :                                 OutputProcessor::StoreType::Average,
    1019            0 :                                 state.dataSurface->Surface(sid).Name);
    1020            0 :             SetupOutputVariable(state,
    1021              :                                 "HAMT Surface Outside Face Relative Humidity",
    1022              :                                 Constant::Units::Perc,
    1023            0 :                                 s_hbh->surfextrh(sid),
    1024              :                                 OutputProcessor::TimeStepType::Zone,
    1025              :                                 OutputProcessor::StoreType::Average,
    1026            0 :                                 state.dataSurface->Surface(sid).Name);
    1027              : 
    1028              :             // write cell origins to initialization output file
    1029            0 :             conid = state.dataSurface->Surface(sid).Construction;
    1030            0 :             print(state.files.eio, "HAMT cells, {},{}", state.dataSurface->Surface(sid).Name, state.dataConstruction->Construct(conid).Name);
    1031            0 :             for (int concell = 1, concell_end = s_hbh->Intcell(sid) - s_hbh->Extcell(sid) + 1; concell <= concell_end; ++concell) {
    1032            0 :                 print(state.files.eio, ",{:4}", concell);
    1033              :             }
    1034            0 :             print(state.files.eio, "\n");
    1035            0 :             print(state.files.eio, "HAMT origins,{},{}", state.dataSurface->Surface(sid).Name, state.dataConstruction->Construct(conid).Name);
    1036            0 :             for (int cellid = s_hbh->Extcell(sid); cellid <= s_hbh->Intcell(sid); ++cellid) {
    1037            0 :                 print(state.files.eio, ",{:10.7F}", s_hbh->cells(cellid).origin(1));
    1038              :             }
    1039            0 :             print(state.files.eio, "\n");
    1040              : 
    1041            0 :             for (int cellid = s_hbh->Extcell(sid), concell = 1; cellid <= s_hbh->Intcell(sid); ++cellid, ++concell) {
    1042            0 :                 SetupOutputVariable(state,
    1043            0 :                                     format("HAMT Surface Temperature Cell {}", concell),
    1044              :                                     Constant::Units::C,
    1045            0 :                                     s_hbh->cells(cellid).temp,
    1046              :                                     OutputProcessor::TimeStepType::Zone,
    1047              :                                     OutputProcessor::StoreType::Average,
    1048            0 :                                     state.dataSurface->Surface(sid).Name);
    1049              :             }
    1050            0 :             for (int cellid = s_hbh->Extcell(sid), concell = 1; cellid <= s_hbh->Intcell(sid); ++cellid, ++concell) {
    1051            0 :                 SetupOutputVariable(state,
    1052            0 :                                     format("HAMT Surface Water Content Cell {}", concell),
    1053              :                                     Constant::Units::kg_kg,
    1054            0 :                                     s_hbh->cells(cellid).wreport,
    1055              :                                     OutputProcessor::TimeStepType::Zone,
    1056              :                                     OutputProcessor::StoreType::Average,
    1057            0 :                                     state.dataSurface->Surface(sid).Name);
    1058              :             }
    1059            0 :             for (int cellid = s_hbh->Extcell(sid), concell = 1; cellid <= s_hbh->Intcell(sid); ++cellid, ++concell) {
    1060            0 :                 SetupOutputVariable(state,
    1061            0 :                                     format("HAMT Surface Relative Humidity Cell {}", concell),
    1062              :                                     Constant::Units::Perc,
    1063            0 :                                     s_hbh->cells(cellid).rhp,
    1064              :                                     OutputProcessor::TimeStepType::Zone,
    1065              :                                     OutputProcessor::StoreType::Average,
    1066            0 :                                     state.dataSurface->Surface(sid).Name);
    1067              :             }
    1068              :         }
    1069              : 
    1070            0 :         ScanForReports(state, "Constructions", DoReport, "Constructions");
    1071            0 :         if (DoReport) {
    1072              : 
    1073              :             static constexpr std::string_view Format_108("! <Material Nominal Resistance>, Material Name,  Nominal R\n");
    1074            0 :             print(state.files.eio, Format_108);
    1075              : 
    1076            0 :             for (auto const *mat : s_mat->materials) {
    1077              :                 static constexpr std::string_view Format_111("Material Nominal Resistance,{},{:.4R}\n");
    1078            0 :                 print(state.files.eio, Format_111, mat->Name, mat->NominalR);
    1079              :             }
    1080              :         }
    1081            0 :     }
    1082              : 
    1083            0 :     void CalcHeatBalHAMT(EnergyPlusData &state, int const sid, Real64 &SurfTempInTmp, Real64 &TempSurfOutTmp)
    1084              :     {
    1085              :         // SUBROUTINE INFORMATION:
    1086              :         //       AUTHOR         Phillip Biddulph
    1087              :         //       DATE WRITTEN   June 2008
    1088              :         //       MODIFIED       na
    1089              :         //       RE-ENGINEERED  na
    1090              : 
    1091              :         // PURPOSE OF THIS SUBROUTINE:
    1092              :         // To calculate the heat and moisture transfer through the surface
    1093              : 
    1094              :         // Using/Aliasing
    1095              :         using DataSurfaces::OtherSideCondModeledExt;
    1096              : 
    1097              :         // Locals
    1098              :         // SUBROUTINE ARGUMENT DEFINITIONS:
    1099              : 
    1100              :         // SUBROUTINE PARAMETER DEFINITIONS:
    1101            0 :         static std::string const HAMTExt("HAMT-Ext");
    1102            0 :         static std::string const HAMTInt("HAMT-Int");
    1103              : 
    1104              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    1105              :         Real64 SurfTempInP;
    1106              :         Real64 RhoIn;
    1107              :         Real64 RhoOut;
    1108              :         Real64 torsum;
    1109              :         Real64 oorsum;
    1110              :         Real64 phioosum;
    1111              :         Real64 phiorsum;
    1112              :         Real64 vpoosum;
    1113              :         Real64 vporsum;
    1114              :         Real64 rhr1;
    1115              :         Real64 rhr2;
    1116              :         Real64 wcap;
    1117              :         Real64 thermr1;
    1118              :         Real64 thermr2;
    1119              :         Real64 tcap;
    1120              :         Real64 qvp;
    1121              :         Real64 vaporr1;
    1122              :         Real64 vaporr2;
    1123              :         Real64 vpdiff;
    1124              :         Real64 sumtp1;
    1125              :         Real64 tempmax;
    1126              :         Real64 tempmin;
    1127              : 
    1128              :         int itter;
    1129              : 
    1130              :         Real64 denominator;
    1131              : 
    1132            0 :         auto &s_mat = state.dataMaterial;
    1133            0 :         auto &s_hbh = state.dataHeatBalHAMTMgr;
    1134              : 
    1135            0 :         if (state.dataGlobal->BeginEnvrnFlag && s_hbh->MyEnvrnFlag(sid)) {
    1136            0 :             auto &extCell = s_hbh->cells(s_hbh->Extcell(sid));
    1137            0 :             extCell.rh = 0.0;
    1138            0 :             extCell.rhp1 = 0.0;
    1139            0 :             extCell.rhp2 = 0.0;
    1140              : 
    1141            0 :             extCell.temp = 10.0;
    1142            0 :             extCell.tempp1 = 10.0;
    1143            0 :             extCell.tempp2 = 10.0;
    1144              : 
    1145            0 :             auto &intCell = s_hbh->cells(s_hbh->Intcell(sid));
    1146            0 :             intCell.rh = 0.0;
    1147            0 :             intCell.rhp1 = 0.0;
    1148            0 :             intCell.rhp2 = 0.0;
    1149              : 
    1150            0 :             intCell.temp = 10.0;
    1151            0 :             intCell.tempp1 = 10.0;
    1152            0 :             intCell.tempp2 = 10.0;
    1153              : 
    1154            0 :             for (int cid = s_hbh->Extcell(sid) + 1; cid <= s_hbh->Intcell(sid) - 1; ++cid) {
    1155            0 :                 auto &cell = s_hbh->cells(cid);
    1156            0 :                 auto const *mat = dynamic_cast<const MaterialHAMT *>(s_mat->materials(cell.matid));
    1157            0 :                 assert(mat != nullptr);
    1158            0 :                 cell.temp = mat->itemp;
    1159            0 :                 cell.tempp1 = mat->itemp;
    1160            0 :                 cell.tempp2 = mat->itemp;
    1161              : 
    1162            0 :                 cell.rh = mat->irh;
    1163            0 :                 cell.rhp1 = mat->irh;
    1164            0 :                 cell.rhp2 = mat->irh;
    1165              :             }
    1166            0 :             s_hbh->MyEnvrnFlag(sid) = false;
    1167              :         }
    1168            0 :         if (!state.dataGlobal->BeginEnvrnFlag) {
    1169            0 :             s_hbh->MyEnvrnFlag(sid) = true;
    1170              :         }
    1171              : 
    1172            0 :         auto &extCell = s_hbh->cells(s_hbh->Extcell(sid));
    1173            0 :         auto &extRadCell = s_hbh->cells(s_hbh->ExtRadcell(sid));
    1174            0 :         auto &extSkyCell = s_hbh->cells(s_hbh->ExtSkycell(sid));
    1175            0 :         auto &extGrnCell = s_hbh->cells(s_hbh->ExtGrncell(sid));
    1176            0 :         auto &extConCell = s_hbh->cells(s_hbh->ExtConcell(sid));
    1177              : 
    1178              :         // Set all the boundary values
    1179            0 :         extRadCell.temp = state.dataMstBal->TempOutsideAirFD(sid);
    1180            0 :         extConCell.temp = state.dataMstBal->TempOutsideAirFD(sid);
    1181            0 :         Real64 spaceMAT = state.dataZoneTempPredictorCorrector->spaceHeatBalance(state.dataSurface->Surface(sid).spaceNum).MAT;
    1182            0 :         if (state.dataSurface->Surface(sid).ExtBoundCond == OtherSideCondModeledExt) {
    1183              :             // CR8046 switch modeled rad temp for sky temp.
    1184            0 :             extSkyCell.temp = state.dataSurface->OSCM(state.dataSurface->Surface(sid).OSCMPtr).TRad;
    1185            0 :             extCell.Qadds = 0.0; // eliminate incident shortwave on underlying surface
    1186              :         } else {
    1187            0 :             extSkyCell.temp = state.dataEnvrn->SkyTemp;
    1188            0 :             extCell.Qadds = state.dataSurface->Surface(sid).Area * state.dataHeatBalSurf->SurfOpaqQRadSWOutAbs(sid);
    1189              :         }
    1190              : 
    1191            0 :         extGrnCell.temp = state.dataMstBal->TempOutsideAirFD(sid);
    1192            0 :         RhoOut = state.dataMstBal->RhoVaporAirOut(sid);
    1193              : 
    1194              :         // Special case when the surface is an internal mass
    1195            0 :         if (state.dataSurface->Surface(sid).ExtBoundCond == sid) {
    1196            0 :             extConCell.temp = spaceMAT;
    1197            0 :             RhoOut = state.dataMstBal->RhoVaporAirIn(sid);
    1198              :         }
    1199              : 
    1200            0 :         RhoIn = state.dataMstBal->RhoVaporAirIn(sid);
    1201              : 
    1202            0 :         extRadCell.htc = state.dataMstBal->HAirFD(sid);
    1203            0 :         extConCell.htc = state.dataMstBal->HConvExtFD(sid);
    1204            0 :         extSkyCell.htc = state.dataMstBal->HSkyFD(sid);
    1205            0 :         extGrnCell.htc = state.dataMstBal->HGrndFD(sid);
    1206              : 
    1207            0 :         auto &intCell = s_hbh->cells(s_hbh->Intcell(sid));
    1208            0 :         auto &intConCell = s_hbh->cells(s_hbh->IntConcell(sid));
    1209              : 
    1210            0 :         intConCell.temp = spaceMAT;
    1211            0 :         intConCell.htc = state.dataMstBal->HConvInFD(sid);
    1212              : 
    1213            0 :         intCell.Qadds = state.dataSurface->Surface(sid).Area *
    1214            0 :                         (state.dataHeatBalSurf->SurfOpaqQRadSWInAbs(sid) + state.dataHeatBalSurf->SurfQdotRadNetLWInPerArea(sid) +
    1215            0 :                          state.dataHeatBalSurf->SurfQdotRadHVACInPerArea(sid) + state.dataHeatBal->SurfQdotRadIntGainsInPerArea(sid) +
    1216            0 :                          state.dataHeatBalSurf->SurfQAdditionalHeatSourceInside(sid));
    1217              : 
    1218            0 :         extConCell.rh = PsyRhFnTdbRhov(state, extConCell.temp, RhoOut, HAMTExt);
    1219            0 :         intConCell.rh = PsyRhFnTdbRhov(state, intConCell.temp, RhoIn, HAMTInt);
    1220              : 
    1221            0 :         if (extConCell.rh > rhmax) {
    1222            0 :             extConCell.rh = rhmax;
    1223              :         }
    1224            0 :         if (intConCell.rh > rhmax) {
    1225            0 :             intConCell.rh = rhmax;
    1226              :         }
    1227              : 
    1228              :         // PDB August 2009 Start! Correction for when no vapour transfer coefficient have been defined.
    1229            0 :         if (s_hbh->extvtcflag(sid)) {
    1230            0 :             extConCell.vtc = s_hbh->extvtc(sid);
    1231              :         } else {
    1232            0 :             if (extConCell.rh > 0) {
    1233            0 :                 extConCell.vtc =
    1234            0 :                     state.dataMstBal->HMassConvExtFD(sid) * RhoOut / (PsyPsatFnTemp(state, state.dataMstBal->TempOutsideAirFD(sid)) * extConCell.rh);
    1235              :             } else {
    1236            0 :                 extConCell.vtc = 10000.0;
    1237              :             }
    1238              :         }
    1239              : 
    1240            0 :         if (s_hbh->intvtcflag(sid)) {
    1241            0 :             intConCell.vtc = s_hbh->intvtc(sid);
    1242            0 :             state.dataMstBal->HMassConvInFD(sid) = intConCell.vtc * PsyPsatFnTemp(state, spaceMAT) * intConCell.rh / RhoIn;
    1243              :         } else {
    1244            0 :             if (intConCell.rh > 0) {
    1245            0 :                 intConCell.vtc = state.dataMstBal->HMassConvInFD(sid) * RhoIn / (PsyPsatFnTemp(state, spaceMAT) * intConCell.rh);
    1246              :             } else {
    1247            0 :                 intConCell.vtc = 10000.0;
    1248              :             }
    1249              :         }
    1250              :         // PDB August 2009 End
    1251              : 
    1252              :         // Initialise
    1253            0 :         for (int cid = s_hbh->firstcell(sid); cid <= s_hbh->Extcell(sid) - 1; ++cid) {
    1254            0 :             auto &cell = s_hbh->cells(cid);
    1255            0 :             cell.tempp1 = cell.temp;
    1256            0 :             cell.tempp2 = cell.temp;
    1257            0 :             cell.rhp1 = cell.rh;
    1258            0 :             cell.rhp2 = cell.rh;
    1259              :         }
    1260            0 :         for (int cid = s_hbh->Intcell(sid) + 1; cid <= s_hbh->lastcell(sid); ++cid) {
    1261            0 :             auto &cell = s_hbh->cells(cid);
    1262            0 :             cell.tempp1 = cell.temp;
    1263            0 :             cell.tempp2 = cell.temp;
    1264            0 :             cell.rhp1 = cell.rh;
    1265            0 :             cell.rhp2 = cell.rh;
    1266              :         }
    1267              : 
    1268            0 :         itter = 0;
    1269              :         while (true) {
    1270            0 :             ++itter;
    1271              :             // Update Moisture values
    1272              : 
    1273            0 :             for (int cid = s_hbh->firstcell(sid); cid <= s_hbh->lastcell(sid); ++cid) {
    1274            0 :                 auto &cell = s_hbh->cells(cid);
    1275            0 :                 cell.vp = RHtoVP(state, cell.rh, cell.temp);
    1276            0 :                 cell.vpp1 = RHtoVP(state, cell.rhp1, cell.tempp1);
    1277            0 :                 cell.vpsat = PsyPsatFnTemp(state, cell.tempp1);
    1278            0 :                 if (cell.matid > 0) {
    1279            0 :                     auto const *mat = dynamic_cast<const MaterialHAMT *>(s_mat->materials(cell.matid));
    1280            0 :                     assert(mat != nullptr);
    1281            0 :                     interp(mat->niso, mat->isorh, mat->isodata, cell.rhp1, cell.water, cell.dwdphi);
    1282            0 :                     if (state.dataEnvrn->IsRain && s_hbh->rainswitch) {
    1283            0 :                         interp(mat->nsuc, mat->sucwater, mat->sucdata, cell.water, cell.dw);
    1284              :                     } else {
    1285            0 :                         interp(mat->nred, mat->redwater, mat->reddata, cell.water, cell.dw);
    1286              :                     }
    1287            0 :                     interp(mat->nmu, mat->murh, mat->mudata, cell.rhp1, cell.mu);
    1288            0 :                     interp(mat->ntc, mat->tcwater, mat->tcdata, cell.water, cell.wthermalc);
    1289              :                 }
    1290              :             }
    1291              : 
    1292              :             // Calculate Heat and Vapor resistances,
    1293            0 :             for (int cid = s_hbh->Extcell(sid); cid <= s_hbh->Intcell(sid); ++cid) {
    1294            0 :                 torsum = 0.0;
    1295            0 :                 oorsum = 0.0;
    1296            0 :                 vpdiff = 0.0;
    1297            0 :                 auto &cell = s_hbh->cells(cid);
    1298            0 :                 for (int ii = 1; ii <= adjmax; ++ii) {
    1299            0 :                     int adj = cell.adjs(ii);
    1300            0 :                     int adjl = cell.adjsl(ii);
    1301            0 :                     if (adj == -1) {
    1302            0 :                         break;
    1303              :                     }
    1304              : 
    1305            0 :                     if (cell.htc > 0) {
    1306            0 :                         thermr1 = 1.0 / (cell.overlap(ii) * cell.htc);
    1307            0 :                     } else if (cell.matid > 0) {
    1308            0 :                         thermr1 = cell.dist(ii) / (cell.overlap(ii) * cell.wthermalc);
    1309              :                     } else {
    1310            0 :                         thermr1 = 0.0;
    1311              :                     }
    1312              : 
    1313            0 :                     if (cell.vtc > 0) {
    1314            0 :                         vaporr1 = 1.0 / (cell.overlap(ii) * cell.vtc);
    1315            0 :                     } else if (cell.matid > 0) {
    1316            0 :                         vaporr1 = (cell.dist(ii) * cell.mu) / (cell.overlap(ii) * WVDC(cell.tempp1, state.dataEnvrn->OutBaroPress));
    1317              :                     } else {
    1318            0 :                         vaporr1 = 0.0;
    1319              :                     }
    1320              : 
    1321            0 :                     auto &adjCell = s_hbh->cells(adj);
    1322            0 :                     if (adjCell.htc > 0) {
    1323            0 :                         thermr2 = 1.0 / (cell.overlap(ii) * adjCell.htc);
    1324            0 :                     } else if (adjCell.matid > 0) {
    1325            0 :                         thermr2 = adjCell.dist(adjl) / (cell.overlap(ii) * adjCell.wthermalc);
    1326              :                     } else {
    1327            0 :                         thermr2 = 0.0;
    1328              :                     }
    1329              : 
    1330            0 :                     if (adjCell.vtc > 0) {
    1331            0 :                         vaporr2 = 1.0 / (cell.overlap(ii) * adjCell.vtc);
    1332            0 :                     } else if (adjCell.matid > 0) {
    1333            0 :                         vaporr2 = adjCell.mu * adjCell.dist(adjl) / (WVDC(adjCell.tempp1, state.dataEnvrn->OutBaroPress) * cell.overlap(ii));
    1334              :                     } else {
    1335            0 :                         vaporr2 = 0.0;
    1336              :                     }
    1337              : 
    1338            0 :                     if (thermr1 + thermr2 > 0) {
    1339            0 :                         oorsum += 1.0 / (thermr1 + thermr2);
    1340            0 :                         torsum += adjCell.tempp1 / (thermr1 + thermr2);
    1341              :                     }
    1342            0 :                     if (vaporr1 + vaporr2 > 0) {
    1343            0 :                         vpdiff += (adjCell.vp - cell.vp) / (vaporr1 + vaporr2);
    1344              :                     }
    1345              :                 }
    1346              : 
    1347              :                 // Calculate Heat Capacitance
    1348            0 :                 tcap = ((cell.density * cell.spech + cell.water * wspech) * cell.volume);
    1349              : 
    1350              :                 // calculate the latent heat if wanted and check for divergence
    1351            0 :                 qvp = 0.0;
    1352            0 :                 if ((cell.matid > 0) && (s_hbh->latswitch)) {
    1353            0 :                     qvp = vpdiff * whv;
    1354              :                 }
    1355            0 :                 if (std::abs(qvp) > qvplim) {
    1356            0 :                     if (!state.dataGlobal->WarmupFlag) {
    1357            0 :                         ++s_hbh->qvpErrCount;
    1358            0 :                         if (s_hbh->qvpErrCount < 16) {
    1359            0 :                             ShowWarningError(
    1360            0 :                                 state, format("HeatAndMoistureTransfer: Large Latent Heat for Surface {}", state.dataSurface->Surface(sid).Name));
    1361              :                         } else {
    1362            0 :                             ShowRecurringWarningErrorAtEnd(state, "HeatAndMoistureTransfer: Large Latent Heat Errors ", s_hbh->qvpErrReport);
    1363              :                         }
    1364              :                     }
    1365            0 :                     qvp = 0.0;
    1366              :                 }
    1367              : 
    1368              :                 // Calculate the temperature for the next time step
    1369            0 :                 cell.tempp1 = (torsum + qvp + cell.Qadds + (tcap * cell.temp / s_hbh->deltat)) / (oorsum + (tcap / s_hbh->deltat));
    1370              :             }
    1371              : 
    1372              :             // Check for silly temperatures
    1373            0 :             tempmax = maxval(s_hbh->cells, &subcell::tempp1);
    1374            0 :             tempmin = minval(s_hbh->cells, &subcell::tempp1);
    1375            0 :             if (tempmax > state.dataHeatBalSurf->MaxSurfaceTempLimit) {
    1376            0 :                 if (!state.dataGlobal->WarmupFlag) {
    1377            0 :                     if (state.dataSurface->SurfHighTempErrCount(sid) == 0) {
    1378            0 :                         ShowSevereMessage(
    1379              :                             state,
    1380            0 :                             format("HAMT: Temperature (high) out of bounds ({:.2R}) for surface={}", tempmax, state.dataSurface->Surface(sid).Name));
    1381            0 :                         ShowContinueErrorTimeStamp(state, "");
    1382              :                     }
    1383            0 :                     ShowRecurringWarningErrorAtEnd(state,
    1384            0 :                                                    "HAMT: Temperature Temperature (high) out of bounds; Surface=" +
    1385            0 :                                                        state.dataSurface->Surface(sid).Name,
    1386            0 :                                                    state.dataSurface->SurfHighTempErrCount(sid),
    1387              :                                                    tempmax,
    1388              :                                                    tempmax,
    1389              :                                                    _,
    1390              :                                                    "C",
    1391              :                                                    "C");
    1392              :                 }
    1393              :             }
    1394            0 :             if (tempmax > state.dataHeatBalSurf->MaxSurfaceTempLimitBeforeFatal) {
    1395            0 :                 if (!state.dataGlobal->WarmupFlag) {
    1396            0 :                     ShowSevereError(state,
    1397            0 :                                     format("HAMT: HAMT: Temperature (high) out of bounds ( {:.2R}) for surface={}",
    1398              :                                            tempmax,
    1399            0 :                                            state.dataSurface->Surface(sid).Name));
    1400            0 :                     ShowContinueErrorTimeStamp(state, "");
    1401            0 :                     ShowFatalError(state, "Program terminates due to preceding condition.");
    1402              :                 }
    1403              :             }
    1404            0 :             if (tempmin < MinSurfaceTempLimit) {
    1405            0 :                 if (!state.dataGlobal->WarmupFlag) {
    1406            0 :                     if (state.dataSurface->SurfHighTempErrCount(sid) == 0) {
    1407            0 :                         ShowSevereMessage(
    1408              :                             state,
    1409            0 :                             format("HAMT: Temperature (low) out of bounds ({:.2R}) for surface={}", tempmin, state.dataSurface->Surface(sid).Name));
    1410            0 :                         ShowContinueErrorTimeStamp(state, "");
    1411              :                     }
    1412            0 :                     ShowRecurringWarningErrorAtEnd(state,
    1413            0 :                                                    "HAMT: Temperature Temperature (high) out of bounds; Surface=" +
    1414            0 :                                                        state.dataSurface->Surface(sid).Name,
    1415            0 :                                                    state.dataSurface->SurfHighTempErrCount(sid),
    1416              :                                                    tempmin,
    1417              :                                                    tempmin,
    1418              :                                                    _,
    1419              :                                                    "C",
    1420              :                                                    "C");
    1421              :                 }
    1422              :             }
    1423            0 :             if (tempmin < MinSurfaceTempLimitBeforeFatal) {
    1424            0 :                 if (!state.dataGlobal->WarmupFlag) {
    1425            0 :                     ShowSevereError(state,
    1426            0 :                                     format("HAMT: HAMT: Temperature (low) out of bounds ( {:.2R}) for surface={}",
    1427              :                                            tempmin,
    1428            0 :                                            state.dataSurface->Surface(sid).Name));
    1429            0 :                     ShowContinueErrorTimeStamp(state, "");
    1430            0 :                     ShowFatalError(state, "Program terminates due to preceding condition.");
    1431              :                 }
    1432              :             }
    1433              : 
    1434              :             // Calculate the liquid and vapor resisitances
    1435            0 :             for (int cid = s_hbh->Extcell(sid); cid <= s_hbh->Intcell(sid); ++cid) {
    1436            0 :                 phioosum = 0.0;
    1437            0 :                 phiorsum = 0.0;
    1438            0 :                 vpoosum = 0.0;
    1439            0 :                 vporsum = 0.0;
    1440              : 
    1441            0 :                 auto &cell = s_hbh->cells(cid);
    1442            0 :                 for (int ii = 1; ii <= adjmax; ++ii) {
    1443            0 :                     int adj = cell.adjs(ii);
    1444            0 :                     int adjl = cell.adjsl(ii);
    1445            0 :                     if (adj == -1) {
    1446            0 :                         break;
    1447              :                     }
    1448              : 
    1449            0 :                     if (cell.vtc > 0) {
    1450            0 :                         vaporr1 = 1.0 / (cell.overlap(ii) * cell.vtc);
    1451            0 :                     } else if (cell.matid > 0) {
    1452            0 :                         vaporr1 = (cell.dist(ii) * cell.mu) / (cell.overlap(ii) * WVDC(cell.tempp1, state.dataEnvrn->OutBaroPress));
    1453              :                     } else {
    1454            0 :                         vaporr1 = 0.0;
    1455              :                     }
    1456              : 
    1457            0 :                     auto &adjCell = s_hbh->cells(adj);
    1458            0 :                     if (adjCell.vtc > 0) {
    1459            0 :                         vaporr2 = 1.0 / (cell.overlap(ii) * adjCell.vtc);
    1460            0 :                     } else if (adjCell.matid > 0) {
    1461            0 :                         vaporr2 = (adjCell.dist(adjl) * adjCell.mu) / (cell.overlap(ii) * WVDC(adjCell.tempp1, state.dataEnvrn->OutBaroPress));
    1462              :                     } else {
    1463            0 :                         vaporr2 = 0.0;
    1464              :                     }
    1465            0 :                     if (vaporr1 + vaporr2 > 0) {
    1466            0 :                         vpoosum += 1.0 / (vaporr1 + vaporr2);
    1467            0 :                         vporsum += (adjCell.vpp1 / (vaporr1 + vaporr2));
    1468              :                     }
    1469              : 
    1470            0 :                     if ((cell.dw > 0) && (cell.dwdphi > 0)) {
    1471            0 :                         rhr1 = cell.dist(ii) / (cell.overlap(ii) * cell.dw * cell.dwdphi);
    1472              :                     } else {
    1473            0 :                         rhr1 = 0.0;
    1474              :                     }
    1475            0 :                     if ((adjCell.dw > 0) && (adjCell.dwdphi > 0)) {
    1476            0 :                         rhr2 = adjCell.dist(adjl) / (cell.overlap(ii) * adjCell.dw * adjCell.dwdphi);
    1477              :                     } else {
    1478            0 :                         rhr2 = 0.0;
    1479              :                     }
    1480              : 
    1481              :                     //             IF(rhr1+rhr2>0)THEN
    1482            0 :                     if (rhr1 * rhr2 > 0) {
    1483            0 :                         phioosum += 1.0 / (rhr1 + rhr2);
    1484            0 :                         phiorsum += (adjCell.rhp1 / (rhr1 + rhr2));
    1485              :                     }
    1486              :                 }
    1487              : 
    1488              :                 // Moisture Capacitance
    1489            0 :                 if (cell.dwdphi > 0.0) {
    1490            0 :                     wcap = cell.dwdphi * cell.volume;
    1491              :                 } else {
    1492            0 :                     wcap = 0.0;
    1493              :                 }
    1494              : 
    1495              :                 // Calculate the RH for the next time step
    1496            0 :                 denominator = (phioosum + vpoosum * cell.vpsat + wcap / s_hbh->deltat);
    1497            0 :                 if (denominator != 0.0) {
    1498            0 :                     cell.rhp1 = (phiorsum + vporsum + (wcap * cell.rh) / s_hbh->deltat) / denominator;
    1499              :                 } else {
    1500            0 :                     ShowSevereError(state, "CalcHeatBalHAMT: demoninator in calculating RH is zero.  Check material properties for accuracy.");
    1501            0 :                     ShowContinueError(state, format("...Problem occurs in Material=\"{}\".", s_mat->materials(cell.matid)->Name));
    1502            0 :                     ShowFatalError(state, "Program terminates due to preceding condition.");
    1503              :                 }
    1504              : 
    1505            0 :                 if (cell.rhp1 > rhmax) {
    1506            0 :                     cell.rhp1 = rhmax;
    1507              :                 }
    1508              :             }
    1509              : 
    1510              :             // Check for convergence or too many itterations
    1511            0 :             sumtp1 = 0.0;
    1512            0 :             for (int cid = s_hbh->Extcell(sid); cid <= s_hbh->Intcell(sid); ++cid) {
    1513            0 :                 auto const &cell = s_hbh->cells(cid);
    1514            0 :                 if (sumtp1 < std::abs(cell.tempp2 - cell.tempp1)) {
    1515            0 :                     sumtp1 = std::abs(cell.tempp2 - cell.tempp1);
    1516              :                 }
    1517              :             }
    1518            0 :             if (sumtp1 < convt) {
    1519            0 :                 break;
    1520              :             }
    1521            0 :             if (itter > ittermax) {
    1522            0 :                 break;
    1523              :             }
    1524            0 :             for (int cid = s_hbh->firstcell(sid); cid <= s_hbh->lastcell(sid); ++cid) {
    1525            0 :                 auto &cell = s_hbh->cells(cid);
    1526            0 :                 cell.tempp2 = cell.tempp1;
    1527            0 :                 cell.rhp2 = cell.rhp1;
    1528              :             }
    1529            0 :         }
    1530              : 
    1531              :         // report back to CalcHeatBalanceInsideSurf
    1532            0 :         TempSurfOutTmp = extCell.tempp1;
    1533            0 :         SurfTempInTmp = intCell.tempp1;
    1534              : 
    1535            0 :         SurfTempInP = intCell.rhp1 * PsyPsatFnTemp(state, intCell.tempp1);
    1536              : 
    1537            0 :         state.dataMstBal->RhoVaporSurfIn(sid) = SurfTempInP / (461.52 * (spaceMAT + Constant::Kelvin));
    1538            0 :     }
    1539              : 
    1540            0 :     void UpdateHeatBalHAMT(EnergyPlusData &state, int const sid)
    1541              :     {
    1542              :         // SUBROUTINE INFORMATION:
    1543              :         //       AUTHOR         Phillip Biddulph
    1544              :         //       DATE WRITTEN   June 2008
    1545              :         //       MODIFIED       na
    1546              :         //       RE-ENGINEERED  na
    1547              : 
    1548              :         // PURPOSE OF THIS SUBROUTINE:
    1549              :         // The zone heat balance equation has converged, so now the HAMT values are to be fixed
    1550              :         // ready for the next itteration.
    1551              :         // Fill all the report variables
    1552              : 
    1553              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    1554              :         Real64 watermass;
    1555              :         Real64 matmass;
    1556              :         // unused1208    REAL(r64), SAVE :: InOld=0.0D0
    1557              :         // unused1208    REAL(r64), SAVE :: OutOld=0.0D0
    1558              : 
    1559            0 :         auto &s_hbh = state.dataHeatBalHAMTMgr;
    1560              : 
    1561              :         // Update Temperatures and RHs. Calculate report variables
    1562            0 :         matmass = 0.0;
    1563            0 :         watermass = 0.0;
    1564            0 :         for (int cid = s_hbh->firstcell(sid); cid <= s_hbh->lastcell(sid); ++cid) {
    1565            0 :             auto &cell = s_hbh->cells(cid);
    1566              :             // fix HAMT values for this surface
    1567            0 :             cell.temp = cell.tempp1;
    1568            0 :             cell.rh = cell.rhp1;
    1569            0 :             cell.rhp = cell.rh * 100.0;
    1570            0 :             if (cell.density > 0.0) {
    1571            0 :                 cell.wreport = cell.water / cell.density;
    1572            0 :                 watermass += (cell.water * cell.volume);
    1573            0 :                 matmass += (cell.density * cell.volume);
    1574              :             }
    1575              :         }
    1576              : 
    1577            0 :         s_hbh->watertot(sid) = 0.0;
    1578            0 :         if (matmass > 0) {
    1579            0 :             s_hbh->watertot(sid) = watermass / matmass;
    1580              :         }
    1581              : 
    1582            0 :         s_hbh->surfrh(sid) = 100.0 * s_hbh->cells(s_hbh->Intcell(sid)).rh;
    1583            0 :         s_hbh->surfextrh(sid) = 100.0 * s_hbh->cells(s_hbh->Extcell(sid)).rh;
    1584            0 :         s_hbh->surftemp(sid) = s_hbh->cells(s_hbh->Intcell(sid)).temp;
    1585            0 :         s_hbh->surfexttemp(sid) = s_hbh->cells(s_hbh->Extcell(sid)).temp;
    1586            0 :         s_hbh->surfvp(sid) = RHtoVP(state, s_hbh->cells(s_hbh->Intcell(sid)).rh, s_hbh->cells(s_hbh->Intcell(sid)).temp);
    1587            0 :     }
    1588              : 
    1589            0 :     void interp(int const ndata,
    1590              :                 const Array1D<Real64> &xx,
    1591              :                 const Array1D<Real64> &yy,
    1592              :                 Real64 const invalue,
    1593              :                 Real64 &outvalue,
    1594              :                 ObjexxFCL::Optional<Real64> outgrad)
    1595              :     {
    1596              :         // SUBROUTINE INFORMATION:
    1597              :         //       AUTHOR         Phillip Biddulph
    1598              :         //       DATE WRITTEN   June 2008
    1599              :         //       MODIFIED       na
    1600              :         //       RE-ENGINEERED  na
    1601              : 
    1602              :         // PURPOSE OF THIS SUBROUTINE:
    1603              :         // To find a value by searching an array and interpolating between two coordinates
    1604              :         // Also returns the gradient if required.
    1605              : 
    1606              :         // METHODOLOGY EMPLOYED:
    1607              :         // Simple search
    1608              : 
    1609              :         // Argument array dimensioning
    1610            0 :         EP_SIZE_CHECK(xx, ndata);
    1611            0 :         EP_SIZE_CHECK(yy, ndata);
    1612              : 
    1613              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
    1614              :         Real64 xxlow;
    1615              :         Real64 xxhigh;
    1616              :         Real64 yylow;
    1617              :         Real64 yyhigh;
    1618              :         Real64 mygrad;
    1619              : 
    1620            0 :         mygrad = 0.0;
    1621            0 :         outvalue = 0.0;
    1622              : 
    1623            0 :         if (ndata > 1) {
    1624            0 :             xxlow = xx(1);
    1625            0 :             yylow = yy(1);
    1626            0 :             for (int step = 2; step <= ndata; ++step) {
    1627            0 :                 xxhigh = xx(step);
    1628            0 :                 yyhigh = yy(step);
    1629            0 :                 if (invalue <= xxhigh) {
    1630            0 :                     break;
    1631              :                 }
    1632            0 :                 xxlow = xxhigh;
    1633            0 :                 yylow = yyhigh;
    1634              :             }
    1635              : 
    1636            0 :             if (xxhigh > xxlow) {
    1637            0 :                 mygrad = (yyhigh - yylow) / (xxhigh - xxlow);
    1638            0 :                 outvalue = (invalue - xxlow) * mygrad + yylow;
    1639              :                 // PDB August 2009 bug fix
    1640            0 :             } else if (std::abs(xxhigh - xxlow) < 0.0000000001) {
    1641            0 :                 outvalue = yylow;
    1642              :             }
    1643              :         }
    1644              : 
    1645            0 :         if (present(outgrad)) {
    1646              :             // return gradient if required
    1647            0 :             outgrad = mygrad;
    1648              :         }
    1649            0 :     }
    1650              : 
    1651            0 :     Real64 RHtoVP(EnergyPlusData &state, Real64 const RH, Real64 const Temperature)
    1652              :     {
    1653              :         // FUNCTION INFORMATION:
    1654              :         //       AUTHOR         Phillip Biddulph
    1655              :         //       DATE WRITTEN   June 2008
    1656              :         //       MODIFIED       na
    1657              :         //       RE-ENGINEERED  na
    1658              : 
    1659              :         // PURPOSE OF THIS FUNCTION:
    1660              :         // Convert Relative Humidity and Temperature to Vapor Pressure
    1661              : 
    1662              :         // Return value
    1663              :         Real64 RHtoVP;
    1664              : 
    1665              :         // FUNCTION LOCAL VARIABLE DECLARATIONS:
    1666              :         Real64 VPSat;
    1667              : 
    1668            0 :         VPSat = PsyPsatFnTemp(state, Temperature);
    1669              : 
    1670            0 :         RHtoVP = RH * VPSat;
    1671              : 
    1672            0 :         return RHtoVP;
    1673              :     }
    1674              : 
    1675            0 :     Real64 WVDC(Real64 const Temperature, Real64 const ambp)
    1676              :     {
    1677              :         // FUNCTION INFORMATION:
    1678              :         //       AUTHOR         Phillip Biddulph
    1679              :         //       DATE WRITTEN   June 2008
    1680              :         //       MODIFIED       na
    1681              :         //       RE-ENGINEERED  na
    1682              : 
    1683              :         // PURPOSE OF THIS FUNCTION:
    1684              :         // To calculate the Water Vapor Diffusion Coefficient in air
    1685              :         // using the temperature and ambient atmospheric pressor
    1686              : 
    1687              :         // REFERENCES:
    1688              :         // K?zel, H.M. (1995) Simultaneous Heat and Moisture Transport in Building Components.
    1689              :         // One- and two-dimensional calculation using simple parameters. IRB Verlag 1995
    1690              : 
    1691              :         // Return value
    1692              :         Real64 WVDC;
    1693              : 
    1694            0 :         WVDC = (2.e-7 * std::pow(Temperature + Constant::Kelvin, 0.81)) / ambp;
    1695              : 
    1696            0 :         return WVDC;
    1697              :     }
    1698              : 
    1699              :     //                                 COPYRIGHT NOTICE
    1700              : 
    1701              :     //     Portions Copyright (c) University College London 2007.  All rights
    1702              :     //     reserved.
    1703              : 
    1704              :     //     UCL LEGAL NOTICE
    1705              :     //     Neither UCL, members of UCL nor any person or organisation acting on
    1706              :     //     behalf of either:
    1707              : 
    1708              :     //     A. Makes any warranty of representation, express or implied with
    1709              :     //        respect to the accuracy, completeness, or usefulness of the
    1710              :     //        information contained in this program, including any warranty of
    1711              :     //        merchantability or fitness of any purpose with respect to the
    1712              :     //        program, or that the use of any information disclosed in this
    1713              :     //        program may not infringe privately-owned rights, or
    1714              : 
    1715              :     //     B. Assumes any liability with respect to the use of, or for any and
    1716              :     //        all damages resulting from the use of the program or any portion
    1717              :     //        thereof or any information disclosed therein.
    1718              : 
    1719              : } // namespace HeatBalanceHAMTManager
    1720              : 
    1721              : } // namespace EnergyPlus
        

Generated by: LCOV version 2.0-1