LCOV - code coverage report
Current view: top level - EnergyPlus - GeneratorFuelSupply.cc (source / functions) Coverage Total Hit
Test: lcov.output.filtered Lines: 92.9 % 424 394
Test Date: 2025-05-22 16:09:37 Functions: 100.0 % 2 2

            Line data    Source code
       1              : // EnergyPlus, Copyright (c) 1996-2025, The Board of Trustees of the University of Illinois,
       2              : // The Regents of the University of California, through Lawrence Berkeley National Laboratory
       3              : // (subject to receipt of any required approvals from the U.S. Dept. of Energy), Oak Ridge
       4              : // National Laboratory, managed by UT-Battelle, Alliance for Sustainable Energy, LLC, and other
       5              : // contributors. All rights reserved.
       6              : //
       7              : // NOTICE: This Software was developed under funding from the U.S. Department of Energy and the
       8              : // U.S. Government consequently retains certain rights. As such, the U.S. Government has been
       9              : // granted for itself and others acting on its behalf a paid-up, nonexclusive, irrevocable,
      10              : // worldwide license in the Software to reproduce, distribute copies to the public, prepare
      11              : // derivative works, and perform publicly and display publicly, and to permit others to do so.
      12              : //
      13              : // Redistribution and use in source and binary forms, with or without modification, are permitted
      14              : // provided that the following conditions are met:
      15              : //
      16              : // (1) Redistributions of source code must retain the above copyright notice, this list of
      17              : //     conditions and the following disclaimer.
      18              : //
      19              : // (2) Redistributions in binary form must reproduce the above copyright notice, this list of
      20              : //     conditions and the following disclaimer in the documentation and/or other materials
      21              : //     provided with the distribution.
      22              : //
      23              : // (3) Neither the name of the University of California, Lawrence Berkeley National Laboratory,
      24              : //     the University of Illinois, U.S. Dept. of Energy nor the names of its contributors may be
      25              : //     used to endorse or promote products derived from this software without specific prior
      26              : //     written permission.
      27              : //
      28              : // (4) Use of EnergyPlus(TM) Name. If Licensee (i) distributes the software in stand-alone form
      29              : //     without changes from the version obtained under this License, or (ii) Licensee makes a
      30              : //     reference solely to the software portion of its product, Licensee must refer to the
      31              : //     software as "EnergyPlus version X" software, where "X" is the version number Licensee
      32              : //     obtained under this License and may not use a different name for the software. Except as
      33              : //     specifically required in this Section (4), Licensee shall not use in a company name, a
      34              : //     product name, in advertising, publicity, or other promotional activities any name, trade
      35              : //     name, trademark, logo, or other designation of "EnergyPlus", "E+", "e+" or confusingly
      36              : //     similar designation, without the U.S. Department of Energy's prior written consent.
      37              : //
      38              : // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
      39              : // IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
      40              : // AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
      41              : // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
      42              : // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
      43              : // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
      44              : // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
      45              : // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
      46              : // POSSIBILITY OF SUCH DAMAGE.
      47              : 
      48              : // C++ Headers
      49              : #include <cmath>
      50              : #include <string>
      51              : 
      52              : // ObjexxFCL Headers
      53              : #include <ObjexxFCL/Array.functions.hh>
      54              : #include <ObjexxFCL/Array1D.hh>
      55              : 
      56              : // EnergyPlus Headers
      57              : #include <EnergyPlus/CurveManager.hh>
      58              : #include <EnergyPlus/Data/EnergyPlusData.hh>
      59              : #include <EnergyPlus/DataGenerators.hh>
      60              : #include <EnergyPlus/DataIPShortCuts.hh>
      61              : #include <EnergyPlus/DataLoopNode.hh>
      62              : #include <EnergyPlus/General.hh>
      63              : #include <EnergyPlus/GeneratorFuelSupply.hh>
      64              : #include <EnergyPlus/InputProcessing/InputProcessor.hh>
      65              : #include <EnergyPlus/NodeInputManager.hh>
      66              : #include <EnergyPlus/ScheduleManager.hh>
      67              : #include <EnergyPlus/UtilityRoutines.hh>
      68              : 
      69              : namespace EnergyPlus {
      70              : 
      71              : namespace GeneratorFuelSupply {
      72              : 
      73              :     //_______________________________________________
      74              :     // Utility modules used by other generators.
      75              :     //
      76              :     // GeneratorFuelSupply
      77              :     //   reused among some generators to define gaseous fuel chemistry, optional compressor)
      78              : 
      79              :     // Module containing the routines dealing with the fuel supply for some generators
      80              :     // different generator modules can reuse the same fuel supply code, hence a separate module
      81              : 
      82              :     // MODULE INFORMATION:
      83              :     //       AUTHOR         B Griffith
      84              :     //       DATE WRITTEN   July 2006
      85              : 
      86              :     // METHODOLOGY EMPLOYED:
      87              :     // data defined in DataGenerators.cc
      88              :     // this module only provides input and subroutines for other component simulations
      89              :     //  no specific energyplus component is modeled here.  it is used by other generators
      90              : 
      91              :     // REFERENCES:
      92              :     // Annex 42 documentation
      93              : 
      94            2 :     void GetGeneratorFuelSupplyInput(EnergyPlusData &state)
      95              :     {
      96              : 
      97              :         // SUBROUTINE INFORMATION:
      98              :         //       AUTHOR         B Griffith
      99              :         //       DATE WRITTEN   July 2006,
     100              :         //       RE-ENGINEERED  this module extracted from older SOFC module for
     101              :         //                      reuse with both Annex 42 models,
     102              : 
     103              :         static constexpr std::string_view routineName = "GetGeneratorFuelSupplyInput";
     104              :         // SUBROUTINE LOCAL VARIABLE DECLARATIONS:
     105              :         //  INTEGER                     :: GeneratorNum !Generator counter
     106            2 :         Array1D_string AlphArray(25);  // character string data
     107            2 :         Array1D<Real64> NumArray(200); // numeric data TODO deal with allocatable for extensible
     108              : 
     109            2 :         if (state.dataGeneratorFuelSupply->MyOneTimeFlag) {
     110              :             int NumAlphas; // Number of elements in the alpha array
     111              :             int NumNums;   // Number of elements in the numeric array
     112              :             int IOStat;    // IO Status when calling get input subroutine
     113            2 :             bool ErrorsFound = false;
     114            2 :             std::string const cCurrentModuleObject = "Generator:FuelSupply";
     115            2 :             int NumGeneratorFuelSups = state.dataInputProcessing->inputProcessor->getNumObjectsFound(state, cCurrentModuleObject);
     116              : 
     117            2 :             if (NumGeneratorFuelSups <= 0) {
     118            0 :                 ShowSevereError(state, format("No {} equipment specified in input file", cCurrentModuleObject));
     119            0 :                 ErrorsFound = true;
     120              :             }
     121              : 
     122            2 :             state.dataGenerator->FuelSupply.allocate(NumGeneratorFuelSups);
     123              : 
     124            4 :             for (int FuelSupNum = 1; FuelSupNum <= NumGeneratorFuelSups; ++FuelSupNum) {
     125            4 :                 state.dataInputProcessing->inputProcessor->getObjectItem(state,
     126              :                                                                          cCurrentModuleObject,
     127              :                                                                          FuelSupNum,
     128              :                                                                          AlphArray,
     129              :                                                                          NumAlphas,
     130              :                                                                          NumArray,
     131              :                                                                          NumNums,
     132              :                                                                          IOStat,
     133              :                                                                          _,
     134              :                                                                          _,
     135            2 :                                                                          state.dataIPShortCut->cAlphaFieldNames,
     136            2 :                                                                          state.dataIPShortCut->cNumericFieldNames);
     137              : 
     138            2 :                 ErrorObjectHeader eoh{routineName, cCurrentModuleObject, AlphArray(1)};
     139            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).Name = AlphArray(1);
     140            2 :                 if (Util::SameString("TemperatureFromAirNode", AlphArray(2))) {
     141            1 :                     state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempFromNode;
     142            1 :                 } else if (Util::SameString("Scheduled", AlphArray(2))) {
     143            1 :                     state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode = DataGenerators::FuelTemperatureMode::FuelInTempSchedule;
     144              :                 } else {
     145            0 :                     ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(2), AlphArray(2)));
     146            0 :                     ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, AlphArray(1)));
     147            0 :                     ErrorsFound = true;
     148              :                 }
     149              : 
     150            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).NodeName = AlphArray(3);
     151            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).NodeNum =
     152            4 :                     NodeInputManager::GetOnlySingleNode(state,
     153            2 :                                                         AlphArray(3),
     154              :                                                         ErrorsFound,
     155              :                                                         DataLoopNode::ConnectionObjectType::GeneratorFuelSupply,
     156            2 :                                                         AlphArray(1),
     157              :                                                         DataLoopNode::NodeFluidType::Air,
     158              :                                                         DataLoopNode::ConnectionType::Sensor,
     159              :                                                         NodeInputManager::CompFluidStream::Primary,
     160              :                                                         DataLoopNode::ObjectIsNotParent);
     161              : 
     162            2 :                 if (state.dataGenerator->FuelSupply(FuelSupNum).FuelTempMode == DataGenerators::FuelTemperatureMode::FuelInTempSchedule) {
     163            1 :                     if ((state.dataGenerator->FuelSupply(FuelSupNum).sched = Sched::GetSchedule(state, AlphArray(4))) == nullptr) {
     164            0 :                         ShowSevereItemNotFound(state, eoh, state.dataIPShortCut->cAlphaFieldNames(4), AlphArray(4));
     165            0 :                         ErrorsFound = true;
     166              :                     }
     167              :                 }
     168              : 
     169            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).CompPowerCurveID = Curve::GetCurveIndex(state, AlphArray(5));
     170            2 :                 if (state.dataGenerator->FuelSupply(FuelSupNum).CompPowerCurveID == 0) {
     171            0 :                     ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(5), AlphArray(5)));
     172            0 :                     ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, AlphArray(1)));
     173            0 :                     ShowContinueError(state, "Curve named was not found ");
     174            0 :                     ErrorsFound = true;
     175              :                 }
     176              : 
     177            4 :                 for (auto &e : state.dataGenerator->FuelSupply)
     178            2 :                     e.CompPowerLossFactor = NumArray(1);
     179              : 
     180            2 :                 if (Util::SameString(AlphArray(6), "GaseousConstituents")) {
     181            2 :                     state.dataGenerator->FuelSupply(FuelSupNum).FuelTypeMode = DataGenerators::FuelMode::GaseousConstituents;
     182            0 :                 } else if (Util::SameString(AlphArray(6), "LiquidGeneric")) {
     183            0 :                     state.dataGenerator->FuelSupply(FuelSupNum).FuelTypeMode = DataGenerators::FuelMode::GenericLiquid;
     184              :                 } else {
     185            0 :                     ShowSevereError(state, format("Invalid, {} = {}", state.dataIPShortCut->cAlphaFieldNames(6), AlphArray(6)));
     186            0 :                     ShowContinueError(state, format("Entered in {}={}", cCurrentModuleObject, AlphArray(1)));
     187            0 :                     ErrorsFound = true;
     188              :                 }
     189              : 
     190            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).LHVliquid = NumArray(2) * 1000.0; // generic liquid LHV  (kJ/kG input converted to J/kG )
     191            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).HHV = NumArray(3) * 1000.0;       // generic liquid HHV (kJ/kG input converted to J/kG )
     192            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).MW = NumArray(4);
     193            2 :                 state.dataGenerator->FuelSupply(FuelSupNum).eCO2 = NumArray(5);
     194              : 
     195            2 :                 if (state.dataGenerator->FuelSupply(FuelSupNum).FuelTypeMode == DataGenerators::FuelMode::GaseousConstituents) {
     196            2 :                     int NumFuelConstit = NumArray(6);
     197            2 :                     state.dataGenerator->FuelSupply(FuelSupNum).NumConstituents = NumFuelConstit;
     198              : 
     199            2 :                     if (NumFuelConstit > 12) {
     200            0 :                         ShowSevereError(state, format("{} model not set up for more than 12 fuel constituents", cCurrentModuleObject));
     201            0 :                         ErrorsFound = true;
     202              :                     }
     203            2 :                     if (NumFuelConstit < 1) {
     204            0 :                         ShowSevereError(state, format("{} model needs at least one fuel constituent", cCurrentModuleObject));
     205            0 :                         ErrorsFound = true;
     206              :                     }
     207              : 
     208           18 :                     for (int ConstitNum = 1; ConstitNum <= NumFuelConstit; ++ConstitNum) {
     209           16 :                         state.dataGenerator->FuelSupply(FuelSupNum).ConstitName(ConstitNum) = AlphArray(ConstitNum + 6);
     210           16 :                         state.dataGenerator->FuelSupply(FuelSupNum).ConstitMolalFract(ConstitNum) = NumArray(ConstitNum + 6);
     211              :                     }
     212              : 
     213              :                     // check for molar fractions summing to 1.0.
     214            2 :                     if (std::abs(sum(state.dataGenerator->FuelSupply(FuelSupNum).ConstitMolalFract) - 1.0) > 0.0001) {
     215            0 :                         ShowSevereError(state, format("{} molar fractions do not sum to 1.0", cCurrentModuleObject));
     216            0 :                         ShowContinueError(state, format("Sum was={:.5R}", sum(state.dataGenerator->FuelSupply(FuelSupNum).ConstitMolalFract)));
     217            0 :                         ShowContinueError(state, format("Entered in {} = {}", cCurrentModuleObject, AlphArray(1)));
     218            0 :                         ErrorsFound = true;
     219              :                     }
     220              :                 }
     221              :             }
     222              : 
     223              :             // now make calls to Setup
     224              : 
     225            4 :             for (int FuelSupNum = 1; FuelSupNum <= NumGeneratorFuelSups; ++FuelSupNum) {
     226            2 :                 SetupFuelConstituentData(state, FuelSupNum, ErrorsFound);
     227              :             }
     228              : 
     229            2 :             if (ErrorsFound) {
     230            0 :                 ShowFatalError(state, format("Problem found processing input for {}", cCurrentModuleObject));
     231              :             }
     232              : 
     233            2 :             state.dataGeneratorFuelSupply->MyOneTimeFlag = false;
     234            2 :         } // MyOneTimeFlag
     235            2 :     }
     236              : 
     237              :     //******************************************************************************
     238              : 
     239            3 :     void SetupFuelConstituentData(EnergyPlusData &state, int const FuelSupplyNum, bool &ErrorsFound)
     240              :     {
     241              : 
     242              :         // SUBROUTINE INFORMATION:
     243              :         //       AUTHOR         B Griffith
     244              :         //       DATE WRITTEN   Aug 2005,
     245              :         //       RE-ENGINEERED  July/Aug 2006, extracted to own module. added liquid fuel option
     246              : 
     247              :         // PURPOSE OF THIS SUBROUTINE:
     248              :         // Fill data structure for gas phase thermochemistry
     249              : 
     250              :         // METHODOLOGY EMPLOYED:
     251              :         // Hardcoded data from NIST is filled into data structure one time only
     252              : 
     253            3 :         int constexpr NumHardCodedConstituents = 14; // number of gases included in data
     254              : 
     255            3 :         if (!allocated(state.dataGenerator->GasPhaseThermoChemistryData)) {
     256            2 :             state.dataGenerator->GasPhaseThermoChemistryData.allocate(NumHardCodedConstituents);
     257              :         }
     258              :         // Carbon Dioxide (CO2) Temp K 298-1200 (Chase 1998)
     259            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ConstituentName = "CarbonDioxide";
     260            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ConstituentFormula = "CO2";
     261            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).StdRefMolarEnthOfForm = -393.5224; // KJ/mol
     262            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     263            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateA = 24.99735;
     264            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateB = 55.18696;
     265            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateC = -33.69137;
     266            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateD = 7.948387;
     267            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateE = -0.136638;
     268            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateF = -403.6075;
     269            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateG = 228.2431;
     270            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).ShomateH = -393.5224;
     271            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).NumCarbons = 1.0;
     272            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).NumHydrogens = 0.0;
     273            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).NumOxygens = 2.0;
     274            3 :         state.dataGenerator->GasPhaseThermoChemistryData(1).MolecularWeight = 44.01;
     275              : 
     276              :         // Nitrogen (N2) Temp (K) 298-6000
     277            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ConstituentName = "Nitrogen";
     278            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ConstituentFormula = "N2";
     279            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).StdRefMolarEnthOfForm = 0.0;
     280            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     281            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateA = 26.092;
     282            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateB = 8.218801;
     283            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateC = -1.976141;
     284            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateD = 0.159274;
     285            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateE = 0.044434;
     286            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateF = -7.98923;
     287            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateG = 221.02;
     288            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).ShomateH = 0.000;
     289            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).NumCarbons = 0.0;
     290            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).NumHydrogens = 0.0;
     291            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).NumOxygens = 0.0;
     292            3 :         state.dataGenerator->GasPhaseThermoChemistryData(2).MolecularWeight = 28.01;
     293              : 
     294              :         // Oxygen (O2) Temp (K) 298-6000
     295            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ConstituentName = "Oxygen";
     296            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ConstituentFormula = "O2";
     297            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).StdRefMolarEnthOfForm = 0.0;
     298            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     299            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateA = 29.659;
     300            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateB = 6.137261;
     301            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateC = -1.186521;
     302            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateD = 0.095780;
     303            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateE = -0.219663;
     304            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateF = -9.861391;
     305            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateG = 237.948;
     306            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).ShomateH = 0.0;
     307            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).NumCarbons = 0.0;
     308            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).NumHydrogens = 0.0;
     309            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).NumOxygens = 2.0;
     310            3 :         state.dataGenerator->GasPhaseThermoChemistryData(3).MolecularWeight = 32.00;
     311              : 
     312              :         // Water (H2O) Temp K 300-1700
     313              :         // need lower temperature range for Shomate coef for Water Vapor..
     314            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ConstituentName = "Water";
     315            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ConstituentFormula = "H2O";
     316            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).StdRefMolarEnthOfForm = -241.8264; // KJ/mol
     317            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     318            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateA = 29.0373;
     319            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateB = 10.2573;
     320            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateC = 2.81048;
     321            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateD = -0.95914;
     322            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateE = 0.11725;
     323            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateF = -250.569;
     324            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateG = 223.3967;
     325            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).ShomateH = -241.8264;
     326            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).NumCarbons = 0.0;
     327            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).NumHydrogens = 2.0;
     328            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).NumOxygens = 1.0;
     329            3 :         state.dataGenerator->GasPhaseThermoChemistryData(4).MolecularWeight = 18.02;
     330              : 
     331              :         // Argon (Ar)  Temp K 298-600
     332              : 
     333            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ConstituentName = "Argon";
     334            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ConstituentFormula = "Ar";
     335            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).StdRefMolarEnthOfForm = 0.0;
     336            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     337            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateA = 20.786;
     338            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateB = 2.825911e-07;
     339            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateC = -1.464191e-07;
     340            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateD = 1.092131e-08;
     341            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateE = -3.661371e-08;
     342            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateF = -6.19735;
     343            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateG = 179.999;
     344            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).ShomateH = 0.0;
     345            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).NumCarbons = 0.0;
     346            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).NumHydrogens = 0.0;
     347            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).NumOxygens = 0.0;
     348            3 :         state.dataGenerator->GasPhaseThermoChemistryData(5).MolecularWeight = 39.95;
     349              : 
     350              :         // Hydrogen (H2) Temp K 298-1000
     351            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ConstituentName = "Hydrogen";
     352            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ConstituentFormula = "H2";
     353            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).StdRefMolarEnthOfForm = 0.0;
     354            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     355            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateA = 33.066178;
     356            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateB = -11.363417;
     357            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateC = 11.432816;
     358            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateD = -2.772874;
     359            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateE = -0.158558;
     360            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateF = -9.980797;
     361            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateG = 172.707974;
     362            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).ShomateH = 0.0;
     363            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).NumCarbons = 0.0;
     364            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).NumHydrogens = 2.0;
     365            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).NumOxygens = 0.0;
     366            3 :         state.dataGenerator->GasPhaseThermoChemistryData(6).MolecularWeight = 2.02;
     367              : 
     368              :         // Methane (CH4) Temp K 298-1300
     369            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ConstituentName = "Methane";
     370            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ConstituentFormula = "CH4";
     371            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).StdRefMolarEnthOfForm = -74.8731; // KJ/mol (Chase 1998)
     372            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     373            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateA = -0.703029;
     374            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateB = 108.4773;
     375            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateC = -42.52157;
     376            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateD = 5.862788;
     377            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateE = 0.678565;
     378            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateF = -76.84376;
     379            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateG = 158.7163;
     380            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).ShomateH = -74.87310;
     381            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).NumCarbons = 1.0;
     382            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).NumHydrogens = 4.0;
     383            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).NumOxygens = 0.0;
     384            3 :         state.dataGenerator->GasPhaseThermoChemistryData(7).MolecularWeight = 16.04;
     385              : 
     386              :         // Ethane (C2H6)
     387            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ConstituentName = "Ethane";
     388            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ConstituentFormula = "C2H6";
     389            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).StdRefMolarEnthOfForm = -83.8605; // -83.8 !KJ/mol (Pittam and Pilcher 1972)
     390            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     391            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateA = -3.03849;
     392            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateB = 199.202;
     393            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateC = -84.9812;
     394            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateD = 11.0348;
     395            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateE = 0.30348;
     396            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateF = -90.0633;
     397            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateG = -999.0;
     398            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).ShomateH = -83.8605;
     399            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NumCarbons = 2.0;
     400            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NumHydrogens = 6.0;
     401            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NumOxygens = 0.0;
     402            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).MolecularWeight = 30.07;
     403            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A1 = 0.14625388e+01;
     404            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A2 = 0.15494667e-01;
     405            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A3 = 0.05780507e-04;
     406            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A4 = -0.12578319e-07;
     407            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A5 = 0.04586267e-10;
     408            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A6 = -0.11239176e+05;
     409            3 :         state.dataGenerator->GasPhaseThermoChemistryData(8).NASA_A7 = 0.14432295e+02;
     410              : 
     411              :         // Propane (C3H8)
     412            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ConstituentName = "Propane";
     413            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ConstituentFormula = "C3H8";
     414            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).StdRefMolarEnthOfForm = -103.855; //  -104.7 !kJ/mol  (Pittam and Pilcher 1972)
     415            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     416            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateA = -23.1747;
     417            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateB = 363.742;
     418            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateC = -222.981;
     419            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateD = 56.253;
     420            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateE = 0.61164;
     421            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateF = -109.206;
     422            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateG = -999.0;
     423            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).ShomateH = -103.855;
     424            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NumCarbons = 3.0;
     425            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NumHydrogens = 8.0;
     426            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NumOxygens = 0.0;
     427            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).MolecularWeight = 44.10;
     428            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A1 = 0.08969208e+01;
     429            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A2 = 0.02668986e+00;
     430            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A3 = 0.05431425e-04;
     431            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A4 = -0.02126000e-06;
     432            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A5 = 0.09243330e-10;
     433            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A6 = -0.13954918e+05;
     434            3 :         state.dataGenerator->GasPhaseThermoChemistryData(9).NASA_A7 = 0.01935533e+03;
     435              : 
     436              :         // Butane (C4H10)
     437            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ConstituentName = "Butane";
     438            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ConstituentFormula = "C4H10";
     439            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).StdRefMolarEnthOfForm = -133.218; // -125.6 !kJ/mol  (Pittam and Pilcher 1972)
     440            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     441            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateA = -5.24343;
     442            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateB = 426.442;
     443            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateC = -257.955;
     444            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateD = 66.535;
     445            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateE = -0.26994;
     446            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateF = -149.365;
     447            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateG = -999.0;
     448            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).ShomateH = -133.218;
     449            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NumCarbons = 4.0;
     450            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NumHydrogens = 10.0;
     451            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NumOxygens = 0.0;
     452            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).MolecularWeight = 58.12;
     453            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A1 = -0.02256618e+02;
     454            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A2 = 0.05881732e+00;
     455            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A3 = -0.04525782e-03;
     456            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A4 = 0.02037115e-06;
     457            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A5 = -0.04079458e-10;
     458            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A6 = -0.01760233e+06;
     459            3 :         state.dataGenerator->GasPhaseThermoChemistryData(10).NASA_A7 = 0.03329595e+03;
     460              : 
     461              :         // Pentane (C5H12)
     462            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ConstituentName = "Pentane";
     463            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ConstituentFormula = "C5H12";
     464            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).StdRefMolarEnthOfForm = -146.348; // -146.8 !kJ/mol (Good 1970)
     465            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     466            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateA = -34.9431;
     467            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateB = 576.777;
     468            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateC = -338.353;
     469            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateD = 76.8232;
     470            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateE = 1.00948;
     471            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateF = -155.348;
     472            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateG = -999.0;
     473            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).ShomateH = -146.348;
     474            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NumCarbons = 5.0;
     475            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NumHydrogens = 12.0;
     476            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NumOxygens = 0.0;
     477            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).MolecularWeight = 72.15;
     478            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A1 = 0.01877907e+02;
     479            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A2 = 0.04121645e+00;
     480            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A3 = 0.12532337e-04;
     481            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A4 = -0.03701536e-06;
     482            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A5 = 0.15255685e-10;
     483            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A6 = -0.02003815e+06;
     484            3 :         state.dataGenerator->GasPhaseThermoChemistryData(11).NASA_A7 = 0.01877256e+03;
     485              : 
     486              :         // Hexane  (C6H14)
     487            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ConstituentName = "Hexane";
     488            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ConstituentFormula = "C6H14";
     489            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).StdRefMolarEnthOfForm = -166.966; // -167.2 !kJ/mol (Prosen and Rossini 1945)
     490            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     491            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateA = -46.7786;
     492            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateB = 711.187;
     493            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateC = -438.39;
     494            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateD = 103.784;
     495            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateE = 1.23887;
     496            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateF = -176.813;
     497            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateG = -999.0;
     498            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).ShomateH = -166.966;
     499            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NumCarbons = 6.0;
     500            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NumHydrogens = 14.0;
     501            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NumOxygens = 0.0;
     502            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).MolecularWeight = 86.18;
     503            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A1 = 0.01836174e+02;
     504            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A2 = 0.05098461e+00;
     505            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A3 = 0.12595857e-04;
     506            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A4 = -0.04428362e-06;
     507            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A5 = 0.01872237e-09;
     508            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A6 = -0.02292749e+06;
     509            3 :         state.dataGenerator->GasPhaseThermoChemistryData(12).NASA_A7 = 0.02088145e+03;
     510              : 
     511              :         // Methanol (CH3OH)
     512              :         // No Shomate coefficients???
     513            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ConstituentName = "Methanol";
     514            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ConstituentFormula = "CH3OH";
     515            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).StdRefMolarEnthOfForm = -201.102; // -201.0 !kJ/mol (Hine and Arata 1976)
     516            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     517            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateA = 14.1952;
     518            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateB = 97.7218;
     519            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateC = -9.73279;
     520            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateD = -12.8461;
     521            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateE = 0.15819;
     522            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateF = -209.037;
     523            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateG = -999.0;
     524            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).ShomateH = -201.102;
     525            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NumCarbons = 1.0;
     526            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NumHydrogens = 4.0;
     527            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NumOxygens = 1.0;
     528            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).MolecularWeight = 32.04;
     529            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A1 = 0.02660115e+02;
     530            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A2 = 0.07341508e-01;
     531            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A3 = 0.07170050e-04;
     532            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A4 = -0.08793194e-07;
     533            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A5 = 0.02390570e-10;
     534            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A6 = -0.02535348e+06;
     535            3 :         state.dataGenerator->GasPhaseThermoChemistryData(13).NASA_A7 = 0.11232631e+02;
     536              : 
     537              :         // Ethanol (C2H5OH)
     538              :         // No Shomate coefficients???
     539            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ConstituentName = "Ethanol";
     540            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ConstituentFormula = "C2H5OH";
     541            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).StdRefMolarEnthOfForm = -234.441; //  -235.3 !kJ/mol (Green 1960)
     542            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ThermoMode = DataGenerators::ThermodynamicMode::NISTShomate;
     543            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateA = -8.87256;
     544            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateB = 282.389;
     545            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateC = -178.85;
     546            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateD = 46.3528;
     547            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateE = 0.48364;
     548            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateF = -241.239;
     549            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateG = -999.0;
     550            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).ShomateH = -234.441;
     551            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NumCarbons = 2.0;
     552            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NumHydrogens = 6.0;
     553            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NumOxygens = 1.0;
     554            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).MolecularWeight = 46.07;
     555            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A1 = 0.18461027e+01;
     556            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A2 = 0.20475008e-01;
     557            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A3 = 0.39904089e-05;
     558            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A4 = -0.16585986e-07;
     559            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A5 = 0.73090440e-11;
     560            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A6 = -0.29663086e+05;
     561            3 :         state.dataGenerator->GasPhaseThermoChemistryData(14).NASA_A7 = 0.17289993e+02;
     562              : 
     563            3 :         if (state.dataGenerator->FuelSupply(FuelSupplyNum).FuelTypeMode == DataGenerators::FuelMode::GaseousConstituents) {
     564              :             // now calculate LHV of fuel for entire simulation
     565              : 
     566              :             // sum over each constituent
     567            3 :             Real64 O2Stoic = 0.0;      // stochiometric oxygen coef in chemical equation (15)
     568            3 :             Real64 CO2ProdStoic = 0.0; // product gases carbon dioxide coeff
     569            3 :             Real64 H2OProdStoic = 0.0; // product gases water coeff
     570            3 :             int CO2dataID = 1;         // hard-coded above
     571            3 :             int WaterDataID = 4;       // hard-coded above
     572              :             // Loop over fuel constituents and do one-time setup
     573           27 :             for (int i = 1; i <= state.dataGenerator->FuelSupply(FuelSupplyNum).NumConstituents; ++i) {
     574              : 
     575           24 :                 std::string const &thisName = state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitName(i);
     576           24 :                 int thisGasID = Util::FindItem(
     577           24 :                     thisName, state.dataGenerator->GasPhaseThermoChemistryData, &DataGenerators::GasPropertyDataStruct::ConstituentName);
     578           24 :                 state.dataGenerator->FuelSupply(FuelSupplyNum).GasLibID(i) = thisGasID;
     579              : 
     580           24 :                 if (thisGasID == 0) {
     581            0 :                     ShowSevereError(state, format("Fuel constituent not found in thermochemistry data: {}", thisName));
     582            0 :                     ErrorsFound = true;
     583              :                 }
     584              : 
     585              :                 // for this fuel mixture, figure stoichiometric oxygen requirement
     586           24 :                 O2Stoic += state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i) *
     587           24 :                            (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumCarbons +
     588           24 :                             state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens / 4.0 -
     589           24 :                             state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumOxygens / 2.0);
     590              :                 // for this fuel mixture, figure stoichiometric Carbon Dioxide in Product Gases
     591              : 
     592           24 :                 CO2ProdStoic += state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i) *
     593           24 :                                 state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumCarbons;
     594              : 
     595           24 :                 H2OProdStoic += state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i) *
     596           24 :                                 state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens / 2.0;
     597              :             }
     598              : 
     599            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).StoicOxygenRate = O2Stoic;
     600            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).CO2ProductGasCoef = CO2ProdStoic;
     601            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).H2OProductGasCoef = H2OProdStoic;
     602              : 
     603              :             // Calculate LHV for an NdotFuel of 1.0
     604            3 :             Real64 LHVfuel = 0.0;
     605              :             Real64 LHVi; // working var for lower heating value calc
     606           27 :             for (int i = 1; i <= state.dataGenerator->FuelSupply(FuelSupplyNum).NumConstituents; ++i) {
     607           24 :                 int thisGasID = state.dataGenerator->FuelSupply(FuelSupplyNum).GasLibID(i);
     608           24 :                 if (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens == 0.0) {
     609            9 :                     LHVi = 0.0;
     610              :                 } else {
     611           15 :                     LHVi = state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).StdRefMolarEnthOfForm -
     612           15 :                            state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumCarbons *
     613           15 :                                state.dataGenerator->GasPhaseThermoChemistryData(CO2dataID).StdRefMolarEnthOfForm -
     614           15 :                            (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens / 2.0) *
     615           15 :                                state.dataGenerator->GasPhaseThermoChemistryData(WaterDataID).StdRefMolarEnthOfForm;
     616              :                 }
     617           24 :                 LHVfuel += LHVi * state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i);
     618              :             }
     619            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).LHV = LHVfuel;
     620              : 
     621              :             // Calculate HHV for an NdotFuel of 1.0
     622            3 :             Real64 HHVfuel = 0.0;
     623              :             Real64 HHVi; // working var for higher heating value calc
     624           27 :             for (int i = 1; i <= state.dataGenerator->FuelSupply(FuelSupplyNum).NumConstituents; ++i) {
     625           24 :                 int thisGasID = state.dataGenerator->FuelSupply(FuelSupplyNum).GasLibID(i);
     626           24 :                 if (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens == 0.0) {
     627            9 :                     HHVi = 0.0;
     628              :                 } else {
     629           15 :                     HHVi = state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).StdRefMolarEnthOfForm -
     630           15 :                            state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumCarbons *
     631           15 :                                state.dataGenerator->GasPhaseThermoChemistryData(CO2dataID).StdRefMolarEnthOfForm -
     632           15 :                            (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens / 2.0) *
     633           15 :                                state.dataGenerator->GasPhaseThermoChemistryData(WaterDataID).StdRefMolarEnthOfForm +
     634           15 :                            (state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).NumHydrogens / 2.0) *
     635           15 :                                (state.dataGenerator->GasPhaseThermoChemistryData(WaterDataID).StdRefMolarEnthOfForm + 285.8304);
     636              :                 }
     637           24 :                 HHVfuel += HHVi * state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i);
     638              :             }
     639              : 
     640              :             // Calculate Molecular Weight for this fuel
     641            3 :             Real64 MWfuel = 0.0;
     642           27 :             for (int i = 1; i <= state.dataGenerator->FuelSupply(FuelSupplyNum).NumConstituents; ++i) {
     643           24 :                 int thisGasID = state.dataGenerator->FuelSupply(FuelSupplyNum).GasLibID(i);
     644           24 :                 MWfuel += state.dataGenerator->FuelSupply(FuelSupplyNum).ConstitMolalFract(i) *
     645           24 :                           state.dataGenerator->GasPhaseThermoChemistryData(thisGasID).MolecularWeight;
     646              :             }
     647            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).MW = MWfuel;
     648            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).KmolPerSecToKgPerSec = MWfuel;      // TODO check this, guessing on conversion...
     649            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).HHV = 1000000.0 * HHVfuel / MWfuel; // (1000/k) (1000/k) (kJ/mol)/(g/mol) = J/kg
     650            3 :             state.dataGenerator->FuelSupply(FuelSupplyNum).LHVJperkg =
     651            3 :                 state.dataGenerator->FuelSupply(FuelSupplyNum).LHV * 1000000.0 / state.dataGenerator->FuelSupply(FuelSupplyNum).MW;
     652              : 
     653            0 :         } else if (state.dataGenerator->FuelSupply(FuelSupplyNum).FuelTypeMode == DataGenerators::FuelMode::GenericLiquid) {
     654            0 :             state.dataGenerator->FuelSupply(FuelSupplyNum).LHV = state.dataGenerator->FuelSupply(FuelSupplyNum).LHVliquid *
     655            0 :                                                                  state.dataGenerator->FuelSupply(FuelSupplyNum).MW /
     656              :                                                                  1000000.0; // J/kg * g/mol (k/1000) (k/10000)
     657              : 
     658              :         } else {
     659              :         }
     660              : 
     661              :         // report Heating Values in EIO.
     662            3 :         print(state.files.eio,
     663              :               "! <Fuel Supply>, Fuel Supply Name, Lower Heating Value [J/kmol], Lower Heating Value [kJ/kg], Higher "
     664              :               "Heating Value [KJ/kg],  Molecular Weight [g/mol] \n");
     665              :         static constexpr std::string_view Format_501(" Fuel Supply, {},{:13.6N},{:13.6N},{:13.6N},{:13.6N}\n");
     666            3 :         print(state.files.eio,
     667              :               Format_501,
     668            3 :               state.dataGenerator->FuelSupply(FuelSupplyNum).Name,
     669            3 :               state.dataGenerator->FuelSupply(FuelSupplyNum).LHV * 1000000.0,
     670            3 :               state.dataGenerator->FuelSupply(FuelSupplyNum).LHVJperkg / 1000.0,
     671            3 :               state.dataGenerator->FuelSupply(FuelSupplyNum).HHV / 1000.0,
     672            3 :               state.dataGenerator->FuelSupply(FuelSupplyNum).MW);
     673            3 :     }
     674              : 
     675              : } // namespace GeneratorFuelSupply
     676              : 
     677              : } // namespace EnergyPlus
        

Generated by: LCOV version 2.0-1