LCOV - code coverage report
Current view: top level - EnergyPlus - Psychrometrics.hh (source / functions) Hit Total Coverage
Test: lcov.output.filtered Lines: 175 201 87.1 %
Date: 2023-01-17 19:17:23 Functions: 35 38 92.1 %

          Line data    Source code
       1             : // EnergyPlus, Copyright (c) 1996-2023, 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             : #ifndef Psychrometrics_hh_INCLUDED
      49             : #define Psychrometrics_hh_INCLUDED
      50             : 
      51             : // C++ Headers
      52             : #include <cassert>
      53             : #include <cmath>
      54             : 
      55             : // ObjexxFCL Headers
      56             : #include <ObjexxFCL/Array1D.hh>
      57             : #include <ObjexxFCL/Fmath.hh>
      58             : 
      59             : // EnergyPlus Headers
      60             : #include <EnergyPlus/Data/BaseData.hh>
      61             : #include <EnergyPlus/Data/EnergyPlusData.hh>
      62             : #include <EnergyPlus/DataGlobals.hh>
      63             : #include <EnergyPlus/EnergyPlus.hh>
      64             : #include <EnergyPlus/PsychCacheData.hh>
      65             : #include <EnergyPlus/UtilityRoutines.hh>
      66             : 
      67             : namespace EnergyPlus {
      68             : 
      69             : // Forward declarations
      70             : struct EnergyPlusData;
      71             : 
      72             : #ifdef EP_nocache_Psychrometrics
      73             : #undef EP_cache_PsyTwbFnTdbWPb
      74             : #undef EP_cache_PsyPsatFnTemp
      75             : #undef EP_cache_PsyTsatFnPb
      76             : #undef EP_cache_PsyTsatFnHPb
      77             : #else
      78             : #define EP_cache_PsyTwbFnTdbWPb
      79             : #define EP_cache_PsyPsatFnTemp
      80             : #define EP_cache_PsyTsatFnPb
      81             : #define EP_cache_PsyTsatFnHPb
      82             : #endif
      83             : 
      84             : // Adapted from: https://www.fluentcpp.com/2019/08/30/how-to-disable-a-warning-in-cpp/
      85             : // clang-format off
      86             : #if defined(_MSC_VER)
      87             : #define DISABLE_WARNING_PUSH __pragma(warning(push))
      88             : #define DISABLE_WARNING_POP __pragma(warning(pop))
      89             : #define DISABLE_WARNING(warningNumber) __pragma(warning(disable : warningNumber))
      90             : 
      91             : // purposfully doing nothing here - does MSVC not have a strict-aliasing warning?
      92             : #define DISABLE_WARNING_STRICT_ALIASING
      93             : #define DISABLE_WARNING_UNINITIALIZED
      94             : #elif defined(__GNUC__) || defined(__clang__)
      95             : #define DO_PRAGMA(X) _Pragma(#X)
      96             : #define DISABLE_WARNING_PUSH DO_PRAGMA(GCC diagnostic push)
      97             : #define DISABLE_WARNING_POP DO_PRAGMA(GCC diagnostic pop)
      98             : #define DISABLE_WARNING(warningName) DO_PRAGMA(GCC diagnostic ignored #warningName)
      99             : 
     100             : #define DISABLE_WARNING_STRICT_ALIASING DISABLE_WARNING(-Wstrict-aliasing)
     101             : #define DISABLE_WARNING_UNINITIALIZED DISABLE_WARNING(-Wuninitialized)
     102             : 
     103             : #endif
     104             : // clang-format on
     105             : 
     106             : namespace Psychrometrics {
     107             : 
     108             :     // Data
     109             :     // MODULE PARAMETER DEFINITIONS:
     110             :     // call for recurring errors
     111             : 
     112             :     static constexpr std::array<std::string_view, static_cast<int>(PsychrometricFunction::Num)> PsyRoutineNames = {
     113             :         "PsyTdpFnTdbTwbPb",
     114             :         "PsyRhFnTdbWPb",
     115             :         "PsyTwbFnTdbWPb",
     116             :         "PsyVFnTdbWPb",
     117             :         "PsyWFnTdpPb",
     118             :         "PsyWFnTdbH",
     119             :         "PsyWFnTdbTwbPb",
     120             :         "PsyWFnTdbRhPb",
     121             :         "PsyPsatFnTemp",
     122             :         "PsyTsatFnHPb",
     123             :         "PsyTsatFnPb",
     124             :         "PsyRhFnTdbRhov",
     125             :         "PsyRhFnTdbRhovLBnd0C",
     126             :         "PsyTwbFnTdbWPb",
     127             :         "PsyTwbFnTdbWPb",
     128             :         "PsyWFnTdbTwbPb",
     129             :         "PsyTsatFnPb",
     130             :         "PsyTwbFnTdbWPb_cache",
     131             :         "PsyPsatFnTemp_cache"}; // 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
     132             :                                 // 14 - HR | 15 - max iter | 16 - HR | 17 - max iter | 18 -
     133             :                                 // PsyTwbFnTdbWPb_raw (raw calc) | 19 - PsyPsatFnTemp_raw
     134             :                                 // (raw calc)
     135             :                                 // sample bin size =64 Pa; sample size =1651 (continous)
     136             :     static constexpr std::array<Real64, 1651> tsat_fn_pb_y = {
     137             :         -100,        -24.88812836, -17.74197121, -13.36696483, -10.17031904, -7.635747635, -5.528025298, -3.719474549, -2.132789207, -0.717496548,
     138             :         0.635182846, 1.961212857,  3.184455749,  4.320585222,  5.381890646,  6.378191532,  7.317464071,  8.206277019,  9.050107781,  9.853572827,
     139             :         10.62060139, 11.35456508,  12.05838073,  12.73458802,  13.38541367,  14.01282043,  14.61854774,  15.2041452,   15.77099766,  16.32035156,
     140             :         16.85332662, 17.37094188,  17.87411665,  18.36369351,  18.84043883,  19.30505535,  19.75818947,  20.200435,    20.63234161,  21.05441545,
     141             :         21.46712703, 21.87091368,  22.26617973,  22.65330582,  23.03264392,  23.40452474,  23.76925695,  24.12713074,  24.4784194,   24.82337925,
     142             :         25.16224961, 25.49525941,  25.82262353,  26.14454343,  26.46121131,  26.77280989,  27.07951029,  27.38147718,  27.67886392,  27.97181871,
     143             :         28.26048327, 28.54498875,  28.82546493,  29.10203155,  29.37480614,  29.64389783,  29.90941288,  30.17145332,  30.43011544,  30.68549275,
     144             :         30.93767354, 31.1867437,   31.43278471,  31.67587535,  31.91609169,  32.15350578,  32.38818672,  32.62020399,  32.84962034,  33.07649705,
     145             :         33.30089772, 33.52287753,  33.7424911,   33.95979768,  34.17484337,  34.38768181,  34.59836177,  34.8069286,   35.01342775,  35.21790433,
     146             :         35.42039942, 35.62095455,  35.81961149,  36.0164063,   36.21137695,  36.40456083,  36.59599334,  36.78570706,  36.97373442,  37.16011096,
     147             :         37.34486543, 37.5280276,   37.70962755,  37.88969498,  38.06825698,  38.24534078,  38.4209727,   38.59517724,  38.7679823,   38.93940873,
     148             :         39.10948012, 39.2782229,   39.44565725,  39.6118041,   39.77668652,  39.94032485,  40.10273846,  40.26394796,  40.42397281,  40.58283123,
     149             :         40.74054192, 40.89712156,  41.0525873,   41.20696011,  41.3602526,   41.5124819,   41.66366455,  41.81381521,  41.96295168,  42.11108573,
     150             :         42.25823182, 42.40440716,  42.54962287,  42.69389419,  42.8372333,   42.97965197,  43.12116511,  43.2617866,   43.40152372,  43.5403934,
     151             :         43.67840528, 43.81556931,  43.95189963,  44.0874032,   44.22209605,  44.35598543,  44.48908135,  44.62139435,  44.75293555,  44.88371503,
     152             :         45.01374001, 45.14302132,  45.27156964,  45.39939168,  45.52649676,  45.65289264,  45.77859083,  45.90359809,  46.02792097,  46.15157051,
     153             :         46.27455279, 46.39687482,  46.51854662,  46.63957407,  46.75996667,  46.87972868,  46.99886779,  47.11739332,  47.23530984,  47.35262368,
     154             :         47.46934408, 47.58547585,  47.7010257,   47.81600131,  47.93040599,  48.0442474,   48.15753313,  48.27026594,  48.38245292,  48.49410119,
     155             :         48.60521578, 48.71580123,  48.82586296,  48.93540734,  49.04443945,  49.15296424,  49.26098645,  49.36851262,  49.47554597,  49.58209088,
     156             :         49.68815438, 49.7937401,   49.89885468,  50.00349843,  50.10767869,  50.21139915,  50.31466562,  50.41748127,  50.51984969,  50.6217774,
     157             :         50.72326533, 50.8243191,   50.92494506,  51.02514303,  51.12491978,  51.22427873,  51.32322162,  51.42175505,  51.51988223,  51.61760565,
     158             :         51.71492849, 51.81185626,  51.90838995,  52.00453601,  52.10029659,  52.19567395,  52.29067211,  52.38529434,  52.47954517,  52.57342522,
     159             :         52.66694094, 52.76009179,  52.85288285,  52.94531781,  53.03739768,  53.12912747,  53.22050752,  53.31154238,  53.40223643,  53.49258938,
     160             :         53.58260762, 53.67228883,  53.76164079,  53.85066348,  53.93935919,  54.02773136,  54.11578345,  54.20351687,  54.29093451,  54.37803778,
     161             :         54.46483065, 54.55131516,  54.63749308,  54.7233676,   54.80894018,  54.89421491,  54.97919066,  55.0638724,   55.14826341,  55.23236115,
     162             :         55.31617223, 55.39969882,  55.48294042,  55.56589968,  55.64857895,  55.7309827,   55.8131092,   55.89496315,  55.97654474,  56.05785774,
     163             :         56.1389022,  56.21968099,  56.30019707,  56.38045024,  56.46044318,  56.54017846,  56.61965822,  56.69888215,  56.77785343,  56.85657191,
     164             :         56.93504425, 57.01326641,  57.09124313,  57.16897715,  57.24646717,  57.32371609,  57.40072768,  57.4774991,   57.55403662,  57.63033718,
     165             :         57.70640793, 57.7822446,   57.85785243,  57.93323193,  58.00838488,  58.08331234,  58.15801692,  58.23249741,  58.30675724,  58.38079823,
     166             :         58.4546222,  58.52822764,  58.60161837,  58.67479622,  58.74775927,  58.82051339,  58.89305587,  58.96539129,  59.03751832,  59.1094403,
     167             :         59.18115654, 59.25267006,  59.32398161,  59.39509291,  59.46600373,  59.53671502,  59.60723006,  59.67755023,  59.74767505,  59.81760513,
     168             :         59.88734393, 59.95688928,  60.02624654,  60.09541405,  60.16439371,  60.2331876,   60.30179567,  60.37021755,  60.43845741,  60.50651412,
     169             :         60.57438886, 60.64208387,  60.70960018,  60.77693773,  60.84409885,  60.91108356,  60.97789194,  61.04452769,  61.11098811,  61.1772789,
     170             :         61.2433966,  61.30934573,  61.37512456,  61.44073521,  61.50617791,  61.57145516,  61.6365656,   61.70151178,  61.76629472,  61.83091455,
     171             :         61.89537314, 61.95967045,  62.02380873,  62.08778598,  62.15160576,  62.21526616,  62.2787729,   62.34212215,  62.40531644,  62.46835564,
     172             :         62.53124254, 62.59397652,  62.65655972,  62.7189898,   62.78127202,  62.84340443,  62.90538831,  62.96722333,  63.02891098,  63.09045474,
     173             :         63.15185221, 63.21310404,  63.27421125,  63.33517636,  63.395999,    63.45668024,  63.5172196,   63.57761821,  63.63787789,  63.69799922,
     174             :         63.75798178, 63.81782639,  63.87753525,  63.93710759,  63.99654311,  64.05584549,  64.11501608,  64.1740502,   64.23294864,  64.29172001,
     175             :         64.35035847, 64.40886389,  64.4672399,   64.5254877,   64.5836074,   64.64159658,  64.69945949,  64.75719386,  64.81480044,  64.87228539,
     176             :         64.92964246, 64.98687573,  65.04398502,  65.10096852,  65.15782959,  65.21457202,  65.27118885,  65.32768769,  65.38406204,  65.44031895,
     177             :         65.49645605, 65.55247365,  65.60837577,  65.66415606,  65.7198208,   65.7753675,   65.8307992,   65.88611471,  65.94131694,  65.99640529,
     178             :         66.05137563, 66.10623566,  66.16098047,  66.21561318,  66.27013565,  66.32454189,  66.37884177,  66.43303089,  66.48710748,  66.54107712,
     179             :         66.59493603, 66.64868734,  66.70232946,  66.75586325,  66.80929006,  66.86261073,  66.91582873,  66.96893645,  67.02193922,  67.07484084,
     180             :         67.12763318, 67.18032374,  67.23291261,  67.2853971,   67.33777697,  67.39005562,  67.44223342,  67.49431315,  67.54628565,  67.59816124,
     181             :         67.64993655, 67.70161425,  67.75319106,  67.80466762,  67.85604816,  67.90732765,  67.95851385,  68.00959903,  68.06059149,  68.11148356,
     182             :         68.16228279, 68.21298473,  68.26359087,  68.31410431,  68.36452488,  68.41484999,  68.46508104,  68.51521777,  68.56526159,  68.6152136,
     183             :         68.6650752,  68.71484646,  68.76452459,  68.81410894,  68.86360503,  68.9130119,   68.96232932,  69.01155648,  69.06069295,  69.10974389,
     184             :         69.15870478, 69.20757526,  69.25636202,  69.30505708,  69.35366941,  69.40219039,  69.45062774,  69.49898231,  69.54724573,  69.59542511,
     185             :         69.64352333, 69.69153266,  69.73946144,  69.78730174,  69.83506042,  69.8827346,   69.93032771,  69.97783945,  70.02526447,  70.07260834,
     186             :         70.11987362, 70.16705659,  70.21415392,  70.26117672,  70.3081124,   70.35497219,  70.40175094,  70.44845033,  70.49506926,  70.5416108,
     187             :         70.58807245, 70.63445733,  70.68076429,  70.72698884,  70.77314,     70.81921262,  70.86521029,  70.91112621,  70.956971,    71.0027362,
     188             :         71.04842458, 71.09404158,  71.13958183,  71.18504519,  71.23043212,  71.27574987,  71.3209896,   71.36615442,  71.41124924,  71.45626937,
     189             :         71.50121362, 71.5460872,   71.59088911,  71.63561453,  71.68027218,  71.72485702,  71.76936872,  71.8138079,   71.85817753,  71.90247673,
     190             :         71.94670456, 71.99086376,  72.03495158,  72.07896913,  72.12291519,  72.16679298,  72.21060503,  72.25434249,  72.29801465,  72.34161996,
     191             :         72.38515599, 72.42862145,  72.47201901,  72.51535392,  72.5586171,   72.60181527,  72.64494367,  72.68800759,  72.73100471,  72.77393894,
     192             :         72.81680315, 72.85960377,  72.90233649,  72.94500537,  72.98760805,  73.03014695,  73.07262276,  73.11503298,  73.1573782,   73.19966128,
     193             :         73.24187731, 73.28403304,  73.32612125,  73.36815237,  73.41011791,  73.45201898,  73.49385988,  73.53563549,  73.57735287,  73.61900651,
     194             :         73.6605957,  73.70212525,  73.74359587,  73.78500201,  73.82635101,  73.86763719,  73.90886374,  73.95002747,  73.99113361,  74.03217995,
     195             :         74.07316582, 74.11409233,  74.15495789,  74.19576541,  74.23651553,  74.27720372,  74.31783561,  74.35840878,  74.39892536,  74.43938115,
     196             :         74.47978004, 74.52011928,  74.56040515,  74.60062901,  74.64080092,  74.68091054,  74.72096571,  74.76096771,  74.80090708,  74.84079646,
     197             :         74.88062483, 74.9204009,   74.96011942,  74.99977909,  75.03939008,  75.07893992,  75.11843698,  75.15788211,  75.19726977,  75.23660313,
     198             :         75.27588023, 75.31510624,  75.3542739,   75.39339345,  75.43245611,  75.47146405,  75.51042254,  75.54932382,  75.58817471,  75.62697021,
     199             :         75.66571461, 75.70440632,  75.74304491,  75.78163044,  75.82016525,  75.85865056,  75.89708068,  75.93545883,  75.97378492,  76.0120621,
     200             :         76.05028712, 76.08846034,  76.12658418,  76.16465767,  76.2026797,   76.24065195,  76.27857222,  76.31644424,  76.35426512,  76.39203326,
     201             :         76.42975531, 76.46742597,  76.50504989,  76.54262349,  76.58014732,  76.6176226,   76.6550495,   76.69242337,  76.72975292,  76.76703263,
     202             :         76.80426597, 76.84144989,  76.87858556,  76.91567266,  76.95271451,  76.98970341,  77.02664946,  77.06354801,  77.10039946,  77.13720248,
     203             :         77.17395743, 77.21066858,  77.24732868,  77.28394674,  77.32051481,  77.35703974,  77.3935179,   77.4299481,   77.46633278,  77.50267234,
     204             :         77.53896767, 77.5752132,   77.6114198,   77.64757673,  77.68368996,  77.71975535,  77.75577955,  77.79175544,  77.82768892,  77.86357885,
     205             :         77.89942204, 77.93522269,  77.97097918,  78.00669057,  78.04235789,  78.07798,     78.11356019,  78.14909725,  78.18459127,  78.22004104,
     206             :         78.25544735, 78.29081033,  78.32613242,  78.3614084,   78.39664434,  78.43183732,  78.46698385,  78.50209439,  78.53715718,  78.57218022,
     207             :         78.60716047, 78.64209878,  78.6769951,   78.71185226,  78.746663,    78.78143682,  78.81616758,  78.85085484,  78.88550274,  78.92010982,
     208             :         78.9546777,  78.98920242,  79.02368438,  79.05812941,  79.09253277,  79.12689452,  79.16121566,  79.19549993,  79.22974184,  79.26394059,
     209             :         79.29810401, 79.33222714,  79.36630773,  79.40034862,  79.43435261,  79.46831575,  79.50224105,  79.5361278,   79.56997224,  79.60377852,
     210             :         79.63754844, 79.6712756,   79.70496707,  79.7386195,   79.77223095,  79.80580692,  79.8393431,   79.87284009,  79.90630324,  79.9397239,
     211             :         79.9731062,  80.00645432,  80.03976078,  80.07303132,  80.10626466,  80.13946141,  80.17261862,  80.2057402,   80.23882443,  80.27187067,
     212             :         80.30488333, 80.33785562,  80.37079099,  80.40368818,  80.43655134,  80.46937694,  80.50216672,  80.53492197,  80.56763831,  80.60032048,
     213             :         80.63296434, 80.66557006,  80.69814406,  80.73067924,  80.7631833,   80.7956466,   80.82807796,  80.86046929,  80.89282813,  80.92515223,
     214             :         80.95744088, 80.98969387,  81.02191322,  81.05409659,  81.08624412,  81.11835765,  81.15043579,  81.1824791,   81.21448773,  81.24646338,
     215             :         81.27840107, 81.31030725,  81.34217912,  81.3740162,   81.40582266,  81.43759037,  81.4693268,   81.50102878,  81.53269738,  81.564328,
     216             :         81.59592988, 81.62749803,  81.65902927,  81.69053248,  81.72199906,  81.75343024,  81.78483194,  81.81620159,  81.84753434,  81.87883589,
     217             :         81.91010465, 81.94134123,  81.97254592,  82.0037149,   82.03485388,  82.06595769,  82.09703065,  82.1280729,   82.15908193,  82.19005726,
     218             :         82.22100267, 82.25191447,  82.28279684,  82.31364612,  82.34446044,  82.37524835,  82.40600156,  82.43672281,  82.46741359,  82.49807143,
     219             :         82.52869953, 82.55929763,  82.58986383,  82.62039574,  82.65090102,  82.68137014,  82.71181314,  82.74222283,  82.77260316,  82.80295069,
     220             :         82.83327058, 82.86355667,  82.89381203,  82.92404037,  82.95423709,  82.98440109,  83.0145352,   83.04464057,  83.0747166,   83.10476355,
     221             :         83.13477865, 83.16476369,  83.19471663,  83.22464346,  83.25454104,  83.28440557,  83.31424367,  83.34405051,  83.37382643,  83.403574,
     222             :         83.43329363, 83.46298145,  83.49264184,  83.52227618,  83.55187566,  83.5814507,   83.61099411,  83.64050958,  83.66999636,  83.69945328,
     223             :         83.72888435, 83.75828467,  83.78765457,  83.81699798,  83.84631261,  83.87559999,  83.90485773,  83.93408864,  83.96328773,  83.9924604,
     224             :         84.02160824, 84.05072359,  84.07981307,  84.10887322,  84.13790674,  84.16691375,  84.19589213,  84.22484302,  84.25376552,  84.28266125,
     225             :         84.31152889, 84.34036894,  84.36918258,  84.39796509,  84.426723,    84.4554566,   84.48416077,  84.51283457,  84.54148605,  84.57010873,
     226             :         84.59870416, 84.62727398,  84.65581296,  84.68432935,  84.71281921,  84.74128034,  84.76971427,  84.79812356,  84.82650714,  84.85486414,
     227             :         84.88319335, 84.91149363,  84.93977033,  84.96802107,  84.99624746,  85.02444686,  85.05261848,  85.08076234,  85.10888389,  85.13697661,
     228             :         85.16504751, 85.19308996,  85.22110697,  85.24909745,  85.27706406,  85.3050058,   85.33291891,  85.36080872,  85.38867288,  85.41650897,
     229             :         85.44432122, 85.47211082,  85.49987157,  85.5276116,   85.55532315,  85.58301033,  85.61067074,  85.63830715,  85.66592225,  85.69350747,
     230             :         85.72106906, 85.74860734,  85.77612007,  85.80360992,  85.83107309,  85.85851235,  85.88592674,  85.91331883,  85.940685,    85.96802559,
     231             :         85.99534052, 86.02263527,  86.04990355,  86.07714803,  86.1043677,   86.13156409,  86.15873472,  86.18588473,  86.21300672,  86.24010603,
     232             :         86.267184,   86.29423588,  86.32126306,  86.34826803,  86.37525004,  86.40220887,  86.42914117,  86.45605219,  86.48294074,  86.50980317,
     233             :         86.53664208, 86.56346029,  86.59025279,  86.61702366,  86.64376933,  86.6704935,   86.6971967,   86.72387239,  86.75052605,  86.77716019,
     234             :         86.80376776, 86.83035345,  86.85691767,  86.88345664,  86.90997465,  86.93646901,  86.96294,     86.98938903,  87.01581375,  87.04222061,
     235             :         87.06860086, 87.09495848,  87.12129645,  87.14761207,  87.17390292,  87.20017179,  87.22641888,  87.25264536,  87.27884551,  87.30502537,
     236             :         87.33118401, 87.35732172,  87.38343463,  87.40952679,  87.43559834,  87.46164719,  87.48767415,  87.51367842,  87.53966135,  87.56562576,
     237             :         87.59156283, 87.61748293,  87.64337717,  87.66925215,  87.69510798,  87.72093736,  87.74674778,  87.77253857,  87.79830413,  87.82405258,
     238             :         87.84977774, 87.87547845,  87.90116109,  87.92682487,  87.95246439,  87.9780827,   88.00367984,  88.02925702,  88.05481207,  88.08035027,
     239             :         88.10586302, 88.13135623,  88.15683029,  88.18227924,  88.2077092,   88.23311926,  88.25851218,  88.28387904,  88.30922637,  88.33455433,
     240             :         88.35986038, 88.38515007,  88.41041472,  88.43566009,  88.46088564,  88.48608997,  88.51127475,  88.53643864,  88.5615843,   88.58670705,
     241             :         88.61180925, 88.63689372,  88.66195676,  88.6870023,   88.71202293,  88.73702912,  88.76201161,  88.7869734,   88.81191947,  88.83684387,
     242             :         88.86174532, 88.88662923,  88.91149412,  88.93633903,  88.96116308,  88.98596844,  89.01075422,  89.03552234,  89.0602694,   89.08499342,
     243             :         89.10970333, 89.1343894,   89.15906041,  89.18370902,  89.20834007,  89.23295171,  89.25754223,  89.28211345,  89.30666784,  89.33119931,
     244             :         89.35571584, 89.38021293,  89.40468873,  89.42914701,  89.45358423,  89.47800419,  89.50240334,  89.52678556,  89.55114712,  89.57549205,
     245             :         89.59981659, 89.62412467,  89.64841158,  89.67267947,  89.69693248,  89.72116452,  89.74537692,  89.76957083,  89.7937454,   89.81790335,
     246             :         89.84204321, 89.86616299,  89.89026483,  89.9143479,   89.93841405,  89.96245975,  89.98648709,  90.01049982,  90.03449049,  90.05846689,
     247             :         90.08242149, 90.10635828,  90.13027714,  90.15417848,  90.17806217,  90.20192576,  90.22577482,  90.24960461,  90.27341656,  90.2972106,
     248             :         90.32098387, 90.34474149,  90.36848137,  90.39220204,  90.41590903,  90.43959324,  90.46326397,  90.48691589,  90.51054803,  90.53416512,
     249             :         90.55776192, 90.58134304,  90.60490873,  90.62845405,  90.65198139,  90.67549356,  90.69898682,  90.72246132,  90.74592103,  90.769361,
     250             :         90.79278746, 90.81619179,  90.83958359,  90.86295533,  90.88630908,  90.90964877,  90.93297058,  90.95627204,  90.97955858,  91.00282768,
     251             :         91.02608323, 91.04931768,  91.07253502,  91.09573908,  91.11892527,  91.14209171,  91.16524142,  91.1883783,   91.21149485,  91.23459599,
     252             :         91.25767976, 91.2807473,   91.30379877,  91.32683136,  91.34984706,  91.37285084,  91.39583217,  91.41880262,  91.44175194,  91.46468678,
     253             :         91.48760533, 91.51050867,  91.53339033,  91.55625985,  91.57911433,  91.60195137,  91.62476883,  91.64757164,  91.67036098,  91.69313301,
     254             :         91.71588507, 91.73862389,  91.76134768,  91.78405458,  91.80674275,  91.82941719,  91.85207509,  91.87471831,  91.89734523,  91.91995466,
     255             :         91.94254665, 91.96512422,  91.98768844,  92.01023542,  92.03276627,  92.05527817,  92.07777696,  92.10025976,  92.12272678,  92.14517897,
     256             :         92.16761444, 92.19003427,  92.21243853,  92.23482725,  92.25720356,  92.27955771,  92.30190036,  92.3242278,   92.34654009,  92.36883447,
     257             :         92.39111284, 92.41338006,  92.43562863,  92.45786234,  92.48008133,  92.50228177,  92.52446971,  92.54664103,  92.56880174,  92.59094039,
     258             :         92.61306856, 92.63517859,  92.65727443,  92.67935617,  92.70142287,  92.72347274,  92.74550864,  92.76753071,  92.7895351,   92.81152687,
     259             :         92.83350013, 92.85545971,  92.87740485,  92.89933747,  92.92125288,  92.943154,    92.96503896,  92.98690982,  93.0087646,   93.03060924,
     260             :         93.05243319, 93.07424721,  93.09604538,  93.11782401,  93.13959274,  93.16134502,  93.18308465,  93.20480792,  93.22651868,  93.24821416,
     261             :         93.26989246, 93.29155854,  93.31320847,  93.3348463,   93.35646639,  93.37807529,  93.3996693,   93.42124759,  93.44281016,  93.46436002,
     262             :         93.48589524, 93.50741881,  93.52892603,  93.55041879,  93.57189532,  93.59336136,  93.61480953,  93.63624525,  93.65766882,  93.67907358,
     263             :         93.70046721, 93.72184688,  93.74321081,  93.7645638,   93.78590211,  93.80722194,  93.82853104,  93.84982856,  93.8711087,   93.89237653,
     264             :         93.91362794, 93.9348689,   93.95609091,  93.9773035,   93.99850109,  94.01968552,  94.04085511,  94.06201077,  94.08315348,  94.10428149,
     265             :         94.12539575, 94.14649848,  94.16758545,  94.18865888,  94.20971874,  94.23076523,  94.25179828,  94.2728171,   94.29382356,  94.31481682,
     266             :         94.33579601, 94.3567592,   94.37771222,  94.39865154,  94.41957488,  94.44048529,  94.46138296,  94.48226783,  94.50314002,  94.52399573,
     267             :         94.54484271, 94.56567332,  94.58649145,  94.60729332,  94.6280858,   94.64886302,  94.6696293,   94.69037824,  94.71111801,  94.73184187,
     268             :         94.75255372, 94.77325448,  94.79393861,  94.8146147,   94.8352743,   94.85591916,  94.87655236,  94.89717391,  94.91778139,  94.93837602,
     269             :         94.95895446, 94.97952618,  95.00008186,  95.02062236,  95.04115163,  95.06166969,  95.08217276,  95.10266477,  95.12314186,  95.14360713,
     270             :         95.16406232, 95.18450036,  95.20493,     95.22534421,  95.24574469,  95.26613366,  95.28651202,  95.30687598,  95.32722563,  95.34756393,
     271             :         95.36788887, 95.38820343,  95.40850304,  95.42879168,  95.449067,    95.4693292,   95.48958046,  95.50981786,  95.53004526,  95.55025891,
     272             :         95.57045881, 95.59064806,  95.61082454,  95.63098662,  95.65113602,  95.67127496,  95.6914036,   95.71151577,  95.73161845,  95.75170788,
     273             :         95.77178414, 95.7918502,   95.81190402,  95.83194392,  95.85197168,  95.87198945,  95.89199053,  95.91198337,  95.93196106,  95.95193138,
     274             :         95.97188434, 95.99182926,  96.01176161,  96.03168058,  96.05158784,  96.07148185,  96.09136342,  96.11123649,  96.13109341,  96.15094189,
     275             :         96.17077664, 96.19059992,  96.21041192,  96.23021102,  96.24999892,  96.26977403,  96.28953722,  96.30929235,  96.32903185,  96.34875878,
     276             :         96.36847475, 96.38818287,  96.40787474,  96.42755733,  96.44722605,  96.46688407,  96.48652908,  96.50616346,  96.5257865,   96.54539743,
     277             :         96.5649979,  96.58458635,  96.60416366,  96.62372601,  96.64328114,  96.66282372,  96.68235301,  96.70187136,  96.72137804,  96.74087386,
     278             :         96.76035587, 96.77983017,  96.79928993,  96.81874209,  96.83818056,  96.85760851,  96.87702132,  96.89642747,  96.91581871,  96.93520023,
     279             :         96.95457142, 96.97393153,  96.99327835,  97.01261497,  97.03194067,  97.05125242,  97.07055411,  97.08984577,  97.10912744,  97.12839538,
     280             :         97.14765195, 97.16689939,  97.18613698,  97.20535798,  97.22457231,  97.24377619,  97.26296359,  97.28214521,  97.30131272,  97.32047148,
     281             :         97.33962005, 97.35875536,  97.37787753,  97.39699277,  97.41609556,  97.43518605,  97.45426661,  97.47333802,  97.49239649,  97.51144208,
     282             :         97.53048245, 97.54950626,  97.56852035,  97.58752557,  97.60651883,  97.62550117,  97.64447612,  97.66343401,  97.68238777,  97.7013245,
     283             :         97.72025336, 97.73917295,  97.75808021,  97.77697826,  97.79586097,  97.81473912,  97.83360053,  97.85245612,  97.87129715,  97.89012997,
     284             :         97.90895465, 97.92776351,  97.94656357,  97.96535557,  97.98413572,  98.00290411,  98.0216607,   98.04040946,  98.0591458,   98.07787434,
     285             :         98.09659062, 98.11529602,  98.13399297,  98.15267543,  98.17135021,  98.19001678,  98.20866815,  98.22731202,  98.24594464,  98.26456913,
     286             :         98.28317933, 98.30178152,  98.32037191,  98.33895574,  98.35752401,  98.37608583,  98.39463599,  98.41317593,  98.43170428,  98.45022567,
     287             :         98.46873238, 98.48723156,  98.50572064,  98.52419839,  98.54266935,  98.56112833,  98.5795743,   98.59801359,  98.61644162,  98.63485926,
     288             :         98.65326612, 98.6716639,   98.69005,     98.70842759,  98.72679422,  98.74515239,  98.76349897,  98.78183652,  98.80016317,  98.818479,
     289             :         98.83678649, 98.85508254,  98.87337098,  98.89164802,  98.90991685,  98.92817432,  98.94642114,  98.96465599,  98.98288655,  99.0011027,
     290             :         99.0193095,  99.03750706,  99.05569661,  99.07387501,  99.09204163,  99.11020164,  99.12834992,  99.14649098,  99.16462101,  99.18274005,
     291             :         99.20084747, 99.21894777,  99.23704034,  99.25511882,  99.2731896,   99.29125019,  99.30930313,  99.32734527,  99.34537664,  99.36340108,
     292             :         99.38141098, 99.39941718,  99.41740889,  99.43539377,  99.45336677,  99.4713336,   99.48928668,  99.50723239,  99.5251714,   99.54309608,
     293             :         99.56101346, 99.57892103,  99.59682135,  99.61470745,  99.63258635,  99.65045553,  99.66831756,  99.68616804,  99.70400948,  99.72184065,
     294             :         99.7396654,  99.75747931,  99.77528304,  99.79307659,  99.81085938,  99.82863649,  99.84640288,  99.8641592,   99.88190929,  99.8996443,
     295             :         99.91737375, 99.93509321,  99.95280653,  99.97050611,  99.98819959,  100.0058826,  100.0235557,  100.041219,   100.0588725,  100.0765193,
     296             :         100.0941565, 100.1117838,  100.1294041,  100.147012,   100.1646135,  100.1822015,  100.1997837,  100.2173562,  100.2349186,  100.2524759,
     297             :         100.2700192, 100.2875567,  100.3050842,  100.3226022,  100.3401102,  100.3576094,  100.3751023,  100.3925827,  100.4100569,  100.4275217,
     298             :         100.4449773, 100.462423,   100.4798599,  100.4972871,  100.514705,   100.532117,   100.5495203,  100.5669127,  100.5842934,  100.6016687,
     299             :         100.6190344, 100.636391,   100.6537386,  100.6710809,  100.6884104,  100.7057304,  100.7230452,  100.7403472,  100.7576436,  100.7749305,
     300             :         100.7922053, 100.809475,   100.8267359,  100.8439874,  100.8612302,  100.8784641,  100.8956893,  100.9129053,  100.9301125,  100.947311,
     301             :         100.9645009, 100.9816821,  100.9988569,  101.0160203,  101.0331752,  101.0503248,  101.067462,   101.0845908,  101.101711,   101.1188265,
     302             :         101.1359293};
     303             :     static constexpr std::array<Real64, 1651> tsat_fn_pb_d2y = {
     304             :         0.015250294,  -0.030500589, 0.007192909,  -0.002330349, 0.000402372,  -0.000248973, -3.17456E-05, -0.000062284, -4.41164E-05, -1.23139E-05,
     305             :         1.6533E-06,   -3.33366E-05, -1.88742E-05, -1.87743E-05, -1.56343E-05, -1.39099E-05, -1.22638E-05, -1.09504E-05, -9.8264E-06,  -8.8733E-06,
     306             :         -8.0541E-06,  -7.3451E-06,  -6.7277E-06,  -0.000006186, -5.7085E-06,  -5.2852E-06,  -4.9077E-06,  -0.000004571, -4.2666E-06,  -3.9951E-06,
     307             :         -3.7455E-06,  -3.5228E-06,  -3.3165E-06,  -3.1302E-06,  -2.9589E-06,  -2.8011E-06,  -2.6567E-06,  -2.5223E-06,  -2.3992E-06,  -2.2844E-06,
     308             :         -2.1774E-06,  -2.0795E-06,  -1.9859E-06,  -1.9007E-06,  -1.8196E-06,  -1.7446E-06,  -1.6737E-06,  -0.000001607, -1.5443E-06,  -1.4864E-06,
     309             :         -1.4302E-06,  -1.3778E-06,  -1.3288E-06,  -1.2819E-06,  -0.000001237, -1.1958E-06,  -0.000001155, -1.1181E-06,  -1.0818E-06,  -1.0468E-06,
     310             :         -1.0157E-06,  -0.000000983, -9.547E-07,   -9.252E-07,   -8.992E-07,   -0.000000873, -0.000000848, -8.248E-07,   -8.016E-07,   -7.804E-07,
     311             :         -7.592E-07,   -7.395E-07,   -7.202E-07,   -7.016E-07,   -0.000000684, -6.675E-07,   -6.499E-07,   -6.349E-07,   -6.203E-07,   -6.039E-07,
     312             :         -0.000000591, -5.783E-07,   -5.621E-07,   -5.528E-07,   -5.384E-07,   -5.269E-07,   -5.159E-07,   -5.048E-07,   -4.935E-07,   -4.838E-07,
     313             :         -4.737E-07,   -0.000000463, -4.549E-07,   -4.453E-07,   -4.362E-07,   -4.274E-07,   -4.196E-07,   -0.000000412, -4.025E-07,   -3.962E-07,
     314             :         -3.887E-07,   -3.814E-07,   -0.000000374, -3.676E-07,   -3.609E-07,   -3.542E-07,   -3.489E-07,   -3.411E-07,   -3.368E-07,   -3.311E-07,
     315             :         -3.239E-07,   -3.196E-07,   -3.145E-07,   -3.085E-07,   -3.037E-07,   -2.991E-07,   -2.939E-07,   -2.891E-07,   -2.849E-07,   -2.801E-07,
     316             :         -2.761E-07,   -2.724E-07,   -2.661E-07,   -2.642E-07,   -2.594E-07,   -2.554E-07,   -2.523E-07,   -2.471E-07,   -0.000000245, -2.414E-07,
     317             :         -2.365E-07,   -2.348E-07,   -2.303E-07,   -2.276E-07,   -2.249E-07,   -2.211E-07,   -0.000000217, -2.168E-07,   -2.111E-07,   -2.095E-07,
     318             :         -2.074E-07,   -2.028E-07,   -2.028E-07,   -0.000000197, -1.966E-07,   -1.936E-07,   -1.912E-07,   -1.884E-07,   -1.857E-07,   -1.845E-07,
     319             :         -1.816E-07,   -1.786E-07,   -1.776E-07,   -1.748E-07,   -1.735E-07,   -0.00000017,  -1.687E-07,   -1.675E-07,   -0.000000164, -0.000000163,
     320             :         -1.615E-07,   -1.583E-07,   -1.578E-07,   -1.545E-07,   -1.543E-07,   -1.522E-07,   -1.495E-07,   -1.488E-07,   -1.474E-07,   -1.445E-07,
     321             :         -1.439E-07,   -1.422E-07,   -1.398E-07,   -1.398E-07,   -1.375E-07,   -1.353E-07,   -1.354E-07,   -1.332E-07,   -1.314E-07,   -1.303E-07,
     322             :         -1.292E-07,   -1.279E-07,   -1.262E-07,   -1.251E-07,   -1.238E-07,   -1.229E-07,   -1.208E-07,   -1.204E-07,   -1.195E-07,   -1.171E-07,
     323             :         -1.171E-07,   -1.143E-07,   -1.157E-07,   -1.127E-07,   -1.126E-07,   -1.106E-07,   -1.101E-07,   -1.095E-07,   -1.071E-07,   -1.078E-07,
     324             :         -1.061E-07,   -1.039E-07,   -1.051E-07,   -1.025E-07,   -1.019E-07,   -0.000000102, -9.96E-08,    -9.92E-08,    -9.85E-08,    -9.81E-08,
     325             :         -0.000000096, -9.68E-08,    -9.42E-08,    -9.42E-08,    -9.37E-08,    -9.25E-08,    -0.000000092, -9.02E-08,    -9.12E-08,    -8.82E-08,
     326             :         -8.96E-08,    -8.77E-08,    -8.67E-08,    -8.71E-08,    -0.000000085, -8.58E-08,    -8.43E-08,    -8.27E-08,    -0.000000084, -8.07E-08,
     327             :         -8.33E-08,    -7.96E-08,    -8.07E-08,    -7.98E-08,    -0.000000079, -0.000000078, -0.000000078, -7.69E-08,    -0.000000077, -7.56E-08,
     328             :         -7.53E-08,    -0.000000075, -7.38E-08,    -7.41E-08,    -7.22E-08,    -7.35E-08,    -7.17E-08,    -7.05E-08,    -7.24E-08,    -6.95E-08,
     329             :         -6.93E-08,    -6.98E-08,    -6.88E-08,    -6.87E-08,    -6.66E-08,    -6.84E-08,    -0.000000066, -0.000000067, -6.52E-08,    -6.58E-08,
     330             :         -6.49E-08,    -6.39E-08,    -6.45E-08,    -6.34E-08,    -0.000000063, -6.21E-08,    -6.29E-08,    -6.12E-08,    -6.25E-08,    -0.000000059,
     331             :         -6.19E-08,    -5.96E-08,    -0.000000059, -5.99E-08,    -0.000000059, -5.73E-08,    -5.96E-08,    -0.000000056, -5.91E-08,    -5.48E-08,
     332             :         -5.82E-08,    -5.52E-08,    -0.000000056, -5.51E-08,    -5.53E-08,    -0.000000054, -5.52E-08,    -5.36E-08,    -5.36E-08,    -5.26E-08,
     333             :         -5.38E-08,    -5.23E-08,    -5.16E-08,    -5.33E-08,    -5.01E-08,    -5.25E-08,    -4.98E-08,    -5.15E-08,    -4.96E-08,    -5.07E-08,
     334             :         -4.92E-08,    -4.95E-08,    -4.87E-08,    -0.000000049, -4.89E-08,    -4.78E-08,    -4.75E-08,    -4.77E-08,    -4.79E-08,    -4.61E-08,
     335             :         -0.000000048, -4.52E-08,    -4.67E-08,    -4.58E-08,    -4.53E-08,    -4.53E-08,    -4.59E-08,    -4.39E-08,    -0.000000045, -4.44E-08,
     336             :         -4.38E-08,    -4.35E-08,    -4.39E-08,    -4.29E-08,    -0.000000043, -4.35E-08,    -4.14E-08,    -4.38E-08,    -4.04E-08,    -4.32E-08,
     337             :         -4.04E-08,    -4.21E-08,    -4.07E-08,    -4.13E-08,    -0.00000004,  -4.11E-08,    -3.99E-08,    -3.98E-08,    -0.00000004,  -3.91E-08,
     338             :         -3.97E-08,    -3.83E-08,    -0.00000004,  -3.77E-08,    -3.98E-08,    -3.65E-08,    -3.92E-08,    -3.74E-08,    -3.83E-08,    -3.68E-08,
     339             :         -3.77E-08,    -3.62E-08,    -3.82E-08,    -3.53E-08,    -0.000000037, -0.000000036, -3.65E-08,    -3.62E-08,    -3.46E-08,    -3.61E-08,
     340             :         -3.54E-08,    -3.55E-08,    -3.44E-08,    -0.000000035, -3.43E-08,    -3.48E-08,    -3.44E-08,    -3.39E-08,    -3.37E-08,    -3.39E-08,
     341             :         -3.38E-08,    -3.29E-08,    -3.33E-08,    -3.37E-08,    -3.24E-08,    -3.18E-08,    -3.36E-08,    -3.38E-08,    -2.98E-08,    -3.31E-08,
     342             :         -3.26E-08,    -3.14E-08,    -3.14E-08,    -3.09E-08,    -3.25E-08,    -3.02E-08,    -3.16E-08,    -3.18E-08,    -2.85E-08,    -3.23E-08,
     343             :         -2.97E-08,    -3.02E-08,    -0.000000031, -3.01E-08,    -2.79E-08,    -3.22E-08,    -2.72E-08,    -3.19E-08,    -2.76E-08,    -2.96E-08,
     344             :         -2.96E-08,    -2.71E-08,    -0.000000031, -2.72E-08,    -2.96E-08,    -2.75E-08,    -2.88E-08,    -2.74E-08,    -2.74E-08,    -0.00000003,
     345             :         -2.57E-08,    -2.89E-08,    -2.73E-08,    -2.61E-08,    -2.99E-08,    -2.46E-08,    -2.74E-08,    -2.81E-08,    -2.52E-08,    -2.78E-08,
     346             :         -2.57E-08,    -2.69E-08,    -2.64E-08,    -0.000000026, -2.64E-08,    -0.000000024, -0.000000028, -2.55E-08,    -2.36E-08,    -2.81E-08,
     347             :         -0.000000024, -2.48E-08,    -2.56E-08,    -2.58E-08,    -2.43E-08,    -2.52E-08,    -2.26E-08,    -2.81E-08,    -2.21E-08,    -2.54E-08,
     348             :         -2.32E-08,    -2.49E-08,    -2.49E-08,    -2.24E-08,    -2.62E-08,    -0.000000021, -2.65E-08,    -2.08E-08,    -2.62E-08,    -2.13E-08,
     349             :         -2.45E-08,    -2.33E-08,    -2.25E-08,    -2.25E-08,    -2.37E-08,    -2.27E-08,    -2.32E-08,    -2.26E-08,    -2.25E-08,    -0.000000022,
     350             :         -2.19E-08,    -2.28E-08,    -2.34E-08,    -0.000000021, -0.000000022, -2.18E-08,    -2.19E-08,    -2.27E-08,    -2.01E-08,    -2.22E-08,
     351             :         -2.28E-08,    -1.89E-08,    -2.43E-08,    -1.82E-08,    -0.000000024, -1.98E-08,    -1.95E-08,    -2.35E-08,    -2.02E-08,    -1.88E-08,
     352             :         -2.34E-08,    -1.78E-08,    -2.33E-08,    -1.87E-08,    -2.14E-08,    -1.95E-08,    -1.94E-08,    -0.000000022, -1.95E-08,    -0.000000019,
     353             :         -1.98E-08,    -2.25E-08,    -1.57E-08,    -2.38E-08,    -1.66E-08,    -2.08E-08,    -1.88E-08,    -2.02E-08,    -1.83E-08,    -2.01E-08,
     354             :         -1.85E-08,    -1.86E-08,    -2.14E-08,    -1.64E-08,    -2.04E-08,    -1.69E-08,    -2.19E-08,    -1.54E-08,    -2.06E-08,    -1.88E-08,
     355             :         -1.66E-08,    -1.93E-08,    -1.84E-08,    -1.95E-08,    -1.54E-08,    -2.01E-08,    -1.83E-08,    -1.64E-08,    -1.85E-08,    -1.89E-08,
     356             :         -1.69E-08,    -0.000000017, -0.00000002,  -1.52E-08,    -1.84E-08,    -1.77E-08,    -0.000000018, -1.67E-08,    -1.72E-08,    -1.78E-08,
     357             :         -1.62E-08,    -1.79E-08,    -1.68E-08,    -1.78E-08,    -1.68E-08,    -1.49E-08,    -1.99E-08,    -1.48E-08,    -1.66E-08,    -1.69E-08,
     358             :         -1.74E-08,    -1.71E-08,    -1.39E-08,    -1.92E-08,    -1.44E-08,    -1.83E-08,    -1.47E-08,    -1.73E-08,    -1.41E-08,    -1.86E-08,
     359             :         -1.42E-08,    -1.76E-08,    -1.48E-08,    -1.67E-08,    -1.54E-08,    -1.52E-08,    -1.62E-08,    -1.62E-08,    -1.43E-08,    -1.77E-08,
     360             :         -0.000000013, -1.85E-08,    -0.000000012, -0.000000017, -1.59E-08,    -1.37E-08,    -1.72E-08,    -0.000000013, -1.61E-08,    -0.000000016,
     361             :         -1.44E-08,    -1.37E-08,    -1.71E-08,    -1.26E-08,    -1.65E-08,    -1.37E-08,    -1.63E-08,    -1.33E-08,    -1.48E-08,    -1.49E-08,
     362             :         -1.42E-08,    -1.53E-08,    -1.41E-08,    -1.35E-08,    -1.61E-08,    -1.28E-08,    -0.000000015, -0.000000013, -1.58E-08,    -1.29E-08,
     363             :         -1.58E-08,    -1.13E-08,    -1.73E-08,    -1.05E-08,    -0.000000017, -1.27E-08,    -1.19E-08,    -1.75E-08,    -9.6E-09,     -1.71E-08,
     364             :         -1.13E-08,    -1.44E-08,    -1.55E-08,    -9.7E-09,     -0.000000017, -0.000000012, -1.23E-08,    -1.48E-08,    -1.25E-08,    -1.47E-08,
     365             :         -0.000000011, -1.62E-08,    -9.8E-09,     -0.000000015, -1.36E-08,    -1.08E-08,    -1.55E-08,    -1.09E-08,    -1.46E-08,    -1.18E-08,
     366             :         -1.31E-08,    -1.29E-08,    -1.31E-08,    -1.25E-08,    -1.14E-08,    -1.43E-08,    -1.22E-08,    -1.32E-08,    -1.13E-08,    -1.31E-08,
     367             :         -1.27E-08,    -1.18E-08,    -1.23E-08,    -1.29E-08,    -1.17E-08,    -1.33E-08,    -1.12E-08,    -1.25E-08,    -1.37E-08,    -0.00000001,
     368             :         -1.37E-08,    -1.05E-08,    -1.28E-08,    -0.000000012, -0.000000012, -1.11E-08,    -1.43E-08,    -9.3E-09,     -1.33E-08,    -1.05E-08,
     369             :         -1.26E-08,    -1.14E-08,    -1.25E-08,    -9.8E-09,     -1.47E-08,    -8.9E-09,     -1.24E-08,    -1.12E-08,    -1.19E-08,    -1.23E-08,
     370             :         -9.4E-09,     -1.42E-08,    -8.4E-09,     -1.39E-08,    -9.4E-09,     -1.18E-08,    -1.19E-08,    -1.09E-08,    -1.13E-08,    -9.9E-09,
     371             :         -1.39E-08,    -7.3E-09,     -1.41E-08,    -9.2E-09,     -1.31E-08,    -8.5E-09,     -1.32E-08,    -9.6E-09,     -1.05E-08,    -0.000000012,
     372             :         -9.8E-09,     -1.09E-08,    -1.12E-08,    -1.05E-08,    -1.15E-08,    -9.8E-09,     -1.08E-08,    -1.03E-08,    -0.000000011, -1.04E-08,
     373             :         -0.000000011, -9.1E-09,     -1.23E-08,    -0.000000009, -1.03E-08,    -1.28E-08,    -6.5E-09,     -1.38E-08,    -8.3E-09,     -1.11E-08,
     374             :         -9.9E-09,     -1.08E-08,    -8.4E-09,     -0.000000013, -7.5E-09,     -1.12E-08,    -1.09E-08,    -9.1E-09,     -1.04E-08,    -9.1E-09,
     375             :         -1.08E-08,    -1.09E-08,    -8.1E-09,     -1.07E-08,    -0.00000001,  -1.03E-08,    -8.3E-09,     -1.06E-08,    -1.13E-08,    -7.6E-09,
     376             :         -1.02E-08,    -1.06E-08,    -9.8E-09,     -8.4E-09,     -1.06E-08,    -8.9E-09,     -9.2E-09,     -1.09E-08,    -9.2E-09,     -8.1E-09,
     377             :         -1.17E-08,    -7.7E-09,     -9.7E-09,     -1.06E-08,    -7.8E-09,     -1.01E-08,    -1.01E-08,    -0.000000007, -1.15E-08,    -9.3E-09,
     378             :         -7.3E-09,     -1.15E-08,    -7.9E-09,     -9.5E-09,     -8.4E-09,     -1.03E-08,    -8.2E-09,     -9.2E-09,     -9.8E-09,     -7.1E-09,
     379             :         -1.09E-08,    -8.3E-09,     -0.00000001,  -7.5E-09,     -9.7E-09,     -8.7E-09,     -7.9E-09,     -1.04E-08,    -7.5E-09,     -9.7E-09,
     380             :         -0.00000001,  -6.3E-09,     -1.12E-08,    -5.6E-09,     -1.21E-08,    -5.8E-09,     -1.15E-08,    -6.8E-09,     -8.9E-09,     -8.5E-09,
     381             :         -0.000000009, -7.8E-09,     -0.000000009, -8.9E-09,     -0.000000008, -8.9E-09,     -8.3E-09,     -8.8E-09,     -7.3E-09,     -1.04E-08,
     382             :         -6.8E-09,     -8.6E-09,     -0.000000009, -6.2E-09,     -0.000000011, -6.4E-09,     -9.2E-09,     -7.3E-09,     -1.07E-08,    -5.8E-09,
     383             :         -8.4E-09,     -1.01E-08,    -5.3E-09,     -9.9E-09,     -8.8E-09,     -6.7E-09,     -7.6E-09,     -9.9E-09,     -6.9E-09,     -8.3E-09,
     384             :         -7.9E-09,     -7.3E-09,     -9.7E-09,     -6.2E-09,     -9.6E-09,     -0.000000007, -7.4E-09,     -8.1E-09,     -8.7E-09,     -6.5E-09,
     385             :         -9.1E-09,     -6.5E-09,     -8.1E-09,     -9.6E-09,     -4.9E-09,     -9.6E-09,     -7.5E-09,     -7.1E-09,     -8.6E-09,     -6.9E-09,
     386             :         -7.4E-09,     -7.5E-09,     -9.5E-09,     -4.6E-09,     -0.000000011, -4.4E-09,     -9.6E-09,     -6.1E-09,     -9.1E-09,     -5.6E-09,
     387             :         -9.1E-09,     -7.5E-09,     -0.000000006, -0.000000008, -8.2E-09,     -7.2E-09,     -6.9E-09,     -7.3E-09,     -6.7E-09,     -8.3E-09,
     388             :         -6.8E-09,     -8.7E-09,     -5.6E-09,     -7.1E-09,     -0.000000009, -5.4E-09,     -8.2E-09,     -7.5E-09,     -6.9E-09,     -6.4E-09,
     389             :         -8.4E-09,     -6.6E-09,     -5.3E-09,     -1.04E-08,    -4.1E-09,     -0.000000009, -6.2E-09,     -0.000000007, -7.8E-09,     -5.5E-09,
     390             :         -0.000000008, -7.7E-09,     -5.9E-09,     -7.5E-09,     -6.1E-09,     -7.9E-09,     -5.7E-09,     -8.7E-09,     -6.2E-09,     -5.2E-09,
     391             :         -9.3E-09,     -5.2E-09,     -7.9E-09,     -6.2E-09,     -6.3E-09,     -7.3E-09,     -6.4E-09,     -7.2E-09,     -6.2E-09,     -0.000000007,
     392             :         -6.9E-09,     -5.8E-09,     -8.6E-09,     -5.4E-09,     -5.7E-09,     -7.3E-09,     -8.3E-09,     -4.1E-09,     -7.9E-09,     -6.6E-09,
     393             :         -5.5E-09,     -8.8E-09,     -4.4E-09,     -6.8E-09,     -7.1E-09,     -6.7E-09,     -5.7E-09,     -6.4E-09,     -6.5E-09,     -6.6E-09,
     394             :         -7.7E-09,     -0.000000005, -6.9E-09,     -5.5E-09,     -6.9E-09,     -6.6E-09,     -7.5E-09,     -4.2E-09,     -8.6E-09,     -3.8E-09,
     395             :         -8.1E-09,     -5.6E-09,     -6.9E-09,     -5.6E-09,     -5.8E-09,     -7.8E-09,     -0.000000005, -6.3E-09,     -7.3E-09,     -5.7E-09,
     396             :         -4.7E-09,     -8.5E-09,     -3.4E-09,     -8.3E-09,     -5.1E-09,     -0.000000007, -0.000000006, -4.2E-09,     -8.6E-09,     -5.1E-09,
     397             :         -5.6E-09,     -6.7E-09,     -4.9E-09,     -7.2E-09,     -5.3E-09,     -6.6E-09,     -4.8E-09,     -6.8E-09,     -5.9E-09,     -0.000000007,
     398             :         -3.8E-09,     -7.4E-09,     -5.2E-09,     -6.5E-09,     -5.1E-09,     -7.2E-09,     -3.7E-09,     -8.1E-09,     -5.1E-09,     -4.8E-09,
     399             :         -6.8E-09,     -0.000000006, -5.2E-09,     -5.8E-09,     -5.2E-09,     -7.3E-09,     -4.6E-09,     -5.4E-09,     -6.8E-09,     -5.8E-09,
     400             :         -4.3E-09,     -7.2E-09,     -4.4E-09,     -6.9E-09,     -0.000000005, -4.5E-09,     -7.7E-09,     -5.2E-09,     -0.000000004, -7.5E-09,
     401             :         -4.9E-09,     -4.9E-09,     -6.9E-09,     -4.4E-09,     -6.1E-09,     -5.8E-09,     -4.8E-09,     -0.000000007, -2.9E-09,     -7.7E-09,
     402             :         -5.2E-09,     -4.5E-09,     -5.4E-09,     -6.5E-09,     -0.000000005, -5.7E-09,     -4.2E-09,     -7.5E-09,     -4.1E-09,     -5.6E-09,
     403             :         -4.6E-09,     -6.8E-09,     -4.7E-09,     -4.9E-09,     -5.8E-09,     -5.2E-09,     -5.6E-09,     -5.6E-09,     -3.2E-09,     -8.7E-09,
     404             :         -2.1E-09,     -7.9E-09,     -0.000000004, -4.1E-09,     -7.7E-09,     -3.9E-09,     -4.4E-09,     -7.4E-09,     -2.9E-09,     -6.2E-09,
     405             :         -6.4E-09,     -3.9E-09,     -4.3E-09,     -6.6E-09,     -4.7E-09,     -5.5E-09,     -4.3E-09,     -6.4E-09,     -2.7E-09,     -7.6E-09,
     406             :         -4.2E-09,     -4.2E-09,     -7.2E-09,     -3.7E-09,     -5.6E-09,     -2.9E-09,     -7.8E-09,     -4.1E-09,     -4.5E-09,     -6.3E-09,
     407             :         -2.5E-09,     -7.5E-09,     -3.9E-09,     -4.9E-09,     -5.4E-09,     -4.4E-09,     -5.6E-09,     -3.7E-09,     -6.2E-09,     -5.1E-09,
     408             :         -3.7E-09,     -6.2E-09,     -2.8E-09,     -0.000000008, -1.5E-09,     -0.000000007, -0.000000005, -3.1E-09,     -5.6E-09,     -6.1E-09,
     409             :         -3.7E-09,     -4.9E-09,     -4.8E-09,     -5.4E-09,     -4.2E-09,     -5.1E-09,     -3.9E-09,     -0.000000005, -6.8E-09,     -1.5E-09,
     410             :         -7.9E-09,     -1.8E-09,     -6.9E-09,     -3.5E-09,     -4.9E-09,     -5.3E-09,     -0.000000005, -3.2E-09,     -0.000000007, -2.5E-09,
     411             :         -5.1E-09,     -5.7E-09,     -3.5E-09,     -0.000000006, -3.3E-09,     -0.000000006, -3.2E-09,     -0.000000006, -3.1E-09,     -5.9E-09,
     412             :         -3.1E-09,     -5.8E-09,     -4.8E-09,     -2.8E-09,     -5.8E-09,     -4.7E-09,     -4.3E-09,     -5.1E-09,     -3.7E-09,     -4.4E-09,
     413             :         -5.3E-09,     -0.000000004, -0.000000005, -3.6E-09,     -5.4E-09,     -4.8E-09,     -2.4E-09,     -0.000000007, -1.8E-09,     -6.6E-09,
     414             :         -3.7E-09,     -4.6E-09,     -4.3E-09,     -0.000000004, -5.7E-09,     -2.5E-09,     -5.4E-09,     -4.2E-09,     -4.1E-09,     -5.8E-09,
     415             :         -3.2E-09,     -4.3E-09,     -5.5E-09,     -1.8E-09,     -7.5E-09,     -1.8E-09,     -5.1E-09,     -5.3E-09,     -2.7E-09,     -5.9E-09,
     416             :         -3.4E-09,     -3.4E-09,     -5.5E-09,     -4.4E-09,     -3.2E-09,     -4.9E-09,     -0.000000005, -2.6E-09,     -6.2E-09,     -1.6E-09,
     417             :         -7.4E-09,     -1.3E-09,     -5.9E-09,     -4.4E-09,     -0.000000003, -4.4E-09,     -5.7E-09,     -2.8E-09,     -5.2E-09,     -2.1E-09,
     418             :         -6.2E-09,     -0.000000004, -2.7E-09,     -4.6E-09,     -0.000000005, -4.4E-09,     -2.1E-09,     -6.2E-09,     -2.9E-09,     -4.7E-09,
     419             :         -3.9E-09,     -3.7E-09,     -4.8E-09,     -4.7E-09,     -1.2E-09,     -7.8E-09,     -3E-10,       -7.1E-09,     -2.4E-09,     -4.7E-09,
     420             :         -2.7E-09,     -6.8E-09,     -1.7E-09,     -4.1E-09,     -0.000000004, -5.3E-09,     -3.3E-09,     -3.1E-09,     -4.1E-09,     -5.7E-09,
     421             :         -2.5E-09,     -3.9E-09,     -3.9E-09,     -5.2E-09,     -2.6E-09,     -4.6E-09,     -3.2E-09,     -4.1E-09,     -4.3E-09,     -4.5E-09,
     422             :         -3.5E-09,     -2.8E-09,     -4.8E-09,     -3.3E-09,     -5.5E-09,     -2.3E-09,     -4.3E-09,     -3.9E-09,     -3.4E-09,     -4.4E-09,
     423             :         -3.7E-09,     -3.7E-09,     -4.4E-09,     -1.6E-09,     -7.4E-09,     -1.2E-09,     -4.4E-09,     -3.3E-09,     -4.7E-09,     -4.3E-09,
     424             :         -1.6E-09,     -5.6E-09,     -3.2E-09,     -3.2E-09,     -5.5E-09,     -1.8E-09,     -5.5E-09,     -6E-10,       -7.8E-09,     -4E-10,
     425             :         -5.8E-09,     -2.8E-09,     -3.6E-09,     -3.5E-09,     -4.5E-09,     -3.3E-09,     -2.9E-09,     -5.3E-09,     -1.9E-09,     -5.7E-09,
     426             :         -2.6E-09,     -4.1E-09,     -2.3E-09,     -0.000000005, -2.9E-09,     -4.5E-09,     -2.8E-09,     -0.000000005, -6E-10,       -7.2E-09,
     427             :         -8E-10,       -4.1E-09,     -5.9E-09,     -8E-10,       -5.3E-09,     -2.1E-09,     -4.9E-09,     -2.4E-09,     -3.8E-09,     -4.8E-09,
     428             :         -0.000000002, -0.000000005, -1.8E-09,     -5.6E-09,     -1.7E-09,     -4.1E-09,     -3.7E-09,     -4.2E-09,     -2.6E-09,     -4.2E-09,
     429             :         -0.000000002, -4.8E-09,     -2.9E-09,     -4.9E-09,     -1.2E-09,     -5.6E-09,     -2.6E-09,     -2.3E-09,     -5.9E-09,     -1.7E-09,
     430             :         -3.6E-09,     -4.4E-09,     -0.000000002, -3.5E-09,     -5.4E-09,     -0.000000002, -2.4E-09,     -5.3E-09,     -1.9E-09,     -5.3E-09,
     431             :         -9E-10,       -6.6E-09,     -6E-10,       -4.7E-09,     -2.7E-09,     -3.9E-09,     -3.4E-09,     -0.000000003, -3.8E-09,     -3.5E-09,
     432             :         -2.2E-09,     -4.5E-09,     -0.000000003, -3.4E-09,     -3.3E-09,     -3.2E-09,     -3.7E-09,     -2.8E-09,     -3.3E-09,     -3.2E-09,
     433             :         -4.6E-09,     -1.7E-09,     -3.5E-09,     -4.2E-09,     -2.9E-09,     -3.1E-09,     -3.3E-09,     -2.5E-09,     -5.3E-09,     -5E-10,
     434             :         -5.4E-09,     -1.9E-09,     -5.3E-09,     -9E-10,       -5.1E-09,     -1.3E-09,     -5.9E-09,     -6E-10,       -0.000000005, -2.6E-09,
     435             :         -0.000000002, -5.5E-09,     -3E-10,       -5.1E-09,     -3.4E-09,     -2.8E-09,     -2.6E-09,     -3.9E-09,     -2.4E-09,     -5.4E-09,
     436             :         1E-10,        -0.000000005, -3.7E-09,     -2.6E-09,     -2.3E-09,     -4.4E-09,     -1.9E-09,     -4.3E-09,     -2.9E-09,     -1.5E-09,
     437             :         -5.8E-09,     -4E-10,       -4.8E-09,     -3.1E-09,     -2.9E-09,     -2.2E-09,     -3.8E-09,     -3.7E-09,     -2.2E-09,     -3.9E-09,
     438             :         -1.7E-09,     -4.6E-09,     -0.000000002, -3.5E-09,     -3.4E-09,     -2.1E-09,     -4.1E-09,     -1.7E-09,     -3.7E-09,     -3.6E-09,
     439             :         -2.2E-09,     -3.2E-09,     -3.7E-09,     -3.1E-09,     -2.6E-09,     -1.8E-09,     -5.3E-09,     -1.2E-09,     -3.7E-09,     -3.4E-09,
     440             :         -2.1E-09,     -3.1E-09,     -3.5E-09,     -3.2E-09,     -1.4E-09,     -5.7E-09,     -2E-10,       -5.6E-09,     3E-10,        -6.3E-09,
     441             :         -4E-10,       -3.7E-09,     -3.3E-09,     -2.6E-09,     -3.3E-09,     -3.5E-09,     -9E-10,       -5.5E-09,     -6E-10,       -4.2E-09,
     442             :         -2.5E-09,     -2.7E-09,     -3.5E-09,     -2.4E-09,     -3.2E-09,     -3.3E-09,     -9E-10,       -4.9E-09,     -2.6E-09,     -3.2E-09,
     443             :         -7E-10,       -5.6E-09,     -9E-10,       -4.4E-09,     -1.9E-09,     -3.7E-09,     -2.3E-09,     -2.8E-09,     -3.2E-09,     -2.2E-09,
     444             :         -3.3E-09,     -0.000000002, -4.8E-09,     -5E-10,       -3.6E-09,     -3.4E-09,     -2.4E-09,     -3.2E-09,     -2.1E-09,     -4.4E-09,
     445             :         -4E-10,       -5.1E-09,     -4E-10,       -4.6E-09,     -1.4E-09,     -5.2E-09,     1E-10,        -5.1E-09,     -1.6E-09,     -2.8E-09,
     446             :         -2.4E-09,     -3.7E-09,     -2.2E-09,     -2.5E-09,     -0.000000004, -0.000000002, -2.7E-09,     -0.000000002, -3.9E-09,     -2.6E-09,
     447             :         -2.3E-09,     -1.6E-09,     -5.5E-09,     -5E-10,       -2.3E-09,     -5.6E-09,     5E-10,        -0.000000005, -1.3E-09,     -2.6E-09,
     448             :         -3.2E-09,     -3.8E-09,     -7E-10,       -3.6E-09,     -0.000000003, -2.4E-09,     -1.9E-09,     -3.2E-09,     -0.000000004, 5E-10,
     449             :         -5.8E-09,     -1.6E-09,     -2.1E-09,     -3.1E-09,     -3.2E-09,     -3E-10,       -6.6E-09,     1.8E-09,      -6.5E-09,     -7E-10,
     450             :         -2.3E-09,     -3.7E-09,     -0.000000001, -5.7E-09,     1.4E-09,      -6.7E-09,     8E-10,        -5.2E-09,     -1.4E-09,     -1.4E-09,
     451             :         -5.1E-09,     -1.5E-09,     -1.8E-09,     -3.2E-09,     -2.6E-09,     -3.4E-09,     -0.000000001, -4.1E-09,     -0.000000001, -3.6E-09,
     452             :         -2.8E-09,     -1.2E-09,     -4.7E-09,     -1.3E-09,     -1.4E-09,     -5.1E-09,     -5E-10,       -3.8E-09,     -8E-10,       -4.9E-09,
     453             :         -7E-10,       -4.2E-09,     1E-10,        -5.7E-09,     0.000000,     -3.8E-09,     -1.9E-09,     -3.7E-09,     -4E-10,       -5.1E-09,
     454             :         -8E-10,       -2.7E-09,     -3.3E-09,     -9E-10,       -3.2E-09,     -3.8E-09,     -7E-10,       -3.4E-09,     -2.2E-09,     -0.000000003,
     455             :         -1.7E-09,     -3.5E-09,     -1.4E-09,     -3.3E-09,     -1.4E-09,     -3.5E-09,     -1.7E-09,     -2.8E-09,     -2.9E-09,     -1.4E-09,
     456             :         -3.6E-09,     -0.000000001, -3.6E-09,     -1.3E-09,     -3.3E-09,     -2.1E-09,     -0.000000004, 7E-10,        -5.1E-09,     -1.5E-09,
     457             :         -2.6E-09,     -1.6E-09,     -2.8E-09,     -3.5E-09,     -6E-10,       -3.9E-09,     -9E-10,       -3.2E-09,     -2.4E-09,     -3.3E-09,
     458             :         -1.5E-09,     -1.3E-09,     -4.6E-09,     -9E-10,       -3.2E-09,     -1.3E-09,     -2.8E-09,     -3.1E-09,     -3E-10,       -5.6E-09,
     459             :         1.5E-09,      -5.7E-09,     0.00000,      -4.4E-09,     0.00000,      -4.7E-09,     -1.3E-09,     -9E-10,       -4.9E-09,     -6E-10,
     460             :         -3.3E-09,     -6E-10,       -4.9E-09,     -6E-10,       -3.2E-09,     -9E-10,       -3.6E-09,     -1.6E-09,     -3.2E-09,     -8E-10,
     461             :         -3.2E-09,     -2.4E-09,     -2.3E-09,     -3.2E-09,     -5E-10,       -3.1E-09,     -2.9E-09,     -2E-10,       -5.5E-09,     3E-10,
     462             :         -3.7E-09,     -1E-10,       -0.000000005, -2E-10,       -3.2E-09,     -2.2E-09,     -2.4E-09,     -2.7E-09,     -1.1E-09,     -2.6E-09,
     463             :         -2.7E-09,     -9E-10,       -4.3E-09,     -1E-10,       -4.9E-09,     -2E-10,       -2.7E-09,     -3.1E-09,     2E-10,        -5.2E-09,
     464             :         0.0000,       -3.2E-09,     -0.000000002, -2.6E-09,     -2.5E-09,     -6E-10,       -4.4E-09,     -5E-10,       -2.8E-09,     -2.1E-09,
     465             :         -2.6E-09,     -1.9E-09,     -2.5E-09,     -2.5E-09,     -0.000000001, -2.3E-09,     -2.5E-09,     -3.6E-09,     -3E-10,       -0.000000003,
     466             :         -1.9E-09,     -2.8E-09,     -2E-10,       -0.000000004, -2.5E-09,     -1E-10,       -4.6E-09,     -3E-10,       -2.5E-09,     -3.8E-09,
     467             :         -3E-10,       -2.6E-09,     -2.3E-09,     -2.1E-09,     -2.2E-09,     -2.1E-09,     -2.4E-09,     -2.1E-09,     -2.2E-09,     -0.000000002,
     468             :         -2.4E-09,     -9E-10,       -3.3E-09,     -2.2E-09,     -4E-10,       -4.1E-09,     -1.4E-09,     -2.9E-09,     4E-10,        -5.5E-09,
     469             :         2.7E-09}; // namespace Psychrometrics
     470             : #ifdef EP_psych_stats
     471             :     static constexpr std::array<bool, static_cast<int>(PsychrometricFunction::Num)> PsyReportIt = {
     472             :         true,
     473             :         true,
     474             :         true,
     475             :         true,
     476             :         true,
     477             :         true,
     478             :         true,
     479             :         true,
     480             :         true,
     481             :         true,
     482             :         true,
     483             :         true,
     484             :         true,
     485             :         false,
     486             :         false,
     487             :         false,
     488             :         false,
     489             :         true,
     490             :         true}; // PsyTdpFnTdbTwbPb     1 | PsyRhFnTdbWPb        2 | PsyTwbFnTdbWPb       3 | PsyVFnTdbWPb         4 |
     491             :                // PsyWFnTdpPb          5 | PsyWFnTdbH           6 | PsyWFnTdbTwbPb       7 | PsyWFnTdbRhPb        8 |
     492             :                // PsyPsatFnTemp        9 | PsyTsatFnHPb         10 | PsyTsatFnPb          11 | PsyRhFnTdbRhov       12 |
     493             :                // PsyRhFnTdbRhovLBnd0C 13 | PsyTwbFnTdbWPb       14 - HR | PsyTwbFnTdbWPb       15 - max iter |
     494             :                // PsyWFnTdbTwbPb       16 - HR | PsyTsatFnPb          17 - max iter | PsyTwbFnTdbWPb_cache 18 -
     495             :                // PsyTwbFnTdbWPb_raw (raw calc) | PsyPsatFnTemp_cache  19 - PsyPsatFnTemp_raw (raw calc)
     496             : #endif
     497             : 
     498             :     void InitializePsychRoutines(EnergyPlusData &state);
     499             : 
     500             :     void ShowPsychrometricSummary(EnergyPlusData &state, InputOutputFile &auditFile);
     501             : 
     502             : #ifdef EP_psych_errors
     503             :     void PsyRhoAirFnPbTdbW_error(EnergyPlusData &state,
     504             :                                  Real64 const pb,                       // barometric pressure (Pascals)
     505             :                                  Real64 const tdb,                      // dry bulb temperature (Celsius)
     506             :                                  Real64 const dw,                       // humidity ratio (kgWater/kgDryAir)
     507             :                                  Real64 const rhoair,                   // density of air
     508             :                                  std::string_view const CalledFrom = "" // routine this function was called from (error messages) !unused1208
     509             :     );
     510             : #endif
     511             : 
     512             :     inline Real64
     513   731760026 :     PsyRhoAirFnPbTdbW([[maybe_unused]] EnergyPlusData &state,
     514             :                       Real64 const pb,                                        // pressure (Pascals)
     515             :                       Real64 const tdb,                                       // dry bulb temperature (Celsius)
     516             :                       Real64 const dw,                                        // humidity ratio (kgWater/kgDryAir)
     517             :                       [[maybe_unused]] std::string_view const CalledFrom = "" // routine this function was called from (error messages) !unused1208
     518             :     )
     519             : 
     520             :     {
     521             :         // FUNCTION INFORMATION:
     522             :         //       AUTHOR         G. S. Wright
     523             :         //       DATE WRITTEN   June 2, 1994
     524             :         //       MODIFIED       na
     525             :         //       RE-ENGINEERED  na
     526             : 
     527             :         // PURPOSE OF THIS FUNCTION:
     528             :         // This function provides density of air as a function of barometric
     529             :         // pressure, dry bulb temperature, and humidity ratio.
     530             : 
     531             :         // METHODOLOGY EMPLOYED:
     532             :         // ideal gas law
     533             :         //    universal gas const for air 287 J/(kg K)
     534             :         //    air/water molecular mass ratio 28.9645/18.01534
     535             : 
     536             :         // REFERENCES:
     537             :         // Wylan & Sontag, Fundamentals of Classical Thermodynamics.
     538             :         // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26)
     539             : 
     540   731760026 :         Real64 const rhoair(pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv) * (1.0 + 1.6077687 * max(dw, 1.0e-5))));
     541             : #ifdef EP_psych_errors
     542   731760026 :         if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(state, pb, tdb, dw, rhoair, CalledFrom);
     543             : #endif
     544   731760026 :         return rhoair;
     545             :     }
     546             : 
     547          32 :     constexpr Real64 PsyRhoAirFnPbTdbW(Real64 const pb,  // barometric pressure (Pascals)
     548             :                                        Real64 const tdb, // dry bulb temperature (Celsius)
     549             :                                        Real64 const dw   // humidity ratio (kgWater/kgDryAir)
     550             :     )
     551             :     {
     552             :         // FUNCTION INFORMATION:
     553             :         //       AUTHOR         G. S. Wright
     554             :         //       DATE WRITTEN   June 2, 1994
     555             :         //       MODIFIED       na
     556             :         //       RE-ENGINEERED  na
     557             : 
     558             :         // PURPOSE OF THIS FUNCTION:
     559             :         // This function provides density of air as a function of barometric
     560             :         // pressure, dry bulb temperature, and humidity ratio.
     561             : 
     562             :         // METHODOLOGY EMPLOYED:
     563             :         // ideal gas law
     564             :         //    universal gas const for air 287 J/(kg K)
     565             :         //    air/water molecular mass ratio 28.9645/18.01534
     566             : 
     567             :         // REFERENCES:
     568             :         // Wylan & Sontag, Fundamentals of Classical Thermodynamics.
     569             :         // ASHRAE handbook 1985 Fundamentals, Ch. 6, eqn. (6),(26)
     570             : 
     571          32 :         return (pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv) * (1.0 + 1.6077687 * std::max(dw, 1.0e-5))));
     572             :     }
     573             : 
     574     1054511 :     inline Real64 PsyRhoAirFnPbTdbW_fast([[maybe_unused]] EnergyPlusData &state,
     575             :                                          Real64 const pb,  // barometric pressure (Pascals)
     576             :                                          Real64 const tdb, // dry bulb temperature (Celsius)
     577             :                                          Real64 const dw   // humidity ratio (kgWater/kgDryAir)
     578             :     )
     579             :     {
     580             :         // Faster version with humidity ratio already adjusted
     581     1054511 :         assert(dw >= 1.0e-5);
     582     1054511 :         Real64 const rhoair(pb / (287.0 * (tdb + DataGlobalConstants::KelvinConv) * (1.0 + 1.6077687 * dw)));
     583             : #ifdef EP_psych_errors
     584     1054511 :         if (rhoair < 0.0) PsyRhoAirFnPbTdbW_error(state, pb, tdb, dw, rhoair);
     585             : #endif
     586     1054511 :         return rhoair;
     587             :     }
     588             : 
     589    28610689 :     inline Real64 PsyHfgAirFnWTdb([[maybe_unused]] Real64 const w, // humidity ratio {kgWater/kgDryAir} !unused1208
     590             :                                   Real64 const T                   // input temperature {Celsius}
     591             :     )
     592             :     {
     593             :         // FUNCTION INFORMATION:
     594             :         //       AUTHOR         Richard Liesen
     595             :         //       DATE WRITTEN   May, 2001
     596             :         //       MODIFIED       June, 2002
     597             :         //       RE-ENGINEERED  na
     598             : 
     599             :         // PURPOSE OF THIS FUNCTION:
     600             :         // This function provides latent energy of air as function of humidity ratio and temperature.
     601             : 
     602             :         // METHODOLOGY EMPLOYED:
     603             :         // calculates hg and then hf and the difference is Hfg.
     604             : 
     605             :         // REFERENCES:
     606             :         // see ASHRAE Fundamentals Psychrometric Chapter
     607             :         // USAGE:  hfg = PsyHfgAirFnWTdb(w,T)
     608             : 
     609             :         // Return value
     610             :         // result => heat of vaporization for moist air {J/kg}
     611             : 
     612             :         // This formulation currently does not use W since it returns results that are in J/kg and the
     613             :         //  amount of energy is on a per unit of moisture basis.
     614             : 
     615    28610689 :         Real64 const Temperature(max(T, 0.0));                               // input temperature {Celsius} - corrected for >= 0C
     616    28610689 :         return (2500940.0 + 1858.95 * Temperature) - (4180.0 * Temperature); // enthalpy of the gas - enthalpy of the fluid
     617             :     }
     618             : 
     619    82289797 :     inline Real64 PsyHgAirFnWTdb([[maybe_unused]] Real64 const w, // humidity ratio {kgWater/kgDryAir} !unused1208
     620             :                                  Real64 const T                   // input temperature {Celsius}
     621             :     )
     622             :     {
     623             : 
     624             :         // FUNCTION INFORMATION:
     625             :         //       AUTHOR         Richard Liesen
     626             :         //       DATE WRITTEN   May, 2001
     627             :         //       MODIFIED       June, 2002
     628             :         //       RE-ENGINEERED  na
     629             : 
     630             :         // PURPOSE OF THIS FUNCTION:
     631             :         // This function provides latent energy of the moisture as a gas in the air as
     632             :         // function of humidity ratio and temperature.
     633             : 
     634             :         // REFERENCES:
     635             :         // see ASHRAE Fundamentals Psychrometric Chapter
     636             :         // USAGE:  hg = PsyHgAirFnWTdb(w,T)
     637             : 
     638             :         // This formulation currently does not use W since it returns results that are in J/kg and the
     639             :         //  amount of energy is on a per unit of moisture basis.
     640             : 
     641    82289797 :         return 2500940.0 + 1858.95 * T; // enthalpy of the gas {units?}
     642             :     }
     643             : 
     644  1118794823 :     inline Real64 PsyHFnTdbW(Real64 const TDB, // dry-bulb temperature {C}
     645             :                              Real64 const dW   // humidity ratio
     646             :     )
     647             :     {
     648             :         // FUNCTION INFORMATION:
     649             :         //       AUTHOR         George Shih
     650             :         //       DATE WRITTEN   May 1976
     651             :         //       MODIFIED       na
     652             :         //       RE-ENGINEERED  na
     653             : 
     654             :         // PURPOSE OF THIS FUNCTION:
     655             :         // This function calculates the enthalpy {J/kg} from dry-bulb temperature and humidity ratio.
     656             : 
     657             :         // REFERENCES:
     658             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P100, EQN 32
     659             : 
     660             :         // calculate enthalpy
     661  1118794823 :         return 1.00484e3 * TDB + max(dW, 1.0e-5) * (2.50094e6 + 1.85895e3 * TDB); // enthalpy {J/kg}
     662             :     }
     663             : 
     664        8140 :     inline Real64 PsyHFnTdbW_fast(Real64 const TDB, // dry-bulb temperature {C}
     665             :                                   Real64 const dW   // humidity ratio
     666             :     )
     667             :     {
     668             :         // Faster version with humidity ratio already adjusted
     669        8140 :         assert(dW >= 1.0e-5);
     670             : 
     671             :         // calculate enthalpy
     672        8140 :         return 1.00484e3 * TDB + dW * (2.50094e6 + 1.85895e3 * TDB); // enthalpy {J/kg}
     673             :     }
     674             : 
     675   864151676 :     inline Real64 PsyCpAirFnW(Real64 const dw // humidity ratio {kgWater/kgDryAir}
     676             :     )
     677             :     {
     678             :         // FUNCTION INFORMATION:
     679             :         //       AUTHOR         J. C. VanderZee
     680             :         //       DATE WRITTEN   Feb. 1994
     681             :         //       MODIFIED       na
     682             :         //       RE-ENGINEERED  na
     683             : 
     684             :         // PURPOSE OF THIS FUNCTION:
     685             :         // This function provides the heat capacity of air {J/kg-C} as function of humidity ratio.
     686             : 
     687             :         // METHODOLOGY EMPLOYED:
     688             :         // take numerical derivative of PsyHFnTdbW function
     689             : 
     690             :         // REFERENCES:
     691             :         // see PsyHFnTdbW ref. to ASHRAE Fundamentals
     692             :         // USAGE:  cpa = PsyCpAirFnW(w)
     693             : 
     694             :         // Static locals
     695             :         static Real64 dwSave(-100.0);
     696             :         static Real64 cpaSave(-100.0);
     697             : 
     698             :         // check if last call had the same input and if it did just use the saved output
     699   864151676 :         if (dwSave == dw) return cpaSave;
     700             : 
     701             :         // compute heat capacity of air
     702   429177320 :         Real64 const w(max(dw, 1.0e-5));
     703   429177320 :         Real64 const cpa((1.00484e3 + w * 1.85895e3)); // result => heat capacity of moist air {J/kg-C}
     704             : 
     705             :         // save values for next call
     706   429177320 :         dwSave = dw;
     707   429177320 :         cpaSave = cpa;
     708             : 
     709   429177320 :         return cpa;
     710             :     }
     711             : 
     712     1052476 :     inline Real64 PsyCpAirFnW_fast(Real64 const dw // humidity ratio {kgWater/kgDryAir}
     713             :     )
     714             :     {
     715             :         // Faster version with humidity ratio already adjusted
     716     1052476 :         assert(dw >= 1.0e-5);
     717             : 
     718             :         // Static locals
     719             :         static Real64 dwSave(-100.0);
     720             :         static Real64 cpaSave(-100.0);
     721             : 
     722             :         // check if last call had the same input and if it did just use the saved output
     723     1052476 :         if (dwSave == dw) return cpaSave;
     724             : 
     725             :         // compute heat capacity of air
     726      123024 :         Real64 const cpa((1.00484e3 + dw * 1.85895e3)); // result => heat capacity of moist air {J/kg-C}
     727             : 
     728             :         // save values for next call
     729      123024 :         dwSave = dw;
     730      123024 :         cpaSave = cpa;
     731             : 
     732      123024 :         return cpa;
     733             :     }
     734             : 
     735   275696747 :     inline Real64 PsyTdbFnHW(Real64 const H, // enthalpy {J/kg}
     736             :                              Real64 const dW // humidity ratio
     737             :     )
     738             :     {
     739             :         // FUNCTION INFORMATION:
     740             :         //       AUTHOR         J. C. VanderZee
     741             :         //       DATE WRITTEN   Feb. 1994
     742             :         //       MODIFIED       na
     743             :         //       RE-ENGINEERED  na
     744             : 
     745             :         // PURPOSE OF THIS FUNCTION:
     746             :         // This function provides air temperature from enthalpy and humidity ratio.
     747             : 
     748             :         // REFERENCES:
     749             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P100, EQN 32
     750             :         //   by inverting function PsyHFnTdbW
     751             : 
     752   275696747 :         Real64 const W(max(dW, 1.0e-5));                          // humidity ratio
     753   275696747 :         return (H - 2.50094e6 * W) / (1.00484e3 + 1.85895e3 * W); // result=> dry-bulb temperature {C}
     754             :     }
     755             : 
     756      416483 :     inline Real64 PsyRhovFnTdbRhLBnd0C(Real64 const Tdb, // dry-bulb temperature {C}
     757             :                                        Real64 const RH   // relative humidity value (0.0-1.0)
     758             :     )
     759             :     {
     760             :         // FUNCTION INFORMATION:
     761             :         //       AUTHOR         R. J. Liesen
     762             :         //       DATE WRITTEN   July 2000
     763             :         //       MODIFIED       Name change to signify derivation and temperatures were used
     764             :         //                      with 0C as minimum; LKL January 2008
     765             :         //       RE-ENGINEERED  na
     766             : 
     767             :         // PURPOSE OF THIS FUNCTION:
     768             :         // This function provides the Vapor Density in air as a
     769             :         // function of dry bulb temperature, and Relative Humidity.
     770             : 
     771             :         // METHODOLOGY EMPLOYED:
     772             :         // ideal gas law
     773             :         // Universal gas const for water vapor 461.52 J/(kg K)
     774             : 
     775             :         // REFERENCES:
     776             :         // ASHRAE handbook 1993 Fundamentals,
     777             : 
     778      416483 :         return RH / (461.52 * (Tdb + DataGlobalConstants::KelvinConv)) *
     779      416483 :                std::exp(23.7093 - 4111.0 / ((Tdb + DataGlobalConstants::KelvinConv) - 35.45)); // Vapor density in air
     780             :     }
     781             : 
     782     1919467 :     inline Real64 PsyRhovFnTdbWPb(Real64 const Tdb, // dry-bulb temperature {C}
     783             :                                   Real64 const dW,  // humidity ratio
     784             :                                   Real64 const PB   // Barometric Pressure {Pascals}
     785             :     )
     786             :     {
     787             :         // FUNCTION INFORMATION:
     788             :         //       AUTHOR         R. J. Liesen
     789             :         //       DATE WRITTEN   July 2000
     790             :         //       MODIFIED       na
     791             :         //       RE-ENGINEERED  na
     792             : 
     793             :         // PURPOSE OF THIS FUNCTION:
     794             :         // This function provides the Vapor Density in air as a
     795             :         // function of dry bulb temperature, Humidity Ratio, and Barometric Pressure.
     796             : 
     797             :         // METHODOLOGY EMPLOYED:
     798             :         // ideal gas law
     799             :         // Universal gas const for water vapor 461.52 J/(kg K)
     800             : 
     801             :         // REFERENCES:
     802             :         // ASHRAE handbook 1993 Fundamentals,
     803             : 
     804     1919467 :         Real64 const W(max(dW, 1.0e-5)); // humidity ratio
     805     1919467 :         return W * PB / (461.52 * (Tdb + DataGlobalConstants::KelvinConv) * (W + 0.62198));
     806             :     }
     807             : 
     808     1052960 :     inline Real64 PsyRhovFnTdbWPb_fast(Real64 const Tdb, // dry-bulb temperature {C}
     809             :                                        Real64 const dW,  // humidity ratio
     810             :                                        Real64 const PB   // Barometric Pressure {Pascals}
     811             :     )
     812             :     {
     813             :         // Faster version with humidity ratio already adjusted
     814     1052960 :         assert(dW >= 1.0e-5);
     815     1052960 :         return dW * PB / (461.52 * (Tdb + DataGlobalConstants::KelvinConv) * (dW + 0.62198));
     816             :     }
     817             : 
     818             : #ifdef EP_psych_errors
     819             :     void PsyRhFnTdbRhovLBnd0C_error(EnergyPlusData &state,
     820             :                                     Real64 const Tdb,                 // dry-bulb temperature {C}
     821             :                                     Real64 const Rhovapor,            // vapor density in air {kg/m3}
     822             :                                     Real64 const RHValue,             // relative humidity value (0.0-1.0)
     823             :                                     std::string_view const CalledFrom // routine this function was called from (error messages)
     824             :     );
     825             : #endif
     826             : 
     827             :     inline Real64
     828      150018 :     PsyRhFnTdbRhovLBnd0C([[maybe_unused]] EnergyPlusData &state,
     829             :                          Real64 const Tdb,                                       // dry-bulb temperature {C}
     830             :                          Real64 const Rhovapor,                                  // vapor density in air {kg/m3}
     831             :                          [[maybe_unused]] std::string_view const CalledFrom = "" // routine this function was called from (error message)
     832             :     )
     833             :     {
     834             :         // FUNCTION INFORMATION:
     835             :         //       AUTHOR         R. J. Liesen
     836             :         //       DATE WRITTEN   July 2000
     837             :         //       MODIFIED       Name change to signify derivation and temperatures were used
     838             :         //                      with 0C as minimum; LKL January 2008
     839             :         //       RE-ENGINEERED  na
     840             : 
     841             :         // PURPOSE OF THIS FUNCTION:
     842             :         // This function provides the Relative Humidity in air as a
     843             :         // function of dry bulb temperature and Vapor Density.
     844             : 
     845             :         // METHODOLOGY EMPLOYED:
     846             :         // ideal gas law
     847             :         // Universal gas const for water vapor 461.52 J/(kg K)
     848             : 
     849             :         // REFERENCES:
     850             :         // ASHRAE handbook 1993 Fundamentals,
     851             : 
     852             : #ifdef EP_psych_stats
     853             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::RhFnTdbRhovLBnd0C)];
     854             : #endif
     855             : 
     856      300036 :         Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + DataGlobalConstants::KelvinConv) *
     857      150018 :                                                   std::exp(-23.7093 + 4111.0 / ((Tdb + DataGlobalConstants::KelvinConv) - 35.45))
     858      150018 :                                             : 0.0);
     859             : 
     860      150018 :         if ((RHValue < 0.0) || (RHValue > 1.0)) {
     861             : #ifdef EP_psych_errors
     862           0 :             if ((RHValue < -0.05) || (RHValue > 1.01)) {
     863           0 :                 PsyRhFnTdbRhovLBnd0C_error(state, Tdb, Rhovapor, RHValue, CalledFrom);
     864             :             }
     865             : #endif
     866           0 :             return min(max(RHValue, 0.01), 1.0);
     867             :         } else {
     868      150018 :             return RHValue;
     869             :         }
     870             :     }
     871             : 
     872             : #ifdef EP_cache_PsyTwbFnTdbWPb
     873             : 
     874             :     Real64 PsyTwbFnTdbWPb(EnergyPlusData &state,
     875             :                           Real64 const Tdb,                      // dry-bulb temperature {C}
     876             :                           Real64 const W,                        // humidity ratio
     877             :                           Real64 const Pb,                       // barometric pressure {Pascals}
     878             :                           std::string_view const CalledFrom = "" // routine this function was called from (error messages)
     879             :     );
     880             : 
     881             :     Real64 PsyTwbFnTdbWPb_raw(EnergyPlusData &state,
     882             :                               Real64 const TDB,                      // dry-bulb temperature {C}
     883             :                               Real64 const dW,                       // humidity ratio
     884             :                               Real64 const Patm,                     // barometric pressure {Pascals}
     885             :                               std::string_view const CalledFrom = "" // routine this function was called from (error messages)
     886             :     );
     887             : 
     888             : #else
     889             : 
     890             :     Real64 PsyTwbFnTdbWPb(EnergyPlusData &state,
     891             :                           Real64 const TDB,                      // dry-bulb temperature {C}
     892             :                           Real64 const dW,                       // humidity ratio
     893             :                           Real64 const Patm,                     // barometric pressure {Pascals}
     894             :                           std::string_view const CalledFrom = "" // routine this function was called from (error messages)
     895             :     );
     896             : 
     897             : #endif
     898             : 
     899             : #ifdef EP_psych_errors
     900             :     void PsyVFnTdbWPb_error(EnergyPlusData &state,
     901             :                             Real64 const TDB,                 // dry-bulb temperature {C}
     902             :                             Real64 const w,                   // humidity ratio
     903             :                             Real64 const PB,                  // barometric pressure {Pascals}
     904             :                             Real64 const V,                   // specific volume {m3/kg}
     905             :                             std::string_view const CalledFrom // routine this function was called from (error messages)
     906             :     );
     907             : #endif
     908             : 
     909           0 :     inline Real64 PsyVFnTdbWPb([[maybe_unused]] EnergyPlusData &state,
     910             :                                Real64 const TDB,                                       // dry-bulb temperature {C}
     911             :                                Real64 const dW,                                        // humidity ratio
     912             :                                Real64 const PB,                                        // barometric pressure {Pascals}
     913             :                                [[maybe_unused]] std::string_view const CalledFrom = "" // routine this function was called from (error messages)
     914             :     )
     915             :     {
     916             :         // FUNCTION INFORMATION:
     917             :         //       AUTHOR         George Shih
     918             :         //       DATE WRITTEN   May 1976
     919             :         //       MODIFIED       na
     920             :         //       RE-ENGINEERED  na
     921             : 
     922             :         // PURPOSE OF THIS FUNCTION:
     923             :         // This function provides the specific volume from dry-bulb temperature,
     924             :         // humidity ratio and barometric pressure.
     925             : 
     926             :         // REFERENCES:
     927             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQN 28
     928             : 
     929             : #ifdef EP_psych_stats
     930             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::VFnTdbWPb)];
     931             : #endif
     932             : 
     933           0 :         Real64 const w(max(dW, 1.0e-5));                                           // humidity ratio
     934           0 :         Real64 const V(1.59473e2 * (1.0 + 1.6078 * w) * (1.8 * TDB + 492.0) / PB); // specific volume {m3/kg}
     935             : 
     936             :         // Validity test
     937           0 :         if (V < 0.0) {
     938             : #ifdef EP_psych_errors
     939           0 :             if (V <= -0.01) PsyVFnTdbWPb_error(state, TDB, w, PB, V, CalledFrom);
     940             : #endif
     941           0 :             return 0.83; // Fix Was inside the ifdef
     942             :         } else {
     943           0 :             return V;
     944             :         }
     945             :     }
     946             : 
     947             : #ifdef EP_psych_errors
     948             :     void PsyWFnTdbH_error(EnergyPlusData &state,
     949             :                           Real64 const TDB,                 // dry-bulb temperature {C}
     950             :                           Real64 const H,                   // enthalpy {J/kg}
     951             :                           Real64 const W,                   // humidity ratio
     952             :                           std::string_view const CalledFrom // routine this function was called from (error messages)
     953             :     );
     954             : #endif
     955             : 
     956   219078876 :     inline Real64 PsyWFnTdbH([[maybe_unused]] EnergyPlusData &state,
     957             :                              Real64 const TDB,                                        // dry-bulb temperature {C}
     958             :                              Real64 const H,                                          // enthalpy {J/kg}
     959             :                              [[maybe_unused]] std::string_view const CalledFrom = "", // routine this function was called from (error messages)
     960             :                              [[maybe_unused]] bool const SuppressWarnings = false     // if calling function is calculating an intermediate state
     961             :     )
     962             :     {
     963             :         // FUNCTION INFORMATION:
     964             :         //       AUTHOR         George Shih
     965             :         //       DATE WRITTEN   May 1976
     966             :         //       MODIFIED       na
     967             :         //       RE-ENGINEERED  na
     968             : 
     969             :         // PURPOSE OF THIS FUNCTION:
     970             :         // This function provides the humidity ratio from dry-bulb temperature
     971             :         // and enthalpy.
     972             : 
     973             :         // REFERENCES:
     974             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P100, EQN 32
     975             : 
     976             : #ifdef EP_psych_stats
     977             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::WFnTdbH)];
     978             : #endif
     979             : 
     980   219078876 :         Real64 const W((H - 1.00484e3 * TDB) / (2.50094e6 + 1.85895e3 * TDB)); // humidity ratio
     981             : 
     982             :         // Validity test
     983   219078876 :         if (W < 0.0) {
     984             : #ifdef EP_psych_errors
     985        9586 :             if ((W <= -0.0001) && (!SuppressWarnings)) PsyWFnTdbH_error(state, TDB, H, W, CalledFrom);
     986             : #endif
     987        9586 :             return 1.0e-5;
     988             :         } else {
     989   219069290 :             return W;
     990             :         }
     991             :     }
     992             : 
     993             : #ifdef EP_cache_PsyPsatFnTemp
     994             : 
     995             :     Real64 PsyPsatFnTemp_raw(EnergyPlusData &state,
     996             :                              Real64 const T,                        // dry-bulb temperature {C}
     997             :                              std::string_view const CalledFrom = "" // routine this function was called from (error messages)
     998             :     );
     999             : 
    1000             : // we are disabling these warnings on Windows because the cache value lookups are using 64bit integers,
    1001             : // but the () and [] operator overloads for Array1D (which stores the cache) only uses 32bit lookups
    1002             : // this seems ... very bad. This problem will be fixed when we get rid of Array1D
    1003             : // at which time this warning disable should be removed.
    1004             : #ifdef _MSC_VER
    1005             : #pragma warning(push)
    1006             : #pragma warning(disable : 4244)
    1007             : #endif
    1008             : 
    1009   882527547 :     inline Real64 PsyPsatFnTemp(EnergyPlusData &state,
    1010             :                                 Real64 const T,                        // dry-bulb temperature {C}
    1011             :                                 std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1012             :     )
    1013             :     {
    1014             :         // FUNCTION INFORMATION:
    1015             :         //       AUTHOR         Linda Lawrie
    1016             :         //       DATE WRITTEN   March 2013
    1017             :         //       MODIFIED       na
    1018             :         //       RE-ENGINEERED  na
    1019             : 
    1020             :         // PURPOSE OF THIS FUNCTION:
    1021             :         // Provide a "cache" of results for the given argument (T) and pressure (Pascal) output result.
    1022             : 
    1023             :         // METHODOLOGY EMPLOYED:
    1024             :         // Use grid shifting and masking to provide hash into the cache. Use Equivalence to
    1025             :         // make Fortran ignore "types".
    1026             : 
    1027             :         // FUNCTION PARAMETER DEFINITIONS:
    1028             :         //  integer(i64), parameter :: Grid_Mask=NOT(ISHFT(1_i64, Grid_Shift)-1)
    1029   882527547 :         std::uint64_t constexpr Grid_Shift = 64 - 12 - psatprecision_bits;
    1030             : 
    1031             : #ifdef EP_psych_stats
    1032             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::PsatFnTemp_cache)];
    1033             : #endif
    1034             : 
    1035             :         DISABLE_WARNING_PUSH
    1036             :         DISABLE_WARNING_STRICT_ALIASING
    1037   882527547 :         Int64 Tdb_tag(*reinterpret_cast<Int64 const *>(&T) >> Grid_Shift);
    1038             :         DISABLE_WARNING_POP
    1039   882527547 :         Int64 const hash(Tdb_tag & psatcache_mask);
    1040   882527547 :         auto &cPsat(state.dataPsychCache->cached_Psat[hash]);
    1041             : 
    1042   882527547 :         if (cPsat.iTdb != Tdb_tag) {
    1043   405575457 :             cPsat.iTdb = Tdb_tag;
    1044   405575457 :             Tdb_tag <<= Grid_Shift;
    1045             :             DISABLE_WARNING_PUSH
    1046             :             DISABLE_WARNING_STRICT_ALIASING
    1047   405575457 :             Real64 Tdb_tag_r = *reinterpret_cast<Real64 const *>(&Tdb_tag);
    1048             :             DISABLE_WARNING_POP
    1049   405575457 :             cPsat.Psat = PsyPsatFnTemp_raw(state, Tdb_tag_r, CalledFrom);
    1050             :         }
    1051             : 
    1052   882527547 :         return cPsat.Psat; // saturation pressure {Pascals}
    1053             :     }
    1054             : 
    1055             : #else
    1056             : 
    1057             :     Real64 PsyPsatFnTemp(EnergyPlusData &state,
    1058             :                          Real64 const T,                        // dry-bulb temperature {C}
    1059             :                          std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1060             :     );
    1061             : 
    1062             : #endif
    1063             : 
    1064             : #ifdef EP_cache_PsyTsatFnHPb
    1065             :     Real64 PsyTsatFnHPb_raw(EnergyPlusData &state,
    1066             :                             Real64 const H,                        // enthalpy {J/kg}
    1067             :                             Real64 const PB,                       // barometric pressure {Pascals}
    1068             :                             std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1069             :     );
    1070   228491206 :     inline Real64 PsyTsatFnHPb(EnergyPlusData &state,
    1071             :                                Real64 const H,
    1072             :                                Real64 const Pb,                       // barometric pressure {Pascals}
    1073             :                                std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1074             :     )
    1075             :     {
    1076             : 
    1077             :         Real64 Tsat_result; // result=> Sat-Temp {C}
    1078             : 
    1079   228491206 :         std::uint64_t constexpr Grid_Shift = 64 - 12 - tsat_hbp_precision_bits;
    1080             : 
    1081             :         // INTERFACE BLOCK SPECIFICATIONS:
    1082             :         // na
    1083             : 
    1084             :         // DERIVED TYPE DEFINITIONS:
    1085             :         // na
    1086             : 
    1087             :         // FUNCTION LOCAL VARIABLE DECLARATIONS:
    1088             : 
    1089             : #ifdef EP_psych_stats
    1090             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::TwbFnTdbWPb_cache)];
    1091             : #endif
    1092             :         DISABLE_WARNING_PUSH
    1093             :         DISABLE_WARNING_STRICT_ALIASING
    1094   228491206 :         Int64 H_tag = *reinterpret_cast<Int64 const *>(&H) >> Grid_Shift;
    1095   228491206 :         Int64 Pb_tag = *reinterpret_cast<Int64 const *>(&Pb) >> Grid_Shift;
    1096             :         DISABLE_WARNING_POP
    1097   228491206 :         Int64 hash = (H_tag ^ Pb_tag) & Int64(tsat_hbp_cache_size - 1);
    1098   228491206 :         auto &cached_Tsat_HPb = state.dataPsychCache->cached_Tsat_HPb;
    1099   228491206 :         if (cached_Tsat_HPb[hash].iH != H_tag || cached_Tsat_HPb[hash].iPb != Pb_tag) {
    1100    48591001 :             cached_Tsat_HPb[hash].iH = H_tag;
    1101    48591001 :             cached_Tsat_HPb[hash].iPb = Pb_tag;
    1102    48591001 :             cached_Tsat_HPb[hash].Tsat = PsyTsatFnHPb_raw(state, H, Pb, CalledFrom);
    1103             :         }
    1104             : 
    1105   228491206 :         Tsat_result = cached_Tsat_HPb[hash].Tsat;
    1106             : 
    1107   228491206 :         return Tsat_result;
    1108             :     }
    1109             : 
    1110             : #else
    1111             : 
    1112             :     Real64 PsyTsatFnHPb(EnergyPlusData &state,
    1113             :                         Real64 const H,                        // enthalpy {J/kg}
    1114             :                         Real64 const PB,                       // barometric pressure {Pascals}
    1115             :                         std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1116             :     );
    1117             : 
    1118             : #endif
    1119             : 
    1120     4390892 :     inline Real64 PsyRhovFnTdbRh(EnergyPlusData &state,
    1121             :                                  Real64 const Tdb,                      // dry-bulb temperature {C}
    1122             :                                  Real64 const RH,                       // relative humidity value (0.0-1.0)
    1123             :                                  std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1124             :     )
    1125             :     {
    1126             :         // FUNCTION INFORMATION:
    1127             :         //       AUTHOR         R. J. Liesen
    1128             :         //       DATE WRITTEN   July 2000
    1129             :         //       MODIFIED       Change temperature range applied (determine pws); Aug 2007; LKL
    1130             :         //                      Function is continuous over temperature spectrum
    1131             :         //       RE-ENGINEERED  na
    1132             : 
    1133             :         // PURPOSE OF THIS FUNCTION:
    1134             :         // This function provides the Vapor Density in air as a
    1135             :         // function of dry bulb temperature, and Relative Humidity.
    1136             : 
    1137             :         // METHODOLOGY EMPLOYED:
    1138             :         // ideal gas law
    1139             :         // Universal gas const for water vapor 461.52 J/(kg K)
    1140             : 
    1141             :         // REFERENCES:
    1142             :         // ASHRAE handbook 1993 Fundamentals, ??
    1143             :         // Used values from Table 2, HOF 2005, Chapter 6, to verify that these values match (at saturation)
    1144             :         // values from PsyRhFnTdbWPb
    1145             : 
    1146     4390892 :         return (PsyPsatFnTemp(state, Tdb, CalledFrom) * RH) / (461.52 * (Tdb + DataGlobalConstants::KelvinConv)); // Vapor density in air
    1147             :     }
    1148             : 
    1149             : #ifdef EP_psych_errors
    1150             :     void PsyRhFnTdbRhov_error(EnergyPlusData &state,
    1151             :                               Real64 const Tdb,                      // dry-bulb temperature {C}
    1152             :                               Real64 const Rhovapor,                 // vapor density in air {kg/m3}
    1153             :                               Real64 const RHValue,                  // relative humidity
    1154             :                               std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1155             :     );
    1156             : #endif
    1157             : 
    1158     2448080 :     inline Real64 PsyRhFnTdbRhov(EnergyPlusData &state,
    1159             :                                  Real64 const Tdb,                                       // dry-bulb temperature {C}
    1160             :                                  Real64 const Rhovapor,                                  // vapor density in air {kg/m3}
    1161             :                                  [[maybe_unused]] std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1162             :     )
    1163             :     {
    1164             :         // FUNCTION INFORMATION:
    1165             :         //       AUTHOR         R. J. Liesen
    1166             :         //       DATE WRITTEN   July 2000
    1167             :         //       MODIFIED       Change temperature range applied (determine pws); Aug 2007; LKL
    1168             :         //                      Function is continuous over temperature spectrum
    1169             :         //       RE-ENGINEERED  na
    1170             : 
    1171             :         // PURPOSE OF THIS FUNCTION:
    1172             :         // This function provides the Relative Humidity in air as a
    1173             :         // function of dry bulb temperature and Vapor Density.
    1174             : 
    1175             :         // METHODOLOGY EMPLOYED:
    1176             :         // ideal gas law
    1177             :         // Universal gas const for water vapor 461.52 J/(kg K)
    1178             : 
    1179             :         // REFERENCES:
    1180             :         // ASHRAE handbook 1993 Fundamentals,
    1181             :         // Used values from Table 2, HOF 2005, Chapter 6, to verify that these values match (at saturation)
    1182             :         // values from PsyRhFnTdbWPb
    1183             : 
    1184             : #ifdef EP_psych_stats
    1185             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::RhFnTdbRhov)];
    1186             : #endif
    1187             : 
    1188     4896160 :         Real64 const RHValue(Rhovapor > 0.0 ? Rhovapor * 461.52 * (Tdb + DataGlobalConstants::KelvinConv) /
    1189     2448080 :                                                   PsyPsatFnTemp(state, Tdb, PsyRoutineNames[static_cast<int>(PsychrometricFunction::RhFnTdbRhov)])
    1190     2448080 :                                             : 0.0);
    1191             : 
    1192     2448080 :         if ((RHValue < 0.0) || (RHValue > 1.0)) {
    1193             : #ifdef EP_psych_errors
    1194       62654 :             if ((RHValue < -0.05) || (RHValue > 1.01)) {
    1195           0 :                 PsyRhFnTdbRhov_error(state, Tdb, Rhovapor, RHValue, CalledFrom);
    1196             :             }
    1197             : #endif
    1198       62654 :             return min(max(RHValue, 0.01), 1.0);
    1199             :         } else {
    1200     2385426 :             return RHValue;
    1201             :         }
    1202             :     }
    1203             : 
    1204             : #ifdef EP_psych_errors
    1205             :     void PsyRhFnTdbWPb_error(EnergyPlusData &state,
    1206             :                              Real64 const TDB,                 // dry-bulb temperature {C}
    1207             :                              Real64 const W,                   // humidity ratio
    1208             :                              Real64 const RHValue,             // relative humidity (0.0-1.0)
    1209             :                              std::string_view const CalledFrom // routine this function was called from (error messages)
    1210             :     );
    1211             : #endif
    1212             : 
    1213    65558854 :     inline Real64 PsyRhFnTdbWPb(EnergyPlusData &state,
    1214             :                                 Real64 const TDB,                      // dry-bulb temperature {C}
    1215             :                                 Real64 const dW,                       // humidity ratio
    1216             :                                 Real64 const PB,                       // barometric pressure {Pascals}
    1217             :                                 std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1218             :     )
    1219             :     {
    1220             :         // FUNCTION INFORMATION:
    1221             :         //       AUTHOR         Richard J. Liesen
    1222             :         //       DATE WRITTEN   Nov 1988
    1223             :         //       MODIFIED       Aug 1989, Michael J. Witte
    1224             :         //       RE-ENGINEERED  na
    1225             : 
    1226             :         // PURPOSE OF THIS FUNCTION:
    1227             :         // This function provides the relative humidity value (0.0-1.0) as a result of
    1228             :         // dry-bulb temperature, humidity ratio and barometric pressure.
    1229             : 
    1230             :         // REFERENCES:
    1231             :         // ASHRAE HANDBOOK FUNDAMENTALS 1985, P6.12, EQN 10,21,23
    1232             : 
    1233             : #ifdef EP_psych_stats
    1234             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::RhFnTdbWPb)];
    1235             : #endif
    1236             : 
    1237             :         Real64 const PWS(PsyPsatFnTemp(state,
    1238             :                                        TDB,
    1239    65558854 :                                        (CalledFrom.empty() ? PsyRoutineNames[static_cast<int>(PsychrometricFunction::RhFnTdbWPb)]
    1240    65558854 :                                                            : CalledFrom))); // Pressure -- saturated for pure water
    1241             : 
    1242             :         // Find Degree Of Saturation
    1243    65558854 :         Real64 const W(max(dW, 1.0e-5));                  // humidity ratio
    1244    65558854 :         Real64 const U(W / (0.62198 * PWS / (PB - PWS))); // Degree of Saturation
    1245             : 
    1246             :         // Calculate The Relative Humidity
    1247    65558854 :         Real64 const RHValue(U / (1.0 - (1.0 - U) * (PWS / PB)));
    1248             : 
    1249             :         // Validity test
    1250    65558854 :         if ((RHValue < 0.0) || (RHValue > 1.0)) {
    1251             : #ifdef EP_psych_errors
    1252      358173 :             if ((RHValue < -0.05) || (RHValue > 1.01)) {
    1253          35 :                 PsyRhFnTdbWPb_error(state, TDB, W, RHValue, CalledFrom);
    1254             :             }
    1255             : #endif
    1256      358173 :             return min(max(RHValue, 0.01), 1.0);
    1257             :         } else {
    1258    65200681 :             return RHValue;
    1259             :         }
    1260             :     }
    1261             : 
    1262             : #ifdef EP_psych_errors
    1263             :     void PsyWFnTdpPb_error(EnergyPlusData &state,
    1264             :                            Real64 const TDP,                 // dew-point temperature {C}
    1265             :                            Real64 const PB,                  // barometric pressure {Pascals}
    1266             :                            Real64 const W,                   // humidity ratio
    1267             :                            Real64 const DeltaT,              // Reduced temperature difference of dew point
    1268             :                            std::string_view const CalledFrom // routine this function was called from (error messages)
    1269             :     );
    1270             : #endif
    1271             : 
    1272    55960030 :     inline Real64 PsyWFnTdpPb(EnergyPlusData &state,
    1273             :                               Real64 const TDP,                      // dew-point temperature {C}
    1274             :                               Real64 const PB,                       // barometric pressure {Pascals}
    1275             :                               std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1276             :     )
    1277             :     {
    1278             :         // FUNCTION INFORMATION:
    1279             :         //       AUTHOR         George Shih
    1280             :         //       DATE WRITTEN   May 1976
    1281             :         //       MODIFIED       na
    1282             :         //       RE-ENGINEERED  na
    1283             : 
    1284             :         // PURPOSE OF THIS FUNCTION:
    1285             :         // This function provides the humidity ratio from dew-point temperature
    1286             :         // and barometric pressure.
    1287             : 
    1288             :         // REFERENCES:
    1289             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQN 22
    1290             : 
    1291             : #ifdef EP_psych_stats
    1292             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::WFnTdpPb)];
    1293             : #endif
    1294             : 
    1295             :         Real64 const PDEW(PsyPsatFnTemp(state,
    1296             :                                         TDP,
    1297    55960030 :                                         (CalledFrom.empty() ? PsyRoutineNames[static_cast<int>(PsychrometricFunction::WFnTdpPb)]
    1298    55960030 :                                                             : CalledFrom))); // saturation pressure at dew-point temperature {Pascals}
    1299    55960030 :         Real64 const W(PDEW * 0.62198 / (PB - PDEW));                        // humidity ratio
    1300             : 
    1301             :         // Validity test
    1302    55960030 :         if (W < 0.0) {
    1303           2 :             Real64 DeltaT = 0.0;
    1304           2 :             Real64 PDEW1 = PDEW;
    1305        1122 :             while (PDEW1 >= PB) {
    1306         560 :                 DeltaT++;
    1307         560 :                 PDEW1 = PsyPsatFnTemp(state,
    1308             :                                       TDP - DeltaT,
    1309         560 :                                       (CalledFrom.empty() ? PsyRoutineNames[static_cast<int>(PsychrometricFunction::WFnTdpPb)]
    1310             :                                                           : CalledFrom)); // saturation pressure at dew-point temperature {Pascals}
    1311             :             }
    1312           2 :             Real64 W1 = PDEW1 * 0.62198 / (PB - PDEW1);
    1313             : #ifdef EP_psych_errors
    1314           2 :             if (W <= -0.0001) {
    1315           2 :                 PsyWFnTdpPb_error(state, TDP, PB, W1, DeltaT, CalledFrom);
    1316             :             }
    1317             : #endif
    1318           2 :             return W1;
    1319             :         } else {
    1320    55960028 :             return W;
    1321             :         }
    1322             :     }
    1323             : 
    1324             : #ifdef EP_psych_errors
    1325             :     void PsyWFnTdbRhPb_error(EnergyPlusData &state,
    1326             :                              Real64 const TDB,                 // dry-bulb temperature {C}
    1327             :                              Real64 const RH,                  // relative humidity value (0.0-1.0)
    1328             :                              Real64 const PB,                  // barometric pressure {Pascals}
    1329             :                              Real64 const W,                   // humidity ratio
    1330             :                              std::string_view const CalledFrom // routine this function was called from (error messages)
    1331             :     );
    1332             : #endif
    1333             : 
    1334   160645788 :     inline Real64 PsyWFnTdbRhPb(EnergyPlusData &state,
    1335             :                                 Real64 const TDB,                      // dry-bulb temperature {C}
    1336             :                                 Real64 const RH,                       // relative humidity value (0.0-1.0)
    1337             :                                 Real64 const PB,                       // barometric pressure {Pascals}
    1338             :                                 std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1339             :     )
    1340             :     {
    1341             :         // FUNCTION INFORMATION:
    1342             :         //       AUTHOR         George Shih
    1343             :         //       DATE WRITTEN   May 1976
    1344             :         //       MODIFIED       na
    1345             :         //       RE-ENGINEERED  na
    1346             : 
    1347             :         // PURPOSE OF THIS FUNCTION:
    1348             :         // This function provides the humidity ratio from dry-bulb temperature,
    1349             :         // relative humidty (value) and barometric pressure.
    1350             : 
    1351             :         // REFERENCES:
    1352             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQN 22
    1353             : 
    1354             : #ifdef EP_psych_stats
    1355             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::WFnTdbRhPb)];
    1356             : #endif
    1357             : 
    1358   160645788 :         Real64 const PDEW(RH * PsyPsatFnTemp(state,
    1359             :                                              TDB,
    1360   160645788 :                                              (CalledFrom.empty() ? PsyRoutineNames[static_cast<int>(PsychrometricFunction::WFnTdbRhPb)]
    1361   160645788 :                                                                  : CalledFrom))); // Pressure at dew-point temperature {Pascals}
    1362             : 
    1363             :         // Numeric error check when the temperature and RH values cause Pdew to equal or exceed
    1364             :         // barometric pressure which is physically impossible. An approach limit of 1000 pascals
    1365             :         // was chosen to keep the numerics stable as the denominator approaches 0.
    1366   160645788 :         Real64 const W(PDEW * 0.62198 / max(PB - PDEW, 1000.0)); // humidity ratio
    1367             :         // THIS EQUATION IN SI UNIT IS FROM ASHRAE HANDBOOK OF FUNDAMENTALS PAGE 99  EQUATION 22
    1368             : 
    1369             :         // Validity test
    1370   160645788 :         if (W < 1.0e-5) {
    1371             : #ifdef EP_psych_errors
    1372         951 :             if (W <= -0.0001) PsyWFnTdbRhPb_error(state, TDB, RH, PB, W, CalledFrom);
    1373             : #endif
    1374         951 :             return 1.0e-5;
    1375             :         } else {
    1376   160644837 :             return W;
    1377             :         }
    1378             :     }
    1379             : 
    1380             : #ifdef EP_psych_errors
    1381             : 
    1382             :     void PsyWFnTdbTwbPb_temperature_error(EnergyPlusData &state,
    1383             :                                           Real64 const TDB,                 // dry-bulb temperature {C}
    1384             :                                           Real64 const TWB,                 // wet-bulb temperature {C}
    1385             :                                           Real64 const PB,                  // barometric pressure {Pascals}
    1386             :                                           std::string_view const CalledFrom // routine this function was called from (error messages)
    1387             :     );
    1388             : 
    1389             :     void PsyWFnTdbTwbPb_humidity_error(EnergyPlusData &state,
    1390             :                                        Real64 const TDB,                 // dry-bulb temperature {C}
    1391             :                                        Real64 const TWB,                 // wet-bulb temperature {C}
    1392             :                                        Real64 const PB,                  // barometric pressure {Pascals}
    1393             :                                        Real64 const W,                   // humidity ratio
    1394             :                                        std::string_view const CalledFrom // routine this function was called from (error messages)
    1395             :     );
    1396             : 
    1397             : #endif
    1398             : 
    1399   207221884 :     inline Real64 PsyWFnTdbTwbPb(EnergyPlusData &state,
    1400             :                                  Real64 const TDB,                      // dry-bulb temperature {C}
    1401             :                                  Real64 const TWBin,                    // wet-bulb temperature {C}
    1402             :                                  Real64 const PB,                       // barometric pressure {Pascals}
    1403             :                                  std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1404             :     )
    1405             :     {
    1406             :         // FUNCTION INFORMATION:
    1407             :         //       AUTHOR         George Shih
    1408             :         //       DATE WRITTEN   May 1976
    1409             :         //       MODIFIED       na
    1410             :         //       RE-ENGINEERED  na
    1411             : 
    1412             :         // PURPOSE OF THIS FUNCTION:
    1413             :         // This function provides the humidity ratio from dry-bulb temperature,
    1414             :         // wet-bulb temperature and barometric pressure.
    1415             : 
    1416             :         // REFERENCES:
    1417             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P99, EQ 22,35
    1418             : 
    1419             : #ifdef EP_psych_stats
    1420             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::WFnTdbTwbPb)];
    1421             : #endif
    1422             : 
    1423   207221884 :         Real64 TWB(TWBin); // test wet-bulb temperature
    1424             : 
    1425             :         // Validity check
    1426   207221884 :         if (TWB > TDB) {
    1427             : #ifdef EP_psych_errors
    1428      106753 :             if (TWB > TDB + 0.01) PsyWFnTdbTwbPb_temperature_error(state, TDB, TWB, PB, CalledFrom);
    1429             : #endif
    1430      106753 :             TWB = TDB;
    1431             :         }
    1432             : 
    1433             :         // Calculation
    1434             :         Real64 const PWET(PsyPsatFnTemp(state,
    1435             :                                         TWB,
    1436   207221884 :                                         (CalledFrom.empty() ? PsyRoutineNames[static_cast<int>(PsychrometricFunction::WFnTdbTwbPb)]
    1437   207221884 :                                                             : CalledFrom))); // Pressure at wet-bulb temperature {Pascals}
    1438   207221884 :         Real64 const WET(0.62198 * PWET / (PB - PWET));                      // Humidity ratio at wet-bulb temperature
    1439   207221884 :         Real64 const W(((2501.0 - 2.381 * TWB) * WET - (TDB - TWB)) / (2501.0 + 1.805 * TDB - 4.186 * TWB)); // humidity ratio
    1440             : 
    1441             :         // Validity check
    1442   207221884 :         if (W < 0.0) {
    1443             : #ifdef EP_psych_errors
    1444         320 :             PsyWFnTdbTwbPb_humidity_error(state, TDB, TWB, PB, W, CalledFrom);
    1445             : #endif
    1446         320 :             return PsyWFnTdbRhPb(state, TDB, 0.0001, PB, CalledFrom);
    1447             :         } else {
    1448   207221564 :             return W;
    1449             :         }
    1450             :     }
    1451             : 
    1452    65534023 :     inline Real64 PsyHFnTdbRhPb(EnergyPlusData &state,
    1453             :                                 Real64 const TDB,                      // dry-bulb temperature {C}
    1454             :                                 Real64 const RH,                       // relative humidity value (0.0 - 1.0)
    1455             :                                 Real64 const PB,                       // barometric pressure (N/M**2) {Pascals}
    1456             :                                 std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1457             :     )
    1458             :     {
    1459             :         // FUNCTION INFORMATION:
    1460             :         //       AUTHOR         J. C. VanderZee
    1461             :         //       DATE WRITTEN   Feb. 1994
    1462             :         //       MODIFIED       na
    1463             :         //       RE-ENGINEERED  na
    1464             : 
    1465             :         // PURPOSE OF THIS FUNCTION:
    1466             :         // This function provides air enthalpy from temperature and relative humidity.
    1467             : 
    1468             :         // METHODOLOGY EMPLOYED:
    1469             :         // na
    1470             : 
    1471             :         // REFERENCES:
    1472             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P100, EQN 32
    1473             :         //   by using functions PsyWFnTdbRhPb and PsyHFnTdbW
    1474             : 
    1475    65534023 :         return PsyHFnTdbW(TDB, max(PsyWFnTdbRhPb(state, TDB, RH, PB, CalledFrom), 1.0e-5)); // enthalpy {J/kg}
    1476             :     }
    1477             : 
    1478             : #ifdef EP_cache_PsyTsatFnPb
    1479             : 
    1480             :     Real64 PsyTsatFnPb_raw(EnergyPlusData &state,
    1481             :                            Real64 const Press,                    // barometric pressure {Pascals}
    1482             :                            std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1483             :     );
    1484             : 
    1485   118239697 :     inline Real64 PsyTsatFnPb(EnergyPlusData &state,
    1486             :                               Real64 const Press,                    // barometric pressure {Pascals}
    1487             :                               std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1488             :     )
    1489             :     {
    1490             : 
    1491   118239697 :         std::uint64_t Grid_Shift = 64 - 12 - state.dataPsychCache->tsatprecision_bits;
    1492             :         DISABLE_WARNING_PUSH
    1493             :         DISABLE_WARNING_STRICT_ALIASING
    1494   118239697 :         Int64 const Pb_tag(*reinterpret_cast<Int64 const *>(&Press) >> Grid_Shift);
    1495             :         DISABLE_WARNING_POP
    1496             : 
    1497   118239697 :         Int64 const hash(Pb_tag & tsatcache_mask);
    1498   118239697 :         auto &cTsat(state.dataPsychCache->cached_Tsat[hash]);
    1499   118239697 :         if (cTsat.iPb != Pb_tag) {
    1500    13818534 :             cTsat.iPb = Pb_tag;
    1501    13818534 :             cTsat.Tsat = PsyTsatFnPb_raw(state, Press, CalledFrom);
    1502             :         }
    1503             : 
    1504   118239697 :         return cTsat.Tsat; // saturation temperature
    1505             :     }
    1506             : 
    1507             : #ifdef _MSC_VER
    1508             : #pragma warning(pop)
    1509             : #endif
    1510             : 
    1511             : #else
    1512             :     Real64 PsyTsatFnPb(EnergyPlusData &state,
    1513             :                        Real64 const Press,                    // barometric pressure {Pascals}
    1514             :                        std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1515             :     );
    1516             : #endif
    1517             : 
    1518   118200370 :     inline Real64 PsyTdpFnWPb(EnergyPlusData &state,
    1519             :                               Real64 const W,                        // humidity ratio
    1520             :                               Real64 const PB,                       // barometric pressure (N/M**2) {Pascals}
    1521             :                               std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1522             :     )
    1523             :     {
    1524             :         // FUNCTION INFORMATION:
    1525             :         //       AUTHOR         George Shih
    1526             :         //       DATE WRITTEN   May 1976
    1527             :         //       MODIFIED       na
    1528             :         //       RE-ENGINEERED  na
    1529             : 
    1530             :         // PURPOSE OF THIS FUNCTION:
    1531             :         // This function calculates the dew-point temperature {C} from humidity ratio and pressure.
    1532             : 
    1533             :         // METHODOLOGY EMPLOYED:
    1534             :         // na
    1535             : 
    1536             :         // REFERENCES:
    1537             :         // ASHRAE HANDBOOK OF FUNDAMENTALS, 1972, P.99, EQN 22
    1538             : 
    1539   118200370 :         Real64 const W0(max(W, 1.0e-5));             // limited humidity ratio
    1540   118200370 :         Real64 const PDEW(PB * W0 / (0.62198 + W0)); // pressure at dew point temperature
    1541   118200370 :         return PsyTsatFnPb(state, PDEW, CalledFrom);
    1542             :     }
    1543             : 
    1544             : #ifdef EP_psych_errors
    1545             :     void PsyTdpFnTdbTwbPb_error(EnergyPlusData &state,
    1546             :                                 Real64 const TDB,                 // dry-bulb temperature {C}
    1547             :                                 Real64 const TWB,                 // wet-bulb temperature {C}
    1548             :                                 Real64 const PB,                  // barometric pressure (N/M**2) {Pascals}
    1549             :                                 Real64 const W,                   // humidity ratio
    1550             :                                 Real64 const TDP,                 // dew-point temperature {C}
    1551             :                                 std::string_view const CalledFrom // routine this function was called from (error messages)
    1552             :     );
    1553             : #endif
    1554             : 
    1555     2120164 :     inline Real64 PsyTdpFnTdbTwbPb(EnergyPlusData &state,
    1556             :                                    Real64 const TDB,                      // dry-bulb temperature {C}
    1557             :                                    Real64 const TWB,                      // wet-bulb temperature {C}
    1558             :                                    Real64 const PB,                       // barometric pressure (N/M**2) {Pascals}
    1559             :                                    std::string_view const CalledFrom = "" // routine this function was called from (error messages)
    1560             :     )
    1561             :     {
    1562             :         // FUNCTION INFORMATION:
    1563             :         //       AUTHOR         George Shih
    1564             :         //       DATE WRITTEN   May 1976
    1565             :         //       MODIFIED       na
    1566             :         //       RE-ENGINEERED  na
    1567             : 
    1568             :         // PURPOSE OF THIS FUNCTION:
    1569             :         // This function calculates the dew-point temperature {C} from dry-bulb, wet-bulb and pressure.
    1570             : 
    1571             : #ifdef EP_psych_stats
    1572             :         ++state.dataPsychCache->NumTimesCalled[static_cast<int>(PsychrometricFunction::TdpFnTdbTwbPb)];
    1573             : #endif
    1574             : 
    1575     2120164 :         Real64 const W(max(PsyWFnTdbTwbPb(state, TDB, TWB, PB, CalledFrom), 1.0e-5));
    1576     2120164 :         Real64 const TDP(PsyTdpFnWPb(state, W, PB, CalledFrom));
    1577             : 
    1578     2120164 :         if (TDP > TWB) {
    1579             : #ifdef EP_psych_errors
    1580           0 :             if (TDP > TWB + 0.1) PsyTdpFnTdbTwbPb_error(state, TDB, TWB, PB, W, TDP, CalledFrom);
    1581             : #endif
    1582           0 :             return TWB;
    1583             :         } else {
    1584     2120164 :             return TDP;
    1585             :         }
    1586             :     }
    1587             : 
    1588    48591001 :     inline Real64 F6(Real64 const X, Real64 const A0, Real64 const A1, Real64 const A2, Real64 const A3, Real64 const A4, Real64 const A5)
    1589             :     {
    1590    48591001 :         return A0 + X * (A1 + X * (A2 + X * (A3 + X * (A4 + X * A5))));
    1591             :     }
    1592             : 
    1593             :     inline Real64
    1594           0 :     F7(Real64 const X, Real64 const A0, Real64 const A1, Real64 const A2, Real64 const A3, Real64 const A4, Real64 const A5, Real64 const A6)
    1595             :     {
    1596           0 :         return (A0 + X * (A1 + X * (A2 + X * (A3 + X * (A4 + X * (A5 + X * A6)))))) / 1.0E10;
    1597             :     }
    1598             : 
    1599      107643 :     inline Real64 CPCW([[maybe_unused]] Real64 const Temperature // unused1208
    1600             :     )
    1601             :     {
    1602             :         // FUNCTION INFORMATION:
    1603             :         //       AUTHOR         RUSSELL D. TAYLOR
    1604             :         //       DATE WRITTEN   April 1992
    1605             : 
    1606             :         // PURPOSE OF THIS FUNCTION:
    1607             :         // This function provides the specific heat of chilled water. CPCW (J/Kg/k)
    1608             : 
    1609      107643 :         return 4180.0;
    1610             :     }
    1611             : 
    1612   138255057 :     inline Real64 CPHW([[maybe_unused]] Real64 const Temperature // unused1208
    1613             :     )
    1614             :     {
    1615             :         // FUNCTION INFORMATION:
    1616             :         //       AUTHOR         RUSSELL D. TAYLOR
    1617             :         //       DATE WRITTEN   April 1992
    1618             : 
    1619             :         // PURPOSE OF THIS FUNCTION:
    1620             :         // This function provides the specific heat of hot water. CPHW (J/Kg/k)
    1621             : 
    1622   138255057 :         return 4180.0;
    1623             :     }
    1624             : 
    1625   217253769 :     inline Real64 RhoH2O(Real64 const TB // Dry bulb temperature. {C}
    1626             :     )
    1627             :     {
    1628             :         // FUNCTION INFORMATION:
    1629             :         //       AUTHOR         SIGSTEINN P. GRETARSSON
    1630             :         //       DATE WRITTEN   April 1992
    1631             : 
    1632             :         // PURPOSE OF THIS FUNCTION:
    1633             :         // This function provides the density of water at a specific temperature.
    1634             : 
    1635             :         // METHODOLOGY EMPLOYED:
    1636             :         //     Density of water [kg/m3]
    1637             :         //     (RANGE: KelvinConv - 423.15 DEG. K) (convert to C first)
    1638             : 
    1639   217253769 :         return 1000.1207 + 8.3215874e-04 * TB - 4.929976e-03 * pow_2(TB) + 8.4791863e-06 * pow_3(TB);
    1640             :     }
    1641             : 
    1642   168163298 :     inline Real64 PsyDeltaHSenFnTdb2Tdb1W(Real64 const TDB2, // dry-bulb temperature at state 1 {C}
    1643             :                                           Real64 const TDB1, // dry-bulb temperature at state 2 {C}
    1644             :                                           Real64 const W     // humidity ratio (at zone air node or Wmin)
    1645             :     )
    1646             :     {
    1647             :         // When called for zone equipment flow entering a zone (from CalcZoneSensibleLatentOutput or CalcZoneSensibleOutput):
    1648             :         // returns sensible enthalpy difference between equipment supply air (TDB2) and zone air (TDB1) evaluated
    1649             :         // using the zone air node humidity ratio. This enthalpy difference multiplied by supply
    1650             :         // air mass flow rate yields the sensible heat transfer rate in Watts.
    1651             :         // positive value is heating, negative value is cooling
    1652             : 
    1653             :         // When called across a component (from PsyDeltaHSenFnTdb2W2Tdb1W1 by CalcComponentSensibleLatentOutput):
    1654             :         // returns sensible enthalpy difference between state 1 (TDB1) and state 2 (TDB2) using the minimum
    1655             :         // humidity ratio from states 1 and 2. This enthalpy difference multiplied by supply air mass flow
    1656             :         // rate yields the sensible heat transfer rate in Watts.
    1657             :         // positive value is heating, negative value is cooling
    1658             : 
    1659             :         // the following two functions for calculating enthalpy difference are equivalent:
    1660             :         // PsyDeltaHSenFnTdb2Tdb1W() = PsyHFnTdbW(TDB2, W) - PsyHFnTdbW(TDB1, W)
    1661             :         // PsyDeltaHSenFnTdb2Tdb1W() function was derived by simplifying the expression above
    1662             :         // The constant coefficients come from the equation for moist air enthalpy, PsyHFnTdbW()
    1663             : 
    1664   168163298 :         return (1.00484e3 + max(1.0e-5, W) * 1.85895e3) * (TDB2 - TDB1);
    1665             :     }
    1666             : 
    1667    89429579 :     inline Real64 PsyDeltaHSenFnTdb2W2Tdb1W1(Real64 const TDB2, // dry-bulb temperature at state 2 {C}
    1668             :                                              Real64 const W2,   // humidity ratio at state 2
    1669             :                                              Real64 const TDB1, // dry-bulb temperature at state 1 {C}
    1670             :                                              Real64 const W1    // humidity ratio at state 1
    1671             :     )
    1672             :     {
    1673             :         // returns sensible enthalpy difference of moist air going from state 1 to state 2 (e.g across coils)
    1674             :         // using the minimum humidity ratio state points 1 and 2. This enthalpy difference multiplied by
    1675             :         // supply air mass flow rate yields sensible heat transfer rate across coils in Watts
    1676             :         // positive value is heating, negative value is cooling
    1677             : 
    1678             :         // the following two functions for calculating enthalpy difference are equivalent:
    1679             :         // PsyDeltaHSenFnTdb2W2Tdb1W1() = PsyHFnTdbW(TDB2, min(W1, W2)) - PsyHFnTdbW(TDB1, min(W1,W2))
    1680             :         // PsyDeltaHSenFnTdb2W2Tdb1W1() function was derived by simplifying the above expression
    1681             :         // The constant coefficients came from the equation for moist air enthalpy, PsyHFnTdbW()
    1682             : 
    1683    89429579 :         Real64 const Wmin = min(W1, W2);
    1684    89429579 :         return PsyDeltaHSenFnTdb2Tdb1W(TDB2, TDB1, Wmin);
    1685             :     }
    1686             :     Real64 CSplineint(int const n, // sample data size
    1687             :                       Real64 x);   // given value of x
    1688             : } // namespace Psychrometrics
    1689             : 
    1690        1542 : struct PsychrometricsData : BaseGlobalStruct
    1691             : {
    1692             :     Real64 iconvTol = 0.0001;
    1693             :     Real64 last_Patm = -99999.0;  // barometric pressure {Pascals}  (last)
    1694             :     Real64 last_tBoil = -99999.0; // Boiling temperature of water at given pressure (last)
    1695             :     Real64 Press_Save = -99999.0;
    1696             :     Real64 tSat_Save = -99999.0;
    1697             :     std::array<int, static_cast<int>(EnergyPlus::PsychrometricFunction::Num)> iPsyErrIndex;
    1698             :     std::string String;
    1699             :     bool ReportErrors = true;
    1700             :     bool useInterpolationPsychTsatFnPb = false;
    1701             : 
    1702           0 :     void clear_state() override
    1703             :     {
    1704           0 :         iPsyErrIndex.fill(0);
    1705           0 :         iconvTol = 0.0001;
    1706           0 :         last_Patm = -99999.0;  // barometric pressure {Pascals}  (last)
    1707           0 :         last_tBoil = -99999.0; // Boiling temperature of water at given pressure (last)
    1708           0 :         Press_Save = -99999.0;
    1709           0 :         tSat_Save = -99999.0;
    1710           0 :         String = "";
    1711           0 :         ReportErrors = true;
    1712           0 :         useInterpolationPsychTsatFnPb = false;
    1713           0 :     }
    1714             : };
    1715             : 
    1716             : } // namespace EnergyPlus
    1717             : 
    1718             : #endif

Generated by: LCOV version 1.13