From 76a9587ead001ce621077f675809001a5df41a07 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Wed, 28 Aug 2019 12:50:59 -0400 Subject: [PATCH 1/9] Simplified moist air specific heat calc function --- src/EnergyPlus/Psychrometrics.hh | 31 ++++++++----------- .../unit/EvaporativeCoolers.unit.cc | 19 ++++++------ 2 files changed, 22 insertions(+), 28 deletions(-) diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 355e9d34eb1..6b498653463 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -334,8 +334,8 @@ namespace Psychrometrics { return 1.00484e3 * TDB + dW * (2.50094e6 + 1.85895e3 * TDB); // enthalpy {J/kg} } - inline Real64 PsyCpAirFnWTdb(Real64 const dw, // humidity ratio {kgWater/kgDryAir} - Real64 const T // input temperature {Celsius} + inline Real64 PsyCpAirFnWTdb(Real64 const dw, // humidity ratio {kgWater/kgDryAir} + Real64 const EP_UNUSED(T) // input temperature {Celsius} ) { // FUNCTION INFORMATION: @@ -356,26 +356,24 @@ namespace Psychrometrics { // Static locals static Real64 dwSave(-100.0); - static Real64 Tsave(-100.0); static Real64 cpaSave(-100.0); // check if last call had the same input and if it did just use the saved output - if ((Tsave == T) && (dwSave == dw)) return cpaSave; + if (dwSave == dw) return cpaSave; // compute heat capacity of air Real64 const w(max(dw, 1.0e-5)); - Real64 const cpa((PsyHFnTdbW(T + 0.1, w) - PsyHFnTdbW(T, w)) * 10.0); // result => heat capacity of air {J/kg-C} + Real64 const cpa((1.00484e3 + w * 1.85895e3)); // result => heat capacity of moist air {J/kg-C} // save values for next call dwSave = dw; - Tsave = T; cpaSave = cpa; return cpa; } - inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw, // humidity ratio {kgWater/kgDryAir} - Real64 const T // input temperature {Celsius} + inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw, // humidity ratio {kgWater/kgDryAir} + Real64 const EP_UNUSED(T) // input temperature {Celsius} ) { // Faster version with humidity ratio already adjusted @@ -383,18 +381,16 @@ namespace Psychrometrics { // Static locals static Real64 dwSave(-100.0); - static Real64 Tsave(-100.0); static Real64 cpaSave(-100.0); // check if last call had the same input and if it did just use the saved output - if ((Tsave == T) && (dwSave == dw)) return cpaSave; + if (dwSave == dw) return cpaSave; // compute heat capacity of air - Real64 const cpa((PsyHFnTdbW_fast(T + 0.1, dw) - PsyHFnTdbW_fast(T, dw)) * 10.0); // result => heat capacity of air {J/kg-C} + Real64 const cpa((1.00484e3 + dw * 1.85895e3)); // result => heat capacity of moist air {J/kg-C} // save values for next call dwSave = dw; - Tsave = T; cpaSave = cpa; return cpa; @@ -680,8 +676,7 @@ namespace Psychrometrics { // FUNCTION LOCAL VARIABLE DECLARATIONS: - Int64 const Tdb_tag( - bit_shift(bit_transfer(T, Grid_Shift), -Grid_Shift)); // Note that 2nd arg to TRANSFER is not used: Only type matters + Int64 const Tdb_tag(bit_shift(bit_transfer(T, Grid_Shift), -Grid_Shift)); // Note that 2nd arg to TRANSFER is not used: Only type matters // Int64 const hash( bit::bit_and( Tdb_tag, psatcache_mask ) ); //Tuned Replaced by below Int64 const hash(Tdb_tag & psatcache_mask); auto &cPsat(cached_Psat(hash)); @@ -1180,9 +1175,9 @@ namespace Psychrometrics { } inline Real64 PsyDeltaHSenFnTdb2W2Tdb1W1(Real64 const TDB2, // dry-bulb temperature at state 2 {C} - Real64 const dW2, // humidity ratio at at state 2 - Real64 const TDB1, // dry-bulb temperature at at state 1 {C} - Real64 const dW1 // humidity ratio at state 1 + Real64 const dW2, // humidity ratio at at state 2 + Real64 const TDB1, // dry-bulb temperature at at state 1 {C} + Real64 const dW1 // humidity ratio at state 1 ) { // returns sensible enthalpy difference of moist air going from state 1 to state 2 @@ -1191,7 +1186,7 @@ namespace Psychrometrics { } inline Real64 PsyHfgAvgFnTdb2Tdb1(Real64 const TDB2, // dry-bulb temperature at at state 2 {C} - Real64 const TDB1 // dry-bulb temperature at at state 1 {C} + Real64 const TDB1 // dry-bulb temperature at at state 1 {C} ) { // calculate average latent heat of vaporization of water vapor in moist air diff --git a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc index 1e97749d7ad..0e095ef5414 100644 --- a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc @@ -51,6 +51,7 @@ #include // EnergyPlus Headers +#include #include #include #include @@ -59,7 +60,6 @@ #include #include #include -#include #include #include "Fixtures/EnergyPlusFixture.hh" @@ -870,7 +870,7 @@ TEST_F(EnergyPlusFixture, DirectEvapCoolerAutosizeWithoutSysSizingRunDone) TEST_F(EnergyPlusFixture, EvapCoolerAirLoopPumpCycling) { - + bool ErrorsFound = false; std::string const idf_objects = delimited_string({ @@ -891,7 +891,7 @@ TEST_F(EnergyPlusFixture, EvapCoolerAirLoopPumpCycling) EvaporativeCoolers::GetEvapInput(); ASSERT_FALSE(ErrorsFound); - + int AirLoopNum = 1; int EvapCoolNum = 1; int Evap_Cooler_CompType = 18; @@ -902,21 +902,20 @@ TEST_F(EnergyPlusFixture, EvapCoolerAirLoopPumpCycling) DataAirLoop::AirLoopControlInfo.allocate(AirLoopNum); DataAirLoop::AirLoopFlow(1).FanPLR = 0.8; - //Evap cooler conditions + // Evap cooler conditions DataLoopNode::Node(EvapCond(EvapCoolNum).InletNode).MassFlowRate = 0.5; DataLoopNode::Node(EvapCond(EvapCoolNum).InletNode).Temp = 28.0; DataLoopNode::Node(EvapCond(EvapCoolNum).InletNode).HumRat = 0.001; DataLoopNode::Node(EvapCond(EvapCoolNum).InletNode).Press = DataEnvironment::OutBaroPress; DataGlobals::BeginEnvrnFlag = true; - - //Simulate air loop component calls SimEvapCooler - //SimEvapCooler calls InitEvapCooler(EvapCoolNum) and CalcDirectEvapCooler + + // Simulate air loop component calls SimEvapCooler + // SimEvapCooler calls InitEvapCooler(EvapCoolNum) and CalcDirectEvapCooler SimAirServingZones::SimAirLoopComponent(EvapCond(EvapCoolNum).EvapCoolerName, Evap_Cooler_CompType, false, AirLoopNum, EvapCoolNum, 0); - - //air loop FanPLR successfully passed for pump power calculation - EXPECT_EQ(EvapCond(EvapCoolNum).EvapCoolerPower, 60 * 0.8); + // air loop FanPLR successfully passed for pump power calculation + EXPECT_EQ(EvapCond(EvapCoolNum).EvapCoolerPower, 60 * 0.8); } } // namespace EnergyPlus From db12381742707544ca78f76f7485f0709a2f0616 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Thu, 29 Aug 2019 14:47:09 -0400 Subject: [PATCH 2/9] modified uni tests for tiny diffs, on the order of e-10 --- .../unit/EvaporativeCoolers.unit.cc | 4 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 83 ++++++++++--------- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 18 ++-- 3 files changed, 54 insertions(+), 51 deletions(-) diff --git a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc index 0e095ef5414..ae9dfcc5485 100644 --- a/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc +++ b/tst/EnergyPlus/unit/EvaporativeCoolers.unit.cc @@ -109,7 +109,7 @@ TEST_F(EnergyPlusFixture, EvapCoolers_SecondaryAirOutletCondition) CalcSecondaryAirOutletCondition(EvapCoolNum, OperatingMode, AirMassFlowSec, EDBTSec, EWBTSec, EHumRatSec, QHXTotal, QHXLatent); // check outputs for dry operating condition - EXPECT_DOUBLE_EQ(25.0, EvapCond(EvapCoolNum).SecOutletTemp); + EXPECT_NEAR(25.0, EvapCond(EvapCoolNum).SecOutletTemp, 0.000001); EXPECT_DOUBLE_EQ(0.0, QHXLatent); // wet operating mode and non zero secondary air flow rate @@ -357,7 +357,7 @@ TEST_F(EnergyPlusFixture, EvaporativeCoolers_CalcSecondaryAirOutletCondition) EvapCoolNum, OperatingMode, AirMassFlowSec, EDBTSec, EWBTSec, EHumRatSec, QHXTotal, QHXLatent); // check outputs for dry operating condition - EXPECT_DOUBLE_EQ(25.0, EvaporativeCoolers::EvapCond(EvapCoolNum).SecOutletTemp); + EXPECT_NEAR(25.0, EvaporativeCoolers::EvapCond(EvapCoolNum).SecOutletTemp, 0.000001); EXPECT_DOUBLE_EQ(0.0, QHXLatent); // wet operating mode and non zero secondary air flow rate diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index b54bc250549..ab0cb3fccc5 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -7606,7 +7606,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SupplementalHeatingCoilCapacityLimitTest) Real64 SuppHeatCoilCapMax = thisVRFTU.HeatingCoilCapacityLimit(thisVRFTU.SuppHeatCoilAirInletNode, thisVRFTU.SuppHeatCoilAirOutletNode, thisVRFTU.MaxSATFromSuppHeatCoil); - EXPECT_EQ(ExpectedResult, SuppHeatCoilCapMax); + EXPECT_NEAR(ExpectedResult, SuppHeatCoilCapMax, 0.0001); } TEST_F(EnergyPlusFixture, VRFFluidControl_FanSysModel_OnOffModeTest) @@ -9868,7 +9868,7 @@ TEST_F(EnergyPlusFixture, VRFFluidControl_FanSysModel_OnOffModeTest) " , !- Zone Equipment 1 Sequential Cooling Load Fraction", " ; !- Zone Equipment 1 Sequential Heating Load Fraction", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); SimulationManager::ManageSimulation(); @@ -10462,7 +10462,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) " 1.5, !- Maximum Curve Output", " Temperature, !- Input Unit Type for X", " Dimensionless; !- Output Unit Type", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -10506,7 +10506,8 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = + Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -10528,7 +10529,8 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF( + VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); @@ -10546,7 +10548,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) EXPECT_NEAR(368.1510, thisFan.FanPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan.FanPower), 0.0001); } - + TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) { // PURPOSE OF THIS TEST: @@ -10765,35 +10767,35 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " Dimensionless; !- Output Unit Type ", "Zone,", - " SPACE1-1, !- Name", - " 0, !- Direction of Relative North {deg}", - " 0, !- X Origin {m}", - " 0, !- Y Origin {m}", - " 0, !- Z Origin {m}", - " 1, !- Type", - " 1, !- Multiplier", - " 2.438400269, !- Ceiling Height {m}", - " 239.247360229; !- Volume {m3}", - - "ZoneHVAC:EquipmentConnections,", - " SPACE1-1, !- Zone Name", - " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", - " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", - " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", - " SPACE1-1 Node, !- Zone Air Node Name", - " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file - - "ZoneHVAC:EquipmentList,", - " SPACE1-1 Eq, !- Name", - " SequentialLoad, !- Load Distribution Scheme", - " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", - " TU1, !- Zone Equipment 1 Name", - " 1, !- Zone Equipment 1 Cooling Sequence", - " 1; !- Zone Equipment 1 Heating or No-Load Sequence", - - "ZoneTerminalUnitList,", - " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", - " TU1; !- Zone Terminal Unit Name 1", + " SPACE1-1, !- Name", + " 0, !- Direction of Relative North {deg}", + " 0, !- X Origin {m}", + " 0, !- Y Origin {m}", + " 0, !- Z Origin {m}", + " 1, !- Type", + " 1, !- Multiplier", + " 2.438400269, !- Ceiling Height {m}", + " 239.247360229; !- Volume {m3}", + + "ZoneHVAC:EquipmentConnections,", + " SPACE1-1, !- Zone Name", + " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", + " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", + " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", + " SPACE1-1 Node, !- Zone Air Node Name", + " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file + + "ZoneHVAC:EquipmentList,", + " SPACE1-1 Eq, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", + " TU1, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1; !- Zone Equipment 1 Heating or No-Load Sequence", + + "ZoneTerminalUnitList,", + " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", + " TU1; !- Zone Terminal Unit Name 1", "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,", " TU1, !- Zone Terminal Unit Name", @@ -10901,7 +10903,6 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " TU1 Outlet Node, !- Air Outlet Node Name", " General; !- End-Use Subcategory", - " !- =========== ALL OBJECTS IN CLASS: FLUIDPROPERTIES:NAME =========== ", " ", " FluidProperties:Name, ", @@ -12170,7 +12171,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " 0.0000E+00,3.1758E+02; ", " ", " !*************************************************************************** ", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -12212,11 +12213,12 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) Node(thisZoneEquip.ZoneNode).Temp = 24.0; Node(thisZoneEquip.ZoneNode).HumRat = 0.0075; Node(thisZoneEquip.ZoneNode).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisZoneEquip.ZoneNode).Temp, Node(thisZoneEquip.ZoneNode).HumRat); - + auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = + Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -12239,7 +12241,8 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF( + VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index adbc1df696e..d825547c826 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -3318,11 +3318,11 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) thisSys.sizeUnitarySystem(FirstHVACIteration, AirLoopNum); - EXPECT_EQ(1.005, thisSys.m_DesignFanVolFlowRate); - EXPECT_EQ(1.005, thisSys.m_MaxCoolAirVolFlow); + EXPECT_NEAR(1.005, thisSys.m_DesignFanVolFlowRate, 0.0000000001); + EXPECT_NEAR(1.005, thisSys.m_MaxCoolAirVolFlow, 0.0000000001); EXPECT_EQ(1.005, thisSys.m_MaxHeatAirVolFlow); EXPECT_EQ(1.005, thisSys.m_MaxNoCoolHeatAirVolFlow); - EXPECT_EQ(15148.243236712493, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad); + EXPECT_NEAR(15148.243236712493, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad, 0.0000000001); } // #6200 defect file shows fan flow rate when cooling coil is off and no cooling coil exists. Allow user to set flow rate = 0 when coil does not @@ -3341,7 +3341,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) EXPECT_EQ(0.0, thisSys.m_MaxCoolAirVolFlow); EXPECT_EQ(1.005, thisSys.m_MaxHeatAirVolFlow); EXPECT_EQ(1.005, thisSys.m_MaxNoCoolHeatAirVolFlow); - EXPECT_EQ(15148.243236712493, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad); + EXPECT_NEAR(15148.243236712493, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad, 0.0000000001); // continue with unit testing of cooling and heating system thisSys.m_CoolCoilExists = true; @@ -3393,12 +3393,12 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ConfirmUnitarySystemSizingTest) thisSys.sizeUnitarySystem(FirstHVACIteration, AirLoopNum); - EXPECT_EQ(1.005, thisSys.m_DesignFanVolFlowRate); - EXPECT_EQ(1.005, thisSys.m_MaxCoolAirVolFlow); - EXPECT_EQ(1.005, thisSys.m_MaxHeatAirVolFlow); - EXPECT_EQ(1.005, thisSys.m_MaxNoCoolHeatAirVolFlow); + EXPECT_NEAR(1.005, thisSys.m_DesignFanVolFlowRate, 0.0000000001); + EXPECT_NEAR(1.005, thisSys.m_MaxCoolAirVolFlow, 0.0000000001); + EXPECT_NEAR(1.005, thisSys.m_MaxHeatAirVolFlow, 0.0000000001); + EXPECT_NEAR(1.005, thisSys.m_MaxNoCoolHeatAirVolFlow, 0.0000000001); EXPECT_EQ(18827.616766698276, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesCoolingLoad); - EXPECT_EQ(1431.9234900374995, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad); + EXPECT_NEAR(1431.9234900374995, DataSizing::ZoneEqSizing(DataSizing::CurZoneEqNum).DesHeatingLoad, 0.0000000001); } } From e22036f40533cdcae45755a97fba594f41be4388 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Mon, 9 Sep 2019 08:52:14 -0400 Subject: [PATCH 3/9] cleanup --- .../unit/HVACVariableRefrigerantFlow.unit.cc | 81 +++++++++---------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index ab0cb3fccc5..afb511fcafb 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -9868,7 +9868,7 @@ TEST_F(EnergyPlusFixture, VRFFluidControl_FanSysModel_OnOffModeTest) " , !- Zone Equipment 1 Sequential Cooling Load Fraction", " ; !- Zone Equipment 1 Sequential Heating Load Fraction", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); SimulationManager::ManageSimulation(); @@ -10462,7 +10462,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) " 1.5, !- Maximum Curve Output", " Temperature, !- Input Unit Type for X", " Dimensionless; !- Output Unit Type", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -10506,8 +10506,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = - Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -10529,8 +10528,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF( - VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); @@ -10548,7 +10546,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) EXPECT_NEAR(368.1510, thisFan.FanPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan.FanPower), 0.0001); } - + TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) { // PURPOSE OF THIS TEST: @@ -10767,35 +10765,35 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " Dimensionless; !- Output Unit Type ", "Zone,", - " SPACE1-1, !- Name", - " 0, !- Direction of Relative North {deg}", - " 0, !- X Origin {m}", - " 0, !- Y Origin {m}", - " 0, !- Z Origin {m}", - " 1, !- Type", - " 1, !- Multiplier", - " 2.438400269, !- Ceiling Height {m}", - " 239.247360229; !- Volume {m3}", - - "ZoneHVAC:EquipmentConnections,", - " SPACE1-1, !- Zone Name", - " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", - " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", - " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", - " SPACE1-1 Node, !- Zone Air Node Name", - " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file - - "ZoneHVAC:EquipmentList,", - " SPACE1-1 Eq, !- Name", - " SequentialLoad, !- Load Distribution Scheme", - " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", - " TU1, !- Zone Equipment 1 Name", - " 1, !- Zone Equipment 1 Cooling Sequence", - " 1; !- Zone Equipment 1 Heating or No-Load Sequence", - - "ZoneTerminalUnitList,", - " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", - " TU1; !- Zone Terminal Unit Name 1", + " SPACE1-1, !- Name", + " 0, !- Direction of Relative North {deg}", + " 0, !- X Origin {m}", + " 0, !- Y Origin {m}", + " 0, !- Z Origin {m}", + " 1, !- Type", + " 1, !- Multiplier", + " 2.438400269, !- Ceiling Height {m}", + " 239.247360229; !- Volume {m3}", + + "ZoneHVAC:EquipmentConnections,", + " SPACE1-1, !- Zone Name", + " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", + " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", + " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", + " SPACE1-1 Node, !- Zone Air Node Name", + " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file + + "ZoneHVAC:EquipmentList,", + " SPACE1-1 Eq, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", + " TU1, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1; !- Zone Equipment 1 Heating or No-Load Sequence", + + "ZoneTerminalUnitList,", + " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", + " TU1; !- Zone Terminal Unit Name 1", "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,", " TU1, !- Zone Terminal Unit Name", @@ -10903,6 +10901,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " TU1 Outlet Node, !- Air Outlet Node Name", " General; !- End-Use Subcategory", + " !- =========== ALL OBJECTS IN CLASS: FLUIDPROPERTIES:NAME =========== ", " ", " FluidProperties:Name, ", @@ -12171,7 +12170,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " 0.0000E+00,3.1758E+02; ", " ", " !*************************************************************************** ", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -12213,12 +12212,11 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) Node(thisZoneEquip.ZoneNode).Temp = 24.0; Node(thisZoneEquip.ZoneNode).HumRat = 0.0075; Node(thisZoneEquip.ZoneNode).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisZoneEquip.ZoneNode).Temp, Node(thisZoneEquip.ZoneNode).HumRat); - + auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = - Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -12241,8 +12239,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF( - VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); From 28c5c4c4fa8d8f3925888e886e2502094b286b5e Mon Sep 17 00:00:00 2001 From: Nigusse Date: Mon, 4 Nov 2019 13:06:46 -0500 Subject: [PATCH 4/9] Removed unused argument --- .../include/AirflowNetwork/Properties.hpp | 4 +- .../AirflowNetworkBalanceManager.cc | 166 ++-- src/EnergyPlus/BaseboardElectric.cc | 2 +- src/EnergyPlus/BaseboardRadiator.cc | 2 +- src/EnergyPlus/ChillerElectricEIR.cc | 2 +- src/EnergyPlus/ChillerExhaustAbsorption.cc | 4 +- src/EnergyPlus/CondenserLoopTowers.cc | 2 +- src/EnergyPlus/ConvectionCoefficients.cc | 796 ++++++++---------- src/EnergyPlus/CoolTower.cc | 2 +- src/EnergyPlus/DataSurfaces.cc | 2 +- src/EnergyPlus/DesiccantDehumidifiers.cc | 32 +- src/EnergyPlus/DisplacementVentMgr.cc | 10 +- src/EnergyPlus/DualDuct.cc | 39 +- src/EnergyPlus/EarthTube.cc | 4 +- src/EnergyPlus/ElectricBaseboardRadiator.cc | 10 +- src/EnergyPlus/EvaporativeCoolers.cc | 18 +- src/EnergyPlus/EvaporativeFluidCoolers.cc | 2 +- src/EnergyPlus/Fans.cc | 2 +- src/EnergyPlus/FluidCoolers.cc | 2 +- src/EnergyPlus/Furnaces.cc | 60 +- src/EnergyPlus/GeneralRoutines.cc | 54 +- src/EnergyPlus/HVACCooledBeam.cc | 7 +- src/EnergyPlus/HVACFan.cc | 16 +- src/EnergyPlus/HVACFourPipeBeam.cc | 22 +- src/EnergyPlus/HVACManager.cc | 20 +- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 7 +- src/EnergyPlus/HVACSingleDuctInduc.cc | 8 +- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 20 +- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 14 +- src/EnergyPlus/HWBaseboardRadiator.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 94 ++- src/EnergyPlus/HeatRecovery.cc | 28 +- src/EnergyPlus/HeatingCoils.cc | 17 +- src/EnergyPlus/HybridEvapCoolingModel.cc | 18 +- src/EnergyPlus/InternalHeatGains.cc | 69 +- .../MicroturbineElectricGenerator.cc | 189 ++--- src/EnergyPlus/MixedAir.cc | 2 +- src/EnergyPlus/MundtSimMgr.cc | 4 +- src/EnergyPlus/NodeInputManager.cc | 12 +- src/EnergyPlus/OutdoorAirUnit.cc | 14 +- src/EnergyPlus/PackagedTerminalHeatPump.cc | 4 +- .../PhotovoltaicThermalCollectors.cc | 14 +- src/EnergyPlus/PlantChillers.cc | 16 +- src/EnergyPlus/PondGroundHeatExchanger.cc | 2 +- src/EnergyPlus/PoweredInductionUnits.cc | 10 +- src/EnergyPlus/Psychrometrics.hh | 10 +- src/EnergyPlus/PurchasedAirManager.cc | 38 +- src/EnergyPlus/RefrigeratedCase.cc | 364 ++++---- src/EnergyPlus/ReportCoilSelection.cc | 6 +- src/EnergyPlus/ReportSizingManager.cc | 67 +- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 14 +- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 2 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 10 +- src/EnergyPlus/SetPointManager.cc | 79 +- src/EnergyPlus/SimAirServingZones.cc | 34 +- src/EnergyPlus/SingleDuct.cc | 22 +- src/EnergyPlus/SteamCoils.cc | 14 +- src/EnergyPlus/ThermalChimney.cc | 6 +- src/EnergyPlus/TranspiredCollector.cc | 15 +- src/EnergyPlus/UFADManager.cc | 12 +- src/EnergyPlus/UnitHeater.cc | 10 +- src/EnergyPlus/UnitVentilator.cc | 90 +- src/EnergyPlus/UnitarySystem.cc | 51 +- src/EnergyPlus/UserDefinedComponents.cc | 18 +- src/EnergyPlus/VariableSpeedCoils.cc | 16 +- src/EnergyPlus/VentilatedSlab.cc | 22 +- src/EnergyPlus/WaterCoils.cc | 89 +- src/EnergyPlus/WaterThermalTanks.cc | 231 ++--- src/EnergyPlus/WaterToAirHeatPump.cc | 4 +- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 25 +- src/EnergyPlus/WindowAC.cc | 2 +- src/EnergyPlus/WindowComplexManager.cc | 8 +- src/EnergyPlus/WindowEquivalentLayer.cc | 4 +- src/EnergyPlus/WindowManager.cc | 147 ++-- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 4 +- .../ZoneContaminantPredictorCorrector.cc | 2 +- src/EnergyPlus/ZoneDehumidifier.cc | 41 +- src/EnergyPlus/ZoneEquipmentManager.cc | 24 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 54 +- ...alSingleDuctConstantVolumeNoReheat.unit.cc | 3 +- .../unit/DesiccantDehumidifiers.unit.cc | 12 +- .../unit/HVACHXAssistedCoolingCoil.unit.cc | 6 +- .../unit/OASystemHWPreheatCoil.unit.cc | 7 +- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 12 +- .../unit/RoomAirflowNetwork.unit.cc | 6 +- tst/EnergyPlus/unit/SetPointManager.unit.cc | 186 ++-- tst/EnergyPlus/unit/SingleDuct.unit.cc | 3 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 35 +- tst/EnergyPlus/unit/WaterCoils.unit.cc | 11 +- 89 files changed, 1788 insertions(+), 1852 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp index f73db988358..b2f9afe64e6 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp @@ -51,7 +51,7 @@ #ifndef AIRDENSITY #include "../../../Psychrometrics.hh" #define AIRDENSITY(P, T, W) Psychrometrics::PsyRhoAirFnPbTdbW(P, T, W) -#define AIRCP(W, T) Psychrometrics::PsyCpAirFnWTdb(W, T) +#define AIRCP(W, T) Psychrometrics::PsyCpAirFnWTdb(W) #else // Need a fallback #endif @@ -64,7 +64,7 @@ #ifndef TOKELVIN #include "../../../DataGlobals.hh" -#define TOKELVIN(T) (T+DataGlobals::KelvinConv) +#define TOKELVIN(T) (T + DataGlobals::KelvinConv) #else // Need a fallback #endif diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 35f8535d472..9b5e30ee5f4 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -234,12 +234,12 @@ namespace AirflowNetworkBalanceManager { // MODULE VARIABLE DECLARATIONS: - namespace { + namespace { // These are purposefully not in the header file as an extern variable. No one outside of this should // use these. They are cleared by clear_state() for use by unit tests, but normal simulations should be unaffected. // This is purposefully in an anonymous namespace so nothing outside this implementation file can use it. bool ValidateDistributionSystemFlag(true); - } + } // namespace // Report variables Array1D PZ; @@ -6391,7 +6391,7 @@ namespace AirflowNetworkBalanceManager { std::vector dirs30 = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360}; std::vector dirs30Axes; - dirs30Axes.emplace_back(dirs30, Btwxt::Method::LINEAR, Btwxt::Method::LINEAR, std::pair {0.0, 360.0}); + dirs30Axes.emplace_back(dirs30, Btwxt::Method::LINEAR, Btwxt::Method::LINEAR, std::pair{0.0, 360.0}); auto dirs30GridIndex = CurveManager::btwxtManager.addGrid("30 Degree Increments", Btwxt::GriddedData(dirs30Axes)); @@ -6537,7 +6537,7 @@ namespace AirflowNetworkBalanceManager { 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290, 300, 310, 320, 330, 340, 350, 360}; std::vector dirs10Axes; - dirs10Axes.emplace_back(dirs10, Btwxt::Method::LINEAR, Btwxt::Method::LINEAR, std::pair {0.0, 360.0}); + dirs10Axes.emplace_back(dirs10, Btwxt::Method::LINEAR, Btwxt::Method::LINEAR, std::pair{0.0, 360.0}); auto dirs10GridIndex = CurveManager::btwxtManager.addGrid("10 Degree Increments", Btwxt::GriddedData(dirs10Axes)); @@ -6822,10 +6822,7 @@ namespace AirflowNetworkBalanceManager { CompName = AirflowNetworkCompData(CompNum).EPlusName; CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[0]).WZ + AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[1]).WZ) / - 2.0, - (AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[0]).TZ + - AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[1]).TZ) / - 2.0); + 2.0); // Calculate duct conduction loss if (CompTypeNum == CompTypeNum_DWC && CompName == BlankString) { // Duct element only TypeNum = AirflowNetworkCompData(CompNum).TypeNum; @@ -7167,7 +7164,7 @@ namespace AirflowNetworkBalanceManager { LT = AirflowNetworkLinkageData(i).NodeNums[0]; load = Node(NF).Temp - Node(NT).Temp; } - CpAir = PsyCpAirFnWTdb(Node(NT).HumRat, Node(NT).Temp); + CpAir = PsyCpAirFnWTdb(Node(NT).HumRat); MV(LT) += AirflowNetworkLinkSimu(i).FLOW * CpAir * load; } } @@ -8290,10 +8287,10 @@ namespace AirflowNetworkBalanceManager { if (Surface(MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { Tamb = Surface(MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; CpAir = PsyCpAirFnWTdb( - Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress), Tamb); + Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); } else { Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); } hfg = Psychrometrics::PsyHfgAirFnWTdb(ZoneAirHumRat(ZN1), (MAT(ZN1) + Tamb) / 2.0); @@ -8307,7 +8304,8 @@ namespace AirflowNetworkBalanceManager { (AirflowNetworkLinkSimu(i).FLOW2 * CpAir * (MAT(ZN1) - Tamb)) * ReportingConstant; } if (OutHumRat > ZoneAirHumRat(ZN1)) { - AirflowNetworkReportData(ZN1).MultiZoneInfiLatGainW += (AirflowNetworkLinkSimu(i).FLOW2 * (OutHumRat - ZoneAirHumRat(ZN1))) * hfg; + AirflowNetworkReportData(ZN1).MultiZoneInfiLatGainW += + (AirflowNetworkLinkSimu(i).FLOW2 * (OutHumRat - ZoneAirHumRat(ZN1))) * hfg; AirflowNetworkReportData(ZN1).MultiZoneInfiLatGainJ += (AirflowNetworkLinkSimu(i).FLOW2 * (OutHumRat - ZoneAirHumRat(ZN1))) * hfg * ReportingConstant; } else { @@ -8321,12 +8319,12 @@ namespace AirflowNetworkBalanceManager { if (Surface(MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { Tamb = Surface(MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; CpAir = PsyCpAirFnWTdb( - Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress), Tamb); + Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); } else { Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); } - hfg = Psychrometrics::PsyHfgAirFnWTdb(ZoneAirHumRat(ZN2), (MAT(ZN2) + Tamb) / 2.0); + hfg = Psychrometrics::PsyHfgAirFnWTdb(ZoneAirHumRat(ZN2), (MAT(ZN2) + Tamb) / 2.0); if (Tamb > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneInfiSenGainW += (AirflowNetworkLinkSimu(i).FLOW * CpAir * (Tamb - MAT(ZN2))); @@ -8351,7 +8349,7 @@ namespace AirflowNetworkBalanceManager { } if (ZN1 > 0 && ZN2 > 0) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1), MAT(ZN1)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1)); hfg = Psychrometrics::PsyHfgAirFnWTdb((ZoneAirHumRat(ZN1) + ZoneAirHumRat(ZN2)) / 2.0, (MAT(ZN1) + MAT(ZN2)) / 2.0); if (MAT(ZN1) > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneMixSenGainW += (AirflowNetworkLinkSimu(i).FLOW * CpAir * (MAT(ZN1) - MAT(ZN2))); @@ -8373,7 +8371,7 @@ namespace AirflowNetworkBalanceManager { AirflowNetworkReportData(ZN2).MultiZoneMixLatLossJ += (AirflowNetworkLinkSimu(i).FLOW * (ZoneAirHumRat(ZN2) - ZoneAirHumRat(ZN1))) * hfg * ReportingConstant; } - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2), MAT(ZN2)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2)); if (MAT(ZN2) > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneMixSenGainW += (AirflowNetworkLinkSimu(i).FLOW2 * CpAir * (MAT(ZN2) - MAT(ZN1))); AirflowNetworkReportData(ZN1).MultiZoneMixSenGainJ += @@ -8521,7 +8519,7 @@ namespace AirflowNetworkBalanceManager { if (AirflowNetworkNodeData(n).AirLoopNum == 0 && onceSurfFlag(i)) continue; ReportingFraction = (1.0 - RepOnOffFanRunTimeFraction); Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); if (Tamb > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneInfiSenGainW += (AirflowNetworkLinkReport1(i).FLOW2OFF * CpAir * (Tamb - MAT(ZN1))) * (1.0 - RepOnOffFanRunTimeFraction); @@ -8559,7 +8557,7 @@ namespace AirflowNetworkBalanceManager { if (AirflowNetworkNodeData(M).AirLoopNum == 0 && onceSurfFlag(i)) continue; ReportingFraction = (1.0 - RepOnOffFanRunTimeFraction); Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); if (Tamb > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneInfiSenGainW += (AirflowNetworkLinkReport1(i).FLOWOFF * CpAir * (Tamb - MAT(ZN2))) * ReportingFraction; @@ -8589,7 +8587,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 > 0 && ZN2 > 0) { ReportingFraction = (1.0 - MaxOnOffFanRunTimeFraction); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1), MAT(ZN1)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1)); if (MAT(ZN1) > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneMixSenGainW += (AirflowNetworkLinkReport1(i).FLOWOFF * CpAir * (MAT(ZN1) - MAT(ZN2))) * ReportingFraction; @@ -8614,7 +8612,7 @@ namespace AirflowNetworkBalanceManager { (AirflowNetworkLinkReport1(i).FLOWOFF * (ZoneAirHumRat(ZN2) - ZoneAirHumRat(ZN1))) * ReportingConstant * ReportingFraction; } - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2), MAT(ZN2)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2)); if (MAT(ZN2) > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneMixSenGainW += (AirflowNetworkLinkReport1(i).FLOW2OFF * CpAir * (MAT(ZN2) - MAT(ZN1))) * ReportingFraction; @@ -8649,7 +8647,7 @@ namespace AirflowNetworkBalanceManager { for (i = 1; i <= NumOfZones; ++i) { // Start of zone loads report variable update loop ... Tamb = Zone(i).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRatAvg(i), MAT(i)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRatAvg(i)); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(i), ZoneAirHumRatAvg(i)); AirflowNetworkZnRpt(i).InfilVolume = (AirflowNetworkExchangeData(i).SumMCp / CpAir / AirDensity) * ReportingConstant; @@ -8834,7 +8832,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 > 0 && ZN2 == 0) { // Find a linkage from outdoors to this zone Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirflowNetworkExchangeData(ZN1).SumMCp += AirflowNetworkLinkSimu(i).FLOW2 * CpAir; AirflowNetworkExchangeData(ZN1).SumMCpT += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * Tamb; AirflowNetworkExchangeData(ZN1).SumMHr += AirflowNetworkLinkSimu(i).FLOW2; @@ -8849,7 +8847,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 == 0 && ZN2 > 0) { // Find a linkage from outdoors to this zone Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirflowNetworkExchangeData(ZN2).SumMCp += AirflowNetworkLinkSimu(i).FLOW * CpAir; AirflowNetworkExchangeData(ZN2).SumMCpT += AirflowNetworkLinkSimu(i).FLOW * CpAir * Tamb; AirflowNetworkExchangeData(ZN2).SumMHr += AirflowNetworkLinkSimu(i).FLOW; @@ -8863,7 +8861,7 @@ namespace AirflowNetworkBalanceManager { } if (ZN1 > 0 && ZN2 > 0) { // Find a linkage from outdoors to this zone - CpAir = PsyCpAirFnWTdb(ANZW(ZN1), ANZT(ZN1)); + CpAir = PsyCpAirFnWTdb(ANZW(ZN1)); AirflowNetworkExchangeData(ZN2).SumMMCp += AirflowNetworkLinkSimu(i).FLOW * CpAir; AirflowNetworkExchangeData(ZN2).SumMMCpT += AirflowNetworkLinkSimu(i).FLOW * CpAir * ANZT(ZN1); AirflowNetworkExchangeData(ZN2).SumMMHr += AirflowNetworkLinkSimu(i).FLOW; @@ -8874,7 +8872,7 @@ namespace AirflowNetworkBalanceManager { if (Contaminant.GenericContamSimulation) { AirflowNetworkExchangeData(ZN2).SumMMHrGC += AirflowNetworkLinkSimu(i).FLOW * ANGC(ZN1); } - CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2)); + CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).SumMMCp += AirflowNetworkLinkSimu(i).FLOW2 * CpAir; AirflowNetworkExchangeData(ZN1).SumMMCpT += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * ANZT(ZN2); AirflowNetworkExchangeData(ZN1).SumMMHr += AirflowNetworkLinkSimu(i).FLOW2; @@ -8974,23 +8972,23 @@ namespace AirflowNetworkBalanceManager { // Find a linkage from a zone to outdoors if (ZN1 > 0 && ZN2 == 0) { Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirflowNetworkExchangeData(ZN1).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * (Tamb - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW2 * (OutHumRat - ANZW(ZN1)); } if (ZN1 == 0 && ZN2 > 0) { Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirflowNetworkExchangeData(ZN2).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW * CpAir * (Tamb - ANZT(ZN2)); AirflowNetworkExchangeData(ZN2).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW * (OutHumRat - ANZW(ZN2)); } if (ZN1 > 0 && ZN2 > 0) { if (AirflowNetworkLinkSimu(i).FLOW > 0) { // Flow from ZN1 to ZN2 - CpAir = PsyCpAirFnWTdb(ANZW(ZN1), ANZT(ZN1)); + CpAir = PsyCpAirFnWTdb(ANZW(ZN1)); AirflowNetworkExchangeData(ZN2).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW * CpAir * (ANZT(ZN1) - ANZT(ZN2)); AirflowNetworkExchangeData(ZN2).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW * (ANZW(ZN1) - ANZW(ZN2)); - CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2)); + CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).MultiZoneSen += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir * (ANZT(ZN2) - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * (ANZW(ZN2) - ANZW(ZN1)); } else { @@ -9004,7 +9002,7 @@ namespace AirflowNetworkBalanceManager { // ABS(AirflowNetworkLinkSimu(i)%FLOW2)*CpAir*(MAT(ZN1)-MAT(ZN2)) // AirflowNetworkExchangeData(ZN2)%MultiZoneLat = AirflowNetworkExchangeData(ZN2)%MultiZoneLat + & // ABS(AirflowNetworkLinkSimu(i)%FLOW2)*(ZoneAirHumRat(ZN1)-ZoneAirHumRat(ZN2)) - CpAir = PsyCpAirFnWTdb(ANZW(ZN2), ANZT(ZN2)); + CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).MultiZoneSen += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir * (ANZT(ZN2) - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * (ANZW(ZN2) - ANZW(ZN1)); } @@ -9182,8 +9180,7 @@ namespace AirflowNetworkBalanceManager { for (i = 1; i <= AirflowNetworkNumOfLinks; ++i) { Node1 = AirflowNetworkLinkageData(i).NodeNums[0]; Node2 = AirflowNetworkLinkageData(i).NodeNums[1]; - CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(Node1).WZ + AirflowNetworkNodeSimu(Node2).WZ) / 2.0, - (AirflowNetworkNodeSimu(Node1).TZ + AirflowNetworkNodeSimu(Node2).TZ) / 2.0); + CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(Node1).WZ + AirflowNetworkNodeSimu(Node2).WZ) / 2.0); // Calculate sensible loads from duct conduction losses and loads from duct radiation if (AirflowNetworkLinkageData(i).ZoneNum > 0 && AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).CompTypeNum == CompTypeNum_DWC) { @@ -9687,8 +9684,7 @@ namespace AirflowNetworkBalanceManager { if (DisSysNodeData(i).AirLoopNum == 0) { ShowSevereError(RoutineName + "The Node or Component Name defined in " + DisSysNodeData(i).Name + " is not found in the AirLoopHVAC."); - ShowContinueError("The entered name is " + DisSysNodeData(i).EPlusName + - " in an AirflowNetwork:Distribution:Node object."); + ShowContinueError("The entered name is " + DisSysNodeData(i).EPlusName + " in an AirflowNetwork:Distribution:Node object."); ErrorsFound = true; } DisSysNodeData(i).EPlusNodeNum = j; @@ -9710,8 +9706,7 @@ namespace AirflowNetworkBalanceManager { } } if (DisSysNodeData(i).EPlusNodeNum == 0) { - ShowSevereError(RoutineName + - "Primary Air Loop Node is not found in AIRFLOWNETWORK:DISTRIBUTION:NODE = " + DisSysNodeData(i).Name); + ShowSevereError(RoutineName + "Primary Air Loop Node is not found in AIRFLOWNETWORK:DISTRIBUTION:NODE = " + DisSysNodeData(i).Name); ErrorsFound = true; } } @@ -9839,8 +9834,7 @@ namespace AirflowNetworkBalanceManager { break; } else { if (OAMixerNum == GetNumOAMixers()) { - ShowSevereError(RoutineName + "'" + NodeID(i) + - "' is not defined as an AirflowNetwork:Distribution:Node object."); + ShowSevereError(RoutineName + "'" + NodeID(i) + "' is not defined as an AirflowNetwork:Distribution:Node object."); ErrorsFound = true; } } @@ -9889,8 +9883,8 @@ namespace AirflowNetworkBalanceManager { // Error messaage ShowSevereError("ValidateDistributionSystem: AIRFLOWNETWORK:DISTRIBUTION:LINKAGE = " + AirflowNetworkLinkageData(i).Name + " is not valid for AirLoopNum assignment"); - ShowContinueError("AirLoopNum is not found in both nodes for the linkage: " + AirflowNetworkLinkageData(i).NodeNames[0] + - " and " + AirflowNetworkLinkageData(i).NodeNames[1]); + ShowContinueError("AirLoopNum is not found in both nodes for the linkage: " + AirflowNetworkLinkageData(i).NodeNames[0] + " and " + + AirflowNetworkLinkageData(i).NodeNames[1]); ShowContinueError("Please ensure one of two AIRFLOWNETWORK:DISTRIBUTION:NODEs in the first AIRFLOWNETWORK:DISTRIBUTION:LINKAGE " "object should be defined as EnergyPlus NodeID."); ErrorsFound = true; @@ -9907,8 +9901,7 @@ namespace AirflowNetworkBalanceManager { if (AirflowNetworkNodeData(j).AirLoopNum != AirflowNetworkNodeData(k).AirLoopNum && AirflowNetworkNodeData(j).AirLoopNum > 0 && AirflowNetworkNodeData(k).AirLoopNum > 0) { AirflowNetworkLinkageData(i).AirLoopNum = AirflowNetworkNodeData(j).AirLoopNum; - ShowSevereError("The AirLoopNum defined in both AIRFLOWNETWORK:DISTRIBUTION:NODE objects in " + - AirflowNetworkLinkageData(i).Name + + ShowSevereError("The AirLoopNum defined in both AIRFLOWNETWORK:DISTRIBUTION:NODE objects in " + AirflowNetworkLinkageData(i).Name + " are not the same. Please make sure both nodes should be listed in the same AirLoop as a valid linkage."); ShowContinueError("AirLoop defined in " + AirflowNetworkNodeData(j).Name + " is " + PrimaryAirSystem(AirflowNetworkNodeData(j).AirLoopNum).Name + ", and AirLoop defined in " + @@ -9921,7 +9914,8 @@ namespace AirflowNetworkBalanceManager { DisSysCompCVFData(AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).TypeNum).AirLoopNum = AirflowNetworkLinkageData(i).AirLoopNum; if (DisSysCompCVFData(AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).TypeNum).FanModelFlag) { - HVACFan::fanObjs[DisSysCompCVFData(AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).TypeNum).FanIndex]->AirLoopNum = AirflowNetworkLinkageData(i).AirLoopNum; + HVACFan::fanObjs[DisSysCompCVFData(AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).TypeNum).FanIndex]->AirLoopNum = + AirflowNetworkLinkageData(i).AirLoopNum; } else { SetFanAirLoopNumber(n, AirflowNetworkLinkageData(i).AirLoopNum); } @@ -9984,17 +9978,14 @@ namespace AirflowNetworkBalanceManager { } } else if (SELECT_CASE_var == "COIL:COOLING:WATER:DETAILEDGEOMETRY") { - ValidateComponent( - "Coil:Cooling:Water:DetailedGeometry", DisSysCompCoilData(i).Name, IsNotOK, RoutineName + CurrentModuleObject); + ValidateComponent("Coil:Cooling:Water:DetailedGeometry", DisSysCompCoilData(i).Name, IsNotOK, RoutineName + CurrentModuleObject); if (IsNotOK) { ErrorsFound = true; } } else if (SELECT_CASE_var == "COIL:COOLING:DX:TWOSTAGEWITHHUMIDITYCONTROLMODE") { - ValidateComponent("Coil:Cooling:DX:TwoStageWithHumidityControlMode", - DisSysCompCoilData(i).Name, - IsNotOK, - RoutineName + CurrentModuleObject); + ValidateComponent( + "Coil:Cooling:DX:TwoStageWithHumidityControlMode", DisSysCompCoilData(i).Name, IsNotOK, RoutineName + CurrentModuleObject); if (IsNotOK) { ErrorsFound = true; } else { @@ -10046,8 +10037,7 @@ namespace AirflowNetworkBalanceManager { UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) { LocalError = false; if (UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:ConstantVolume:Reheat")) - GetHVACSingleDuctSysIndex( - DisSysCompTermUnitData(i).Name, n, LocalError, "AirflowNetwork:Distribution:Component:TerminalUnit"); + GetHVACSingleDuctSysIndex(DisSysCompTermUnitData(i).Name, n, LocalError, "AirflowNetwork:Distribution:Component:TerminalUnit"); if (UtilityRoutines::SameString(DisSysCompTermUnitData(i).EPlusType, "AirTerminal:SingleDuct:VAV:Reheat")) GetHVACSingleDuctSysIndex(DisSysCompTermUnitData(i).Name, n, @@ -10097,8 +10087,7 @@ namespace AirflowNetworkBalanceManager { } } else if (SELECT_CASE_var == "HEATEXCHANGER:DESICCANT:BALANCEDFLOW") { - ValidateComponent( - "HeatExchanger:Desiccant:BalancedFlow", DisSysCompHXData(i).Name, IsNotOK, RoutineName + CurrentModuleObject); + ValidateComponent("HeatExchanger:Desiccant:BalancedFlow", DisSysCompHXData(i).Name, IsNotOK, RoutineName + CurrentModuleObject); if (IsNotOK) { ErrorsFound = true; } @@ -10167,8 +10156,7 @@ namespace AirflowNetworkBalanceManager { for (j = 1; j <= AirflowNetworkNumOfLinks; ++j) { if (AirflowNetworkLinkageData(i).NodeNums[0] == AirflowNetworkLinkageData(j).NodeNums[1]) { if (AirflowNetworkCompData(AirflowNetworkLinkageData(j).CompNum).CompTypeNum != CompTypeNum_DWC) { - ShowSevereError(RoutineName + "An " + CurrentModuleObject + " object (" + AirflowNetworkLinkageData(i).CompName + - ')'); + ShowSevereError(RoutineName + "An " + CurrentModuleObject + " object (" + AirflowNetworkLinkageData(i).CompName + ')'); ShowContinueError("must connect a duct component upstream and not " + AirflowNetworkLinkageData(j).Name); ErrorsFound = true; } @@ -10225,7 +10213,6 @@ namespace AirflowNetworkBalanceManager { } } - for (i = NumOfNodesMultiZone + 1; i <= AirflowNetworkNumOfNodes; ++i) { if (AirflowNetworkNodeData(i).EPlusTypeNum == EPlusTypeNum_SPL) { LocalError = false; @@ -10244,7 +10231,6 @@ namespace AirflowNetworkBalanceManager { for (j = 1; j <= SplitterNodeNumbers(2); ++j) { if (AirflowNetworkNodeData(i).EPlusNodeNum == SplitterNodeNumbers(j + 2)) { if (AirflowNetworkNodeData(i).EPlusTypeNum == 0) AirflowNetworkNodeData(i).EPlusTypeNum = EPlusTypeNum_SPO; - } } } @@ -10259,7 +10245,7 @@ namespace AirflowNetworkBalanceManager { } if (DisSysCompCVFData(i).FanModelFlag && DisSysCompCVFData(i).FanTypeNum == FanType_SimpleOnOff) { int fanIndex = HVACFan::getFanObjectVectorIndex(DisSysCompCVFData(i).Name); - if ( HVACFan::fanObjs[fanIndex]->AirPathFlag) { + if (HVACFan::fanObjs[fanIndex]->AirPathFlag) { DisSysCompCVFData(i).FanTypeNum = FanType_SimpleConstVolume; } else { OnOffFanFlag = true; @@ -10338,35 +10324,35 @@ namespace AirflowNetworkBalanceManager { for (i = 1; i <= AirflowNetworkNumOfSurfaces; ++i) { if (SupplyFanType == FanType_SimpleConstVolume) { SetupOutputVariable("AFN Linkage Node 1 to Node 2 Mass Flow Rate", - OutputProcessor::Unit::kg_s, - AirflowNetworkLinkReport(i).FLOW, - "System", - "Average", - AirflowNetworkLinkageData(i).Name); + OutputProcessor::Unit::kg_s, + AirflowNetworkLinkReport(i).FLOW, + "System", + "Average", + AirflowNetworkLinkageData(i).Name); SetupOutputVariable("AFN Linkage Node 2 to Node 1 Mass Flow Rate", - OutputProcessor::Unit::kg_s, - AirflowNetworkLinkReport(i).FLOW2, - "System", - "Average", - AirflowNetworkLinkageData(i).Name); + OutputProcessor::Unit::kg_s, + AirflowNetworkLinkReport(i).FLOW2, + "System", + "Average", + AirflowNetworkLinkageData(i).Name); SetupOutputVariable("AFN Linkage Node 1 to Node 2 Volume Flow Rate", - OutputProcessor::Unit::m3_s, - AirflowNetworkLinkReport(i).VolFLOW, - "System", - "Average", - AirflowNetworkLinkageData(i).Name); + OutputProcessor::Unit::m3_s, + AirflowNetworkLinkReport(i).VolFLOW, + "System", + "Average", + AirflowNetworkLinkageData(i).Name); SetupOutputVariable("AFN Linkage Node 2 to Node 1 Volume Flow Rate", - OutputProcessor::Unit::m3_s, - AirflowNetworkLinkReport(i).VolFLOW2, - "System", - "Average", - AirflowNetworkLinkageData(i).Name); + OutputProcessor::Unit::m3_s, + AirflowNetworkLinkReport(i).VolFLOW2, + "System", + "Average", + AirflowNetworkLinkageData(i).Name); SetupOutputVariable("AFN Linkage Node 1 to Node 2 Pressure Difference", - OutputProcessor::Unit::Pa, - AirflowNetworkLinkSimu(i).DP, - "System", - "Average", - AirflowNetworkLinkageData(i).Name); + OutputProcessor::Unit::Pa, + AirflowNetworkLinkSimu(i).DP, + "System", + "Average", + AirflowNetworkLinkageData(i).Name); } } } @@ -10424,8 +10410,7 @@ namespace AirflowNetworkBalanceManager { if (NumOfFans > 1) break; } if (NumOfFans > 1) { - ShowSevereError(RoutineName + "An AirLoop branch, " + PrimaryAirSystem(1).Branch(BranchNum).Name + - ", has two or more fans: " + FanNames); + ShowSevereError(RoutineName + "An AirLoop branch, " + PrimaryAirSystem(1).Branch(BranchNum).Name + ", has two or more fans: " + FanNames); ShowContinueError( "The AirflowNetwork model allows a single supply fan in an AirLoop only. Please make changes in the input file accordingly."); ErrorsFound = true; @@ -10434,10 +10419,10 @@ namespace AirflowNetworkBalanceManager { if (ErrorsFound) { ShowFatalError(RoutineName + "Program terminates for preceding reason(s)."); } - } - void ValidateFanFlowRate() { + void ValidateFanFlowRate() + { // Catch a fan flow rate from EPlus input file and add a flag for VAV terminal damper for (int i = 1; i <= AirflowNetworkNumOfLinks; ++i) { @@ -10447,7 +10432,8 @@ namespace AirflowNetworkBalanceManager { int typeNum = AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).TypeNum; if (DisSysCompCVFData(typeNum).FanTypeNum == FanType_SimpleVAV) { if (DisSysCompCVFData(typeNum).FanModelFlag) { - DisSysCompCVFData(typeNum).MaxAirMassFlowRate = HVACFan::fanObjs[DisSysCompCVFData(typeNum).FanIndex]->designAirVolFlowRate * StdRhoAir; + DisSysCompCVFData(typeNum).MaxAirMassFlowRate = + HVACFan::fanObjs[DisSysCompCVFData(typeNum).FanIndex]->designAirVolFlowRate * StdRhoAir; } else { Real64 FanFlow; // Return type GetFanVolFlow(DisSysCompCVFData(typeNum).FanIndex, FanFlow); @@ -11086,7 +11072,7 @@ namespace AirflowNetworkBalanceManager { Real64 RhoAir; // Zone air density [kg/m3] Real64 CpAir; // Zone air specific heat - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); InfilVolume = (AirflowNetworkExchangeData(ZoneNum).SumMCp / CpAir / RhoAir) * TimeStepSys * SecInHour; ACH = InfilVolume / (TimeStepSys * Zone(ZoneNum).Volume); diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index 0d5ece9a0ee..6b8af3d835c 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -675,7 +675,7 @@ namespace BaseboardElectric { AirInletTemp = Baseboard(BaseboardNum).AirInletTemp; AirOutletTemp = AirInletTemp; - CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat, AirInletTemp); + CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat); AirMassFlowRate = SimpConvAirFlowSpeed; CapacitanceAir = CpAir * AirMassFlowRate; // currently only the efficiency is used to calculate the electric consumption. There could be some diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index 8f6399f4be1..d5d8422b038 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -1156,7 +1156,7 @@ namespace BaseboardRadiator { CpWater = GetSpecificHeatGlycol( PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); - CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat, AirInletTemp); + CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat); if (Baseboard(BaseboardNum).DesAirMassFlowRate > 0.0) { // If UA is autosized, assign design condition AirMassFlowRate = Baseboard(BaseboardNum).DesAirMassFlowRate; diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index f91b644cd78..4c7d579249b 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -2565,7 +2565,7 @@ namespace ChillerElectricEIR { EIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); if (CondMassFlowRate > 0.0) { - Cp = Psychrometrics::PsyCpAirFnWTdb(Node(CondInletNode).HumRat, CondInletTemp); + Cp = Psychrometrics::PsyCpAirFnWTdb(Node(CondInletNode).HumRat); CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / Cp; } else { CondOutletTemp = CondInletTemp; diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 18538669db8..603dd6d8231 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1883,7 +1883,7 @@ namespace ChillerExhaustAbsorption { lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); + CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat); lExhHeatRecPotentialCool = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); // If Microturbine Exhaust temperature and flow rate is not sufficient to run the chiller, then chiller will not run // lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0 @@ -2209,7 +2209,7 @@ namespace ChillerExhaustAbsorption { lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat, lExhaustInTemp); + CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat); lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) { if (ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingHeatingTempIndex == 0) { diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 74209e3320c..46cb89291a1 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -5182,7 +5182,7 @@ namespace CondenserLoopTowers { // set water and air properties Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(this->AirPress, InletAirTemp, this->AirHumRat); // Density of air [kg/m3] Real64 AirMassFlowRate = AirFlowRate * AirDensity; // Mass flow rate of air [kg/s] - Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(this->AirHumRat, InletAirTemp); // Heat capacity of air [J/kg/K] + Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(this->AirHumRat); // Heat capacity of air [J/kg/K] Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->LoopNum).FluidName, this->WaterTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index e76552533f5..704c32bc26c 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -401,7 +401,7 @@ namespace ConvectionCoefficients { if (Surface(SurfNum).IntConvCoeff <= -1) { // Set by user using one of the standard algorithms... algoNum = std::abs(Surface(SurfNum).IntConvCoeff); standardAlgo = true; - } else if (Surface(SurfNum).IntConvCoeff == 0) { // Not set by user, uses Zone Setting + } else if (Surface(SurfNum).IntConvCoeff == 0) { // Not set by user, uses Zone Setting algoNum = Zone(ZoneNum).InsideConvectionAlgo; standardAlgo = true; } else { @@ -446,8 +446,7 @@ namespace ConvectionCoefficients { if (Surface(SurfNum).EMSOverrideIntConvCoef) { HConvIn(SurfNum) = Surface(SurfNum).EMSValueForIntConvCoef; - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(Surface(SurfNum).EMSValueForIntConvCoef); } } @@ -507,8 +506,8 @@ namespace ConvectionCoefficients { Real64 SurfWindDir; Real64 TSky; Real64 TGround; - Real64 Hn; // Natural part of exterior convection - Real64 Hf; // Forced part of exterior convection + Real64 Hn; // Natural part of exterior convection + Real64 Hf; // Forced part of exterior convection Real64 rCalcPerimeter; // approximation for Perimeter int BaseSurf; int SrdSurfsNum; // Srd surface counter @@ -554,7 +553,7 @@ namespace ConvectionCoefficients { if (Surface(SurfNum).ExtConvCoeff <= -1) { // Set by user using one of the standard algorithms... algoNum = std::abs(Surface(SurfNum).ExtConvCoeff); standardAlgo = true; - } else if (Surface(SurfNum).ExtConvCoeff == 0) { // Not set by user, uses Zone Setting + } else if (Surface(SurfNum).ExtConvCoeff == 0) { // Not set by user, uses Zone Setting algoNum = Zone(Surface(SurfNum).Zone).OutsideConvectionAlgo; standardAlgo = true; } else { @@ -566,11 +565,9 @@ namespace ConvectionCoefficients { auto const SELECT_CASE_var1(algoNum); - if (SELECT_CASE_var1 == ASHRAESimple) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [](double, double, double, double windSpeed) -> double { return windSpeed; }; @@ -599,21 +596,20 @@ namespace ConvectionCoefficients { // due to outlying calculations when perimeter is very small compared to area, use Perimeter // approximation calculation - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { if (Surface(SurfNum).Class == SurfaceClass_Wall) { - auto& fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; + auto &fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; const double length = fnd.netPerimeter; const double height = fnd.wall.heightAboveGrade; - const double area = length*height; + const double area = length * height; const double perim = 2.0 * (length + height); SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcSparrowWindward(Roughness, perim, area, windSpeed); double leewardHf = CalcSparrowLeeward(Roughness, perim, area, windSpeed); - return (windwardHf + leewardHf)/2.0; + return (windwardHf + leewardHf) / 2.0; }; - } else { // Slab (used for exterior grade convection) + } else { // Slab (used for exterior grade convection) // Assume very large area for grade (relative to perimeter). const double area = 9999999.; const double perim = 1.; @@ -621,7 +617,8 @@ namespace ConvectionCoefficients { return CalcSparrowWindward(Roughness, perim, area, windSpeed); }; } - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = + [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double { Real64 Ts = Tsurf; if (HMovInsul > 0.0) Ts = (HMovInsul * Tsurf + hfTerm * Tamb) / (HMovInsul + hfTerm); return CalcASHRAETARPNatural(Ts, Tamb, cosTilt) + hfTerm; @@ -646,23 +643,21 @@ namespace ConvectionCoefficients { } } else if (SELECT_CASE_var1 == MoWiTTHcOutside) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { if (Surface(SurfNum).Class == SurfaceClass_Wall) { - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, - double windSpeed) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } else { - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, - double windSpeed) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = + [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double { Real64 Hn = CalcMoWITTNatural(Tsurf - Tamb); return std::sqrt(pow_2(Hn) + pow_2(hfTerm)); }; @@ -676,23 +671,21 @@ namespace ConvectionCoefficients { } } else if (SELECT_CASE_var1 == DOE2HcOutside) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { if (Surface(SurfNum).Class == SurfaceClass_Wall) { - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, - double windSpeed) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } else { - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, - double windSpeed) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = + [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double { Real64 Hf = CalcDOE2Forced(Tsurf, Tamb, cosTilt, hfTerm, Roughness); Real64 Ts = Tsurf; @@ -724,20 +717,17 @@ namespace ConvectionCoefficients { ManageOutsideAdaptiveConvectionAlgo(SurfNum, HExt); } else { - ShowFatalError("InitExtConvection Coefficients: invalid parameter -- outside convection type, Surface=" + - Surface(SurfNum).Name); + ShowFatalError("InitExtConvection Coefficients: invalid parameter -- outside convection type, Surface=" + Surface(SurfNum).Name); } } else { // Exterior convection scheme for this surface has been set by user HExt = SetExtConvectionCoeff(SurfNum); - } if (Surface(SurfNum).EMSOverrideExtConvCoef) { HExt = Surface(SurfNum).EMSValueForExtConvCoef; - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(Surface(SurfNum).EMSValueForExtConvCoef); } @@ -747,8 +737,8 @@ namespace ConvectionCoefficients { HSky = 0.0; } else { // Compute sky radiation coefficient - HSky = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * AirSkyRadSplit(SurfNum) * (pow_4(TSurf) - pow_4(TSky)) / - (TSurf - TSky); + HSky = + StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * AirSkyRadSplit(SurfNum) * (pow_4(TSurf) - pow_4(TSky)) / (TSurf - TSky); } if (TSurf == TAir || algoNum == ASHRAESimple) { @@ -759,11 +749,9 @@ namespace ConvectionCoefficients { HGround = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorGroundIR * (pow_4(TSurf) - pow_4(TGround)) / (TSurf - TGround); // Compute air radiation coefficient - HAir = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - AirSkyRadSplit(SurfNum)) * - (pow_4(TSurf) - pow_4(TAir)) / (TSurf - TAir); + HAir = StefanBoltzmann * AbsExt * Surface(SurfNum).ViewFactorSkyIR * (1.0 - AirSkyRadSplit(SurfNum)) * (pow_4(TSurf) - pow_4(TAir)) / + (TSurf - TAir); } - - } Real64 CalcHfExteriorSparrow(Real64 const SurfWindSpeed, // Local wind speed at height of the heat transfer surface (m/s) @@ -1211,14 +1199,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcInsideUserCurve(Loop).HcFnTempDiffCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcInsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(3)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcInsideUserCurve(Loop).HcFnTempDiffCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcInsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(3)); // Field Name } } else { HcInsideUserCurve(Loop).HcFnTempDiffCurveNum = 0; @@ -1230,14 +1217,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcInsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(4)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcInsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(4)); // Field Name } } else { HcInsideUserCurve(Loop).HcFnTempDiffDivHeightCurveNum = 0; @@ -1249,14 +1235,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcInsideUserCurve(Loop).HcFnACHCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcInsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(5)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcInsideUserCurve(Loop).HcFnACHCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcInsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(5)); // Field Name } } else { HcInsideUserCurve(Loop).HcFnACHCurveNum = 0; @@ -1268,14 +1253,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(6) + '=' + cAlphaArgs(6)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcInsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(6)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcInsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(6)); // Field Name } } else { HcInsideUserCurve(Loop).HcFnACHDivPerimLengthCurveNum = 0; @@ -1325,14 +1309,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(3) + '=' + cAlphaArgs(3)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcOutsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(3)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcOutsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(3)); // Field Name } } else { HcOutsideUserCurve(Loop).HfFnWindSpeedCurveNum = 0; @@ -1345,14 +1328,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(4) + '=' + cAlphaArgs(4)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcOutsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(4)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcOutsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(4)); // Field Name } } else { HcOutsideUserCurve(Loop).HnFnTempDiffCurveNum = 0; @@ -1365,14 +1347,13 @@ namespace ConvectionCoefficients { ShowSevereError("GetUserSuppliedConvectionCoefficients: " + CurrentModuleObject + ": Invalid Name Entered, for " + cAlphaFieldNames(5) + '=' + cAlphaArgs(5)); ErrorsFound = true; - } else { // check type - ErrorsFound |= CurveManager::CheckCurveDims( - HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - HcOutsideUserCurve(Loop).Name, // Object Name - cAlphaFieldNames(5)); // Field Name + } else { // check type + ErrorsFound |= CurveManager::CheckCurveDims(HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + HcOutsideUserCurve(Loop).Name, // Object Name + cAlphaFieldNames(5)); // Field Name } } else { HcOutsideUserCurve(Loop).HnFnTempDiffDivHeightCurveNum = 0; @@ -1472,7 +1453,7 @@ namespace ConvectionCoefficients { UserIntConvectionCoeffs(TotIntConvCoeff).SurfaceName = "Air Boundary IRT Surfaces"; UserIntConvectionCoeffs(TotIntConvCoeff).WhichSurface = -999; for (int surfNum : DataSurfaces::AllHTSurfaceList) { - auto & surf = Surface(surfNum); + auto &surf = Surface(surfNum); if (DataHeatBalance::Construct(surf.Construction).TypeIsAirBoundaryIRTSurface) { surf.IntConvCoeff = TotIntConvCoeff; } @@ -3841,7 +3822,7 @@ namespace ConvectionCoefficients { Real64 DeltaTemp = Tamb - Tsurf; // Set HConvIn using the proper correlation based on DeltaTemp and Cosine of the Tilt of the Surface - if (std::abs(cosTilt) >= 0.9239) { // Horizontal Surface + if (std::abs(cosTilt) >= 0.9239) { // Horizontal Surface if (DeltaTemp * cosTilt < 0.0) { // Horizontal, Reduced Convection return 0.948; } else if (DeltaTemp * cosTilt == 0.0) { // Vertical Surface @@ -3849,7 +3830,7 @@ namespace ConvectionCoefficients { } else /*if (DeltaTemp * cosTilt > 0.0)*/ { // Horizontal, Enhanced Convection return 4.040; } - } else { // Tilted Surface + } else { // Tilted Surface if (DeltaTemp * cosTilt < 0.0) { // Tilted, Reduced Convection return 2.281; } else if (DeltaTemp * cosTilt == 0.0) { // Vertical Surface @@ -3867,8 +3848,7 @@ namespace ConvectionCoefficients { { if (std::abs(Surface(SurfNum).CosTilt) >= 0.3827) { // Recalculate HConvIn - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double { return CalcASHRAESimpleIntConvCoeff(Tsurf, Tamb, cosTilt); }; @@ -3920,13 +3900,13 @@ namespace ConvectionCoefficients { return CalcASHRAEVerticalWall(DeltaTemp); - } else if (((DeltaTemp < 0.0) && (cosTilt < 0.0)) || - ((DeltaTemp > 0.0) && (cosTilt > 0.0))) { // Enhanced Convection + } else if (((DeltaTemp < 0.0) && (cosTilt < 0.0)) || ((DeltaTemp > 0.0) && (cosTilt > 0.0))) { // Enhanced Convection return CalcWaltonUnstableHorizontalOrTilt(DeltaTemp, cosTilt); } else /*if (((DeltaTemp > 0.0) && (cosTilt < 0.0)) || - ((DeltaTemp < 0.0) && (cosTilt > 0.0)))*/ { // Reduced Convection + ((DeltaTemp < 0.0) && (cosTilt > 0.0)))*/ + { // Reduced Convection return CalcWaltonStableHorizontalOrTilt(DeltaTemp, cosTilt); @@ -3939,13 +3919,13 @@ namespace ConvectionCoefficients { ) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = [](double Tsurf, double Tamb, double, double, double cosTilt) -> double { return CalcASHRAETARPNatural(Tsurf, Tamb, cosTilt); }; } else { - HConvIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperature, ZoneMeanAirTemperature, -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior + HConvIn(SurfNum) = CalcASHRAETARPNatural( + SurfaceTemperature, ZoneMeanAirTemperature, -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior } // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) @@ -4007,7 +3987,9 @@ namespace ConvectionCoefficients { HcIn(SurfNum) = SetIntConvectionCoeff(SurfNum); } else { - HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum), TAirConv, -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior + HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum), + TAirConv, + -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior } } else if (AirModel(Surface(SurfNum).Zone).AirModelType == RoomAirModel_UCSDCV) { @@ -4020,7 +4002,9 @@ namespace ConvectionCoefficients { HcIn(SurfNum) = SetIntConvectionCoeff(SurfNum); } else { - HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum), TAirConv, -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior + HcIn(SurfNum) = CalcASHRAETARPNatural(SurfaceTemperatures(SurfNum), + TAirConv, + -Surface(SurfNum).CosTilt); // negative CosTilt because CosTilt is relative to exterior HcIn(SurfNum) = std::pow(std::pow(HcIn(SurfNum), 3.2) + std::pow(Hf, 3.2), 1.0 / 3.2); } } @@ -4100,11 +4084,11 @@ namespace ConvectionCoefficients { Real64 ACH = CalcZoneSystemACH(ZoneNum); // Air changes per hour - // FLOW: + // FLOW: // Set local variables Real64 ZoneMassFlowRate; Real64 ZoneMult = Zone(ZoneNum).Multiplier * Zone(ZoneNum).ListMultiplier; - int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; // Zone node as defined in system simulation + int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; // Zone node as defined in system simulation if (!BeginEnvrnFlag && ZoneNode > 0) { ZoneMassFlowRate = Node(ZoneNode).MassFlowRate / ZoneMult; } else { // because these are not updated yet for new environment @@ -4122,7 +4106,7 @@ namespace ConvectionCoefficients { return ACH; } - Real64 CalcCeilingDiffuserIntConvCoeff(Real64 const ACH, // [1/hr] air system air change rate + Real64 CalcCeilingDiffuserIntConvCoeff(Real64 const ACH, // [1/hr] air system air change rate Real64 const Tsurf, Real64 const Tair, Real64 const cosTilt, @@ -4152,7 +4136,6 @@ namespace ConvectionCoefficients { // in the reference above (Fisher 1997). They have been reformulated with an outlet // temperature reference in order to accomodate the structure of the EnergyPlus code. - // If the Ceiling Diffuser option is selected the following correlations are used. // The development of the ceiling diffuser convection correlations is shown in reference 4. // The correlations shown below differ from (and are less accurate than) those shown in reference 4 because they have been @@ -4160,7 +4143,7 @@ namespace ConvectionCoefficients { // EnergyPlus code. // Set HConvIn using the proper correlation based on Surface Tilt - static const Real64 cos45(sqrt(2.)/2.0); + static const Real64 cos45(sqrt(2.) / 2.0); if (cosTilt < -cos45) { return CalcFisherPedersenCeilDiffuserFloor(ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow); // Floor correlation @@ -4171,7 +4154,8 @@ namespace ConvectionCoefficients { } } - void CalcCeilingDiffuserIntConvCoeff(int const ZoneNum, Array1S const SurfaceTemperatures) // zone number for which coefficients are being calculated + void CalcCeilingDiffuserIntConvCoeff(int const ZoneNum, + Array1S const SurfaceTemperatures) // zone number for which coefficients are being calculated { Real64 ACH = CalcCeilingDiffuserACH(ZoneNum); @@ -4181,13 +4165,19 @@ namespace ConvectionCoefficients { for (auto SurfNum = Zone(ZoneNum).SurfaceFirst; SurfNum <= Zone(ZoneNum).SurfaceLast; ++SurfNum) { if (!Surface(SurfNum).HeatTransSurf) continue; // Skip non-heat transfer surfaces - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = [=](double Tsurf, double Tamb, double, double, double cosTilt) -> double { - return CalcCeilingDiffuserIntConvCoeff(ACH, Tsurf, Tamb, cosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); + return CalcCeilingDiffuserIntConvCoeff( + ACH, Tsurf, Tamb, cosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); }; } else { - HConvIn(SurfNum) = CalcCeilingDiffuserIntConvCoeff(ACH, SurfaceTemperatures(SurfNum), DataHeatBalFanSys::MAT(ZoneNum), Surface(SurfNum).CosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); + HConvIn(SurfNum) = CalcCeilingDiffuserIntConvCoeff(ACH, + SurfaceTemperatures(SurfNum), + DataHeatBalFanSys::MAT(ZoneNum), + Surface(SurfNum).CosTilt, + AirHumRat, + Surface(SurfNum).Height, + Construct(Surface(SurfNum).Construction).TypeIsWindow); // Establish some lower limit to avoid a zero convection coefficient (and potential divide by zero problems) if (HConvIn(SurfNum) < LowHConvLimit) HConvIn(SurfNum) = LowHConvLimit; } @@ -4234,13 +4224,13 @@ namespace ConvectionCoefficients { // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 const MinFlow(0.01); // Minimum mass flow rate Real64 const MaxACH(100.0); // Maximum ceiling diffuser correlation limit - Real64 ACH; // Air changes per hour - int ZoneNode; // Zone node as defined in system simulation - Real64 ZoneVolume; // Zone node as defined in system simulation - Real64 ZoneMassFlowRate; // Zone node as defined in system simulation - Real64 AirDensity; // zone air density - int SurfNum; // DO loop counter for surfaces - Real64 Tilt; // Surface tilt + Real64 ACH; // Air changes per hour + int ZoneNode; // Zone node as defined in system simulation + Real64 ZoneVolume; // Zone node as defined in system simulation + Real64 ZoneMassFlowRate; // Zone node as defined in system simulation + Real64 AirDensity; // zone air density + int SurfNum; // DO loop counter for surfaces + Real64 Tilt; // Surface tilt Real64 ZoneMult; // FLOW: @@ -4439,8 +4429,7 @@ namespace ConvectionCoefficients { // assign the convection coefficent to the major surfaces and any subsurfaces on them if ((Surface(SurfNum).BaseSurf == Surf1) || (Surface(SurfNum).BaseSurf == Surf2)) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError("Trombe wall convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } HConvIn(SurfNum) = 2.0 * HConvNet; @@ -4583,8 +4572,7 @@ namespace ConvectionCoefficients { if (SELECT_CASE_var == ConvCoefValue) { HExt = UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).OverrideValue; - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); } @@ -4593,8 +4581,7 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == ConvCoefSchedule) { HExt = GetCurrentScheduleValue(UserExtConvectionCoeffs(Surface(SurfNum).ExtConvCoeff).ScheduleIndex); // Need to check for validity - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = KIVA_HF_ZERO; SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(HExt); } @@ -4651,16 +4638,14 @@ namespace ConvectionCoefficients { if (SELECT_CASE_var == ConvCoefValue) { HInt = UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).OverrideValue; - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } Surface(SurfNum).IntConvHcModelEq = HcInt_UserValue; // reporting } else if (SELECT_CASE_var == ConvCoefSchedule) { HInt = GetCurrentScheduleValue(UserIntConvectionCoeffs(Surface(SurfNum).IntConvCoeff).ScheduleIndex); // Need to check for validity - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = KIVA_CONST_CONV(HInt); } Surface(SurfNum).IntConvHcModelEq = HcInt_UserSchedule; // reporting @@ -4757,7 +4742,7 @@ namespace ConvectionCoefficients { lambda = 2.873E-3 + 7.76E-5 * TmeanFilmKelvin; // Table B.1 in ISO 15099, mu = 3.723E-6 + 4.94E-8 * TmeanFilmKelvin; // Table B.2 in ISO 15099 - Cp = PsyCpAirFnWTdb(AirHumRat, TmeanFilm); + Cp = PsyCpAirFnWTdb(AirHumRat); // four cases depending on tilt and DeltaTemp (heat flow direction ) if (DeltaTemp > 0.0) TiltDeg = 180.0 - TiltDeg; // complement angle if cooling situation @@ -4806,7 +4791,6 @@ namespace ConvectionCoefficients { } return Nuint * lambda / Height; - } void CalcISO15099WindowIntConvCoeff(int const SurfNum, // surface number for which coefficients are being calculated @@ -4827,8 +4811,7 @@ namespace ConvectionCoefficients { Real64 TiltDeg = Surface(SurfNum).Tilt; Real64 sineTilt = Surface(SurfNum).SinTilt; - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError("ISO15099 convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } @@ -4964,36 +4947,44 @@ namespace ConvectionCoefficients { static FacadeGeoCharactisticsStruct NorthWestFacade(287.5, 332.5, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // Formats - static ObjexxFCL::gio::Fmt Format_900("('! , Surface Name, Outside Model Assignment, Outside Area [m2], ','Outside " - "Perimeter [m], Outside Height [m], Inside Model Assignment, ','Inside Height [m], Inside Perimeter Envelope [m], " - "Inside Hydraulic Diameter [m], Window Wall Ratio, ','Window Location, Near Radiant {Yes/No}, Has Active HVAC " - "{Yes/No}')"); - static ObjexxFCL::gio::Fmt Format_901("('Surface Convection Parameters,',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); - static ObjexxFCL::gio::Fmt Format_8000("('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); + static ObjexxFCL::gio::Fmt Format_900( + "('! , Surface Name, Outside Model Assignment, Outside Area [m2], ','Outside " + "Perimeter [m], Outside Height [m], Inside Model Assignment, ','Inside Height [m], Inside Perimeter Envelope [m], " + "Inside Hydraulic Diameter [m], Window Wall Ratio, ','Window Location, Near Radiant {Yes/No}, Has Active HVAC " + "{Yes/No}')"); + static ObjexxFCL::gio::Fmt Format_901( + "('Surface Convection Parameters,',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); + static ObjexxFCL::gio::Fmt Format_8000( + "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8001("('Building Convection Parameters:North Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); static ObjexxFCL::gio::Fmt Format_8100( "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8101("('Building Convection Parameters:Northeast Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); - static ObjexxFCL::gio::Fmt Format_8200("('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); + static ObjexxFCL::gio::Fmt Format_8200( + "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8201("('Building Convection Parameters:East Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); static ObjexxFCL::gio::Fmt Format_8300( "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8301("('Building Convection Parameters:Southeast Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); - static ObjexxFCL::gio::Fmt Format_8400("('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); + static ObjexxFCL::gio::Fmt Format_8400( + "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8401("('Building Convection Parameters:South Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); static ObjexxFCL::gio::Fmt Format_8500( "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8501("('Building Convection Parameters:Southwest Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); - static ObjexxFCL::gio::Fmt Format_8600("('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); + static ObjexxFCL::gio::Fmt Format_8600( + "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8601("('Building Convection Parameters:West Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); static ObjexxFCL::gio::Fmt Format_8700( "('! , Perimeter, Height, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ')"); static ObjexxFCL::gio::Fmt Format_8701("('Building Convection Parameters:NorthwWest Facade, ',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A)"); - static ObjexxFCL::gio::Fmt Format_8800("('! , Area [m2], Perimeter [m], Height [m], ','XdYdZd:X, XdYdZd:Y, " - "XdYdZd:Z',',XdYdZu:X, XdYdZu:Y, XdYdZu:Z',',XdYuZd:X, XdYuZd:Y, XdYuZd:Z',',XdYuZu:X, XdYuZu:Y, " - "XdYuZu:Z',',XuYdZd:X, XuYdZd:Y, XuYdZd:Z',',XuYuZd:X, XuYuZd:Y, XuYuZd:Z',',XuYdZu:X, XuYdZu:Y, " - "XuYdZu:Z',',XuYuZu:X, XuYuZu:Y, XuYuZu:Z')"); - static ObjexxFCL::gio::Fmt Format_8801("('Building Convection Parameters:Roof,',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',')"); + static ObjexxFCL::gio::Fmt Format_8800( + "('! , Area [m2], Perimeter [m], Height [m], ','XdYdZd:X, XdYdZd:Y, " + "XdYdZd:Z',',XdYdZu:X, XdYdZu:Y, XdYdZu:Z',',XdYuZd:X, XdYuZd:Y, XdYuZd:Z',',XdYuZu:X, XdYuZu:Y, " + "XdYuZu:Z',',XuYdZd:X, XuYdZd:Y, XuYdZd:Z',',XuYuZd:X, XuYuZd:Y, XuYuZd:Z',',XuYdZu:X, XuYdZu:Y, " + "XuYdZu:Z',',XuYuZu:X, XuYuZu:Y, XuYuZu:Z')"); + static ObjexxFCL::gio::Fmt Format_8801( + "('Building Convection Parameters:Roof,',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',')"); static ObjexxFCL::gio::Fmt Format_88012("(A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',',A,',')"); static ObjexxFCL::gio::Fmt Format_88013("(A,',',A,',',A,',',A,',',A,',',A,',',A)"); @@ -5557,10 +5548,11 @@ namespace ConvectionCoefficients { << RoundSigDigits(RoofGeo.XuYdZd.Vertex.y, 3) << RoundSigDigits(RoofGeo.XuYdZd.Vertex.z, 3) << RoundSigDigits(RoofGeo.XuYuZd.Vertex.x, 3) << RoundSigDigits(RoofGeo.XuYuZd.Vertex.y, 3); } - ObjexxFCL::gio::write(OutputFileInits, Format_88013) << RoundSigDigits(RoofGeo.XuYuZd.Vertex.z, 3) << RoundSigDigits(RoofGeo.XuYdZu.Vertex.x, 3) - << RoundSigDigits(RoofGeo.XuYdZu.Vertex.y, 3) << RoundSigDigits(RoofGeo.XuYdZu.Vertex.z, 3) - << RoundSigDigits(RoofGeo.XuYuZu.Vertex.x, 3) << RoundSigDigits(RoofGeo.XuYuZu.Vertex.y, 3) - << RoundSigDigits(RoofGeo.XuYuZu.Vertex.z, 3); + ObjexxFCL::gio::write(OutputFileInits, Format_88013) + << RoundSigDigits(RoofGeo.XuYuZd.Vertex.z, 3) << RoundSigDigits(RoofGeo.XuYdZu.Vertex.x, 3) + << RoundSigDigits(RoofGeo.XuYdZu.Vertex.y, 3) << RoundSigDigits(RoofGeo.XuYdZu.Vertex.z, 3) + << RoundSigDigits(RoofGeo.XuYuZu.Vertex.x, 3) << RoundSigDigits(RoofGeo.XuYuZu.Vertex.y, 3) + << RoundSigDigits(RoofGeo.XuYuZu.Vertex.z, 3); } } @@ -5771,10 +5763,10 @@ namespace ConvectionCoefficients { Real64 tmpHc = 0.0; int const ZoneNum = Surface(SurfNum).Zone; - Real64& Tsurface = TH(2, 1, SurfNum); - Real64& Tzone = MAT(ZoneNum); + Real64 &Tsurface = TH(2, 1, SurfNum); + Real64 &Tzone = MAT(ZoneNum); - auto& HnFn = SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in; + auto &HnFn = SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in; // now call appropriate function to calculate Hc { auto const SELECT_CASE_var(ConvModelEquationNum); @@ -5783,9 +5775,7 @@ namespace ConvectionCoefficients { CalcUserDefinedInsideHcModel(SurfNum, Surface(SurfNum).IntConvHcUserCurveIndex, tmpHc); } else if (SELECT_CASE_var == HcInt_ASHRAEVerticalWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [](double Tsurf, double Tamb, double, double, double) -> double { - return CalcASHRAEVerticalWall(Tsurf - Tamb); - }; + HnFn = [](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); }; } else { tmpHc = CalcASHRAEVerticalWall((Tsurface - Tzone)); } @@ -5796,8 +5786,7 @@ namespace ConvectionCoefficients { return CalcWaltonUnstableHorizontalOrTilt(Tsurf - Tamb, cosTilt); }; } else { - tmpHc = - CalcWaltonUnstableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out + tmpHc = CalcWaltonUnstableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_WaltonStableHorizontalOrTilt) { @@ -5806,8 +5795,7 @@ namespace ConvectionCoefficients { return CalcWaltonStableHorizontalOrTilt(Tsurf - Tamb, cosTilt); }; } else { - tmpHc = - CalcWaltonStableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out + tmpHc = CalcWaltonStableHorizontalOrTilt((Tsurface - Tzone), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserFloor) { @@ -5819,7 +5807,13 @@ namespace ConvectionCoefficients { return CalcFisherPedersenCeilDiffuserFloor(AirChangeRate, Tsurf, Tamb, cosTilt, AirHumRat, Surface(SurfNum).Height); }; } else { - tmpHc = CalcFisherPedersenCeilDiffuserFloor(AirChangeRate, Tsurface, Tzone, Surface(SurfNum).CosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); + tmpHc = CalcFisherPedersenCeilDiffuserFloor(AirChangeRate, + Tsurface, + Tzone, + Surface(SurfNum).CosTilt, + AirHumRat, + Surface(SurfNum).Height, + Construct(Surface(SurfNum).Construction).TypeIsWindow); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserCeiling) { @@ -5831,7 +5825,13 @@ namespace ConvectionCoefficients { return CalcFisherPedersenCeilDiffuserCeiling(AirChangeRate, Tsurf, Tamb, cosTilt, AirHumRat, Surface(SurfNum).Height); }; } else { - tmpHc = CalcFisherPedersenCeilDiffuserCeiling(AirChangeRate, Tsurface, Tzone, Surface(SurfNum).CosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); + tmpHc = CalcFisherPedersenCeilDiffuserCeiling(AirChangeRate, + Tsurface, + Tzone, + Surface(SurfNum).CosTilt, + AirHumRat, + Surface(SurfNum).Height, + Construct(Surface(SurfNum).Construction).TypeIsWindow); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FisherPedersenCeilDiffuserWalls) { @@ -5843,12 +5843,16 @@ namespace ConvectionCoefficients { return CalcFisherPedersenCeilDiffuserWalls(AirChangeRate, Tsurf, Tamb, cosTilt, AirHumRat, Surface(SurfNum).Height); }; } else { - tmpHc = CalcFisherPedersenCeilDiffuserWalls(AirChangeRate, Tsurface, Tzone, Surface(SurfNum).CosTilt, AirHumRat, Surface(SurfNum).Height, Construct(Surface(SurfNum).Construction).TypeIsWindow); + tmpHc = CalcFisherPedersenCeilDiffuserWalls(AirChangeRate, + Tsurface, + Tzone, + Surface(SurfNum).CosTilt, + AirHumRat, + Surface(SurfNum).Height, + Construct(Surface(SurfNum).Construction).TypeIsWindow); } if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double, double, double, double, double) -> double { - return tmpHc; - }; + HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_AlamdariHammondStableHorizontal) { @@ -5880,9 +5884,7 @@ namespace ConvectionCoefficients { Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq3WallAwayFromHeat) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcKhalifaEq3WallAwayFromHeat(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq3WallAwayFromHeat(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq3WallAwayFromHeat((Tsurface - Tzone)); } @@ -5898,27 +5900,21 @@ namespace ConvectionCoefficients { Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq5WallNearHeat) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcKhalifaEq5WallsNearHeat(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq5WallsNearHeat(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq5WallsNearHeat((Tsurface - Tzone)); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq6NonHeatedWalls) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcKhalifaEq6NonHeatedWalls(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq6NonHeatedWalls(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq6NonHeatedWalls((Tsurface - Tzone)); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KhalifaEq7Ceiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcKhalifaEq7Ceiling(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKhalifaEq7Ceiling(Tsurf - Tamb); }; } else { tmpHc = CalcKhalifaEq7Ceiling((Tsurface - Tzone)); } @@ -5944,65 +5940,49 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedAssistingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcBeausoleilMorrisonMixedAssistedWall(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneWallHeight, - Tsurf, - CalcZoneSupplyAirTemp(ZoneNum), - CalcZoneSystemACH(ZoneNum)); + return CalcBeausoleilMorrisonMixedAssistedWall( + Tsurf - Tamb, Surface(SurfNum).IntConvZoneWallHeight, Tsurf, CalcZoneSupplyAirTemp(ZoneNum), CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedAssistedWall((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneWallHeight, - Tsurface, - ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedAssistedWall((Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedOppossingWall) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcBeausoleilMorrisonMixedOpposingWall(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneWallHeight, - Tsurf, - CalcZoneSupplyAirTemp(ZoneNum), - CalcZoneSystemACH(ZoneNum)); + return CalcBeausoleilMorrisonMixedOpposingWall( + Tsurf - Tamb, Surface(SurfNum).IntConvZoneWallHeight, Tsurf, CalcZoneSupplyAirTemp(ZoneNum), CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedOpposingWall((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneWallHeight, - Tsurface, - ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedOpposingWall((Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedStableCeiling(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurf, - CalcZoneSupplyAirTemp(ZoneNum), - CalcZoneSystemACH(ZoneNum)); + Surface(SurfNum).IntConvZoneHorizHydrDiam, + Tsurf, + CalcZoneSupplyAirTemp(ZoneNum), + CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedStableCeiling((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurface, - ZoneNum); + tmpHc = + CalcBeausoleilMorrisonMixedStableCeiling((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcBeausoleilMorrisonMixedUnstableCeiling(Tsurf - Tamb, - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurf, - CalcZoneSupplyAirTemp(ZoneNum), - CalcZoneSystemACH(ZoneNum)); + Surface(SurfNum).IntConvZoneHorizHydrDiam, + Tsurf, + CalcZoneSupplyAirTemp(ZoneNum), + CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedUnstableCeiling((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurface, - ZoneNum); + tmpHc = + CalcBeausoleilMorrisonMixedUnstableCeiling((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedStableFloor) { @@ -6015,10 +5995,7 @@ namespace ConvectionCoefficients { CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedStableFloor((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurface, - ZoneNum); + tmpHc = CalcBeausoleilMorrisonMixedStableFloor((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_BeausoleilMorrisonMixedUnstableFloor) { @@ -6031,10 +6008,8 @@ namespace ConvectionCoefficients { CalcZoneSystemACH(ZoneNum)); }; } else { - tmpHc = CalcBeausoleilMorrisonMixedUnstableFloor((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneHorizHydrDiam, - Tsurface, - ZoneNum); + tmpHc = + CalcBeausoleilMorrisonMixedUnstableFloor((Tsurface - Tzone), Surface(SurfNum).IntConvZoneHorizHydrDiam, Tsurface, ZoneNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_FohannoPolidoriVerticalWall) { @@ -6042,22 +6017,17 @@ namespace ConvectionCoefficients { HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcFohannoPolidoriVerticalWall(Tsurf - Tamb, Surface(SurfNum).IntConvZoneWallHeight, - Tsurf - KelvinConv, // Kiva already uses Kelvin, but algorithm expects C + Tsurf - KelvinConv, // Kiva already uses Kelvin, but algorithm expects C -QdotConvInRepPerArea(SurfNum)); }; } else { - tmpHc = CalcFohannoPolidoriVerticalWall((Tsurface - Tzone), - Surface(SurfNum).IntConvZoneWallHeight, - Tsurface, - -QdotConvInRepPerArea(SurfNum), - SurfNum); + tmpHc = CalcFohannoPolidoriVerticalWall( + (Tsurface - Tzone), Surface(SurfNum).IntConvZoneWallHeight, Tsurface, -QdotConvInRepPerArea(SurfNum), SurfNum); } Surface(SurfNum).TAirRef = ZoneMeanAirTemp; } else if (SELECT_CASE_var == HcInt_KaradagChilledCeiling) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcKaradagChilledCeiling(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcKaradagChilledCeiling(Tsurf - Tamb); }; } else { tmpHc = CalcKaradagChilledCeiling((Tsurface - Tzone)); } @@ -6072,9 +6042,7 @@ namespace ConvectionCoefficients { Surface(SurfNum).IntConvWindowLocation, ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double, double, double, double, double) -> double { - return tmpHc; - }; + HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { @@ -6084,11 +6052,9 @@ namespace ConvectionCoefficients { } } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserWalls) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserWall( - Surface(SurfNum).IntConvZonePerimLength, Surface(SurfNum).IntConvWindowLocation, ZoneNum); + Surface(SurfNum).IntConvZonePerimLength, Surface(SurfNum).IntConvWindowLocation, ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double, double, double, double, double) -> double { - return tmpHc; - }; + HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { @@ -6099,9 +6065,7 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == HcInt_GoldsteinNovoselacCeilingDiffuserFloor) { tmpHc = CalcGoldsteinNovoselacCeilingDiffuserFloor(Surface(SurfNum).IntConvZonePerimLength, ZoneNum); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double, double, double, double, double) -> double { - return tmpHc; - }; + HnFn = [=](double, double, double, double, double) -> double { return tmpHc; }; } int ZoneNode = Zone(ZoneNum).SystemZoneNodeNumber; if (ZoneNode > 0) { @@ -6174,17 +6138,14 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == HcExt_UserCurve) { CalcUserDefinedOutsideHcModel(SurfNum, Surface(SurfNum).OutConvHnUserCurveIndex, Hn); if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - HnFn = [=](double Tsurf, double Tamb, double HfTerm, - double Roughness, double CosTilt) -> double { + HnFn = [=](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double { // Remove Hfterm since this is only used for the natural convection portion return SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out(Tsurf, Tamb, HfTerm, Roughness, CosTilt) - HfTerm; }; } } else if (SELECT_CASE_var == HcExt_NaturalASHRAEVerticalWall) { Hn = CalcASHRAEVerticalWall((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)); - HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { - return CalcASHRAEVerticalWall(Tsurf - Tamb); - }; + HnFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CalcASHRAEVerticalWall(Tsurf - Tamb); }; } else if (SELECT_CASE_var == HcExt_NaturalWaltonUnstableHorizontalOrTilt) { Hn = CalcWaltonUnstableHorizontalOrTilt((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), Surface(SurfNum).CosTilt); // TODO verify CosTilt in vs out @@ -6205,8 +6166,7 @@ namespace ConvectionCoefficients { return CalcAlamdariHammondVerticalWall(Tsurf - Tamb, Surface(SurfNum).OutConvFaceHeight); }; } else if (SELECT_CASE_var == HcExt_FohannoPolidoriVerticalWall) { - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { // Not compatible with Kiva (Exterior surfaces in Kiva are not currently reported. Also need to add cell-level convection.) ShowFatalError("Fohanno Polidori convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } @@ -6257,168 +6217,124 @@ namespace ConvectionCoefficients { HnFn = SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out; } } else if (SELECT_CASE_var == HcExt_SparrowWindward) { - Hf = CalcSparrowWindward(Roughness, - Surface(SurfNum).OutConvFacePerimeter, - Surface(SurfNum).OutConvFaceArea, - SurfWindSpeed, - SurfNum); + Hf = CalcSparrowWindward(Roughness, Surface(SurfNum).OutConvFacePerimeter, Surface(SurfNum).OutConvFaceArea, SurfWindSpeed, SurfNum); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). const double area = 9999999.; const double perim = 1.; - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcSparrowWindward(Roughness, perim, area, windSpeed); }; } else { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - auto& fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; + auto &fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; const double length = fnd.netPerimeter; const double height = fnd.wall.heightAboveGrade; - const double area = length*height; + const double area = length * height; const double perim = 2.0 * (length + height); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcSparrowWindward(Roughness, perim, area, windSpeed); double leewardHf = CalcSparrowLeeward(Roughness, perim, area, windSpeed); - return (windwardHf + leewardHf)/2.0; + return (windwardHf + leewardHf) / 2.0; }; } } - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_SparrowLeeward) { - Hf = CalcSparrowLeeward(Roughness, - Surface(SurfNum).OutConvFacePerimeter, - Surface(SurfNum).OutConvFaceArea, - SurfWindSpeed, - SurfNum); + Hf = CalcSparrowLeeward(Roughness, Surface(SurfNum).OutConvFacePerimeter, Surface(SurfNum).OutConvFaceArea, SurfWindSpeed, SurfNum); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). const double area = 9999999.; const double perim = 1.; - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcSparrowLeeward(Roughness, perim, area, windSpeed); }; } else { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - auto& fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; + auto &fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; const double length = fnd.netPerimeter; const double height = fnd.wall.heightAboveGrade; - const double area = length*height; + const double area = length * height; const double perim = 2.0 * (length + height); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcSparrowWindward(Roughness, perim, area, windSpeed); double leewardHf = CalcSparrowLeeward(Roughness, perim, area, windSpeed); - return (windwardHf + leewardHf)/2.0; + return (windwardHf + leewardHf) / 2.0; }; } } - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_MoWiTTWindward) { Hf = CalcMoWITTWindward(TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp, SurfWindSpeed); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcMoWITTForcedWindward(windSpeed); - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_MoWiTTLeeward) { Hf = CalcMoWITTLeeward((TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp), SurfWindSpeed); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcMoWITTForcedLeeward(windSpeed); - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedLeeward(windSpeed); }; } else { - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Windward) { - Hf = CalcDOE2Windward(TH(1, 1, SurfNum), - Surface(SurfNum).OutDryBulbTemp, - Surface(SurfNum).CosTilt, - SurfWindSpeed, - Roughness); + Hf = CalcDOE2Windward(TH(1, 1, SurfNum), Surface(SurfNum).OutDryBulbTemp, Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcMoWITTForcedWindward(windSpeed); - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_DOE2Leeward) { - Hf = CalcDOE2Leeward(TH(1, 1, SurfNum), - Surface(SurfNum).OutDryBulbTemp, - Surface(SurfNum).CosTilt, - SurfWindSpeed, - Roughness); + Hf = CalcDOE2Leeward(TH(1, 1, SurfNum), Surface(SurfNum).OutDryBulbTemp, Surface(SurfNum).CosTilt, SurfWindSpeed, Roughness); if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcMoWITTForcedWindward(windSpeed); - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMoWITTForcedWindward(windSpeed); }; } else { - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { // Average windward and leeward since all walls use same algorithm double windwardHf = CalcMoWITTForcedWindward(windSpeed); double leewardHf = CalcMoWITTForcedLeeward(windSpeed); return (windwardHf + leewardHf) / 2.0; }; } - HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double{ + HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double cosTilt) -> double { return CalcDOE2Forced(Tsurf, Tamb, cosTilt, hfTerm, Roughness); }; } else if (SELECT_CASE_var == HcExt_NusseltJurges) { Hf = CalcNusseltJurges(SurfWindSpeed); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcNusseltJurges(windSpeed); - }; - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcNusseltJurges(windSpeed); }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_McAdams) { Hf = CalcMcAdams(SurfWindSpeed); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return CalcMcAdams(windSpeed); - }; - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMcAdams(windSpeed); }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_Mitchell) { Hf = CalcMitchell(SurfWindSpeed, CubeRootOfOverallBuildingVolume, SurfNum); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ + HfTermFn = [=](double, double, double, double windSpeed) -> double { return CalcMitchell(windSpeed, CubeRootOfOverallBuildingVolume); }; - HfFn = [](double, double, double HfTerm, double, double) -> double{ - return HfTerm; - }; + HfFn = [](double, double, double HfTerm, double, double) -> double { return HfTerm; }; } else if (SELECT_CASE_var == HcExt_ClearRoof) { SurfWindDir = Surface(SurfNum).WindDir; Hf = CalcClearRoof(SurfNum, @@ -6428,24 +6344,22 @@ namespace ConvectionCoefficients { SurfWindDir, Surface(SurfNum).OutConvFaceArea, Surface(SurfNum).OutConvFacePerimeter); - HfTermFn = [=](double, double, double, double windSpeed) -> double{ - return windSpeed; - }; + HfTermFn = [=](double, double, double, double windSpeed) -> double { return windSpeed; }; if (Surface(SurfNum).Class == SurfaceClass_Floor) { // used for exterior grade // Assume very large area for grade (relative to perimeter). const double area = 9999999.; const double perim = 1.; - HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double{ + HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double { return CalcClearRoof(Tsurf, Tamb, hfTerm, area, perim, Roughness); }; } else { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { - auto& fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; + auto &fnd = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].get_instance(0).first->foundation; const double length = fnd.netPerimeter; const double height = fnd.wall.heightAboveGrade; - const double area = length*height; + const double area = length * height; const double perim = 2.0 * (length + height); - HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double{ + HfFn = [=](double Tsurf, double Tamb, double hfTerm, double, double) -> double { return CalcClearRoof(Tsurf, Tamb, hfTerm, area, perim, Roughness); }; } @@ -6453,22 +6367,19 @@ namespace ConvectionCoefficients { } else if (SELECT_CASE_var == HcExt_BlockenWindward) { Hf = CalcBlockenWindward(WindSpeed, WindDir, Surface(SurfNum).Azimuth); // Not compatible with Kiva (doesn't use weather station windspeed) - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError("Blocken Windward convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } } else if (SELECT_CASE_var == HcExt_EmmelVertical) { Hf = CalcEmmelVertical(WindSpeed, WindDir, Surface(SurfNum).Azimuth, SurfNum); // Not compatible with Kiva (doesn't use weather station windspeed) - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError("Emmel Vertical convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } } else if (SELECT_CASE_var == HcExt_EmmelRoof) { Hf = CalcEmmelRoof(WindSpeed, WindDir, RoofLongAxisOutwardAzimuth, SurfNum); // Not compatible with Kiva (doesn't use weather station windspeed) - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { ShowFatalError("Emmel Roof convection model not applicable for foundation surface =" + Surface(SurfNum).Name); } } @@ -6478,13 +6389,13 @@ namespace ConvectionCoefficients { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = HfTermFn; - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = [=](double Tsurf, double Tamb, double HfTerm, - double Roughness, double cosTilt) -> double { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = + [=](double Tsurf, double Tamb, double HfTerm, double Roughness, double cosTilt) -> double { Real64 HcExt = HfFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt) + HnFn(Tsurf, Tamb, HfTerm, Roughness, cosTilt); if (HcExt < AdaptiveHcOutsideLowLimit) HcExt = AdaptiveHcOutsideLowLimit; return HcExt; }; - Hc = 0.0; // Not used in Kiva + Hc = 0.0; // Not used in Kiva } if (Hc < AdaptiveHcOutsideLowLimit) Hc = AdaptiveHcOutsideLowLimit; @@ -6530,8 +6441,9 @@ namespace ConvectionCoefficients { surfWindDir = Surface(SurfNum).WindDir; if (Surface(SurfNum).Class == SurfaceClass_Roof || - (Surface(SurfNum).Class == SurfaceClass_Floor && Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) // Applies to exterior grade - ) { + (Surface(SurfNum).Class == SurfaceClass_Floor && + Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) // Applies to exterior grade + ) { if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { DeltaTemp = SurfaceGeometry::kivaManager.surfaceMap[SurfNum].results.Tconv - Surface(SurfNum).OutDryBulbTemp; } else { @@ -7736,7 +7648,7 @@ namespace ConvectionCoefficients { } } - auto& UserCurve = HcInsideUserCurve(UserCurveNum); + auto &UserCurve = HcInsideUserCurve(UserCurveNum); { auto const SELECT_CASE_var(UserCurve.ReferenceTempType); @@ -7764,7 +7676,7 @@ namespace ConvectionCoefficients { if (UserCurve.HcFnTempDiffDivHeightCurveNum > 0) { HcFnTempDiffDivHeight = CurveValue(UserCurve.HcFnTempDiffDivHeightCurveNum, - (std::abs(TH(2, 1, SurfNum) - tmpAirTemp) / Surface(SurfNum).IntConvZoneWallHeight)); + (std::abs(TH(2, 1, SurfNum) - tmpAirTemp) / Surface(SurfNum).IntConvZoneWallHeight)); HcFnTempDiffDivHeightFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CurveValue(UserCurve.HcFnTempDiffDivHeightCurveNum, std::abs(Tsurf - Tamb) / Surface(SurfNum).IntConvZoneWallHeight); }; @@ -7775,14 +7687,14 @@ namespace ConvectionCoefficients { } if (UserCurve.HcFnACHDivPerimLengthCurveNum > 0) { - HcFnACHDivPerimLength = - CurveValue(UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / Surface(SurfNum).IntConvZonePerimLength)); + HcFnACHDivPerimLength = CurveValue(UserCurve.HcFnACHDivPerimLengthCurveNum, (AirChangeRate / Surface(SurfNum).IntConvZonePerimLength)); } - if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) - { - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = [=](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double { - return HcFnTempDiffFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HcFnTempDiffDivHeightFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HcFnACH + HcFnACHDivPerimLength; + if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].in = + [=](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double { + return HcFnTempDiffFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HcFnTempDiffDivHeightFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + + HcFnACH + HcFnACHDivPerimLength; }; Hc = 0.0; } else { @@ -7832,7 +7744,7 @@ namespace ConvectionCoefficients { Real64 Theta; Real64 ThetaRad; - auto& UserCurve = HcOutsideUserCurve(UserCurveNum); + auto &UserCurve = HcOutsideUserCurve(UserCurveNum); { auto const SELECT_CASE_var(UserCurve.WindSpeedType); @@ -7860,37 +7772,35 @@ namespace ConvectionCoefficients { Real64 HfFnWindSpeed(0.0), HnFnTempDiff(0.0), HnFnTempDiffDivHeight(0.0); if (UserCurve.HfFnWindSpeedCurveNum > 0) { HfFnWindSpeed = CurveValue(UserCurve.HfFnWindSpeedCurveNum, windVel); - HfFnWindSpeedFn = [=](double, double, double, double windSpeed ) -> double { + HfFnWindSpeedFn = [=](double, double, double, double windSpeed) -> double { return CurveValue(UserCurve.HfFnWindSpeedCurveNum, windSpeed); }; } if (UserCurve.HnFnTempDiffCurveNum > 0) { HnFnTempDiff = CurveValue(UserCurve.HnFnTempDiffCurveNum, std::abs(TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)); - HnFnTempDiffFn = [=](double Tsurf, double Tamb, double, - double, double) -> double { + HnFnTempDiffFn = [=](double Tsurf, double Tamb, double, double, double) -> double { return CurveValue(UserCurve.HnFnTempDiffCurveNum, std::abs(Tsurf - Tamb)); }; } if (UserCurve.HnFnTempDiffDivHeightCurveNum > 0) { if (Surface(SurfNum).OutConvFaceHeight > 0.0) { - HnFnTempDiffDivHeight = CurveValue(UserCurve.HnFnTempDiffDivHeightCurveNum, - ((std::abs(TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)) / Surface(SurfNum).OutConvFaceHeight)); - HnFnTempDiffDivHeightFn = [=](double Tsurf, double Tamb, double, - double, double) -> double { - return CurveValue(UserCurve.HnFnTempDiffDivHeightCurveNum, - ((std::abs(Tsurf - Tamb)) / Surface(SurfNum).OutConvFaceHeight)); + HnFnTempDiffDivHeight = + CurveValue(UserCurve.HnFnTempDiffDivHeightCurveNum, + ((std::abs(TH(1, 1, SurfNum) - Surface(SurfNum).OutDryBulbTemp)) / Surface(SurfNum).OutConvFaceHeight)); + HnFnTempDiffDivHeightFn = [=](double Tsurf, double Tamb, double, double, double) -> double { + return CurveValue(UserCurve.HnFnTempDiffDivHeightCurveNum, ((std::abs(Tsurf - Tamb)) / Surface(SurfNum).OutConvFaceHeight)); }; } } if (Surface(SurfNum).ExtBoundCond == DataSurfaces::KivaFoundation) { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].f = HfFnWindSpeedFn; - SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = [=](double Tsurf, double Tamb, double HfTerm, - double Roughness, double CosTilt) -> double { - return HnFnTempDiffFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) - + HnFnTempDiffDivHeightFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HfTerm; + SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = + [=](double Tsurf, double Tamb, double HfTerm, double Roughness, double CosTilt) -> double { + return HnFnTempDiffFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + HnFnTempDiffDivHeightFn(Tsurf, Tamb, HfTerm, Roughness, CosTilt) + + HfTerm; }; } H = HfFnWindSpeed + HnFnTempDiff + HnFnTempDiffDivHeight; @@ -8029,7 +7939,7 @@ namespace ConvectionCoefficients { return Hn; } - Real64 CalcFisherPedersenCeilDiffuserFloor(Real64 const ACH, // [1/hr] air system air change rate + Real64 CalcFisherPedersenCeilDiffuserFloor(Real64 const ACH, // [1/hr] air system air change rate Real64 const Tsurf, Real64 const Tair, Real64 const cosTilt, @@ -8044,18 +7954,17 @@ namespace ConvectionCoefficients { // ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13 Real64 Hforced; - + Hforced = 3.873 + 0.082 * std::pow(ACH, 0.98); - + if (ACH > 1.0) { return Hforced; - } - else { // Revert to purely natural convection - return CalcFisherPedersenCeilDiffuserNatConv(Hforced,ACH,Tsurf,Tair,cosTilt,humRat,height,isWindow); + } else { // Revert to purely natural convection + return CalcFisherPedersenCeilDiffuserNatConv(Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow); } } - Real64 CalcFisherPedersenCeilDiffuserCeiling(Real64 const ACH, // [1/hr] air system air change rate + Real64 CalcFisherPedersenCeilDiffuserCeiling(Real64 const ACH, // [1/hr] air system air change rate Real64 const Tsurf, Real64 const Tair, Real64 const cosTilt, @@ -8070,18 +7979,17 @@ namespace ConvectionCoefficients { // ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13 Real64 Hforced; - + Hforced = 2.234 + 4.099 * std::pow(ACH, 0.503); - + if (ACH > 1.0) { return Hforced; - } - else { // Revert to purely natural convection - return CalcFisherPedersenCeilDiffuserNatConv(Hforced,ACH,Tsurf,Tair,cosTilt,humRat,height,isWindow); + } else { // Revert to purely natural convection + return CalcFisherPedersenCeilDiffuserNatConv(Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow); } } - Real64 CalcFisherPedersenCeilDiffuserWalls(Real64 const ACH, // [1/hr] air system air change rate + Real64 CalcFisherPedersenCeilDiffuserWalls(Real64 const ACH, // [1/hr] air system air change rate Real64 const Tsurf, Real64 const Tair, Real64 const cosTilt, @@ -8096,14 +8004,13 @@ namespace ConvectionCoefficients { // ASHRAE Transactions, vol. 103, Pt. 2, 1997, p.13 Real64 Hforced; - + Hforced = 1.208 + 1.012 * std::pow(ACH, 0.604); - + if (ACH > 1.0) { return Hforced; - } - else { // Revert to purely natural convection - return CalcFisherPedersenCeilDiffuserNatConv(Hforced,ACH,Tsurf,Tair,cosTilt,humRat,height,isWindow); + } else { // Revert to purely natural convection + return CalcFisherPedersenCeilDiffuserNatConv(Hforced, ACH, Tsurf, Tair, cosTilt, humRat, height, isWindow); } } @@ -8116,26 +8023,25 @@ namespace ConvectionCoefficients { Real64 const height, bool const isWindow) { - + Real64 Hnatural; - - if (isWindow) { // Unlikely for a floor, but okay... + + if (isWindow) { // Unlikely for a floor, but okay... Real64 const tilt = acos(cosTilt); // outward facing tilt Real64 const sinTilt = sin(tilt); Hnatural = CalcISO15099WindowIntConvCoeff(Tsurf, Tair, humRat, height, tilt, sinTilt); } else { - Hnatural = CalcASHRAETARPNatural(Tsurf, Tair, -cosTilt); // negative cosTilt because interior of surface + Hnatural = CalcASHRAETARPNatural(Tsurf, Tair, -cosTilt); // negative cosTilt because interior of surface } if (ACH <= 0.5) { return Hnatural; } else { - return Hnatural + ((Hforced-Hnatural)*((ACH-0.5)/0.5)); + return Hnatural + ((Hforced - Hnatural) * ((ACH - 0.5) / 0.5)); } - } - - Real64 CalcAlamdariHammondUnstableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air - Real64 const HydraulicDiameter // [m] characteristic size, = (4 * area) / perimeter + + Real64 CalcAlamdariHammondUnstableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air + Real64 const HydraulicDiameter // [m] characteristic size, = (4 * area) / perimeter ) { @@ -8157,9 +8063,8 @@ namespace ConvectionCoefficients { // for buoyancy-driven convection in rooms. Building Services Engineering // Research & Technology. Vol. 4, No. 3. - return std::pow(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, OneFourth)) + (1.63 * pow_2(DeltaTemp)), - OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) } Real64 CalcAlamdariHammondUnstableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air @@ -8181,15 +8086,15 @@ namespace ConvectionCoefficients { ShowContinueError("Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } ShowRecurringSevereErrorAtEnd( - "CalcAlamdariHammondUnstableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]", - ErrorIndex); + "CalcAlamdariHammondUnstableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]", + ErrorIndex); } return Hn; } - Real64 CalcAlamdariHammondStableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air - Real64 const HydraulicDiameter // [m] characteristic size, = (4 * area) / perimeter + Real64 CalcAlamdariHammondStableHorizontal(Real64 const DeltaTemp, // [C] temperature difference between surface and air + Real64 const HydraulicDiameter // [m] characteristic size, = (4 * area) / perimeter ) { @@ -8234,16 +8139,15 @@ namespace ConvectionCoefficients { ShowContinueError("Convection surface heat transfer coefficient set to 9.999 [W/m2-K] and the simulation continues"); } ShowRecurringSevereErrorAtEnd( - "CalcAlamdariHammondStableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]", - ErrorIndex); + "CalcAlamdariHammondStableHorizontal: Convection model not evaluated because zero hydraulic diameter and set to 9.999 [W/m2-K]", + ErrorIndex); } return Hn; } Real64 CalcAlamdariHammondVerticalWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air - Real64 const Height - ) + Real64 const Height) { // FUNCTION INFORMATION: @@ -8265,7 +8169,7 @@ namespace ConvectionCoefficients { // Research & Technology. Vol. 4, No. 3. return std::pow(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, OneFourth)) + (1.23 * pow_2(DeltaTemp)), - OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + OneSixth); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) } Real64 CalcAlamdariHammondVerticalWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air @@ -8666,19 +8570,18 @@ namespace ConvectionCoefficients { std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, OneFourth)) + std::pow(1.23 * pow_2(DeltaTemp), OneSixth)) + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.199 + 0.190 * std::pow(AirChangeRate, - 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) - Real64 Hc = std::pow(std::abs(cofpow), OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + Real64 Hc = std::pow(std::abs(cofpow), OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) if (cofpow < 0.0) { Hc = -Hc; } return Hc; - } - Real64 CalcBeausoleilMorrisonMixedAssistedWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air - Real64 const Height, // [m] characteristic size - Real64 const SurfTemp, // [C] surface temperature - int const ZoneNum // index of zone for messaging + Real64 CalcBeausoleilMorrisonMixedAssistedWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air + Real64 const Height, // [m] characteristic size + Real64 const SurfTemp, // [C] surface temperature + int const ZoneNum // index of zone for messaging ) { static int ErrorIndex(0); @@ -8741,13 +8644,12 @@ namespace ConvectionCoefficients { Real64 cofpow; if (Height != 0.0) { - cofpow = std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, OneFourth)) + std::pow(1.23 * pow_2(DeltaTemp), OneSixth)) - - pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * - (-0.199 + - 0.190 * std::pow(AirChangeRate, - 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) - HcTmp1 = - std::pow(std::abs(cofpow), OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + cofpow = + std::sqrt(pow_6(1.5 * std::pow(std::abs(DeltaTemp) / Height, OneFourth)) + std::pow(1.23 * pow_2(DeltaTemp), OneSixth)) - + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * + (-0.199 + 0.190 * std::pow(AirChangeRate, + 0.8))); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) + HcTmp1 = std::pow(std::abs(cofpow), OneThird); // Tuned pow_6( std::pow( std::abs( DeltaTemp ), OneThird ) ) changed to pow_2( DeltaTemp ) if (cofpow < 0.0) { HcTmp1 = -HcTmp1; } @@ -8761,13 +8663,12 @@ namespace ConvectionCoefficients { HcTmp3 = 0.8 * ((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.199 + 0.190 * std::pow(AirChangeRate, 0.8)); return max(max(HcTmp1, HcTmp2), HcTmp3); - } - Real64 CalcBeausoleilMorrisonMixedOpposingWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air - Real64 const Height, // [m] characteristic size - Real64 const SurfTemp, // [C] surface temperature - int const ZoneNum // index of zone for messaging + Real64 CalcBeausoleilMorrisonMixedOpposingWall(Real64 const DeltaTemp, // [C] temperature difference between surface and air + Real64 const Height, // [m] characteristic size + Real64 const SurfTemp, // [C] surface temperature + int const ZoneNum // index of zone for messaging ) { static int ErrorIndex(0); @@ -8831,15 +8732,13 @@ namespace ConvectionCoefficients { // air flow modeling within dynamic whole-building simulations. // PhD. Thesis. University of Strathclyde, Glasgow, UK. - Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, OneFifth)) + - pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8))); + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8))); Real64 Hc = std::pow(std::abs(cofpow), OneThird); if (cofpow < 0.0) { Hc = -Hc; } return Hc; - } Real64 CalcBeausoleilMorrisonMixedStableFloor(Real64 const DeltaTemp, // [C] temperature difference between surface and air @@ -8904,8 +8803,8 @@ namespace ConvectionCoefficients { // PhD. Thesis. University of Strathclyde, Glasgow, UK. Real64 cofpow = std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, OneFourth)) + - pow_6(1.63 * std::pow(std::abs(DeltaTemp), OneThird))) + - pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8))); + pow_6(1.63 * std::pow(std::abs(DeltaTemp), OneThird))) + + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (0.159 + 0.116 * std::pow(AirChangeRate, 0.8))); Real64 Hc = std::pow(std::abs(cofpow), OneThird); if (cofpow < 0.0) { Hc = -Hc; @@ -8975,7 +8874,7 @@ namespace ConvectionCoefficients { // PhD. Thesis. University of Strathclyde, Glasgow, UK. Real64 cofpow = pow_3(0.6 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, OneFifth)) + - pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8))); + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8))); Real64 Hc = std::pow(std::abs(cofpow), OneThird); if (cofpow < 0.0) { Hc = -Hc; @@ -9045,8 +8944,8 @@ namespace ConvectionCoefficients { // PhD. Thesis. University of Strathclyde, Glasgow, UK. Real64 cofpow = std::sqrt(pow_6(1.4 * std::pow(std::abs(DeltaTemp) / HydraulicDiameter, OneFourth)) + - pow_6(1.63 * std::pow(std::abs(DeltaTemp), OneThird))) + - pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8))); + pow_6(1.63 * std::pow(std::abs(DeltaTemp), OneThird))) + + pow_3(((SurfTemp - SupplyAirTemp) / std::abs(DeltaTemp)) * (-0.166 + 0.484 * std::pow(AirChangeRate, 0.8))); Real64 Hc = std::pow(std::abs(cofpow), OneThird); if (cofpow < 0.0) { Hc = -Hc; @@ -9264,10 +9163,8 @@ namespace ConvectionCoefficients { if (ZoneExtPerimLength > 0.0) { if (WindWallRatio <= 0.5) { - if (WindowLocationType != InConvWinLoc_UpperPartOfExteriorWall && - WindowLocationType != InConvWinLoc_LowerPartOfExteriorWall && - WindowLocationType != InConvWinLoc_LargePartOfExteriorWall && - WindowLocationType != InConvWinLoc_NotSet) { + if (WindowLocationType != InConvWinLoc_UpperPartOfExteriorWall && WindowLocationType != InConvWinLoc_LowerPartOfExteriorWall && + WindowLocationType != InConvWinLoc_LargePartOfExteriorWall && WindowLocationType != InConvWinLoc_NotSet) { if (ErrorIndex == 0) { ShowSevereMessage( "CalcGoldsteinNovoselacCeilingDiffuserWindow: Convection model not evaluated (bad relative window location)"); @@ -9345,8 +9242,7 @@ namespace ConvectionCoefficients { Real64 AirSystemFlowRate = CalcZoneSystemVolFlowRate(ZoneNum); if (ZoneExtPerimLength > 0.0) { - if (WindowLocationType != InConvWinLoc_WindowAboveThis && - WindowLocationType != InConvWinLoc_WindowBelowThis && + if (WindowLocationType != InConvWinLoc_WindowAboveThis && WindowLocationType != InConvWinLoc_WindowBelowThis && WindowLocationType != InConvWinLoc_NotSet) { if (ErrorIndex == 0) { ShowSevereMessage("CalcGoldsteinNovoselacCeilingDiffuserWall: Convection model not evaluated (bad relative window location)"); @@ -9372,8 +9268,8 @@ namespace ConvectionCoefficients { return CalcGoldsteinNovoselacCeilingDiffuserWall(AirSystemFlowRate, ZoneExtPerimLength, WindowLocationType); } - Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate - Real64 const ZoneExtPerimLength // [m] length of zone perimeter with exterior walls + Real64 CalcGoldsteinNovoselacCeilingDiffuserFloor(Real64 const AirSystemFlowRate, // [m3/s] air system flow rate + Real64 const ZoneExtPerimLength // [m] length of zone perimeter with exterior walls ) { @@ -9479,11 +9375,9 @@ namespace ConvectionCoefficients { // M.S. Thesis, Department of Mechanical and Industrial Engineering, // University of Illinois at Urbana-Champaign. - return 0.5 * CalcSparrowWindward(RoughnessIndex, FacePerimeter, FaceArea, WindAtZ); } - Real64 CalcSparrowWindward(int const RoughnessIndex, Real64 const FacePerimeter, Real64 const FaceArea, Real64 const WindAtZ, int const SurfNum) { static int ErrorIndex(0); @@ -9527,7 +9421,7 @@ namespace ConvectionCoefficients { Real64 CalcMoWITTNatural(Real64 DeltaTemp) { static Real64 const temp_fac(0.84); - return temp_fac * std::pow(std::abs(DeltaTemp), 1.0/3.0); + return temp_fac * std::pow(std::abs(DeltaTemp), 1.0 / 3.0); } Real64 CalcMoWITTForcedWindward(Real64 const WindAtZ) @@ -9567,7 +9461,6 @@ namespace ConvectionCoefficients { Real64 Hn = CalcMoWITTNatural(DeltaTemp); Real64 Hf = CalcMoWITTForcedWindward(WindAtZ); return std::sqrt(pow_2(Hn) + pow_2(Hf)); - } Real64 CalcMoWITTLeeward(Real64 const DeltaTemp, Real64 const WindAtZ) @@ -10068,8 +9961,7 @@ namespace ConvectionCoefficients { Real64 const RoofPerimeter) { - - Real64 x; // distance to roof edge toward wind direction + Real64 x; // distance to roof edge toward wind direction static int ErrorIndex(0); diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index 8a03902bfe7..33efbe22868 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -716,7 +716,7 @@ namespace CoolTower { // From the mass balance W_in*(m_air + m_water) = W_out*m_air RhoWater = RhoH2O(OutletTemp); // Assume T_water = T_outlet OutletHumRat = (InletHumRat * (AirMassFlowRate + (CoolTowerSys(CoolTowerNum).ActualWaterFlowRate * RhoWater))) / AirMassFlowRate; - AirSpecHeat = PsyCpAirFnWTdb(OutletHumRat, OutletTemp); + AirSpecHeat = PsyCpAirFnWTdb(OutletHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutletTemp, OutletHumRat); // Outlet air density CVF_ZoneNum = CoolTowerSys(CoolTowerNum).ActualAirVolFlowRate * GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum).SchedPtr); MCPC(ZoneNum) = CVF_ZoneNum * AirDensity * AirSpecHeat; diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index ee430b707b7..096c5dc21f0 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -760,7 +760,7 @@ namespace DataSurfaces { for (int NodeNum = 1; NodeNum <= ZoneEquipConfig(Zone).NumInletNodes; ++NodeNum) { Real64 NodeTemp = Node(ZoneEquipConfig(Zone).InletNode(NodeNum)).Temp; Real64 MassFlowRate = Node(ZoneEquipConfig(Zone).InletNode(NodeNum)).MassFlowRate; - Real64 CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(Zone), NodeTemp); + Real64 CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(Zone)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 6f2b5f6be39..2922be780fa 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -1515,13 +1515,12 @@ namespace DesiccantDehumidifiers { DesicDehum(DesicDehumNum).ExhaustFanCurveIndex = GetCurveIndex(Alphas(15)); if (DesicDehum(DesicDehumNum).ExhaustFanCurveIndex > 0) { - ErrorsFoundGeneric |= CurveManager::CheckCurveDims( - DesicDehum(DesicDehumNum).ExhaustFanCurveIndex, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - DesicDehum(DesicDehumNum).Name, // Object Name - cAlphaFields(15)); // Field Name + ErrorsFoundGeneric |= CurveManager::CheckCurveDims(DesicDehum(DesicDehumNum).ExhaustFanCurveIndex, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + DesicDehum(DesicDehumNum).Name, // Object Name + cAlphaFields(15)); // Field Name } if (DesicDehum(DesicDehumNum).Preheat == Yes) { @@ -2680,8 +2679,7 @@ namespace DesiccantDehumidifiers { DataHeatBalance::HeatReclaimVS_DXCoil(DesicDehum(DesicDehumNum).DXCoilIndex).AvailCapacity = 0.0; } - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).CondenserInletNode).HumRat, - Node(DesicDehum(DesicDehumNum).CondenserInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).CondenserInletNode).HumRat); if (DesicDehum(DesicDehumNum).RegenFanPlacement == BlowThru) { if (DesicDehum(DesicDehumNum).regenFanType_Num != DataHVACGlobals::FanType_SystemModelObject) { @@ -2763,8 +2761,7 @@ namespace DesiccantDehumidifiers { if (RegenCoilIndex > 0) { if (NewRegenInTemp < RegenSetPointTemp) { - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat, - Node(DesicDehum(DesicDehumNum).RegenAirInNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); } QRegen = max(0.0, (CpAir * Node(DesicDehum(DesicDehumNum).RegenAirInNode).MassFlowRate * @@ -2850,8 +2847,7 @@ namespace DesiccantDehumidifiers { } if (RegenCoilIndex > 0) { - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat, - Node(DesicDehum(DesicDehumNum).RegenAirInNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); QRegen = max(0.0, (CpAir * Node(DesicDehum(DesicDehumNum).RegenAirInNode).MassFlowRate * (RegenSetPointTemp - Node(DesicDehum(DesicDehumNum).RegenAirInNode).Temp))); @@ -3496,7 +3492,7 @@ namespace DesiccantDehumidifiers { // Return value int NodeNum; // node number returned - // FUNCTION LOCAL VARIABLE DECLARATIONS: + // FUNCTION LOCAL VARIABLE DECLARATIONS: int WhichDesicDehum; // Obtains and Allocates heat exchanger related parameters from input file @@ -3512,7 +3508,7 @@ namespace DesiccantDehumidifiers { ShowSevereError("GetProcAirInletNodeNum: Could not find Desciccant Dehumidifier = \"" + DesicDehumName + "\""); ErrorsFound = true; NodeNum = 0; - } + } return NodeNum; } @@ -3532,7 +3528,7 @@ namespace DesiccantDehumidifiers { // Return value int NodeNum; // node number returned - // FUNCTION LOCAL VARIABLE DECLARATIONS: + // FUNCTION LOCAL VARIABLE DECLARATIONS: int WhichDesicDehum; // Obtains and Allocates heat exchanger related parameters from input file @@ -3568,7 +3564,7 @@ namespace DesiccantDehumidifiers { // Return value int NodeNum; // node number returned - // FUNCTION LOCAL VARIABLE DECLARATIONS: + // FUNCTION LOCAL VARIABLE DECLARATIONS: int WhichDesicDehum; // Obtains and Allocates heat exchanger related parameters from input file @@ -3604,7 +3600,7 @@ namespace DesiccantDehumidifiers { // Return value int NodeNum; // node number returned - // FUNCTION LOCAL VARIABLE DECLARATIONS: + // FUNCTION LOCAL VARIABLE DECLARATIONS: int WhichDesicDehum; // Obtains and Allocates heat exchanger related parameters from input file diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 91e7f177239..5f5a44c3e8d 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -54,8 +54,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include @@ -735,7 +735,7 @@ namespace DisplacementVentMgr { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -861,13 +861,13 @@ namespace DisplacementVentMgr { AIRRATFloor(ZoneNum) = Zone(ZoneNum).Volume * min(HeightTransition(ZoneNum), HeightFloorSubzoneTop) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATFloor(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATFloor(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATOC(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATMX(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3Floor(ZoneNum) = XM3TFloor(ZoneNum); diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index f5b84fd025c..4ce91ace9ad 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -1235,7 +1235,7 @@ namespace DualDuct { // If there is massflow then need to provide the correct amount of total // required zone energy if (MassFlow > SmallMassFlow) { - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); QZnReq = QTotLoad + MassFlow * CpAirZn * Node(ZoneNodeNum).Temp; // If the enthalpy is the same for the hot and cold duct then there would be a // divide by zero so for heating or cooling set the damper to one max flow @@ -1365,7 +1365,7 @@ namespace DualDuct { // The calculated load from the Heat Balance QTotLoad = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; // Calculate all of the required Cp's - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); // CpAirSysHot = PsyCpAirFnWTdb(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp) // CpAirSysCold= PsyCpAirFnWTdb(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp) CpAirSysHot = CpAirZn; @@ -1612,9 +1612,9 @@ namespace DualDuct { QtoCoolSPRemain = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToCoolSP; // Calculate all of the required Cp's - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); - CpAirSysOA = PsyCpAirFnWTdb(Node(OAInletNodeNum).HumRat, Node(OAInletNodeNum).Temp); - if (Damper(DamperNum).RecircIsUsed) CpAirSysRA = PsyCpAirFnWTdb(Node(RecircInletNodeNum).HumRat, Node(RecircInletNodeNum).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); + CpAirSysOA = PsyCpAirFnWTdb(Node(OAInletNodeNum).HumRat); + if (Damper(DamperNum).RecircIsUsed) CpAirSysRA = PsyCpAirFnWTdb(Node(RecircInletNodeNum).HumRat); // Set the OA Damper to the calculated ventilation flow rate DamperOAInlet(DamperNum).AirMassFlowRate = OAMassFlow; @@ -2162,8 +2162,9 @@ namespace DualDuct { // Formats static ObjexxFCL::gio::Fmt Format_100("('! <#Dual Duct Damper Connections>,')"); static ObjexxFCL::gio::Fmt Format_101("(A)"); - static ObjexxFCL::gio::Fmt Format_102("('! ,,,,',',,')"); + static ObjexxFCL::gio::Fmt Format_102( + "('! ,,,,',',,')"); static ObjexxFCL::gio::Fmt fmtLD("*"); if (!allocated(Damper)) @@ -2225,20 +2226,20 @@ namespace DualDuct { } if ((Damper(Count1).DamperType == DualDuct_ConstantVolume) || (Damper(Count1).DamperType == DualDuct_VariableVolume)) { - ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) << " Dual Duct Damper," + stripped(ChrOut) + ',' + DamperType + ',' + - Damper(Count1).DamperName + ',' + NodeID(Damper(Count1).HotAirInletNodeNum) + ',' + - NodeID(Damper(Count1).OutletNodeNum) + ",Hot Air," + ChrName; + ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) + << " Dual Duct Damper," + stripped(ChrOut) + ',' + DamperType + ',' + Damper(Count1).DamperName + ',' + + NodeID(Damper(Count1).HotAirInletNodeNum) + ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Hot Air," + ChrName; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) << " Dual Duct Damper," + stripped(ChrOut) + ',' + DamperType + ',' + - Damper(Count1).DamperName + ',' + NodeID(Damper(Count1).ColdAirInletNodeNum) + - ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Cold Air," + ChrName; + ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) + << " Dual Duct Damper," + stripped(ChrOut) + ',' + DamperType + ',' + Damper(Count1).DamperName + ',' + + NodeID(Damper(Count1).ColdAirInletNodeNum) + ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Cold Air," + ChrName; } else if (Damper(Count1).DamperType == DualDuct_OutdoorAir) { - ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) << "Dual Duct Damper, " + stripped(ChrOut) + ',' + DamperType + ',' + - Damper(Count1).DamperName + ',' + NodeID(Damper(Count1).OAInletNodeNum) + ',' + - NodeID(Damper(Count1).OutletNodeNum) + ",Outdoor Air," + ChrName; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) << "Dual Duct Damper, " + stripped(ChrOut) + ',' + DamperType + ',' + - Damper(Count1).DamperName + ',' + NodeID(Damper(Count1).RecircAirInletNodeNum) + - ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Recirculated Air," + ChrName; + ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) + << "Dual Duct Damper, " + stripped(ChrOut) + ',' + DamperType + ',' + Damper(Count1).DamperName + ',' + + NodeID(Damper(Count1).OAInletNodeNum) + ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Outdoor Air," + ChrName; + ObjexxFCL::gio::write(OutputFileBNDetails, Format_101) + << "Dual Duct Damper, " + stripped(ChrOut) + ',' + DamperType + ',' + Damper(Count1).DamperName + ',' + + NodeID(Damper(Count1).RecircAirInletNodeNum) + ',' + NodeID(Damper(Count1).OutletNodeNum) + ",Recirculated Air," + ChrName; } } } diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index fd922e840e5..d1c6101ee4a 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -556,7 +556,7 @@ namespace EarthTube { if (std::abs(MAT(NZ) - OutDryBulbTemp) < EarthTubeSys(Loop).DelTemperature) continue; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutDryBulbTemp, OutHumRat); - AirSpecHeat = PsyCpAirFnWTdb(OutHumRat, OutDryBulbTemp); + AirSpecHeat = PsyCpAirFnWTdb(OutHumRat); EVF(NZ) = EarthTubeSys(Loop).DesignLevel * GetCurrentScheduleValue(EarthTubeSys(Loop).SchedPtr); MCPE(NZ) = EVF(NZ) * AirDensity * AirSpecHeat * (EarthTubeSys(Loop).ConstantTermCoef + std::abs(OutDryBulbTemp - MAT(NZ)) * EarthTubeSys(Loop).TemperatureTermCoef + @@ -717,7 +717,7 @@ namespace EarthTube { // Break the infiltration load into heat gain and loss components. AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutDryBulbTemp, OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat, OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); ZnRptET(ZoneLoop).EarthTubeVolume = (MCPE(ZoneLoop) / CpAir / AirDensity) * ReportingConstant; ZnRptET(ZoneLoop).EarthTubeMass = (MCPE(ZoneLoop) / CpAir) * ReportingConstant; ZnRptET(ZoneLoop).EarthTubeVolFlowRate = MCPE(ZoneLoop) / CpAir / AirDensity; diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index dfc3676c5af..1e4f19c123b 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -441,10 +441,10 @@ namespace ElectricBaseboardRadiator { ElecBaseboard(BaseboardNum).SurfaceName(SurfNum) = cAlphaArgs(SurfNum + 3); ElecBaseboard(BaseboardNum).SurfacePtr(SurfNum) = HeatBalanceIntRadExchange::GetRadiantSystemSurface(cCurrentModuleObject, - ElecBaseboard(BaseboardNum).EquipName, - ElecBaseboard(BaseboardNum).ZonePtr, - ElecBaseboard(BaseboardNum).SurfaceName(SurfNum), - ErrorsFound); + ElecBaseboard(BaseboardNum).EquipName, + ElecBaseboard(BaseboardNum).ZonePtr, + ElecBaseboard(BaseboardNum).SurfaceName(SurfNum), + ErrorsFound); ElecBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) = rNumericArgs(SurfNum + 6); if (ElecBaseboard(BaseboardNum).FracDistribToSurf(SurfNum) > MaxFraction) { ShowWarningError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\", " + cNumericFieldNames(SurfNum + 6) + @@ -794,7 +794,7 @@ namespace ElectricBaseboardRadiator { QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; AirInletTemp = ElecBaseboard(BaseboardNum).AirInletTemp; AirOutletTemp = AirInletTemp; - CpAir = PsyCpAirFnWTdb(ElecBaseboard(BaseboardNum).AirInletHumRat, AirInletTemp); + CpAir = PsyCpAirFnWTdb(ElecBaseboard(BaseboardNum).AirInletHumRat); AirMassFlowRate = SimpConvAirFlowSpeed; CapacitanceAir = CpAir * AirMassFlowRate; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index 5ccd788507b..f467694b9d8 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -1859,7 +1859,7 @@ namespace EvaporativeCoolers { // CALCULATE THE TLDB FROM HX EQUATIONS GIVEN AN EFFICIENCY //*************************************************************************** EffHX = EvapCond(EvapCoolNum).IndirectHXEffectiveness; - CpAir = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat, EvapCond(EvapCoolNum).InletTemp); + CpAir = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, EvapCond(EvapCoolNum).InletTemp, EvapCond(EvapCoolNum).InletHumRat); CFMAir = EvapCond(EvapCoolNum).VolFlowRate; // Volume Flow Rate Primary Side CFMSec = EvapCond(EvapCoolNum).IndirectVolFlowRate; // Volume Flolw Rate Secondary Side @@ -3047,10 +3047,10 @@ namespace EvaporativeCoolers { if (OutletTemp > EvapCond(EvapCoolNum).InletTemp) { OutletTemp = EvapCond(EvapCoolNum).InletTemp; } - CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat, EvapCond(EvapCoolNum).InletTemp); + CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); CapFlowSys = EvapCond(EvapCoolNum).InletMassFlowRate * CpAirSys; QHXRate = CapFlowSys * (EvapCond(EvapCoolNum).InletTemp - OutletTemp); - CpAirSec = PsyCpAirFnWTdb(EHumRatSec, EDBTSec); + CpAirSec = PsyCpAirFnWTdb(EHumRatSec); CapFlowSec = AirMassFlowSec * CpAirSec; OutletTempSec = EDBTSec + QHXRate / CapFlowSec; if (OutletTempSec >= EvapCond(EvapCoolNum).InletTemp) { @@ -3071,7 +3071,7 @@ namespace EvaporativeCoolers { if (OutletTemp > EvapCond(EvapCoolNum).InletTemp) { OutletTemp = EvapCond(EvapCoolNum).InletTemp; } - CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat, EvapCond(EvapCoolNum).InletTemp); + CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); CapFlowSys = EvapCond(EvapCoolNum).InletMassFlowRate * CpAirSys; QHXRate = CapFlowSys * (EvapCond(EvapCoolNum).InletTemp - OutletTemp); SecOutletEnthalpy = EvapCond(EvapCoolNum).SecInletEnthalpy + QHXRate / AirMassFlowSec; @@ -3147,7 +3147,7 @@ namespace EvaporativeCoolers { if (AirMassFlowSec > 0.0) { if ((OperatingMode == DryModulated || OperatingMode == DryFull)) { EvapCond(EvapCoolNum).SecOutletHumRat = EHumRatSec; - CpAirSec = PsyCpAirFnWTdb(EHumRatSec, EDBTSec); + CpAirSec = PsyCpAirFnWTdb(EHumRatSec); EvapCond(EvapCoolNum).SecOutletTemp = EDBTSec + QHXTotal / AirMassFlowSec / CpAirSec; EvapCond(EvapCoolNum).SecOutletEnthalpy = PsyHFnTdbW(EvapCond(EvapCoolNum).SecOutletTemp, EHumRatSec); EvapCond(EvapCoolNum).SecOuletWetBulbTemp = PsyTwbFnTdbWPb(EvapCond(EvapCoolNum).SecOutletTemp, EHumRatSec, OutBaroPress); @@ -5012,9 +5012,7 @@ namespace EvaporativeCoolers { ZoneEquipmentListChecked = false; } - int GetInletNodeNum(std::string const &EvapCondName, - bool &ErrorsFound - ) + int GetInletNodeNum(std::string const &EvapCondName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu @@ -5049,9 +5047,7 @@ namespace EvaporativeCoolers { return NodeNum; } - int GetOutletNodeNum(std::string const &EvapCondName, - bool &ErrorsFound - ) + int GetOutletNodeNum(std::string const &EvapCondName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index 88e6260ccae..edb39b2adf0 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -2760,7 +2760,7 @@ namespace EvaporativeFluidCoolers { AirDensity = PsyRhoAirFnPbTdbW( SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirPress, InletAirTemp, SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat); AirMassFlowRate = AirFlowRate * AirDensity; - CpAir = PsyCpAirFnWTdb(SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat, InletAirTemp); + CpAir = PsyCpAirFnWTdb(SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat); CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum).LoopNum).FluidName, InletWaterTemp, PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index dadc9574ae1..6717fca0227 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -3117,7 +3117,7 @@ namespace Fans { MotEff = Fan(FanNum).MotEff; MotInAirFrac = Fan(FanNum).MotInAirFrac; RhoAir = StdRhoAir; - CpAir = PsyCpAirFnWTdb(constant_zero, constant_twenty); + CpAir = PsyCpAirFnWTdb(constant_zero); DesignDeltaT = (DeltaP / (RhoAir * CpAir * TotEff)) * (MotEff + MotInAirFrac * (1.0 - MotEff)); } else { DesignDeltaT = 0.0; diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index eda2cb3224d..338a27fd3fa 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -1650,7 +1650,7 @@ namespace FluidCoolers { Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleFluidCooler(FluidCoolerNum).AirPress, InletAirTemp, SimpleFluidCooler(FluidCoolerNum).AirHumRat); Real64 AirMassFlowRate = AirFlowRate * AirDensity; - Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(SimpleFluidCooler(FluidCoolerNum).AirHumRat, InletAirTemp); + Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(SimpleFluidCooler(FluidCoolerNum).AirHumRat); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidName, _InletWaterTemp, DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 1129afd193e..08c73e481ce 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -53,12 +53,12 @@ #include // EnergyPlus Headers +#include #include #include #include #include #include -#include #include #include #include @@ -6408,7 +6408,7 @@ namespace Furnaces { // OnOffAirFlowRatio = 1.0 // Calculate the Cp Air - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat, Node(FurnaceInletNode).Temp); + cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); if (FirstHVACIteration) { HeatCoilLoad = ZoneLoad; @@ -6708,7 +6708,7 @@ namespace Furnaces { OpMode = Furnace(FurnaceNum).OpMode; HumControl = false; // Calculate the Cp Air for all conditions - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat, Node(FurnaceInletNode).Temp); + cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); NoHeatOutput = 0.0; SystemSensibleLoad = 0.0; ReheatCoilLoad = 0.0; @@ -7010,7 +7010,7 @@ namespace Furnaces { TempOutHeatingCoil = Node(FurnaceOutletNode).Temp; } } - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat, Node(FurnaceOutletNode).Temp); + cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); // TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace) if ((TempOutHeatingCoil > Furnace(FurnaceNum).DesignMaxOutletTemp) && (HeatCoilLoad > 0.0)) { // deltaT = Furnace(FurnaceNum)%DesignMaxOutletTemp - Node(FurnaceOutletNode)%Temp @@ -7997,7 +7997,7 @@ namespace Furnaces { //*********INITIAL CALCULATIONS**************** // Calculate the Cp Air for all conditions - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat, Node(FurnaceInletNode).Temp); + cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); // set the fan part load fraction // Note: OnOffFanPartLoadFraction is passed to the @@ -8867,7 +8867,7 @@ namespace Furnaces { if (Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp > Furnace(FurnaceNum).DesignMaxOutletTemp) { Wout = Node(FurnaceOutletNode).HumRat; Tout = Furnace(FurnaceNum).DesignMaxOutletTemp; - ModifiedHeatCoilLoad = HeatCoilLoad - (AirMassFlow * PsyCpAirFnWTdb(Wout, Tout) * (Node(FurnaceOutletNode).Temp - Tout)); + ModifiedHeatCoilLoad = HeatCoilLoad - (AirMassFlow * PsyCpAirFnWTdb(Wout) * (Node(FurnaceOutletNode).Temp - Tout)); Node(FurnaceOutletNode).Temp = Tout; } @@ -10341,11 +10341,11 @@ namespace Furnaces { } } else { LatOutput = noLatOutput; // reset full output if not needed for sensible load - SpeedNum = 1; // reset speed from full output test + SpeedNum = 1; // reset speed from full output test } } else { LatOutput = noLatOutput; // reset full output if not needed for sensible load - SpeedNum = 1; // reset speed from full output test + SpeedNum = 1; // reset speed from full output test } // meet the latent load if (QLatReq < -SmallLoad && QLatReq < LatOutput) { @@ -10353,17 +10353,17 @@ namespace Furnaces { SpeedRatio = 1.0; for (i = SpeedNum; i <= Furnace(FurnaceNum).NumOfSpeedCooling; ++i) { CalcVarSpeedHeatPump(FurnaceNum, - FirstHVACIteration, - CompOp, - i, - SpeedRatio, - PartLoadFrac, - TempOutput, - LatOutput, - QZnReq, - QLatReq, - OnOffAirFlowRatio, - SupHeaterLoad); + FirstHVACIteration, + CompOp, + i, + SpeedRatio, + PartLoadFrac, + TempOutput, + LatOutput, + QZnReq, + QLatReq, + OnOffAirFlowRatio, + SupHeaterLoad); if (QLatReq > LatOutput) { SpeedNum = i; @@ -10373,7 +10373,7 @@ namespace Furnaces { if (QLatReq - LatOutput > SmallLoad) { Par(1) = FurnaceNum; Par(2) = ZoneNum; - if ( FirstHVACIteration ) { + if (FirstHVACIteration) { Par(3) = 1.0; } else { Par(3) = 0.0; @@ -10390,23 +10390,23 @@ namespace Furnaces { } else { SolveRoot(ErrorToler, MaxIte, SolFla, SpeedRatio, VSHPSpeedResidual, 1.0e-10, 1.0, Par); } - if ( SolFla == -1 ) { - if ( !WarmupFlag ) { - if ( ErrCountVar == 0 ) { + if (SolFla == -1) { + if (!WarmupFlag) { + if (ErrCountVar == 0) { ++ErrCountVar; ShowWarningError("Iteration limit exceeded calculating VS WSHP unit speed ratio, for unit=" + Furnace(FurnaceNum).Name); ShowContinueErrorTimeStamp("Speed ratio returned=[" + RoundSigDigits(SpeedRatio, 2) + - "], Speed number =" + RoundSigDigits(SpeedNum)); + "], Speed number =" + RoundSigDigits(SpeedNum)); } else { ++ErrCountVar; ShowRecurringWarningErrorAtEnd(Furnace(FurnaceNum).Name + - "\": Iteration limit warning exceeding calculating DX unit speed ratio continues...", - Furnace(FurnaceNum).ErrIndexVar, - SpeedRatio, - SpeedRatio); + "\": Iteration limit warning exceeding calculating DX unit speed ratio continues...", + Furnace(FurnaceNum).ErrIndexVar, + SpeedRatio, + SpeedRatio); } } - } else if ( SolFla == -2 ) { + } else if (SolFla == -2) { ShowFatalError("VS WSHP unit compressor speed calculation failed: speed limits exceeded, for unit=" + Furnace(FurnaceNum).Name); } } @@ -10451,7 +10451,7 @@ namespace Furnaces { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp < Furnace(FurnaceNum).DesignMaxOutletTemp) { - CpAir = PsyCpAirFnWTdb(Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).HumRat, Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).HumRat); SupHeaterLoad = Node(Furnace(FurnaceNum).FurnaceInletNodeNum).MassFlowRate * CpAir * (Furnace(FurnaceNum).DesignMaxOutletTemp - Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 96695e8d894..5c8ca32ec26 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -502,9 +502,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // simulate series piu reheat coil SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb( - Node(TempOutNode).HumRat, - 0.5 * (Node(TempOutNode).Temp + Node(TempInNode).Temp)); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check + CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check LoadMet = CpAir * Node(TempOutNode).MassFlowRate * (Node(TempOutNode).Temp - Node(TempInNode).Temp); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -514,9 +512,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // simulate series piu reheat coil SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb( - Node(TempOutNode).HumRat, - 0.5 * (Node(TempOutNode).Temp + Node(TempInNode).Temp)); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check + CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check LoadMet = CpAir * Node(TempOutNode).MassFlowRate * (Node(TempOutNode).Temp - Node(TempInNode).Temp); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -526,7 +522,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // Simulate reheat coil for the VAV system SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat, Node(TempOutNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); if (present(AirMassFlow)) { LoadMet = AirMassFlow * CpAir * Node(TempOutNode).Temp; ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -1132,7 +1128,7 @@ void CalcPassiveExteriorBaffleGap(Array1S_int const SurfPtrARR, // Array of inde LocalOutHumRat = PsyWFnTdbTwbPb(LocalOutDryBulbTemp, LocalWetBulbTemp, OutBaroPress, RoutineName); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, LocalOutDryBulbTemp, LocalOutHumRat, RoutineName); - CpAir = PsyCpAirFnWTdb(LocalOutHumRat, LocalOutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(LocalOutHumRat); if (!IsRain) { Tamb = LocalOutDryBulbTemp; } else { // when raining we use wetbulb not drybulb @@ -1577,12 +1573,14 @@ void TestSupplyAirPathIntegrity(bool &ErrFound) static ObjexxFCL::gio::Fmt Format_701("(A)"); static ObjexxFCL::gio::Fmt Format_702("('! ,,,')"); static ObjexxFCL::gio::Fmt Format_703("('! <#Components on Supply Air Path>,')"); - static ObjexxFCL::gio::Fmt Format_704("('! ,,,,','')"); + static ObjexxFCL::gio::Fmt Format_704( + "('! ,,,,','')"); static ObjexxFCL::gio::Fmt Format_705("('! <#Nodes on Supply Air Path>,')"); static ObjexxFCL::gio::Fmt Format_706("('! ,,,,')"); static ObjexxFCL::gio::Fmt Format_707("('! <#Outlet Nodes on Supply Air Path Component>,')"); - static ObjexxFCL::gio::Fmt Format_708("('! ,,,,',',,')"); + static ObjexxFCL::gio::Fmt Format_708( + "('! ,,,,',',,')"); // Do by Paths ShowMessage("Testing Individual Supply Air Path Integrity"); @@ -1628,8 +1626,8 @@ void TestSupplyAirPathIntegrity(bool &ErrFound) ObjexxFCL::gio::write(ChrOut, fmtLD) << Count; strip(ChrOut); ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " Supply Air Path Component," + ChrOut + ',' + - SupplyAirPath(BCount).ComponentType(Count) + ',' + - SupplyAirPath(BCount).ComponentName(Count) + ',' + PrimaryAirLoopName; + SupplyAirPath(BCount).ComponentType(Count) + ',' + + SupplyAirPath(BCount).ComponentName(Count) + ',' + PrimaryAirLoopName; { auto const SELECT_CASE_var(UtilityRoutines::MakeUPPERCase(SupplyAirPath(BCount).ComponentType(Count))); @@ -1646,7 +1644,8 @@ void TestSupplyAirPathIntegrity(bool &ErrFound) ++NumErr; } ObjexxFCL::gio::write(ChrOut, fmtLD) << ZoneSupPlenCond(Count2).NumOutletNodes; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " #Outlet Nodes on Supply Air Path Component," + stripped(ChrOut); + ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) + << " #Outlet Nodes on Supply Air Path Component," + stripped(ChrOut); for (Count1 = 1; Count1 <= ZoneSupPlenCond(Count2).NumOutletNodes; ++Count1) { ObjexxFCL::gio::write(ChrOut, fmtLD) << Count1; ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) @@ -1668,7 +1667,8 @@ void TestSupplyAirPathIntegrity(bool &ErrFound) ++NumErr; } ObjexxFCL::gio::write(ChrOut, fmtLD) << SplitterCond(Count2).NumOutletNodes; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " #Outlet Nodes on Supply Air Path Component," + stripped(ChrOut); + ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) + << " #Outlet Nodes on Supply Air Path Component," + stripped(ChrOut); for (Count1 = 1; Count1 <= SplitterCond(Count2).NumOutletNodes; ++Count1) { ObjexxFCL::gio::write(ChrOut, fmtLD) << Count1; ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) @@ -1697,13 +1697,16 @@ void TestSupplyAirPathIntegrity(bool &ErrFound) strip(ChrOut); if (SupplyAirPath(BCount).NodeType(Count2) == PathInlet) { ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " Supply Air Path Node,Inlet Node," + ChrOut + ',' + - NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + PrimaryAirLoopName; + NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + + PrimaryAirLoopName; } else if (SupplyAirPath(BCount).NodeType(Count2) == Intermediate) { ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " Supply Air Path Node,Through Node," + ChrOut + ',' + - NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + PrimaryAirLoopName; + NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + + PrimaryAirLoopName; } else if (SupplyAirPath(BCount).NodeType(Count2) == Outlet) { ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " Supply Air Path Node,Outlet Node," + ChrOut + ',' + - NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + PrimaryAirLoopName; + NodeID(SupplyAirPath(BCount).Node(Count2)) + ',' + + PrimaryAirLoopName; } } } @@ -1874,8 +1877,9 @@ void TestReturnAirPathIntegrity(bool &ErrFound, Array2S_int ValRetAPaths) static ObjexxFCL::gio::Fmt Format_705("('! <#Nodes on Return Air Path>,')"); static ObjexxFCL::gio::Fmt Format_706("('! ,,,,')"); static ObjexxFCL::gio::Fmt Format_707("('! <#Inlet Nodes on Return Air Path Component>,')"); - static ObjexxFCL::gio::Fmt Format_708("('! ,,,,',',,')"); + static ObjexxFCL::gio::Fmt Format_708( + "('! ,,,,',',,')"); // Do by Paths ShowMessage("Testing Individual Return Air Path Integrity"); @@ -1924,8 +1928,8 @@ void TestReturnAirPathIntegrity(bool &ErrFound, Array2S_int ValRetAPaths) ObjexxFCL::gio::write(ChrOut, fmtLD) << Count; strip(ChrOut); ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " Return Air Path Component," + ChrOut + ',' + - ReturnAirPath(BCount).ComponentType(Count) + ',' + - ReturnAirPath(BCount).ComponentName(Count) + ',' + PrimaryAirLoopName; + ReturnAirPath(BCount).ComponentType(Count) + ',' + + ReturnAirPath(BCount).ComponentName(Count) + ',' + PrimaryAirLoopName; if (UtilityRoutines::SameString(ReturnAirPath(BCount).ComponentType(Count), "AirLoopHVAC:ZoneMixer")) { HasMixer = true; @@ -1970,7 +1974,8 @@ void TestReturnAirPathIntegrity(bool &ErrFound, Array2S_int ValRetAPaths) } } ObjexxFCL::gio::write(ChrOut, fmtLD) << MixerCond(Count2).NumInletNodes; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " #Inlet Nodes on Return Air Path Component," + stripped(ChrOut); + ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) + << " #Inlet Nodes on Return Air Path Component," + stripped(ChrOut); for (Count1 = 1; Count1 <= MixerCond(Count2).NumInletNodes; ++Count1) { ObjexxFCL::gio::write(ChrOut, fmtLD) << Count1; ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) @@ -1999,7 +2004,8 @@ void TestReturnAirPathIntegrity(bool &ErrFound, Array2S_int ValRetAPaths) } } ObjexxFCL::gio::write(ChrOut, fmtLD) << ZoneRetPlenCond(Count2).NumInletNodes; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << " #Inlet Nodes on Return Air Path Component," + stripped(ChrOut); + ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) + << " #Inlet Nodes on Return Air Path Component," + stripped(ChrOut); for (Count1 = 1; Count1 <= ZoneRetPlenCond(Count2).NumInletNodes; ++Count1) { ObjexxFCL::gio::write(ChrOut, fmtLD) << Count1; ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index 0d5fe85f1b9..289fec756ec 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -775,8 +775,7 @@ namespace HVACCooledBeam { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolMassFlow >= SmallAirVolFlow) { DesAirVolFlow = CoolBeam(CBNum).MaxAirVolFlow; - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesTemp); + CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); // the design cooling coil load is the zone load minus whatever the central system does. Note that // DesCoolCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak > 0.0) { @@ -981,8 +980,8 @@ namespace HVACCooledBeam { QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; QToCoolSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToCoolSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); - CpAirSys = PsyCpAirFnWTdb(Node(InAirNode).HumRat, Node(InAirNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); + CpAirSys = PsyCpAirFnWTdb(Node(InAirNode).HumRat); MaxColdWaterFlow = CoolBeam(CBNum).MaxCoolWaterMassFlow; SetComponentFlowRate(MaxColdWaterFlow, CoolBeam(CBNum).CWInNode, diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index 829f00e8a75..1be87b88a4c 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -66,12 +66,12 @@ #include #include #include -#include #include #include #include #include #include +#include namespace EnergyPlus { @@ -84,10 +84,9 @@ namespace HVACFan { fanObjs.clear(); } - int getFanObjectVectorIndex( // lookup vector index for fan object name in object array EnergyPlus::HVACFan::fanObjs + int getFanObjectVectorIndex( // lookup vector index for fan object name in object array EnergyPlus::HVACFan::fanObjs std::string const &objectName, // IDF name in input - bool const ErrorCheck - ) + bool const ErrorCheck) { int index = -1; bool found = false; @@ -356,8 +355,8 @@ namespace HVACFan { FanSystem::FanSystem( // constructor std::string const &objectName) : availSchedIndex(0), inletNodeNum(0), outletNodeNum(0), designAirVolFlowRate(0.0), speedControl(SpeedControlMethod::NotSet), deltaPress(0.0), - designElecPower(0.0), powerModFuncFlowFractionCurveIndex(0), AirLoopNum(0), AirPathFlag(false), fanIsSecondaryDriver(false), m_fanType_Num(0), - m_designAirVolFlowRateWasAutosized(false), m_minPowerFlowFrac(0.0), m_motorEff(0.0), m_motorInAirFrac(0.0), + designElecPower(0.0), powerModFuncFlowFractionCurveIndex(0), AirLoopNum(0), AirPathFlag(false), fanIsSecondaryDriver(false), + m_fanType_Num(0), m_designAirVolFlowRateWasAutosized(false), m_minPowerFlowFrac(0.0), m_motorEff(0.0), m_motorInAirFrac(0.0), m_designElecPowerWasAutosized(false), m_powerSizingMethod(PowerSizingMethod::powerSizingMethodNotSet), m_elecPowerPerFlowRate(0.0), m_elecPowerPerFlowRatePerPressure(0.0), m_fanTotalEff(0.0), m_nightVentPressureDelta(0.0), m_nightVentFlowFraction(0.0), m_zoneNum(0), m_zoneRadFract(0.0), m_heatLossesDestination(ThermalLossDestination::heatLossNotDetermined), m_qdotConvZone(0.0), m_qdotRadZone(0.0), @@ -368,7 +367,7 @@ namespace HVACFan { m_eMSFanEffOverrideOn(false), m_eMSFanEffValue(0.0), m_eMSMaxMassFlowOverrideOn(false), m_eMSAirMassFlowValue(0.0), m_faultyFilterFlag(false), m_faultyFilterIndex(0), - m_massFlowRateMaxAvail(0.0), m_massFlowRateMinAvail(0.0), m_rhoAirStdInit(0.0), m_designPointFEI(0.0) + m_massFlowRateMaxAvail(0.0), m_massFlowRateMinAvail(0.0), m_rhoAirStdInit(0.0), m_designPointFEI(0.0) // oneTimePowerCurveCheck_( true ) { @@ -1063,7 +1062,6 @@ namespace HVACFan { } } } - } void FanSystem::report() @@ -1090,7 +1088,7 @@ namespace HVACFan { Real64 FanSystem::getFanDesignTemperatureRise() const { if (!m_objSizingFlag) { - Real64 cpAir = Psychrometrics::PsyCpAirFnWTdb(DataPrecisionGlobals::constant_zero, DataPrecisionGlobals::constant_twenty); + Real64 cpAir = Psychrometrics::PsyCpAirFnWTdb(DataPrecisionGlobals::constant_zero); Real64 designDeltaT = (deltaPress / (m_rhoAirStdInit * cpAir * m_fanTotalEff)) * (m_motorEff + m_motorInAirFrac * (1.0 - m_motorEff)); return designDeltaT; } else { diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index 08dfb821da2..a957964ccf5 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -701,8 +701,8 @@ namespace FourPipeBeam { Node(this->airInNodeNum).MassFlowRate = this->mDotSystemAir; this->tDBZoneAirTemp = Node(this->zoneNodeIndex).Temp; this->tDBSystemAir = Node(this->airInNodeNum).Temp; - this->cpZoneAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->zoneNodeIndex).HumRat, Node(this->zoneNodeIndex).Temp); - this->cpSystemAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->airInNodeNum).HumRat, Node(this->airInNodeNum).Temp); + this->cpZoneAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->zoneNodeIndex).HumRat); + this->cpSystemAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->airInNodeNum).HumRat); this->qDotBeamCooling = 0.0; this->qDotBeamHeating = 0.0; this->supAirCoolingRate = 0.0; @@ -821,8 +821,7 @@ namespace FourPipeBeam { // max flow is as if the air supply was sufficient to provide all the conditioning if (beamCoolingPresent) { - cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU); + cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); if ((TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak - TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU) > 2.0) { // avoid div by zero and blow up @@ -847,10 +846,8 @@ namespace FourPipeBeam { this->mDotHW = 0.0; this->tDBZoneAirTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak; this->tDBSystemAir = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU; - this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtCoolPeak, - DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak); - this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU, - DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU); + this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtCoolPeak); + this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); this->qDotZoneReq = -1.0 * TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolLoad; this->qDotZoneToCoolSetPt = -1.0 * TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolLoad; this->airAvailable = true; @@ -868,8 +865,7 @@ namespace FourPipeBeam { } if (beamHeatingPresent) { - cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU); + cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); Real64 maxFlowHeat = 0.0; if ((TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU - TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak) > 2.0) { // avoid div by zero and blow up @@ -891,10 +887,8 @@ namespace FourPipeBeam { this->mDotCW = 0.0; this->tDBZoneAirTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; this->tDBSystemAir = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU; - this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak, - DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak); - this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU, - DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU); + this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak); + this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); this->qDotZoneReq = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad; this->qDotZoneToHeatSetPt = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad; this->airAvailable = true; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index 1026e3939fc..a8a64b14a8f 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -2424,7 +2424,7 @@ namespace HVACManager { // Reports zone exhaust loss by exhaust fans for (ZoneLoop = 1; ZoneLoop <= NumOfZones; ++ZoneLoop) { // Start of zone loads report variable update loop ... - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); H2OHtOfVap = PsyHgAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); ADSCorrectionFactor = 1.0; if (AirflowNetwork::SimulateAirflowNetwork == AirflowNetwork::AirflowNetworkControlSimpleADS) { @@ -2491,7 +2491,7 @@ namespace HVACManager { ZnAirRpt(ZoneLoop).InfilHeatLoss = 0.0; } // Report infiltration latent gains and losses - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); H2OHtOfVap = PsyHgAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); if (ZoneAirHumRat(ZoneLoop) > OutHumRat) { @@ -2517,7 +2517,7 @@ namespace HVACManager { } // first calculate mass flows using outside air heat capacity for consistency with input to heat balance - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); ZnAirRpt(ZoneLoop).InfilMass = (MCPI(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilMdot = (MCPI(ZoneLoop) / CpAir) * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilMass = (MCPV(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2624,8 +2624,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(Mixing(MixNum).FromZone)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0, - (MAT(ZoneLoop) + MAT(Mixing(MixNum).FromZone)) / 2.0); + CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += Mixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += Mixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += Mixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2650,8 +2649,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).FromZone)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0, - (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).FromZone)) / 2.0); + CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2671,8 +2669,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).ZonePtr)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0, - (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).ZonePtr)) / 2.0); + CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2703,7 +2700,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0); + CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0); H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += @@ -2732,8 +2729,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, - (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0); + CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0); H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index c6b335bdc2f..77412c1b158 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -848,7 +848,7 @@ namespace HVACMultiSpeedHeatPump { LocalError = false; } MSHeatPump(MSHPNum).MinOATCompressorHeating = DXCoils::GetMinOATCompressorUsingIndex(MSHeatPump(MSHPNum).DXHeatCoilIndex, LocalError); - if ( LocalError ) { + if (LocalError) { ShowContinueError("...for heating coil. Occurs in " + CurrentModuleObject + " \"" + Alphas(1) + "\""); LocalError = false; } @@ -1039,7 +1039,7 @@ namespace HVACMultiSpeedHeatPump { ErrorsFound = true; } - //MSHeatPump(MSHPNum).MinOATCompressor = Numbers(1); // deprecated, now uses coil MinOAT inputs + // MSHeatPump(MSHPNum).MinOATCompressor = Numbers(1); // deprecated, now uses coil MinOAT inputs if (UtilityRoutines::SameString(Alphas(12), "Coil:Cooling:DX:MultiSpeed")) { MSHeatPump(MSHPNum).CoolCoilType = MultiSpeedCoolingCoil; @@ -3301,8 +3301,7 @@ namespace HVACMultiSpeedHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).Temp < MSHeatPump(MSHeatPumpNum).SuppMaxAirTemp) { - CpAir = - PsyCpAirFnWTdb(Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).HumRat, Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).HumRat); SupHeaterLoad = Node(MSHeatPump(MSHeatPumpNum).AirInletNodeNum).MassFlowRate * CpAir * (MSHeatPump(MSHeatPumpNum).SuppMaxAirTemp - Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).Temp); diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index b6accc594dd..0c7b5b1f01c 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -879,8 +879,7 @@ namespace HVACSingleDuctInduc { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatMassFlow >= SmallAirVolFlow) { DesPriVolFlow = IndUnit(IUNum).MaxTotAirVolFlow / (1.0 + IndUnit(IUNum).InducRatio); - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp); + CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); // the design heating coil load is the zone load minus whatever the central system does. Note that // DesHeatCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak > 0.0) { @@ -983,8 +982,7 @@ namespace HVACSingleDuctInduc { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolMassFlow >= SmallAirVolFlow) { DesPriVolFlow = IndUnit(IUNum).MaxTotAirVolFlow / (1.0 + IndUnit(IUNum).InducRatio); - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesTemp); + CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); // the design cooling coil load is the zone load minus whatever the central system does. Note that // DesCoolCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak > 0.0) { @@ -1395,7 +1393,7 @@ namespace HVACSingleDuctInduc { OutletNode = IndUnit(IUNum).OutAirNode; PriAirMassFlow = Node(PriNode).MassFlowRateMaxAvail; InducRat = IndUnit(IUNum).InducRatio; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); SecAirMassFlow = InducRat * PriAirMassFlow; TotAirMassFlow = PriAirMassFlow + SecAirMassFlow; HotControlNode = IndUnit(IUNum).HWControlNode; diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 650c47a1ae2..9532bae3b32 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -315,7 +315,7 @@ namespace HVACUnitaryBypassVAV { if (CBVAV(CBVAVNum).modeChanged) { // set outlet node SP for mixed air SP manager DataLoopNode::Node(CBVAV(CBVAVNum).AirOutNode).TempSetPoint = CalcSetPointTempTarget(CBVAVNum); - if (CBVAV(CBVAVNum).OutNodeSPMIndex > 0) { // update mixed air SPM if exists + if (CBVAV(CBVAVNum).OutNodeSPMIndex > 0) { // update mixed air SPM if exists SetPointManager::MixedAirSetPtMgr(CBVAV(CBVAVNum).OutNodeSPMIndex).calculate(); // update mixed air SP based on new mode SetPointManager::UpdateMixedAirSetPoints(); // need to know control node to fire off just one of these, do this later } @@ -1521,8 +1521,8 @@ namespace HVACUnitaryBypassVAV { DataAirLoop::AirLoopControlInfo(AirLoopNum).UnitarySys = false; DataAirLoop::AirLoopControlInfo(AirLoopNum).FanOpMode = CBVAV(CBVAVNum).OpMode; // check for set point manager on outlet node of CBVAV - CBVAV(CBVAVNum).OutNodeSPMIndex = - SetPointManager::getSPMBasedOnNode(OutNode, SetPointManager::iCtrlVarType_Temp, SetPointManager::iSPMType_MixedAir, SetPointManager::CtrlNodeType::reference); + CBVAV(CBVAVNum).OutNodeSPMIndex = SetPointManager::getSPMBasedOnNode( + OutNode, SetPointManager::iCtrlVarType_Temp, SetPointManager::iSPMType_MixedAir, SetPointManager::CtrlNodeType::reference); MySizeFlag(CBVAVNum) = false; } @@ -3339,8 +3339,7 @@ namespace HVACUnitaryBypassVAV { (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingElectric) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingWater) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingSteam)) { // not a DX heating coil if (CBVAV(CBVAVNum).HeatCoolMode == HeatingMode) { - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).HumRat, - DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).HumRat); QHeater = DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).MassFlowRate * CpAir * (CBVAV(CBVAVNum).CoilTempSetPoint - DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).Temp); } else { @@ -3581,7 +3580,7 @@ namespace HVACUnitaryBypassVAV { QToHeatSetPt = DataZoneEnergyDemands::ZoneSysEnergyDemand(CBVAV(CBVAVNumber).ControlledZoneNum(ZoneNum)).OutputRequiredToHeatingSP; } - Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(OutAirHumRat, OutAirTemp); + Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(OutAirHumRat); // Find the supply air temperature that will force the box to full flow if (BoxOutletNodeNum > 0) { @@ -3773,8 +3772,8 @@ namespace HVACUnitaryBypassVAV { return Residuum; } - void SetAverageAirFlow(int const CBVAVNum, // Index to CBVAV system - Real64 &OnOffAirFlowRatio // Ratio of compressor ON airflow to average airflow over timestep + void SetAverageAirFlow(int const CBVAVNum, // Index to CBVAV system + Real64 &OnOffAirFlowRatio // Ratio of compressor ON airflow to average airflow over timestep ) { @@ -3798,8 +3797,7 @@ namespace HVACUnitaryBypassVAV { int MixerInletAirNode = CBVAV(CBVAVNum).MixerInletAirNode; // Inlet air node number in OA mixer Real64 SystemMassFlow = 0.0; // System mass flow rate required for all zones [kg/s] - Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(OutletNode).HumRat, - DataLoopNode::Node(OutletNode).Temp); // Specific heat of outlet air [J/kg-K] + Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(OutletNode).HumRat); // Specific heat of outlet air [J/kg-K] // Determine zone air flow for (int ZoneNum = 1; ZoneNum <= CBVAV(CBVAVNum).NumControlledZones; ++ZoneNum) { int ZoneNodeNum = CBVAV(CBVAVNum).ActualZoneNodeNum(ZoneNum); @@ -3819,7 +3817,7 @@ namespace HVACUnitaryBypassVAV { } else { ZoneLoad = DataZoneEnergyDemands::ZoneSysEnergyDemand(CBVAV(CBVAVNum).ControlledZoneNum(ZoneNum)).RemainingOutputRequired; } - Real64 CpZoneAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(ZoneNodeNum).HumRat, DataLoopNode::Node(ZoneNodeNum).Temp); + Real64 CpZoneAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(ZoneNodeNum).HumRat); Real64 DeltaCpTemp = CpSupplyAir * DataLoopNode::Node(OutletNode).Temp - CpZoneAir * DataLoopNode::Node(ZoneNodeNum).Temp; // Need to check DeltaCpTemp and ensure that it is not zero diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 8b3e1c627bb..846954a063f 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -8056,7 +8056,7 @@ namespace HVACVariableRefrigerantFlow { TempIn = Node(ZoneNode).Temp; SpecHumOut = Node(ATMixOutNode).HumRat; SpecHumIn = Node(ZoneNode).HumRat; - AirMassFlow = Node( ATMixOutNode ).MassFlowRate; + AirMassFlow = Node(ATMixOutNode).MassFlowRate; } else { // Air terminal inlet side mixer TempOut = Node(VRFTUOutletNodeNum).Temp; @@ -8072,7 +8072,7 @@ namespace HVACVariableRefrigerantFlow { } // calculate sensible load met using delta enthalpy LoadMet = AirMassFlow * PsyDeltaHSenFnTdb2W2Tdb1W1(TempOut, SpecHumOut, TempIn, SpecHumIn); // sensible {W} - LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn); // latent {kgH2O/s} + LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn); // latent {kgH2O/s} if (present(LatOutputProvided)) { // CR9155 Remove specific humidity calculations LatOutputProvided = LatentLoadMet; @@ -11085,7 +11085,7 @@ namespace HVACVariableRefrigerantFlow { TempIn = Node(ZoneNode).Temp; SpecHumOut = Node(ATMixOutNode).HumRat; SpecHumIn = Node(ZoneNode).HumRat; - AirMassFlow = Node( ATMixOutNode ).MassFlowRate; + AirMassFlow = Node(ATMixOutNode).MassFlowRate; } else { // Air terminal inlet side mixer TempOut = Node(VRFTUOutletNodeNum).Temp; @@ -11101,7 +11101,7 @@ namespace HVACVariableRefrigerantFlow { } // calculate sensible load met using delta enthalpy LoadMet = AirMassFlow * PsyDeltaHSenFnTdb2W2Tdb1W1(TempOut, SpecHumOut, TempIn, SpecHumIn); // sensible {W} - LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn); // latent {kgH2O/s} + LatentLoadMet = AirMassFlow * (SpecHumOut - SpecHumIn); // latent {kgH2O/s} if (present(LatOutputProvided)) { // CR9155 Remove specific humidity calculations LatOutputProvided = LatentLoadMet; @@ -13823,10 +13823,8 @@ namespace HVACVariableRefrigerantFlow { Real64 HeatCoilCapacityAllowed; // heating coil maximum capacity that can be deleivered at current time [W] Real64 MDotAir = DataLoopNode::Node(HeatCoilAirInletNode).MassFlowRate; - Real64 CpAirIn = - Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat, DataLoopNode::Node(HeatCoilAirInletNode).Temp); - Real64 CpAirOut = - Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat, DataLoopNode::Node(HeatCoilAirOutletNode).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); Real64 CpAirAvg = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = max(0.0, HeatCoilMaxSATAllowed - DataLoopNode::Node(HeatCoilAirInletNode).Temp); HeatCoilCapacityAllowed = MDotAir * CpAirAvg * HCDeltaT; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index cfa22d029bb..993ad6bdc87 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -1321,7 +1321,7 @@ namespace HWBaseboardRadiator { (WaterMassFlowRate > 0.0)) { // Calculate air mass flow rate AirMassFlowRate = HWBaseboard(BaseboardNum).AirMassFlowRateStd * (WaterMassFlowRate / HWBaseboard(BaseboardNum).WaterMassFlowRateMax); - CapacitanceAir = PsyCpAirFnWTdb(HWBaseboard(BaseboardNum).AirInletHumRat, AirInletTemp) * AirMassFlowRate; + CapacitanceAir = PsyCpAirFnWTdb(HWBaseboard(BaseboardNum).AirInletHumRat) * AirMassFlowRate; Cp = GetSpecificHeatGlycol(PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index f045b33f107..654497cbb15 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -117,13 +117,13 @@ #include #include #include -#include -#include -#include #include #include #include #include +#include +#include +#include namespace EnergyPlus { @@ -191,9 +191,9 @@ namespace HeatBalanceSurfaceManager { bool InitSurfaceHeatBalancefirstTime(true); bool ComputeIntSWAbsorpFactorsfirstTime(true); // First time through routine bool UpdateThermalHistoriesFirstTimeFlag(true); - bool CalculateZoneMRTfirstTime(true); // Flag for first time calculations + bool CalculateZoneMRTfirstTime(true); // Flag for first time calculations bool calcHeatBalanceInsideSurfFirstTime(true); - } + } // namespace // These are now external subroutines // PUBLIC CalcHeatBalanceOutsideSurf ! The heat balance routines are now public because the @@ -1025,7 +1025,7 @@ namespace HeatBalanceSurfaceManager { PreDefTableEntry(pdchFenParent, surfName, Surface(iSurf).BaseSurfName); curAzimuth = Surface(iSurf).Azimuth; // Round to two decimals, like the display in tables - curAzimuth = round(curAzimuth * 100.0) / 100.0; + curAzimuth = round(curAzimuth * 100.0) / 100.0; PreDefTableEntry(pdchFenAzimuth, surfName, curAzimuth); isNorth = false; curTilt = Surface(iSurf).Tilt; @@ -1502,8 +1502,12 @@ namespace HeatBalanceSurfaceManager { if (!Surface(loop).HeatTransSurf) continue; SetupOutputVariable( "Surface Inside Face Temperature", OutputProcessor::Unit::C, TempSurfInRep(loop), "Zone", "State", Surface(loop).Name); - SetupOutputVariable( - "Surface Inside Face Interior Movable Insulation Temperature", OutputProcessor::Unit::C, TempSurfInMovInsRep(loop), "Zone", "State", Surface(loop).Name); + SetupOutputVariable("Surface Inside Face Interior Movable Insulation Temperature", + OutputProcessor::Unit::C, + TempSurfInMovInsRep(loop), + "Zone", + "State", + Surface(loop).Name); if (Surface(loop).ExtBoundCond != KivaFoundation) { SetupOutputVariable( @@ -2165,7 +2169,6 @@ namespace HeatBalanceSurfaceManager { SurfaceGeometry::kivaManager.surfaceConvMap[SurfNum].out = KIVA_CONST_CONV(0.0); } - // Initialize the flux histories QH(1, {2, Construct(Surface(SurfNum).Construction).NumCTFTerms + 1}, SurfNum) = Construct(Surface(SurfNum).Construction).UValue * (TH(1, 1, SurfNum) - TH(2, 1, SurfNum)); @@ -3292,7 +3295,8 @@ namespace HeatBalanceSurfaceManager { //!!! Following may need to be removed or changed when shelves are considered in adjacent reflection calculations if (Surface(SurfNum).Class == SurfaceClass_Shading) continue; int const enclosureNum = Surface(SurfNum).SolarEnclIndex; - IntBmIncInsSurfIntensRep(SurfNum) = ZoneBmSolFrIntWinsRep(enclosureNum) / DataViewFactorInformation::ZoneSolarInfo(enclosureNum).TotalSurfArea; + IntBmIncInsSurfIntensRep(SurfNum) = + ZoneBmSolFrIntWinsRep(enclosureNum) / DataViewFactorInformation::ZoneSolarInfo(enclosureNum).TotalSurfArea; IntBmIncInsSurfAmountRep(SurfNum) = IntBmIncInsSurfIntensRep(SurfNum) * (Surface(SurfNum).Area + SurfaceWindow(SurfNum).DividerArea); IntBmIncInsSurfAmountRepEnergy(SurfNum) = IntBmIncInsSurfAmountRep(SurfNum) * TimeStepZoneSec; // IntDifIncInsSurfIntensRep(SurfNum) = ZoneDifSolFrIntWinsRep(ZoneNum)/Zone(ZoneNum)%TotalSurfArea @@ -3371,7 +3375,8 @@ namespace HeatBalanceSurfaceManager { } BlNum = SurfaceWindow(SurfNum).BlindNumber; if (ShadeFlag == IntShadeOn) - SurfaceWindow(SurfNum).IntLWAbsByShade = QL(radEnclosureNum) * Construct(ConstrNumSh).ShadeAbsorpThermal * TMULT(radEnclosureNum); + SurfaceWindow(SurfNum).IntLWAbsByShade = + QL(radEnclosureNum) * Construct(ConstrNumSh).ShadeAbsorpThermal * TMULT(radEnclosureNum); if (ShadeFlag == IntBlindOn) { EffBlEmiss = InterpSlatAng( SurfaceWindow(SurfNum).SlatAngThisTS, SurfaceWindow(SurfNum).MovableSlats, SurfaceWindow(SurfNum).EffShBlindEmiss); @@ -3391,8 +3396,8 @@ namespace HeatBalanceSurfaceManager { } else if (ShadeFlag == SwitchableGlazing) { // Switchable glazing for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { QRadSWwinAbs(IGlass, SurfNum) += QS(solEnclosureNum) * InterpSw(SurfaceWindow(SurfNum).SwitchingFactor, - Construct(ConstrNum).AbsDiffBack(IGlass), - Construct(ConstrNumSh).AbsDiffBack(IGlass)); + Construct(ConstrNum).AbsDiffBack(IGlass), + Construct(ConstrNumSh).AbsDiffBack(IGlass)); } } // End of shading flag check @@ -3401,8 +3406,8 @@ namespace HeatBalanceSurfaceManager { if (SurfaceWindow(SurfNum).FrameArea > 0.0) SurfaceWindow(SurfNum).FrameQRadInAbs += (QS(solEnclosureNum) * SurfaceWindow(SurfNum).FrameSolAbsorp + - (QL(radEnclosureNum) * TMULT(radEnclosureNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + QHWBaseboardSurf(SurfNum) + - QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum)) * + (QL(radEnclosureNum) * TMULT(radEnclosureNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum)) * SurfaceWindow(SurfNum).FrameEmis) * (1.0 + 0.5 * SurfaceWindow(SurfNum).ProjCorrFrIn); // Window has a frame if (SurfaceWindow(SurfNum).DividerArea > 0.0) { // Window has dividers @@ -3430,9 +3435,10 @@ namespace HeatBalanceSurfaceManager { } // Note that DividerQRadInAbs is initially calculated in InitSolarHeatGains SurfaceWindow(SurfNum).DividerQRadInAbs += - (QS(solEnclosureNum) * DividerSolAbs + (QL(radEnclosureNum) * TMULT(radEnclosureNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + - QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum)) * - DividerThermAbs) * + (QS(solEnclosureNum) * DividerSolAbs + + (QL(radEnclosureNum) * TMULT(radEnclosureNum) + QHTRadSysSurf(SurfNum) + QCoolingPanelSurf(SurfNum) + + QHWBaseboardSurf(SurfNum) + QSteamBaseboardSurf(SurfNum) + QElecBaseboardSurf(SurfNum)) * + DividerThermAbs) * (1.0 + SurfaceWindow(SurfNum).ProjCorrDivIn); } @@ -3477,7 +3483,8 @@ namespace HeatBalanceSurfaceManager { if (SurfaceWindow(SurfNumAdjZone).WindowModelType != WindowEQLModel) { for (IGlass = 1; IGlass <= TotGlassLayers; ++IGlass) { - QRadSWwinAbs(IGlass, SurfNumAdjZone) += QS(solEnclosureNum) * Construct(Surface(SurfNumAdjZone).Construction).AbsDiff(IGlass); + QRadSWwinAbs(IGlass, SurfNumAdjZone) += + QS(solEnclosureNum) * Construct(Surface(SurfNumAdjZone).Construction).AbsDiff(IGlass); // Note that AbsDiff rather than AbsDiffBack is used in the above since the // radiation from the current zone is incident on the outside of the adjacent // zone's window. @@ -3709,9 +3716,9 @@ namespace HeatBalanceSurfaceManager { for (int radEnclosureNum = 1; radEnclosureNum <= DataViewFactorInformation::NumOfRadiantEnclosures; ++radEnclosureNum) { Real64 SUM1 = 0.0; - auto & thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(radEnclosureNum)); + auto &thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(radEnclosureNum)); - for (int const SurfNum : thisEnclosure.SurfacePtr ) { + for (int const SurfNum : thisEnclosure.SurfacePtr) { if (!Surface(SurfNum).HeatTransSurf) continue; @@ -3806,8 +3813,8 @@ namespace HeatBalanceSurfaceManager { Real64 const SmallestAreaAbsProductAllowed(0.01); // Avoid a division by zero of the user has entered a bunch // of surfaces with zero absorptivity on the inside - int ConstrNum; // DO loop counter for constructions - Real64 SUM1; // Intermediate calculation value for solar absorbed and transmitted + int ConstrNum; // DO loop counter for constructions + Real64 SUM1; // Intermediate calculation value for solar absorbed and transmitted // by windows (including shade, blind or insulation, if present) int ShadeFlag; // Shading flag int ConstrNumSh; // Shaded construction number @@ -3844,7 +3851,6 @@ namespace HeatBalanceSurfaceManager { SUM1 = 0.0; - for (int const SurfNum : DataViewFactorInformation::ZoneSolarInfo(enclosureNum).SurfacePtr) { ConstrNum = Surface(SurfNum).Construction; @@ -5246,7 +5252,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTemp, PsyWFnTdbRhPb(GroundTemp, 1.0, OutBaroPress, RoutineNameGroundTemp)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, GroundTemp)); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; @@ -5263,7 +5269,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTemp, PsyWFnTdbRhPb(GroundTemp, 1.0, OutBaroPress, RoutineNameGroundTemp)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, GroundTemp)); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5287,7 +5293,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTempFC, PsyWFnTdbRhPb(GroundTempFC, 1.0, OutBaroPress, RoutineNameGroundTempFC)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, GroundTempFC)); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; @@ -5303,7 +5309,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTempFC, PsyWFnTdbRhPb(GroundTempFC, 1.0, OutBaroPress, RoutineNameGroundTempFC)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, GroundTempFC)); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5356,7 +5362,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOtherSideCoefNoCalcExt)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5406,7 +5412,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOtherSideCoefCalcExt)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5451,7 +5457,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOSCM)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = OSCM(OPtr).HRad; // CR 8046, use sky term for surface to baffle IR HGrndFD(SurfNum) = 0.0; // CR 8046, null out and use only sky term for surface to baffle IR HAirFD(SurfNum) = 0.0; // CR 8046, null out and use only sky term for surface to baffle IR @@ -5533,7 +5539,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvWetSurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5551,7 +5557,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvWetSurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5573,7 +5579,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvDrySurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); // check for saturation conditions of air RhoVaporSat = PsyRhovFnTdbRh(TempOutsideAirFD(SurfNum), 1.0, HBSurfManDrySurfCondFD); if (RhoVaporAirOut(SurfNum) > RhoVaporSat) RhoVaporAirOut(SurfNum) = RhoVaporSat; @@ -5610,7 +5616,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameNoWind)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5671,7 +5677,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOther)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = 0.0; HGrndFD(SurfNum) = 0.0; HAirFD(SurfNum) = 0.0; @@ -5695,7 +5701,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameIZPart)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat, TempOutsideAirFD(SurfNum))); + PsyCpAirFnWTdb(OutHumRat)); HSkyFD(SurfNum) = 0.0; HGrndFD(SurfNum) = 0.0; HAirFD(SurfNum) = 0.0; @@ -5707,7 +5713,7 @@ namespace HeatBalanceSurfaceManager { } // fill in reporting values for outside face - + QdotConvOutRepPerArea(SurfNum) = GetQdotConvOutRepPerArea(SurfNum); QdotConvOutRep(SurfNum) = QdotConvOutRepPerArea(SurfNum) * Surface(SurfNum).Area; @@ -5717,7 +5723,7 @@ namespace HeatBalanceSurfaceManager { } // ...end of DO loop over all surface (actually heat transfer surfaces) } - Real64 GetQdotConvOutRepPerArea(int const SurfNum) + Real64 GetQdotConvOutRepPerArea(int const SurfNum) { int OPtr = Surface(SurfNum).OSCMPtr; if (Surface(SurfNum).OSCMPtr > 0) { // Optr is set above in this case, use OSCM boundary data @@ -5950,7 +5956,7 @@ namespace HeatBalanceSurfaceManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -6060,7 +6066,7 @@ namespace HeatBalanceSurfaceManager { RhoVaporAirIn(SurfNum) = min(PsyRhovFnTdbWPb_fast(MAT_zone, ZoneAirHumRat_zone, OutBaroPress), PsyRhovFnTdbRh(MAT_zone, 1.0, HBSurfManInsideSurf)); HMassConvInFD(SurfNum) = HConvIn_surf / (PsyRhoAirFnPbTdbW_fast(OutBaroPress, MAT_zone, ZoneAirHumRat_zone) * - PsyCpAirFnWTdb_fast(ZoneAirHumRat_zone, MAT_zone)); + PsyCpAirFnWTdb_fast(ZoneAirHumRat_zone)); } } } @@ -6679,7 +6685,7 @@ namespace HeatBalanceSurfaceManager { } ReportIntMovInsInsideSurfTemp(); - + CalculateZoneMRT(ZoneToResimulate); // Update here so that the proper value of MRT is available to radiant systems } @@ -7325,8 +7331,8 @@ namespace HeatBalanceSurfaceManager { TMULTseq(CurOverallSimDay, TimeStepInDay, enclosureNum) = TMULT(enclosureNum); } for (jSurf = 1; jSurf <= TotSurfaces; ++jSurf) { - if (!Surface(jSurf).HeatTransSurf || Surface(jSurf).Zone == 0) continue; // Skip non-heat transfer surfaces - if (Surface(jSurf).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes + if (!Surface(jSurf).HeatTransSurf || Surface(jSurf).Zone == 0) continue; // Skip non-heat transfer surfaces + if (Surface(jSurf).Class == SurfaceClass_TDD_Dome) continue; // Skip tubular daylighting device domes ITABSFseq(CurOverallSimDay, TimeStepInDay, jSurf) = ITABSF(jSurf); } } diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index ac7662736b6..186b17ba0e4 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -1333,7 +1333,7 @@ namespace HeatRecovery { // I believe that all of these initializations should be taking place at the SCFM conditions RhoAir = StdRhoAir; // RhoAir = PsyRhoAirFnPbTdbW(101325.0,20.0,0.0) do we want standard air density at sea level for generic ERVs per ARI 1060? - CpAir = PsyCpAirFnWTdb(0.0, 20.0); + CpAir = PsyCpAirFnWTdb(0.0); ExIndex = ExchNum; // this replaces the loop that went over multiple at once @@ -1857,8 +1857,8 @@ namespace HeatRecovery { Deno = std::pow(QuotSup, 0.78) + ExchCond(ExNum).hARatio * std::pow(QuotExh, 0.78); UA = ExchCond(ExNum).UA0 * (ExchCond(ExNum).hARatio + 1.0) / Deno; // calculate the NTU - CSup = UnitSupMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); - CSec = UnitSecMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat, ExchCond(ExNum).SecInTemp); + CSup = UnitSupMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSec = UnitSecMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); // note: no C can be zero since otherwise we wouldn't be here if (CSup < CSec) { CMin = CSup; @@ -1917,7 +1917,7 @@ namespace HeatRecovery { ExchCond(ExNum).SecOutTemp = ExchCond(ExNum).SecInTemp; ExchCond(ExNum).SecOutMassFlow = ExchCond(ExNum).SecInMassFlow; } - CSup = ExchCond(ExNum).SupInMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); + CSup = ExchCond(ExNum).SupInMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); SensHeatRecRate = CSup * (ExchCond(ExNum).SupOutTemp - ExchCond(ExNum).SupInTemp); TotHeatRecRate = ExchCond(ExNum).SupOutMassFlow * (ExchCond(ExNum).SupOutEnth - ExchCond(ExNum).SupInEnth); LatHeatRecRate = TotHeatRecRate - SensHeatRecRate; @@ -2197,8 +2197,8 @@ namespace HeatRecovery { // Use the effectiveness to calculate the air conditions exiting the heat exchanger (all air flow through the HX) // Include EATR and OACF in the following calculations at some point - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); - CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat, ExchCond(ExNum).SecInTemp); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); CMin = min(CSup, CSec); ExchCond(ExNum).SupOutTemp = @@ -2259,7 +2259,7 @@ namespace HeatRecovery { HXSupAirVolFlowRate = MassFlowSupOut / RhoSup; HXAvgAirVolFlowRate = (HXSecAirVolFlowRate + HXSupAirVolFlowRate) / 2.0; HXAirVolFlowRatio = HXAvgAirVolFlowRate / ExchCond(ExNum).NomSupAirVolFlow; - CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn, TempSupIn); + CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn); CMin = min(CSup, CSec); if (TempSupIn < TempSecIn) { // Use heating effectiveness values @@ -2397,7 +2397,7 @@ namespace HeatRecovery { } // ENDIF for "IF (UnitOn) THEN" // Calculate heat transfer from the unit using the final supply inlet and supply outlet air conditions - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); SensHeatRecRate = CSup * (ExchCond(ExNum).SupOutTemp - ExchCond(ExNum).SupInTemp); TotHeatRecRate = ExchCond(ExNum).SupOutMassFlow * (ExchCond(ExNum).SupOutEnth - ExchCond(ExNum).SupInEnth); LatHeatRecRate = TotHeatRecRate - SensHeatRecRate; @@ -2724,8 +2724,8 @@ namespace HeatRecovery { // the mass flow rate on the process and secondary side of HX may be imbalanced when the HX is used in the OA branch // use the average mass flow rate to avoid psych warnings, mass flow rates will converge at the end of the iteration // if the air mass flow rates do not converge, this model should not be used - CSup = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); - CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat, ExchCond(ExNum).SecInTemp); + CSup = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); ExchCond(ExNum).SupOutEnth = PsyHFnTdbW(ExchCond(ExNum).SupOutTemp, ExchCond(ExNum).SupOutHumRat); @@ -2759,7 +2759,7 @@ namespace HeatRecovery { } // ENDIF for "IF (UnitOn) THEN" // Report the process side heat transfer - CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat, ExchCond(ExNum).SecInTemp); + CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); ProcessSensHeatRecRate = CSec * (ExchCond(ExNum).SecOutTemp - ExchCond(ExNum).SecInTemp); ProcessTotHeatRecRate = ExchCond(ExNum).SecOutMassFlow * (ExchCond(ExNum).SecOutEnth - ExchCond(ExNum).SecInEnth); @@ -2858,8 +2858,8 @@ namespace HeatRecovery { ExchCond(ExNum).SecBypassMassFlow = 0.0; RhoSup = PsyRhoAirFnPbTdbW(OutBaroPress, ExchCond(ExNum).SupInTemp, ExchCond(ExNum).SupInHumRat); RhoSec = PsyRhoAirFnPbTdbW(OutBaroPress, ExchCond(ExNum).SecInTemp, ExchCond(ExNum).SecInHumRat); - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat, ExchCond(ExNum).SupInTemp); - CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat, ExchCond(ExNum).SecInTemp); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); CMin = min(CSup, CSec); TempThreshold = ExchCond(ExNum).ThresholdTemperature; @@ -2927,7 +2927,7 @@ namespace HeatRecovery { HXSecAirVolFlowRate = ExchCond(ExNum).SecOutMassFlow / RhoSec; HXAvgAirVolFlowRate = (HXSecAirVolFlowRate + HXSupAirVolFlowRate) / 2.0; HXAirVolFlowRatio = HXAvgAirVolFlowRate / ExchCond(ExNum).NomSupAirVolFlow; - CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn, TempSupIn); + CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn); CMin = min(CSup, CSec); if (TempSupIn < TempSecIn) { // Use heating effectiveness values diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 6b27c7c640e..7163b146c31 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -1121,8 +1121,8 @@ namespace HeatingCoils { SourceTypeString = HeatReclaimRefrigCondenser(SourceIndexNum).SourceType; SourceNameString = HeatReclaimRefrigCondenser(SourceIndexNum).Name; } - if (HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_COOLING || - HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_MULTISPEED || + if (HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_COOLING || + HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_MULTISPEED || HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_MULTIMODE || HeatingCoil(CoilNum).ReclaimHeatingSource == COIL_DX_VARIABLE_COOLING) { SourceTypeString = HeatReclaimDXCoil(SourceIndexNum).SourceType; @@ -1632,7 +1632,7 @@ namespace HeatingCoils { AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; } - CapacitanceAir = PsyCpAirFnWTdb(Win, TempAirIn) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; // If the coil is operating there should be some heating capacitance // across the coil, so do the simulation. If not set outlet to inlet and no load. @@ -1707,12 +1707,13 @@ namespace HeatingCoils { QCoilActual = HeatingCoilLoad; if (std::abs(HeatingCoil(CoilNum).NominalCapacity) < 1.e-8) { if (HeatingCoil(CoilNum).AirLoopNum > 0) { - AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF = max(AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF, 0.0); + AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF = + max(AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF, 0.0); } } else { if (HeatingCoil(CoilNum).AirLoopNum > 0) { - AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF = - max(AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF, HeatingCoilLoad / HeatingCoil(CoilNum).NominalCapacity); + AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF = max( + AirLoopAFNInfo(HeatingCoil(CoilNum).AirLoopNum).AFNLoopHeatingCoilMaxRTF, HeatingCoilLoad / HeatingCoil(CoilNum).NominalCapacity); } } @@ -2000,7 +2001,7 @@ namespace HeatingCoils { TempSetPoint = HeatingCoil(CoilNum).DesiredOutletTemp; AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; - CapacitanceAir = PsyCpAirFnWTdb(Win, TempAirIn) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; // If there is a fault of coil SAT Sensor (zrp_Jul2016) if (HeatingCoil(CoilNum).FaultyCoilSATFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { @@ -2493,7 +2494,7 @@ namespace HeatingCoils { AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; TempAirIn = HeatingCoil(CoilNum).InletAirTemp; Win = HeatingCoil(CoilNum).InletAirHumRat; - CapacitanceAir = PsyCpAirFnWTdb(Win, TempAirIn) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; TempSetPoint = HeatingCoil(CoilNum).DesiredOutletTemp; // If there is a fault of coil SAT Sensor (zrp_Jul2016) diff --git a/src/EnergyPlus/HybridEvapCoolingModel.cc b/src/EnergyPlus/HybridEvapCoolingModel.cc index d5df3ccac61..58c0c0851e1 100644 --- a/src/EnergyPlus/HybridEvapCoolingModel.cc +++ b/src/EnergyPlus/HybridEvapCoolingModel.cc @@ -50,8 +50,6 @@ #include -#include -#include #include #include #include @@ -61,6 +59,8 @@ #include #include #include +#include +#include // ObjexxFCL Headers #include #include @@ -255,7 +255,7 @@ namespace HybridEvapCoolingModel { if (ValidPointer(HRsa_curve_pointer)) { Y_val = NormalizationReference * CurveValue(HRsa_curve_pointer, X_1, X_2, X_3, X_4, X_5, X_6); - Y_val = max(min(Y_val,1.0),0.0); + Y_val = max(min(Y_val, 1.0), 0.0); } else { Y_val = X_4; // return HR } @@ -1564,9 +1564,9 @@ namespace HybridEvapCoolingModel { Hsa = 1.006 * Tsa * (2501 + 1.86 * Tsa); Hsa = PsyHFnTdbW(Tsa, Wsa); - Real64 SupplyAirCp = PsyCpAirFnWTdb(Wsa, Tsa); // J/degreesK.kg - Real64 ReturnAirCP = PsyCpAirFnWTdb(Wra, StepIns.Tra); // J/degreesK.kg - Real64 OutdoorAirCP = PsyCpAirFnWTdb(Wosa, StepIns.Tosa); // J/degreesK.kg + Real64 SupplyAirCp = PsyCpAirFnWTdb(Wsa); // J/degreesK.kg + Real64 ReturnAirCP = PsyCpAirFnWTdb(Wra); // J/degreesK.kg + Real64 OutdoorAirCP = PsyCpAirFnWTdb(Wosa); // J/degreesK.kg // Calculations below of system cooling and heating capacity are ultimately reassessed when the resultant part runtime fraction is // assessed. However its valuable that they are calculated here to at least provide a check. @@ -2029,9 +2029,9 @@ namespace HybridEvapCoolingModel { // Calculate timestep average unit and system PrimaryMode = CurrentPrimaryMode(); PrimaryModeRuntimeFraction = CurrentPrimaryRuntimeFraction(); - Real64 Outletcp = PsyCpAirFnWTdb(OutletHumRat, OutletTemp); // J/degreesK.kg - Real64 Returncp = PsyCpAirFnWTdb(Wra, StepIns.Tra); // J/degreesK.kg - Real64 Outdoorcp = PsyCpAirFnWTdb(Wosa, StepIns.Tosa); // J/degreesK.kg + Real64 Outletcp = PsyCpAirFnWTdb(OutletHumRat); // J/degreesK.kg + Real64 Returncp = PsyCpAirFnWTdb(Wra); // J/degreesK.kg + Real64 Outdoorcp = PsyCpAirFnWTdb(Wosa); // J/degreesK.kg // Zone Sensible Cooling{ W } = m'SA {kg/s} * 0.5*(cpRA+cpSA) {kJ/kg-C} * (T_RA - T_SA) {C} // Zone Latent Cooling{ W } = m'SAdryair {kg/s} * L {kJ/kgWater} * (HR_RA - HR_SA) {kgWater/kgDryAir} // Zone Total Cooling{ W } = m'SAdryair {kg/s} * (h_RA - h_SA) {kJ/kgDryAir} diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index 65012e76378..b41219579dd 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -306,12 +306,14 @@ namespace InternalHeatGains { // Formats static ObjexxFCL::gio::Fmt Format_720("(' Zone Internal Gains Nominal, ',A,',',A,',',A,',')"); - static ObjexxFCL::gio::Fmt Format_721("('! ,Zone Name, Floor Area {m2},# Occupants,','Area per Occupant " - "{m2/person},Occupant per Area {person/m2},Interior Lighting {W/m2},','Electric Load {W/m2},Gas Load {W/m2},Other " - "Load {W/m2},Hot Water Eq {W/m2},','Steam Equipment {W/m2},Sum Loads per Area {W/m2},Outdoor Controlled Baseboard " - "Heat')"); + static ObjexxFCL::gio::Fmt Format_721( + "('! ,Zone Name, Floor Area {m2},# Occupants,','Area per Occupant " + "{m2/person},Occupant per Area {person/m2},Interior Lighting {W/m2},','Electric Load {W/m2},Gas Load {W/m2},Other " + "Load {W/m2},Hot Water Eq {W/m2},','Steam Equipment {W/m2},Sum Loads per Area {W/m2},Outdoor Controlled Baseboard " + "Heat')"); static ObjexxFCL::gio::Fmt Format_722("(' ',A,' Internal Gains Nominal, ',A,',',A,',',A,',',A,',',A,',')"); - static ObjexxFCL::gio::Fmt Format_723("('! <',A,' Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {m2},# Zone Occupants,',A)"); + static ObjexxFCL::gio::Fmt Format_723( + "('! <',A,' Internal Gains Nominal>,Name,Schedule Name,Zone Name,Zone Floor Area {m2},# Zone Occupants,',A)"); static ObjexxFCL::gio::Fmt Format_724("(' ',A,', ',A)"); // FLOW: @@ -708,7 +710,7 @@ namespace InternalHeatGains { MustInpSch = false; UsingThermalComfort = false; lastOption = NumAlpha; - + // check to see if the user has specified schedules for air velocity, clothing insulation, and/or work efficiency // but have NOT made a selection for a thermal comfort model. If so, then the schedules are reported as unused // which could cause confusion. The solution is for the user to either remove those schedules or pick a thermal @@ -716,12 +718,17 @@ namespace InternalHeatGains { int const NumFirstTCModel = 14; if (NumAlpha < NumFirstTCModel) { bool NoTCModelSelectedWithSchedules = false; - NoTCModelSelectedWithSchedules = CheckThermalComfortSchedules(lAlphaFieldBlanks(9),lAlphaFieldBlanks(12),lAlphaFieldBlanks(13)); + NoTCModelSelectedWithSchedules = + CheckThermalComfortSchedules(lAlphaFieldBlanks(9), lAlphaFieldBlanks(12), lAlphaFieldBlanks(13)); if (NoTCModelSelectedWithSchedules) { - ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + "\" has comfort related schedules but no thermal comfort model selected."); - ShowContinueError("If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no thermal comfort"); - ShowContinueError("thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); - ShowContinueError("To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); + ShowWarningError(RoutineName + CurrentModuleObject + "=\"" + AlphaName(1) + + "\" has comfort related schedules but no thermal comfort model selected."); + ShowContinueError("If schedules are specified for air velocity, clothing insulation, and/or work efficiency but no " + "thermal comfort"); + ShowContinueError( + "thermal comfort model is selected, the schedules will be listed as unused schedules in the .err file."); + ShowContinueError( + "To avoid these errors, select a valid thermal comfort model or eliminate these schedules in the PEOPLE input."); } } @@ -4754,9 +4761,10 @@ namespace InternalHeatGains { }; if (Loop == 1) { if (People(Loop).Fanger || People(Loop).Pierce || People(Loop).KSU) { - ObjexxFCL::gio::write(OutputFileInits, fmtA) << ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " - "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " - "Calculation,KSU Calculation"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << ",MRT Calculation Type,Work Efficiency, Clothing Insulation Calculation Method,Clothing " + "Insulation Calculation Method Schedule,Clothing,Air Velocity,Fanger Calculation,Pierce " + "Calculation,KSU Calculation"; } else { ObjexxFCL::gio::write(OutputFileInits); } @@ -4950,10 +4958,11 @@ namespace InternalHeatGains { } for (Loop = 1; Loop <= TotLights; ++Loop) { if (Loop == 1) - ObjexxFCL::gio::write(OutputFileInits, Format_723) << "Lights" - << "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " - "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " - "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}"; + ObjexxFCL::gio::write(OutputFileInits, Format_723) + << "Lights" + << "Lighting Level {W},Lights/Floor Area {W/m2},Lights per person {W/person},Fraction Return " + "Air,Fraction Radiant,Fraction Short Wave,Fraction Convected,Fraction Replaceable,End-Use " + "Category,Nominal Minimum Lighting Level {W},Nominal Maximum Lighting Level {W}"; ZoneNum = Lights(Loop).ZonePtr; @@ -5549,14 +5558,16 @@ namespace InternalHeatGains { for (Loop = 1; Loop <= TotBBHeat; ++Loop) { if (Loop == 1) - ObjexxFCL::gio::write(OutputFileInits, Format_723) << "Outdoor Controlled Baseboard Heat" - << "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " - "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory"; + ObjexxFCL::gio::write(OutputFileInits, Format_723) + << "Outdoor Controlled Baseboard Heat" + << "Capacity at Low Temperature {W},Low Temperature {C},Capacity at High Temperature " + "{W},High Temperature {C},Fraction Radiant,Fraction Convected,End-Use Subcategory"; ZoneNum = ZoneBBHeat(Loop).ZonePtr; if (ZoneNum == 0) { - ObjexxFCL::gio::write(OutputFileInits, Format_724) << "Outdoor Controlled Baseboard Heat-Illegal Zone specified" << ZoneBBHeat(Loop).Name; + ObjexxFCL::gio::write(OutputFileInits, Format_724) + << "Outdoor Controlled Baseboard Heat-Illegal Zone specified" << ZoneBBHeat(Loop).Name; continue; } @@ -6035,7 +6046,7 @@ namespace InternalHeatGains { // QL is per radiant enclosure (one or more zones if grouped by air boundaries) for (int enclosureNum = 1; enclosureNum <= DataViewFactorInformation::NumOfRadiantEnclosures; ++enclosureNum) { - auto & thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(enclosureNum)); + auto &thisEnclosure(DataViewFactorInformation::ZoneRadiantInfo(enclosureNum)); QL(enclosureNum) = 0.0; for (int const zoneNum : thisEnclosure.ZoneNums) { Real64 zoneQL; @@ -6357,7 +6368,7 @@ namespace InternalHeatGains { AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(StdBaroPress, TAirIn, WAirIn, RoutineName); if (AirMassFlowRate > 0.0) { - TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnWTdb(WAirIn, TAirIn); + TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnWTdb(WAirIn); } else { TAirOut = TAirIn; } @@ -6826,20 +6837,20 @@ namespace InternalHeatGains { return DesignLightingLevelSum; } - + bool CheckThermalComfortSchedules(bool const WorkEffSch, // Blank work efficiency schedule = true bool const CloInsSch, // Blank clothing insulation schedule = true bool const AirVeloSch) // Blank air velocity schedule = true { bool TCSchedsPresent = false; - - if ( !WorkEffSch || !CloInsSch || !AirVeloSch ) { + + if (!WorkEffSch || !CloInsSch || !AirVeloSch) { TCSchedsPresent = true; } - + return TCSchedsPresent; } - + void CheckLightsReplaceableMinMaxForZone(int const WhichZone) // Zone Number { diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index adf904b1760..8c21383281f 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -391,16 +391,14 @@ namespace MicroturbineElectricGenerator { ErrorsFound = true; } else { // Verify curve object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ElecPowFTempElevCurveNum, // Curve index - {2}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(2)); // Field Name - - if (!ErrorsFound) - { + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ElecPowFTempElevCurveNum, // Curve index + {2}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(2)); // Field Name + + if (!ErrorsFound) { // Check electrical power output at reference combustion inlet temp and elevation ElectOutFTempElevOutput = CurveValue(MTGenerator(GeneratorNum).ElecPowFTempElevCurveNum, MTGenerator(GeneratorNum).RefCombustAirInletTemp, @@ -425,16 +423,14 @@ namespace MicroturbineElectricGenerator { ErrorsFound = true; } else { // Verify curve object, only legal types are Quadratic and Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ElecEffFTempCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(3)); // Field Name - - if (!ErrorsFound) - { + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ElecEffFTempCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(3)); // Field Name + + if (!ErrorsFound) { // Check electrical efficiency at reference combustion inlet temp ElecEfficFTempOutput = CurveValue(MTGenerator(GeneratorNum).ElecEffFTempCurveNum, MTGenerator(GeneratorNum).RefCombustAirInletTemp); @@ -456,16 +452,14 @@ namespace MicroturbineElectricGenerator { ErrorsFound = true; } else { // Verify curve object, only legal types are Quadratic and Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ElecEffFPLRCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(4)); // Field Name - - if (!ErrorsFound) - { + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ElecEffFPLRCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(4)); // Field Name + + if (!ErrorsFound) { // Check electrical efficiency at PLR = 1 ElecEfficFPLROutput = CurveValue(MTGenerator(GeneratorNum).ElecEffFPLRCurveNum, 1.0); if (std::abs(ElecEfficFPLROutput - 1.0) > 0.1) { @@ -570,13 +564,12 @@ namespace MicroturbineElectricGenerator { ErrorsFound = true; } else if (MTGenerator(GeneratorNum).AncillaryPowerFuelCurveNum > 0) { // Verify curve object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).AncillaryPowerFuelCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(6)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).AncillaryPowerFuelCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(6)); // Field Name if (!ErrorsFound) { RefFuelUseMdot = (MTGenerator(GeneratorNum).RefElecPowerOutput / MTGenerator(GeneratorNum).RefElecEfficiencyLHV) / @@ -684,13 +677,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).HeatRecFlowFTempPowCurveNum = GetCurveIndex(AlphArray(10)); if (MTGenerator(GeneratorNum).HeatRecFlowFTempPowCurveNum != 0) { // Verify curve object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).HeatRecFlowFTempPowCurveNum, // Curve index - {2}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(10)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).HeatRecFlowFTempPowCurveNum, // Curve index + {2}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(10)); // Field Name // NEED TO FIGURE OUT WHAT TO USE FOR Pnet............Shirey // HeatRecFlowFTempPowCurveOutput = CurveValue(MTGenerator(GeneratorNum)%HeatRecFlowFTempPowCurveNum, Pnet) // IF(ABS(HeatRecFlowFTempPowCurveOutput-1.0d0) .GT. 0.1d0)THEN ! @@ -707,13 +699,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ThermEffFTempElevCurveNum = GetCurveIndex(AlphArray(11)); // convert curve name to number if (MTGenerator(GeneratorNum).ThermEffFTempElevCurveNum != 0) { // Verify curve object, only legal types are BiQuadratic and BiCubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ThermEffFTempElevCurveNum, // Curve index - {2}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(11)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ThermEffFTempElevCurveNum, // Curve index + {2}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(11)); // Field Name if (!ErrorsFound) { ThermalEffTempElevOutput = CurveValue(MTGenerator(GeneratorNum).ThermEffFTempElevCurveNum, @@ -728,8 +719,7 @@ namespace MicroturbineElectricGenerator { TrimSigDigits(MTGenerator(GeneratorNum).RefCombustAirInletTemp, 4) + " C"); ShowContinueError("... Reference elevation = " + TrimSigDigits(MTGenerator(GeneratorNum).RefElevation, 4) + " m"); - ShowContinueError("... Curve output = " + - TrimSigDigits(ThermalEffTempElevOutput, 4)); + ShowContinueError("... Curve output = " + TrimSigDigits(ThermalEffTempElevOutput, 4)); } } } @@ -737,13 +727,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).HeatRecRateFPLRCurveNum = GetCurveIndex(AlphArray(12)); // convert curve name to number if (MTGenerator(GeneratorNum).HeatRecRateFPLRCurveNum != 0) { // Verify curve object, only legal types are Quadratic or Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).HeatRecRateFPLRCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(12)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).HeatRecRateFPLRCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(12)); // Field Name if (!ErrorsFound) { HeatRecRateFPLROutput = CurveValue(MTGenerator(GeneratorNum).HeatRecRateFPLRCurveNum, 1.0); @@ -760,13 +749,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).HeatRecRateFTempCurveNum = GetCurveIndex(AlphArray(13)); // convert curve name to number if (MTGenerator(GeneratorNum).HeatRecRateFTempCurveNum != 0) { // Verify curve object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).HeatRecRateFTempCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(13)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).HeatRecRateFTempCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(13)); // Field Name if (!ErrorsFound) { HeatRecRateFTempOutput = @@ -786,13 +774,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).HeatRecRateFWaterFlowCurveNum = GetCurveIndex(AlphArray(14)); if (MTGenerator(GeneratorNum).HeatRecRateFWaterFlowCurveNum != 0) { // Verify curve object, only legal type is Quadratic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).HeatRecRateFWaterFlowCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(14)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).HeatRecRateFWaterFlowCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(14)); // Field Name if (!ErrorsFound) { HeatRecRateFFlowOutput = @@ -894,13 +881,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhFlowFTempCurveNum = GetCurveIndex(AlphArray(17)); if (MTGenerator(GeneratorNum).ExhFlowFTempCurveNum != 0) { // Verify curve object, only legal types are Quadratic and Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ExhFlowFTempCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(17)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ExhFlowFTempCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(17)); // Field Name if (!ErrorsFound) { ExhFlowFTempOutput = @@ -920,13 +906,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhFlowFPLRCurveNum = GetCurveIndex(AlphArray(18)); // convert curve name to number if (MTGenerator(GeneratorNum).ExhFlowFPLRCurveNum != 0) { // Verify curve object, legal types are Quadratic or Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ExhFlowFPLRCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(18)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ExhFlowFPLRCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(18)); // Field Name if (!ErrorsFound) { ExhFlowFPLROutput = CurveValue(MTGenerator(GeneratorNum).ExhFlowFPLRCurveNum, 1.0); @@ -945,13 +930,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhAirTempFTempCurveNum = GetCurveIndex(AlphArray(19)); if (MTGenerator(GeneratorNum).ExhAirTempFTempCurveNum != 0) { // Verify curve object, only legal types are Quadratic and Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ExhAirTempFTempCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(19)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ExhAirTempFTempCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(19)); // Field Name if (!ErrorsFound) { ExhAirTempFTempOutput = @@ -971,13 +955,12 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhAirTempFPLRCurveNum = GetCurveIndex(AlphArray(20)); // convert curve name to number if (MTGenerator(GeneratorNum).ExhAirTempFPLRCurveNum != 0) { // Verify curve object, legal types are Quadratic or Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - MTGenerator(GeneratorNum).ExhAirTempFPLRCurveNum, // Curve index - {1}, // Valid dimensions - "GetMTGeneratorInput: ", // Routine name - cCurrentModuleObject, // Object Type - MTGenerator(GeneratorNum).Name, // Object Name - cAlphaFieldNames(20)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(MTGenerator(GeneratorNum).ExhAirTempFPLRCurveNum, // Curve index + {1}, // Valid dimensions + "GetMTGeneratorInput: ", // Routine name + cCurrentModuleObject, // Object Type + MTGenerator(GeneratorNum).Name, // Object Name + cAlphaFieldNames(20)); // Field Name if (!ErrorsFound) { ExhOutAirTempFPLROutput = CurveValue(MTGenerator(GeneratorNum).ExhAirTempFPLRCurveNum, 1.0); @@ -2033,7 +2016,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhaustAirTemperature = ExhaustAirTemp; // Adjust exhaust air temperature if heat recovery to water is being done if (QHeatRecToWater > 0.0) { - CpAir = PsyCpAirFnWTdb(CombustionAirInletW, CombustionAirInletTemp); + CpAir = PsyCpAirFnWTdb(CombustionAirInletW); if (CpAir > 0.0) { MTGenerator(GeneratorNum).ExhaustAirTemperature = ExhaustAirTemp - QHeatRecToWater / (CpAir * ExhAirMassFlowRate); } diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index dcdc87e60d0..86f51413bc9 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -3837,7 +3837,7 @@ namespace MixedAir { } this->RelTemp = this->RetTemp; this->RelEnth = this->RetEnth; - this->RelSensiLossRate = this->RelMassFlow * Psychrometrics::PsyCpAirFnWTdb(OutHumRat, OutDryBulbTemp) * (this->RelTemp - OutDryBulbTemp); + this->RelSensiLossRate = this->RelMassFlow * Psychrometrics::PsyCpAirFnWTdb(OutHumRat) * (this->RelTemp - OutDryBulbTemp); this->RelTotalLossRate = this->RelMassFlow * (this->RelEnth - OutEnthalpy); this->RelLatentLossRate = this->RelTotalLossRate - this->RelSensiLossRate; } diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 2f17d17f958..40be5bd4ddd 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -520,7 +520,7 @@ namespace MundtSimMgr { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -532,7 +532,7 @@ namespace MundtSimMgr { SupplyAirTemp = SumSysMCpT / SumSysMCp; } // determine cooling load - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); QsysCoolTot = -(SumSysMCpT - ZoneMassFlowRate * CpAir * MAT(ZoneNum)); } // determine heat gains diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index 080ed656726..d40e9f1c20a 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -335,7 +335,8 @@ namespace NodeInputManager { static ObjexxFCL::gio::Fmt Format_700("('! #Nodes,')"); static ObjexxFCL::gio::Fmt Format_701("(A)"); static ObjexxFCL::gio::Fmt Format_702("('! ,,,,<# Times Node Referenced After Definition>')"); - static ObjexxFCL::gio::Fmt Format_703("('! ,,,,<# Times Node Referenced After Definition>')"); + static ObjexxFCL::gio::Fmt Format_703( + "('! ,,,,<# Times Node Referenced After Definition>')"); static ObjexxFCL::gio::Fmt fmtLD("*"); if (!NodeVarsSetup) { @@ -547,7 +548,8 @@ namespace NodeInputManager { // Show suspicious node names on the Branch-Node Details file if (Count0 > 0) { ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << "! ==============================================================="; - ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << "! Suspicious nodes have 0 references. It is normal for some nodes, however."; + ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) + << "! Suspicious nodes have 0 references. It is normal for some nodes, however."; ObjexxFCL::gio::write(OutputFileBNDetails, Format_701) << "! Listing nodes with 0 references (culled from previous list):"; ObjexxFCL::gio::write(OutputFileBNDetails, Format_703); for (NumNode = 1; NumNode <= NumOfUniqueNodeNames; ++NumNode) { @@ -564,7 +566,7 @@ namespace NodeInputManager { } } - void GetNodeListsInput(bool &ErrorsFound) // Set to true when requested Node List not found, unchanged otherwise + void GetNodeListsInput(bool &ErrorsFound) // Set to true when requested Node List not found, unchanged otherwise { // SUBROUTINE INFORMATION: @@ -1312,7 +1314,7 @@ namespace NodeInputManager { MoreNodeInfo(iNode).RelHumidity = 0.0; } if (ReportSpecificHeat) { // only call psych routine if needed. - MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat, Node(iNode).Temp); + MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat); } else { MoreNodeInfo(iNode).SpecificHeat = 0.0; } @@ -1366,7 +1368,7 @@ namespace NodeInputManager { MoreNodeInfo(iNode).WetBulbTemp = 0.0; } if (ReportSpecificHeat) { - MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat, Node(iNode).Temp); + MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat); } else { MoreNodeInfo(iNode).SpecificHeat = 0.0; } diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 28c8ae5ee8d..58bc0936449 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -2196,7 +2196,7 @@ namespace OutdoorAirUnit { WHCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WHCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WHCoilInletNode).HumRat, Node(WHCoilInletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(WHCoilInletNode).HumRat); if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(WHCoilInletNode).Temp > CompAirOutTemp)) { QCompReq = 0.0; @@ -2260,7 +2260,7 @@ namespace OutdoorAirUnit { WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat, Node(WCCoilInletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { QCompReq = 0.0; @@ -2310,7 +2310,7 @@ namespace OutdoorAirUnit { WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat, Node(WCCoilInletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { @@ -2356,7 +2356,7 @@ namespace OutdoorAirUnit { } WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat, Node(WCCoilInletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { QCompReq = 0.0; @@ -2497,7 +2497,7 @@ namespace OutdoorAirUnit { if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(InletNode).Temp > CoilAirOutTemp)) { QCompReq = 0.0; } else { - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat, Node(InletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } @@ -2521,7 +2521,7 @@ namespace OutdoorAirUnit { QCompReq = 0.0; } else { Node(OutletNode).MassFlowRate = Node(InletNode).MassFlowRate; - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat, Node(InletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } @@ -2543,7 +2543,7 @@ namespace OutdoorAirUnit { if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(InletNode).Temp > CoilAirOutTemp)) { QCompReq = 0.0; } else { - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat, Node(InletNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index bfe1b52498a..b7f85b118c4 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -5709,7 +5709,7 @@ namespace PackagedTerminalHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(PTUnit(PTUnitNum).AirOutNode).Temp < PTUnit(PTUnitNum).MaxSATSupHeat) { - CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat, Node(PTUnit(PTUnitNum).AirOutNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); SupHeaterLoad = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate * CpAir * (PTUnit(PTUnitNum).MaxSATSupHeat - Node(PTUnit(PTUnitNum).AirOutNode).Temp); @@ -7650,7 +7650,7 @@ namespace PackagedTerminalHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(PTUnit(PTUnitNum).AirOutNode).Temp < PTUnit(PTUnitNum).MaxSATSupHeat) { - CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat, Node(PTUnit(PTUnitNum).AirOutNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); SupHeaterLoad = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate * CpAir * (PTUnit(PTUnitNum).MaxSATSupHeat - Node(PTUnit(PTUnitNum).AirOutNode).Temp); diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 36d045df15f..87b10a4a496 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -1173,7 +1173,7 @@ namespace PhotovoltaicThermalCollectors { if (PVT(PVTnum).WorkingFluidType == AirWorkingFluid) { Winlet = Node(InletNode).HumRat; - CpInlet = PsyCpAirFnWTdb(Winlet, Tinlet); + CpInlet = PsyCpAirFnWTdb(Winlet); if (mdot * CpInlet > 0.0) { PotentialOutletTemp = Tinlet + PotentialHeatGain / (mdot * CpInlet); } else { @@ -1189,7 +1189,7 @@ namespace PhotovoltaicThermalCollectors { } BypassFraction = max(0.0, BypassFraction); PotentialOutletTemp = Node(PVT(PVTnum).HVACOutletNodeNum).TempSetPoint; - PotentialHeatGain = mdot * PsyCpAirFnWTdb(Winlet, Tinlet) * (PotentialOutletTemp - Tinlet); + PotentialHeatGain = mdot * PsyCpAirFnWTdb(Winlet) * (PotentialOutletTemp - Tinlet); } else { BypassFraction = 0.0; @@ -1222,7 +1222,7 @@ namespace PhotovoltaicThermalCollectors { if (PVT(PVTnum).WorkingFluidType == AirWorkingFluid) { Winlet = Node(InletNode).HumRat; - CpInlet = PsyCpAirFnWTdb(Winlet, Tinlet); + CpInlet = PsyCpAirFnWTdb(Winlet); WetBulbInlet = PsyTwbFnTdbWPb(Tinlet, Winlet, OutBaroPress, RoutineName); DewPointInlet = PsyTdpFnTdbTwbPb(Tinlet, WetBulbInlet, OutBaroPress, RoutineName); } else if (PVT(PVTnum).WorkingFluidType == LiquidWorkingFluid) { @@ -1411,9 +1411,7 @@ namespace PhotovoltaicThermalCollectors { } } - int GetAirInletNodeNum(std::string const &PVTName, - bool &ErrorsFound - ) + int GetAirInletNodeNum(std::string const &PVTName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu @@ -1447,9 +1445,7 @@ namespace PhotovoltaicThermalCollectors { return NodeNum; } - int GetAirOutletNodeNum(std::string const &PVTName, - bool &ErrorsFound - ) + int GetAirOutletNodeNum(std::string const &PVTName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index 20409e54d07..ef4ad645244 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -1252,9 +1252,9 @@ namespace PlantChillers { cNumericFieldNames); UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - // ErrorsFound will be set to True if problem was found, left untouched otherwise + // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueChillerName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); - + EngineDrivenChiller(ChillerNum).Base.Name = cAlphaArgs(1); EngineDrivenChiller(ChillerNum).Base.NomCap = rNumericArgs(1); @@ -1942,9 +1942,9 @@ namespace PlantChillers { cNumericFieldNames); UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - // ErrorsFound will be set to True if problem was found, left untouched otherwise + // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueChillerName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); - + GTChiller(ChillerNum).Base.Name = cAlphaArgs(1); GTChiller(ChillerNum).Base.NomCap = rNumericArgs(1); @@ -2562,9 +2562,9 @@ namespace PlantChillers { cNumericFieldNames); UtilityRoutines::IsNameEmpty(cAlphaArgs(1), cCurrentModuleObject, ErrorsFound); - // ErrorsFound will be set to True if problem was found, left untouched otherwise + // ErrorsFound will be set to True if problem was found, left untouched otherwise VerifyUniqueChillerName(cCurrentModuleObject, cAlphaArgs(1), ErrorsFound, cCurrentModuleObject + " Name"); - + ConstCOPChiller(ChillerNum).Base.Name = cAlphaArgs(1); ConstCOPChiller(ChillerNum).Base.NomCap = rNumericArgs(1); if (ConstCOPChiller(ChillerNum).Base.NomCap == AutoSize) { @@ -6249,7 +6249,7 @@ namespace PlantChillers { if (ElectricChiller(ChillNum).HeatRecActive) CalcElectricChillerHeatRecovery(ChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); if (CondMassFlowRate > 0.0) { - CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat, CondInletTemp); + CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat); CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / CpCond; } else { CondOutletTemp = CondInletTemp; @@ -8561,7 +8561,7 @@ namespace PlantChillers { PlantLoop(ElectricChiller(ChillNum).Base.CDLoopNum).FluidIndex, RoutineName); } else { - CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat, CondInletTemp); + CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat); } // Before we modify the QCondenser, the total or original value is transferred to QTot diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 24cb4989520..7a11640cab2 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -740,7 +740,7 @@ namespace PondGroundHeatExchanger { // get air properties HumRatioAir = PsyWFnTdbTwbPb(OutDryBulb, OutWetBulb, OutBaroPress); HumRatioFilm = PsyWFnTdbTwbPb(PondBulkTemp, PondBulkTemp, OutBaroPress); - SpecHeatAir = PsyCpAirFnWTdb(HumRatioAir, OutDryBulb); + SpecHeatAir = PsyCpAirFnWTdb(HumRatioAir); LatentHeatAir = PsyHfgAirFnWTdb(HumRatioAir, OutDryBulb); FluxEvap = pow_2(PrantlAir / SchmidtAir) / 3.0 * ConvCoef / SpecHeatAir * (HumRatioFilm - HumRatioAir) * LatentHeatAir; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index fd0bcfdf7e8..e1ebc111d4a 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -1315,8 +1315,7 @@ namespace PoweredInductionUnits { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; DesMassFlow = StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; - DesCoilLoad = - PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); rho = GetDensityGlycol(PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, DataGlobals::HWInitConvTemp, @@ -1406,8 +1405,7 @@ namespace PoweredInductionUnits { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; DesMassFlow = StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; - DesCoilLoad = - PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); TempSteamIn = 100.00; EnthSteamInDry = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 1.0, PIU(PIUNum).HCoil_FluidIndex, RoutineName); EnthSteamOutWet = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 0.0, PIU(PIUNum).HCoil_FluidIndex, RoutineName); @@ -1576,7 +1574,7 @@ namespace PoweredInductionUnits { SecAirMassFlow = Node(SecNode).MassFlowRate; QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); // On the first HVAC iteration the system values are given to the controller, but after that // the demand limits are in place and there needs to be feedback to the Zone Equipment @@ -1844,7 +1842,7 @@ namespace PoweredInductionUnits { SecAirMassFlow = Node(SecNode).MassFlowRate; QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); // Initialize local fan flags to global system flags bool PIUTurnFansOn = (DataHVACGlobals::TurnFansOn || DataHVACGlobals::TurnZoneFansOnlyOn); // If True, overrides fan schedule and cycles PIU fan on diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 5ff44f87df6..05513d53458 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -376,8 +376,7 @@ namespace Psychrometrics { return 1.00484e3 * TDB + dW * (2.50094e6 + 1.85895e3 * TDB); // enthalpy {J/kg} } - inline Real64 PsyCpAirFnWTdb(Real64 const dw, // humidity ratio {kgWater/kgDryAir} - Real64 const EP_UNUSED(T) // input temperature {Celsius} + inline Real64 PsyCpAirFnWTdb(Real64 const dw // humidity ratio {kgWater/kgDryAir} ) { // FUNCTION INFORMATION: @@ -414,8 +413,7 @@ namespace Psychrometrics { return cpa; } - inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw, // humidity ratio {kgWater/kgDryAir} - Real64 const EP_UNUSED(T) // input temperature {Celsius} + inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw // humidity ratio {kgWater/kgDryAir} ) { // Faster version with humidity ratio already adjusted @@ -741,19 +739,17 @@ namespace Psychrometrics { #endif - #ifdef EP_cache_PsyTsatFnHPb Real64 PsyTsatFnHPb_raw(Real64 const H, // enthalpy {J/kg} Real64 const PB, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ); inline Real64 PsyTsatFnHPb(Real64 const H, - Real64 const Pb, // barometric pressure {Pascals} + Real64 const Pb, // barometric pressure {Pascals} std::string const &CalledFrom = blank_string // routine this function was called from (error messages) ) { - Real64 Tsat_result; // result=> Sat-Temp {C} Int64 const Grid_Shift(64 - 12 - tsat_hbp_precision_bits); diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index e19174ac6fd..9e9e7272856 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -2082,7 +2082,7 @@ namespace PurchasedAirManager { // Calculate minimum outdoor air sensible and latent load if (PurchAir(PurchAirNum).OutdoorAir) { - CpAir = PsyCpAirFnWTdb(Node(OANodeNum).HumRat, Node(OANodeNum).Temp); + CpAir = PsyCpAirFnWTdb(Node(OANodeNum).HumRat); MinOASensOutput = OAMassFlowRate * CpAir * (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); MinOALatOutput = OAMassFlowRate * (Node(OANodeNum).HumRat - Node(ZoneNodeNum).HumRat); } else { @@ -2132,7 +2132,7 @@ namespace PurchasedAirManager { (Node(OANodeNum).Enthalpy < Node(PurchAir(PurchAirNum).ZoneRecircAirNodeNum).Enthalpy))) { // Calculate supply MassFlowRate based on sensible load but limit to Max Cooling Supply Air Flow Rate if specified - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); DeltaT = (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); if (DeltaT < -SmallTempDiff) { SupplyMassFlowRate = QZnCoolSP / CpAir / DeltaT; @@ -2155,7 +2155,7 @@ namespace PurchasedAirManager { // Mass flow rate to meet sensible load, at Minimum Cooling Supply Air Temperature SupplyMassFlowRateForCool = 0.0; if (CoolOn) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); DeltaT = (PurchAir(PurchAirNum).MinCoolSuppAirTemp - Node(ZoneNodeNum).Temp); if (DeltaT < -SmallTempDiff) { SupplyMassFlowRateForCool = QZnCoolSP / CpAir / DeltaT; @@ -2212,7 +2212,7 @@ namespace PurchasedAirManager { // In general, in the cooling section, don't let SupplyTemp be set to something that results in heating if (SupplyMassFlowRate > 0.0) { // Calculate supply temp at SupplyMassFlowRate and recheck limit on Minimum Cooling Supply Air Temperature - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); SupplyTemp = QZnCoolSP / (CpAir * SupplyMassFlowRate) + Node(ZoneNodeNum).Temp; SupplyTemp = max(SupplyTemp, PurchAir(PurchAirNum).MinCoolSuppAirTemp); // This is the cooling mode, so SupplyTemp can't be more than MixedAirTemp @@ -2223,7 +2223,7 @@ namespace PurchasedAirManager { // Check sensible load vs max total cooling capacity, if specified, and adjust supply temp before applying humidity controls // Will check again later, too if ((PurchAir(PurchAirNum).CoolingLimit == LimitCapacity) || (PurchAir(PurchAirNum).CoolingLimit == LimitFlowRateAndCapacity)) { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy); if (CoolSensOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { CoolSensOutput = PurchAir(PurchAirNum).MaxCoolTotCap; @@ -2243,7 +2243,7 @@ namespace PurchasedAirManager { } else if (SELECT_CASE_var == ConstantSensibleHeatRatio) { // SHR = CoolSensOutput/CoolTotOutput // CoolTotOutput = CoolSensOutput/SHR - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolTotOutput = CoolSensOutput / PurchAir(PurchAirNum).CoolSHR; SupplyEnthalpy = MixedAirEnthalpy - CoolTotOutput / SupplyMassFlowRate; @@ -2301,7 +2301,7 @@ namespace PurchasedAirManager { // Adjust both supply temp and humidity ratio to maintain SHR // SHR = CoolSensOutput/CoolTotOutput // CoolSensOutput = SHR*CoolTotOutput - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = CoolTotOutput * PurchAir(PurchAirNum).CoolSHR; SupplyTemp = MixedAirTemp - CoolSensOutput / (CpAir * SupplyMassFlowRate); // This is the cooling mode, so SupplyTemp can't be more than MixedAirTemp @@ -2315,7 +2315,7 @@ namespace PurchasedAirManager { } else if ((SELECT_CASE_var == None) || (SELECT_CASE_var == ConstantSupplyHumidityRatio)) { // Keep humidity ratio and adjust supply temp // Check if latent output exceeds capacity - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolLatOutput = CoolTotOutput - CoolSensOutput; if (CoolLatOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { @@ -2339,7 +2339,7 @@ namespace PurchasedAirManager { SupplyTemp = min(SupplyTemp, MixedAirTemp); SupplyHumRat = PsyWFnTdbH(SupplyTemp, SupplyEnthalpy, RoutineName); SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); - // CpAir = PsyCpAirFnWTdb(MixedAirHumRat,MixedAirTemp) + // CpAir = PsyCpAirFnWTdb(MixedAirHumRat) // CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp) // CoolTotOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy) } @@ -2347,7 +2347,7 @@ namespace PurchasedAirManager { } else { // Not dehumidifying // If not dehumidifying, compare sensible cooling to the limit // This section will only increase supply temp, so no need to recheck for super-saturation - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); if (CoolSensOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { CoolSensOutput = PurchAir(PurchAirNum).MaxCoolTotCap; @@ -2404,7 +2404,7 @@ namespace PurchasedAirManager { // Mass flow rate to meet sensible load, at Minimum Cooling Supply Air Temperature SupplyMassFlowRateForHeat = 0.0; if ((HeatOn) && (OperatingMode == Heat)) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); DeltaT = (PurchAir(PurchAirNum).MaxHeatSuppAirTemp - Node(ZoneNodeNum).Temp); if (DeltaT > SmallTempDiff) { SupplyMassFlowRateForHeat = QZnHeatSP / CpAir / DeltaT; @@ -2463,7 +2463,7 @@ namespace PurchasedAirManager { if (SupplyMassFlowRate > 0.0) { if ((HeatOn) && (OperatingMode == Heat)) { // Calculate supply temp at SupplyMassFlowRate and check limit on Maximum Heating Supply Air Temperature - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); SupplyTemp = QZnHeatSP / (CpAir * SupplyMassFlowRate) + Node(ZoneNodeNum).Temp; SupplyTemp = min(SupplyTemp, PurchAir(PurchAirNum).MaxHeatSuppAirTemp); // This is the heating mode, so SupplyTemp can't be less than MixedAirTemp @@ -2471,7 +2471,7 @@ namespace PurchasedAirManager { // Check max heating capacity, if specified if ((PurchAir(PurchAirNum).HeatingLimit == LimitCapacity) || (PurchAir(PurchAirNum).HeatingLimit == LimitFlowRateAndCapacity)) { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); HeatSensOutput = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); if (HeatSensOutput > PurchAir(PurchAirNum).MaxHeatSensCap) { SupplyTemp = PurchAir(PurchAirNum).MaxHeatSensCap / (SupplyMassFlowRate * CpAir) + MixedAirTemp; @@ -2502,7 +2502,7 @@ namespace PurchasedAirManager { SupplyHumRat = PurchAir(PurchAirNum).MaxHeatSuppAirHumRat; SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); CoolTotOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy); - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolLatOutput = CoolTotOutput - CoolSensOutput; if (CoolLatOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { @@ -2541,7 +2541,7 @@ namespace PurchasedAirManager { SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); if (SupplyHumRat < MixedAirHumRat) { // At this point, the system is heating or deadband but dehumidifying, check max cooling cap limit - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); SensOutput = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); LatOutput = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy) - SensOutput; if ((PurchAir(PurchAirNum).CoolingLimit == LimitCapacity) || @@ -2592,7 +2592,7 @@ namespace PurchasedAirManager { PurchAir(PurchAirNum).SenCoilLoad = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy); PurchAir(PurchAirNum).LatCoilLoad = 0.0; } else { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat, MixedAirTemp); + CpAir = PsyCpAirFnWTdb(MixedAirHumRat); PurchAir(PurchAirNum).SenCoilLoad = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); PurchAir(PurchAirNum).LatCoilLoad = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy) - PurchAir(PurchAirNum).SenCoilLoad; } @@ -2635,7 +2635,7 @@ namespace PurchasedAirManager { SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); SysOutputProvided = SupplyMassFlowRate * CpAir * (SupplyTemp - Node(ZoneNodeNum).Temp); MoistOutputProvided = SupplyMassFlowRate * (SupplyHumRat - Node(ZoneNodeNum).HumRat); // Latent rate, kg/s @@ -2643,7 +2643,7 @@ namespace PurchasedAirManager { PurchAir(PurchAirNum).LatOutputToZone = SupplyMassFlowRate * (SupplyEnthalpy - Node(ZoneNodeNum).Enthalpy) - PurchAir(PurchAirNum).SenOutputToZone; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); if (PurchAir(PurchAirNum).OutdoorAir) { PurchAir(PurchAirNum).OASenOutput = OAMassFlowRate * CpAir * (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); PurchAir(PurchAirNum).OALatOutput = @@ -2924,7 +2924,7 @@ namespace PurchasedAirManager { } // Calculate OA and heat recovery sensible and latent rates - CpAir = PsyCpAirFnWTdb(OAInletHumRat, OAInletTemp); + CpAir = PsyCpAirFnWTdb(OAInletHumRat); PurchAir(PurchAirNum).HtRecSenOutput = OAMassFlowRate * CpAir * (OAAfterHtRecTemp - OAInletTemp); PurchAir(PurchAirNum).HtRecLatOutput = OAMassFlowRate * (OAAfterHtRecEnthalpy - OAInletEnthalpy) - PurchAir(PurchAirNum).HtRecSenOutput; diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index cac6a8794e7..70df324861b 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -1116,13 +1116,12 @@ namespace RefrigeratedCase { ErrorsFound = true; } - ErrorsFound |= CurveManager::CheckCurveDims( - RefrigCase(CaseNum).LatCapCurvePtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - RefrigCase(CaseNum).Name, // Object Name - cAlphaFieldNames(5)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(RefrigCase(CaseNum).LatCapCurvePtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + RefrigCase(CaseNum).Name, // Object Name + cAlphaFieldNames(5)); // Field Name NumNum = 8; if (!lNumericBlanks(NumNum)) { @@ -1442,13 +1441,12 @@ namespace RefrigeratedCase { } if (RefrigCase(CaseNum).DefCapCurvePtr > 0) { - ErrorsFound |= CurveManager::CheckCurveDims( - RefrigCase(CaseNum).DefCapCurvePtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - RefrigCase(CaseNum).Name, // Object Name - cAlphaFieldNames(12)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(RefrigCase(CaseNum).DefCapCurvePtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + RefrigCase(CaseNum).Name, // Object Name + cAlphaFieldNames(12)); // Field Name } // warn user if defrost energy curve is entered that it is only used for temperature termination types @@ -2411,13 +2409,12 @@ namespace RefrigeratedCase { ErrorsFound = true; } // error checks for curve type entered and curve name - ErrorsFound |= CurveManager::CheckCurveDims( - WarehouseCoil(CoilID).SHRCorrectionCurvePtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - WarehouseCoil(CoilID).Name, // Object Name - cAlphaFieldNames(AlphaNum)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(WarehouseCoil(CoilID).SHRCorrectionCurvePtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + WarehouseCoil(CoilID).Name, // Object Name + cAlphaFieldNames(AlphaNum)); // Field Name } else if (SELECT_CASE_var == TabularRH_DT1_TRoom) { WarehouseCoil(CoilID).SHRCorrectionCurvePtr = GetCurveIndex(Alphas(AlphaNum)); // convert curve name to number if (lAlphaBlanks(AlphaNum)) { @@ -2429,13 +2426,12 @@ namespace RefrigeratedCase { ShowContinueError("...invalid curve " + cAlphaFieldNames(AlphaNum) + "=\"" + Alphas(AlphaNum) + "\"."); ErrorsFound = true; } - ErrorsFound |= CurveManager::CheckCurveDims( - WarehouseCoil(CoilID).SHRCorrectionCurvePtr, // Curve index - {3}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - WarehouseCoil(CoilID).Name, // Object Name - cAlphaFieldNames(AlphaNum)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(WarehouseCoil(CoilID).SHRCorrectionCurvePtr, // Curve index + {3}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + WarehouseCoil(CoilID).Name, // Object Name + cAlphaFieldNames(AlphaNum)); // Field Name // IF(WarehouseCoil(CoilID)%SHRCorrectionCurvePtr == 0) THEN // CALL ShowSevereError(RoutineName//TRIM(CurrentModuleObject)//'="'//TRIM(WarehouseCoil(CoilID)%Name)//& // '", not found '//TRIM(cAlphaFieldNames(AlphaNum))) @@ -2864,13 +2860,12 @@ namespace RefrigeratedCase { ErrorsFound = true; } - ErrorsFound |= CurveManager::CheckCurveDims( - RefrigRack(RackNum).COPFTempPtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - RefrigRack(RackNum).Name, // Object Name - cAlphaFieldNames(3)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(RefrigRack(RackNum).COPFTempPtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + RefrigRack(RackNum).Name, // Object Name + cAlphaFieldNames(3)); // Field Name RefrigRack(RackNum).CondenserFanPower = Numbers(2); if (Numbers(2) < 0.0) { @@ -2887,13 +2882,12 @@ namespace RefrigeratedCase { } if (!lAlphaBlanks(4)) { - ErrorsFound |= CurveManager::CheckCurveDims( - RefrigRack(RackNum).TotCondFTempPtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - RefrigRack(RackNum).Name, // Object Name - cAlphaFieldNames(4)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(RefrigRack(RackNum).TotCondFTempPtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + RefrigRack(RackNum).Name, // Object Name + cAlphaFieldNames(4)); // Field Name } if (UtilityRoutines::SameString(Alphas(5), "EvaporativelyCooled")) { @@ -4380,13 +4374,12 @@ namespace RefrigeratedCase { cAlphaFieldNames(AlphaNum) + " not found:" + Alphas(AlphaNum)); ErrorsFound = true; } - ErrorsFound |= CurveManager::CheckCurveDims( - Secondary(SecondaryNum).VarSpeedCurvePtr, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - Secondary(SecondaryNum).Name, // Object Name - cAlphaFieldNames(AlphaNum)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(Secondary(SecondaryNum).VarSpeedCurvePtr, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + Secondary(SecondaryNum).Name, // Object Name + cAlphaFieldNames(AlphaNum)); // Field Name } // input power conditions/levels for constant or variable speed pump drives // Default non-hermetic motor eff at 85% and all shaft power goes to heat in fluid @@ -13462,59 +13455,76 @@ namespace RefrigeratedCase { static ObjexxFCL::gio::Fmt Format_101("(A)"); static ObjexxFCL::gio::Fmt Format_102("(4X,A)"); static ObjexxFCL::gio::Fmt Format_103("(2X,A)"); - static ObjexxFCL::gio::Fmt Format_104("('! ,Compressor Rack Name,',' # Refrigerated Cases Connected,# WalkIn Coolers " - "Connected, Heat Rejection Location, ','Condenser Type, COP')"); - static ObjexxFCL::gio::Fmt Format_105("('!',2x,',Refrigeration Case Number, Refrigeration Case Name,Zone Name,','Zone Node #,Zone " - "Node Name,Capacity (W/m),LHR,Temperature (C),Length (m),Fan (W/m),','Installed Lighting (W/m),Anti-Sweat " - "(W/m),Defrost (W/m)')"); + static ObjexxFCL::gio::Fmt Format_104( + "('! ,Compressor Rack Name,',' # Refrigerated Cases Connected,# WalkIn Coolers " + "Connected, Heat Rejection Location, ','Condenser Type, COP')"); + static ObjexxFCL::gio::Fmt Format_105( + "('!',2x,',Refrigeration Case Number, Refrigeration Case Name,Zone Name,','Zone Node #,Zone " + "Node Name,Capacity (W/m),LHR,Temperature (C),Length (m),Fan (W/m),','Installed Lighting (W/m),Anti-Sweat " + "(W/m),Defrost (W/m)')"); static ObjexxFCL::gio::Fmt Format_108("('!',2x,',Compressor Number,Compressor Name,Nominal Capacity (W)')"); static ObjexxFCL::gio::Fmt Format_109("('! <#Refrigeration Compressor Racks>,Number of Refrigeration Compressor Racks')"); static ObjexxFCL::gio::Fmt Format_114("(',',1X,F7.1)"); static ObjexxFCL::gio::Fmt Format_117("('! <#Detailed Refrigeration Systems>,Number of Detailed Refrigeration Systems')"); - static ObjexxFCL::gio::Fmt Format_118("('! ,Refrigeration System Name,Refrigerant Used',', # Refrigerated Cases " - "Connected, # WalkInCoolers Connected, #Air Chillers Connected',', # Secondary Loops Served, # Cascade Condensers " - "Served',', # Mechanical Subcoolers Served, # Compressors Connected',', # Compression Stages, Intercooler Type, " - "Intercooler Effectiveness',', # Subcoolers Connected, Minimum Condensing Temperature (C)')"); - static ObjexxFCL::gio::Fmt Format_119("('!',2x,', Walk In Number, Walk In Name,','Capacity (W),Temperature (C),Coil Fan " - "(W), Circulating Fan (W), ','Lighting (W),Heaters (W),Defrost (W), # Zones')"); - static ObjexxFCL::gio::Fmt Format_120("('! <#Detailed Transcritical Refrigeration Systems>,Number of Detailed Transcritical Refrigeration Systems')"); - static ObjexxFCL::gio::Fmt Format_121("('! ,Transcritical Refrigeration System Name,Refrigerant Used',', # " - "Medium Temperature Refrigerated Cases Connected, # Low Temperature Refrigerated Cases Connected',', # Medium " - "Temperature WalkInCoolers Connected, # Low Temperature WalkInCoolers Connected',', # High Pressure Compressors " - "Connected, # Low Pressure Compressors Connected',', Minimum Condensing Temperature (C)')"); + static ObjexxFCL::gio::Fmt Format_118( + "('! ,Refrigeration System Name,Refrigerant Used',', # Refrigerated Cases " + "Connected, # WalkInCoolers Connected, #Air Chillers Connected',', # Secondary Loops Served, # Cascade Condensers " + "Served',', # Mechanical Subcoolers Served, # Compressors Connected',', # Compression Stages, Intercooler Type, " + "Intercooler Effectiveness',', # Subcoolers Connected, Minimum Condensing Temperature (C)')"); + static ObjexxFCL::gio::Fmt Format_119( + "('!',2x,', Walk In Number, Walk In Name,','Capacity (W),Temperature (C),Coil Fan " + "(W), Circulating Fan (W), ','Lighting (W),Heaters (W),Defrost (W), # Zones')"); + static ObjexxFCL::gio::Fmt Format_120( + "('! <#Detailed Transcritical Refrigeration Systems>,Number of Detailed Transcritical Refrigeration Systems')"); + static ObjexxFCL::gio::Fmt Format_121( + "('! ,Transcritical Refrigeration System Name,Refrigerant Used',', # " + "Medium Temperature Refrigerated Cases Connected, # Low Temperature Refrigerated Cases Connected',', # Medium " + "Temperature WalkInCoolers Connected, # Low Temperature WalkInCoolers Connected',', # High Pressure Compressors " + "Connected, # Low Pressure Compressors Connected',', Minimum Condensing Temperature (C)')"); static ObjexxFCL::gio::Fmt Format_123("('!',2x,', Secondary System Served Name, Secondary Number')"); - static ObjexxFCL::gio::Fmt Format_126("('!',2x,', Subcooler Number, Subcooler Name, ','Name of System Providing " - "Cooling, Design Outlet Temperature (C)')"); - static ObjexxFCL::gio::Fmt Format_127("('!',2x,', Subcooler Number, Subcooler Name, ','Design Subcooling " - "(DeltaC),','Design liquid inlet temperature (C), Design vapor inlet temperature (C)')"); + static ObjexxFCL::gio::Fmt Format_126( + "('!',2x,', Subcooler Number, Subcooler Name, ','Name of System Providing " + "Cooling, Design Outlet Temperature (C)')"); + static ObjexxFCL::gio::Fmt Format_127( + "('!',2x,', Subcooler Number, Subcooler Name, ','Design Subcooling " + "(DeltaC),','Design liquid inlet temperature (C), Design vapor inlet temperature (C)')"); static ObjexxFCL::gio::Fmt Format_128("('!',2x,', System Name Connected, Condenser Number, Condenser Name')"); - static ObjexxFCL::gio::Fmt Format_129("('!',2x,',Condenser Number,Condenser Name,Rated Condensing Temperature " - "(C),','Rated Capacity (W), Rated Fan Power (W)')"); - static ObjexxFCL::gio::Fmt Format_130("('!',2x,',Condenser Number,Condenser Name,Rated Condensing Temperature " - "(C),','Rated Capacity (W), Rated Water Inlet Temperature (C), Rated Water Flow Rate (m3/s)')"); + static ObjexxFCL::gio::Fmt Format_129( + "('!',2x,',Condenser Number,Condenser Name,Rated Condensing Temperature " + "(C),','Rated Capacity (W), Rated Fan Power (W)')"); + static ObjexxFCL::gio::Fmt Format_130( + "('!',2x,',Condenser Number,Condenser Name,Rated Condensing Temperature " + "(C),','Rated Capacity (W), Rated Water Inlet Temperature (C), Rated Water Flow Rate (m3/s)')"); static ObjexxFCL::gio::Fmt Format_131( "('!',2x,',Condenser Number,Condenser Name,','Rated Capacity (W), Rated Fan Power (W)')"); - static ObjexxFCL::gio::Fmt Format_132("('!',2x,', Condenser Number, Condenser Name,',' Condensing Temperature Control " - "Type, Rated Condensing Temperature (C),',' Capacity (W), Approach Temperature Difference (DeltaC)')"); - static ObjexxFCL::gio::Fmt Format_133("('! , Secondary Number, Secondary Name,',' # Refrigerated " - "Cases Connected, # WalkIn Coolers Connected,',' Fluid Name, Capacity (W),Evap Temperature in Secondary " - "Evaporator (C),',' Approach Temperature Difference (DeltaC), Temperature Range (DeltaC), TotalPumpPower (W)')"); - static ObjexxFCL::gio::Fmt Format_134("('!',6x,', ZoneName,',' Wall/Ceiling Area (m2), UValue (W/m2-C), AreaStockDoors " - "(m2), HeightStockDoors,',' UValueStockDoors (W/m2-C), AreaGlassDoors (m2), HeightGlassDoors (m), ',' " - "UValueGlassDoors (W/m2-C)')"); + static ObjexxFCL::gio::Fmt Format_132( + "('!',2x,', Condenser Number, Condenser Name,',' Condensing Temperature Control " + "Type, Rated Condensing Temperature (C),',' Capacity (W), Approach Temperature Difference (DeltaC)')"); + static ObjexxFCL::gio::Fmt Format_133( + "('! , Secondary Number, Secondary Name,',' # Refrigerated " + "Cases Connected, # WalkIn Coolers Connected,',' Fluid Name, Capacity (W),Evap Temperature in Secondary " + "Evaporator (C),',' Approach Temperature Difference (DeltaC), Temperature Range (DeltaC), TotalPumpPower (W)')"); + static ObjexxFCL::gio::Fmt Format_134( + "('!',6x,', ZoneName,',' Wall/Ceiling Area (m2), UValue (W/m2-C), AreaStockDoors " + "(m2), HeightStockDoors,',' UValueStockDoors (W/m2-C), AreaGlassDoors (m2), HeightGlassDoors (m), ',' " + "UValueGlassDoors (W/m2-C)')"); static ObjexxFCL::gio::Fmt Format_141("('!',2x,', Subcooler Number, Subcooler Name')"); static ObjexxFCL::gio::Fmt Format_142("('! <#Secondary Refrigeration Systems>,Number of Secondary Refrigeration Systems')"); - static ObjexxFCL::gio::Fmt Format_146("('! , Secondary Number, Secondary Name,',' # Refrigerated Cases " - "Connected, # WalkIn Coolers Connected, #Air Coils Connected',' Fluid Name, Capacity (W),Evap Temperature in " - "Secondary Evaporator (C),',' Approach Temperature Difference (DeltaC), Circulating Rate, TotalPumpPower (W)')"); + static ObjexxFCL::gio::Fmt Format_146( + "('! , Secondary Number, Secondary Name,',' # Refrigerated Cases " + "Connected, # WalkIn Coolers Connected, #Air Coils Connected',' Fluid Name, Capacity (W),Evap Temperature in " + "Secondary Evaporator (C),',' Approach Temperature Difference (DeltaC), Circulating Rate, TotalPumpPower (W)')"); static ObjexxFCL::gio::Fmt Format_148("('! <#ZoneHVAC/Refrigeration Air Chiller Sets>,Number of ZoneHVAC/Refrigeration Air Chiller Sets')"); - static ObjexxFCL::gio::Fmt Format_149("('! ,Chiller Set Name,',' # Air Chillers Connected, Zone Location')"); - static ObjexxFCL::gio::Fmt Format_151("('!',2x,',Refrigeration Chiller Number, Refrigeration Chiller Name,Zone Name,','Zone " - "Node #,Zone Node Name,Sensible Capacity (W/C),Sensible Capacity (W),Evaporating Temperature (C),DT1 (C),','Fan " - "Power (W),Heater (W),Defrost (W), Air Flow Rate (m3/s)')"); + static ObjexxFCL::gio::Fmt Format_149( + "('! ,Chiller Set Name,',' # Air Chillers Connected, Zone Location')"); + static ObjexxFCL::gio::Fmt Format_151( + "('!',2x,',Refrigeration Chiller Number, Refrigeration Chiller Name,Zone Name,','Zone " + "Node #,Zone Node Name,Sensible Capacity (W/C),Sensible Capacity (W),Evaporating Temperature (C),DT1 (C),','Fan " + "Power (W),Heater (W),Defrost (W), Air Flow Rate (m3/s)')"); static ObjexxFCL::gio::Fmt Format_152("('!',2x,', Air Chiller Name, Air Chiller Number, Zone Name,')"); - static ObjexxFCL::gio::Fmt Format_160("('!',2x,',Gas Cooler Number, Gas Cooler Name, Rated Outlet Pressure " - "(Pa),','Rated Outlet Temperature (C), Rated Approach Temperature (C), Rated Capacity (W), Rated Fan Power (W)')"); + static ObjexxFCL::gio::Fmt Format_160( + "('!',2x,',Gas Cooler Number, Gas Cooler Name, Rated Outlet Pressure " + "(Pa),','Rated Outlet Temperature (C), Rated Approach Temperature (C), Rated Capacity (W), Rated Fan Power (W)')"); // 111 FORMAT(',',1X,F6.3) ! compressor rack output line // 112 FORMAT(',',1X,F16.0)! compressor output line @@ -13535,12 +13545,12 @@ namespace RefrigeratedCase { if (NumRefrigeratedRacks > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_109); // Intro to refrigeration case racks ObjexxFCL::gio::write(OutputFileInits, Format_104); // Refrigeration Rack header - } //(NumRefrigeratedRacks > 0) + } //(NumRefrigeratedRacks > 0) if (NumRefrigSystems > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_117); // Intro to detailed systems ObjexxFCL::gio::write(OutputFileInits, Format_118); // Detailed system header ObjexxFCL::gio::write(OutputFileInits, Format_108); // Compressor header (Always have compressor if have detailed system) - } //(NumRefrigSystems > 0) + } //(NumRefrigSystems > 0) if (NumSimulationSecondarySystems > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_142); // Intro to Secondary systems CountSecPhase = 0; @@ -13556,56 +13566,56 @@ namespace RefrigeratedCase { } } ObjexxFCL::gio::write(OutputFileInits, Format_123); // Secondary system load header - } //(NumSimulationSecondarySystems > 0) + } //(NumSimulationSecondarySystems > 0) if (NumRefrigChillerSets > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_148); // Intro to Chiller set ObjexxFCL::gio::write(OutputFileInits, Format_149); // Chiller set header ObjexxFCL::gio::write(OutputFileInits, Format_151); // Intro to Air Chiller ObjexxFCL::gio::write(OutputFileInits, Format_152); // Air chiller header - } //(NumRefrigSystems > 0) + } //(NumRefrigSystems > 0) if (NumSimulationCases > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_105); // Case header - } //(NumSimulationCases > 0) + } //(NumSimulationCases > 0) if (NumSimulationWalkIns > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_119); // Walk-in header ObjexxFCL::gio::write(OutputFileInits, Format_134); // Walk-in zone-specific header - } //(NumSimulationWalkIns > 0) + } //(NumSimulationWalkIns > 0) if (NumSimulationCondAir > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_129); // Condenser, Air-Cooled header - } //(NumSimulationCondAir > 0) + } //(NumSimulationCondAir > 0) if (NumSimulationCondEvap > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_131); // Condenser, Evaporative-Cooled header - } //(NumSimulationCondEvap > 0) + } //(NumSimulationCondEvap > 0) if (NumSimulationCondWater > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_130); // Condenser, Water-Cooled header - } //(NumSimulationCondWater > 0) + } //(NumSimulationCondWater > 0) if (NumSimulationCascadeCondensers > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_132); // Condenser, Cascade header ObjexxFCL::gio::write(OutputFileInits, Format_128); // Cascade Load header - } //(NumSimulationCascadeCondensers > 0) + } //(NumSimulationCascadeCondensers > 0) if (NumSimulationMechSubcoolers > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_141); // Mech subcooler loads served header ObjexxFCL::gio::write(OutputFileInits, Format_126); // Mechanical Subcooler header - } //(NumSimulationMechSubcoolers > 0) + } //(NumSimulationMechSubcoolers > 0) if ((NumSimulationSubcoolers - NumSimulationMechSubcoolers) > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_127); // LSHX Subcooler header - } //((NumSimulationSubcoolers - NumSimulationMechSubcoolers) > 0) + } //((NumSimulationSubcoolers - NumSimulationMechSubcoolers) > 0) if (NumTransRefrigSystems > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_120); // Intro to detailed transcriticial refrigeration system ObjexxFCL::gio::write(OutputFileInits, Format_121); // Detailed system header if (NumSimulationCases > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_105); // Case header - } //(NumSimulationCases > 0) + } //(NumSimulationCases > 0) if (NumSimulationWalkIns > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_119); // Walk-in header ObjexxFCL::gio::write(OutputFileInits, Format_134); // Walk-in zone-specific header - } //(NumSimulationWalkIns > 0) + } //(NumSimulationWalkIns > 0) ObjexxFCL::gio::write(OutputFileInits, Format_108); // Compressor header (Always have compressor if have detailed system) if (NumSimulationGasCooler > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_160); // Gas Cooler, Air-Cooled header - } //(NumSimulationGasCooler > 0) - } //(NumTransRefrigSystems > 0) + } //(NumSimulationGasCooler > 0) + } //(NumTransRefrigSystems > 0) if (NumRefrigeratedRacks > 0) { ObjexxFCL::gio::write(OutputFileInits, Format_101) << "#Refrigeration Compressor Racks, " + RoundSigDigits(NumRefrigeratedRacks); @@ -13626,9 +13636,9 @@ namespace RefrigeratedCase { } } ObjexxFCL::gio::write(OutputFileInits, Format_101) << " Refrigeration Compressor Rack," + RefrigRack(RackNum).Name + ',' + - RoundSigDigits(RefrigRack(RackNum).NumCases) + ',' + - RoundSigDigits(RefrigRack(RackNum).NumWalkIns) + ',' + ChrOut + ',' + ChrOut2 + ',' + - RoundSigDigits(RefrigRack(RackNum).RatedCOP, 3); + RoundSigDigits(RefrigRack(RackNum).NumCases) + ',' + + RoundSigDigits(RefrigRack(RackNum).NumWalkIns) + ',' + ChrOut + ',' + + ChrOut2 + ',' + RoundSigDigits(RefrigRack(RackNum).RatedCOP, 3); for (CaseNum = 1; CaseNum <= RefrigRack(RackNum).NumCases; ++CaseNum) { CaseID = RefrigRack(RackNum).CaseNum(CaseNum); if (RefrigCase(CaseID).ZoneNodeNum > 0) { @@ -13653,15 +13663,15 @@ namespace RefrigeratedCase { RoundSigDigits(WalkIn(WalkInID).HeaterPower, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).DefrostCapacity, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).NumZones); for (ZoneID = 1; ZoneID <= WalkIn(WalkInID).NumZones; ++ZoneID) { - ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone, " + WalkIn(WalkInID).ZoneName(ZoneID) + ',' + - RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); + ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone, " + WalkIn(WalkInID).ZoneName(ZoneID) + + ',' + RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + + ',' + RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); } // zones for walk ins on rack } // walk ins on rack @@ -13708,15 +13718,15 @@ namespace RefrigeratedCase { RoundSigDigits(WalkIn(WalkInID).DesignLighting, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).HeaterPower, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).DefrostCapacity, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).NumZones); for (ZoneID = 1; ZoneID <= WalkIn(WalkInID).NumZones; ++ZoneID) { - ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone, " + WalkIn(WalkInID).ZoneName(ZoneID) + ',' + - RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); + ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone, " + WalkIn(WalkInID).ZoneName(ZoneID) + + ',' + RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + + ',' + RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); } // Num zones for each walk in on system } // NumWalkIns on system @@ -13728,13 +13738,15 @@ namespace RefrigeratedCase { for (CascadeLoadNum = 1; CascadeLoadNum <= System(SystemNum).NumCascadeLoads; ++CascadeLoadNum) { CascadeLoadID = System(SystemNum).CascadeLoadNum(CascadeLoadNum); - ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Cascade Load," + System(Condenser(CascadeLoadID).CascadeSysID).Name + ',' + - RoundSigDigits(CascadeLoadID) + ',' + Condenser(CascadeLoadID).Name; + ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Cascade Load," + System(Condenser(CascadeLoadID).CascadeSysID).Name + + ',' + RoundSigDigits(CascadeLoadID) + ',' + + Condenser(CascadeLoadID).Name; } // cascade load on detailed system for (SecondaryNum = 1; SecondaryNum <= System(SystemNum).NumSecondarys; ++SecondaryNum) { SecondaryID = System(SystemNum).SecondaryNum(SecondaryNum); - ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Secondary Load," + Secondary(SecondaryID).Name + ',' + RoundSigDigits(SecondaryID); + ObjexxFCL::gio::write(OutputFileInits, Format_103) + << " Secondary Load," + Secondary(SecondaryID).Name + ',' + RoundSigDigits(SecondaryID); } // secondary load on detailed system for (SubcoolerNum = 1; SubcoolerNum <= NumSimulationSubcoolers; ++SubcoolerNum) { @@ -13747,20 +13759,23 @@ namespace RefrigeratedCase { for (CompressorNum = 1; CompressorNum <= System(SystemNum).NumCompressors; ++CompressorNum) { CompID = System(SystemNum).CompressorNum(CompressorNum); ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Refrigeration Compressor," + RoundSigDigits(CompID) + ',' + - Compressor(CompID).Name + ',' + RoundSigDigits(Compressor(CompID).NomCap, 0); + Compressor(CompID).Name + ',' + + RoundSigDigits(Compressor(CompID).NomCap, 0); } // NumCompressors } else if (System(SystemNum).NumStages == 2) { // Two-stage compression system // Low-stage compressors for (CompressorNum = 1; CompressorNum <= System(SystemNum).NumCompressors; ++CompressorNum) { CompID = System(SystemNum).CompressorNum(CompressorNum); ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Refrigeration Low-Stage Compressor," + RoundSigDigits(CompID) + ',' + - Compressor(CompID).Name + ',' + RoundSigDigits(Compressor(CompID).NomCap, 0); + Compressor(CompID).Name + ',' + + RoundSigDigits(Compressor(CompID).NomCap, 0); } // NumCompressors // High-stage compressors for (CompressorNum = 1; CompressorNum <= System(SystemNum).NumHiStageCompressors; ++CompressorNum) { CompID = System(SystemNum).HiStageCompressorNum(CompressorNum); ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Refrigeration High-Stage Compressor," + RoundSigDigits(CompID) + ',' + - Compressor(CompID).Name + ',' + RoundSigDigits(Compressor(CompID).NomCap, 0); + Compressor(CompID).Name + ',' + + RoundSigDigits(Compressor(CompID).NomCap, 0); } // NumHiStageCompressors } // NumStages @@ -13803,15 +13818,15 @@ namespace RefrigeratedCase { { auto const SELECT_CASE_var(Subcooler(SubcoolerID).SubcoolerType); if (SELECT_CASE_var == LiquidSuction) { - ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Refrigeration Liquid Suction Subcooler," + RoundSigDigits(SubcoolerID) + - ',' + Subcooler(SubcoolerID).Name + ',' + - RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignDelT, 1) + ',' + - RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignTliqIn, 1) + ',' + - RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignTvapIn, 1); + ObjexxFCL::gio::write(OutputFileInits, Format_103) + << " Refrigeration Liquid Suction Subcooler," + RoundSigDigits(SubcoolerID) + ',' + Subcooler(SubcoolerID).Name + + ',' + RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignDelT, 1) + ',' + + RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignTliqIn, 1) + ',' + + RoundSigDigits(Subcooler(SubcoolerID).LiqSuctDesignTvapIn, 1); } else if (SELECT_CASE_var == Mechanical) { - ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Refrigeration Mechanical Subcooler," + RoundSigDigits(SubcoolerID) + ',' + - Subcooler(SubcoolerID).Name + ',' + Subcooler(SubcoolerID).MechSourceSys + - ',' + RoundSigDigits(Subcooler(SubcoolerID).MechControlTliqOut, 1); + ObjexxFCL::gio::write(OutputFileInits, Format_103) + << " Refrigeration Mechanical Subcooler," + RoundSigDigits(SubcoolerID) + ',' + Subcooler(SubcoolerID).Name + ',' + + Subcooler(SubcoolerID).MechSourceSys + ',' + RoundSigDigits(Subcooler(SubcoolerID).MechControlTliqOut, 1); } } } // NumSubcoolers @@ -13820,7 +13835,8 @@ namespace RefrigeratedCase { } //(NumRefrigSystems > 0) if (NumTransRefrigSystems > 0) { - ObjexxFCL::gio::write(OutputFileInits, Format_101) << "#Detailed Transcritical Refrigeration Systems," + RoundSigDigits(NumTransRefrigSystems); + ObjexxFCL::gio::write(OutputFileInits, Format_101) + << "#Detailed Transcritical Refrigeration Systems," + RoundSigDigits(NumTransRefrigSystems); for (TransSystemNum = 1; TransSystemNum <= NumTransRefrigSystems; ++TransSystemNum) { ObjexxFCL::gio::write(OutputFileInits, Format_101) << " Detailed Transcritical Refrigeration System," + TransSystem(TransSystemNum).Name + ',' + @@ -13866,15 +13882,15 @@ namespace RefrigeratedCase { RoundSigDigits(WalkIn(WalkInID).DesignLighting, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).HeaterPower, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).DefrostCapacity, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).NumZones); for (ZoneID = 1; ZoneID <= WalkIn(WalkInID).NumZones; ++ZoneID) { - ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + ',' + - RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); + ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + + ',' + RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + + ',' + RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); } // Num zones for each walk in on system } // NumWalkInsMT on system for (WalkInNum = 1; WalkInNum <= TransSystem(TransSystemNum).NumWalkInsLT; ++WalkInNum) { @@ -13886,27 +13902,29 @@ namespace RefrigeratedCase { RoundSigDigits(WalkIn(WalkInID).DesignLighting, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).HeaterPower, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).DefrostCapacity, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).NumZones); for (ZoneID = 1; ZoneID <= WalkIn(WalkInID).NumZones; ++ZoneID) { - ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + ',' + - RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); + ObjexxFCL::gio::write(OutputFileInits, Format_102) << " Walk-In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + + ',' + RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + + ',' + RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); } // Num zones for each walk in on system } // NumWalkInsLT on system for (CompressorNum = 1; CompressorNum <= TransSystem(TransSystemNum).NumCompressorsHP; ++CompressorNum) { CompID = TransSystem(TransSystemNum).CompressorNumHP(CompressorNum); ObjexxFCL::gio::write(OutputFileInits, Format_103) << " High Pressure Refrigeration Compressor," + RoundSigDigits(CompID) + ',' + - Compressor(CompID).Name + ',' + RoundSigDigits(Compressor(CompID).NomCap, 0); + Compressor(CompID).Name + ',' + + RoundSigDigits(Compressor(CompID).NomCap, 0); } // NumCompressorsHP for (CompressorNum = 1; CompressorNum <= TransSystem(TransSystemNum).NumCompressorsLP; ++CompressorNum) { CompID = TransSystem(TransSystemNum).CompressorNumLP(CompressorNum); ObjexxFCL::gio::write(OutputFileInits, Format_103) << " Low Pressure Refrigeration Compressor," + RoundSigDigits(CompID) + ',' + - Compressor(CompID).Name + ',' + RoundSigDigits(Compressor(CompID).NomCap, 0); + Compressor(CompID).Name + ',' + + RoundSigDigits(Compressor(CompID).NomCap, 0); } // NumCompressorsLP if (TransSystem(TransSystemNum).NumGasCoolers >= 1) { @@ -13971,15 +13989,15 @@ namespace RefrigeratedCase { RoundSigDigits(WalkIn(WalkInID).DesignLighting, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).HeaterPower, 1) + ',' + RoundSigDigits(WalkIn(WalkInID).DefrostCapacity, 1); for (ZoneID = 1; ZoneID <= WalkIn(WalkInID).NumZones; ++ZoneID) { - ObjexxFCL::gio::write(OutputFileInits, Format_102) << "Walk In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + ',' + - RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + - RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + - RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); + ObjexxFCL::gio::write(OutputFileInits, Format_102) << "Walk In Surfaces Facing Zone," + WalkIn(WalkInID).ZoneName(ZoneID) + + ',' + RoundSigDigits(WalkIn(WalkInID).SurfaceArea(ZoneID), 1) + + ',' + RoundSigDigits(WalkIn(WalkInID).UValue(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightStockDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueStockDr(ZoneID), 4) + ',' + + RoundSigDigits(WalkIn(WalkInID).AreaGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).HeightGlassDr(ZoneID), 2) + ',' + + RoundSigDigits(WalkIn(WalkInID).UValueGlassDr(ZoneID), 4); } // zones for walk ins on secondary } // walk ins on secondary @@ -15422,7 +15440,7 @@ namespace RefrigeratedCase { ZoneMixedAirEnthalpy = PsyHFnTdbRhPb(ZoneMixedAirDryBulb, ZoneMixedAirRHFrac, OutBaroPress, TrackMessage); ZoneMixedAirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZoneMixedAirDryBulb, ZoneMixedAirHumRatio, TrackMessage); ZoneDryAirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZoneMixedAirDryBulb, 0.0, TrackMessage); - ZoneMixedAirCp = PsyCpAirFnWTdb(ZoneMixedAirHumRatio, ZoneMixedAirDryBulb); + ZoneMixedAirCp = PsyCpAirFnWTdb(ZoneMixedAirHumRatio); DryAirMassFlowRated = AirVolumeFlowRated * ZoneDryAirDensity; // calc t inlet to coil assuming at middle/mixed point in room bbb - // later need to do for hottest/coolest in room where Tin /= Tzonemixed @@ -15441,7 +15459,7 @@ namespace RefrigeratedCase { CoilInletCp = ZoneMixedAirCp; CoilInletHumRatio = ZoneMixedAirHumRatio; CoilInletDryAirDensity = ZoneDryAirDensity; - CoilInletDryAirCp = PsyCpAirFnWTdb(0.0, CoilInletTemp); + CoilInletDryAirCp = PsyCpAirFnWTdb(0.0); break; } AirVolumeFlowMax = AirVolumeFlowRated * (1.0 - DefrostDripDownSchedule) * CoilSchedule; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index 0da8ae2cf3a..bdf5f3f3e26 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -856,7 +856,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData() c->coilFlowPrcntPlantFlow = -999.0; } - c->cpDryAir = Psychrometrics::PsyCpAirFnWTdb(0.0, 20.0); + c->cpDryAir = Psychrometrics::PsyCpAirFnWTdb(0.0); c->rhoStandAir = DataEnvironment::StdRhoAir; // apply ADP method to find an SHR for Ideal loads peak, calculate sensible capacity for cooling coils @@ -1399,7 +1399,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( } // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesEntHumRat, 0.5 * (c->coilDesEntTemp + c->coilDesLvgTemp)); + c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesEntHumRat); } void ReportCoilSelection::setCoilHeatingCapacity( @@ -1714,7 +1714,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( } // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesLvgHumRat, 0.5 * (c->coilDesEntTemp + c->coilDesLvgTemp)); + c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesLvgHumRat); // this is not generally correct but okay for heating coils c->coilSensCapAtPeak = std::abs(c->cpMoistAir * c->coilDesMassFlow * (c->coilDesLvgTemp - c->coilDesEntTemp)); c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak); diff --git a/src/EnergyPlus/ReportSizingManager.cc b/src/EnergyPlus/ReportSizingManager.cc index 59fe5d30f99..e5fee8ac79c 100644 --- a/src/EnergyPlus/ReportSizingManager.cc +++ b/src/EnergyPlus/ReportSizingManager.cc @@ -434,7 +434,7 @@ namespace ReportSizingManager { OASysFlag = false; AirLoopSysFlag = false; bCheckForZero = true; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); SupFanDT = 0.0; RetFanDT = 0.0; SupFanNum = 0; @@ -1761,7 +1761,7 @@ namespace ReportSizingManager { setHeatCoilInletTempForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(PlantLoop(DataWaterLoopNum).FluidName, DataGlobals::HWInitConvTemp, @@ -1839,7 +1839,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat, AutosizeDes); + CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); } } @@ -1863,8 +1863,7 @@ namespace ReportSizingManager { PlantLoop(DataWaterLoopNum).FluidIndex, CallingRoutine); DesCoilLoad = DataWaterFlowUsedForSizing * DataWaterCoilSizCoolDeltaT * Cp * rho; - T1Out = DataDesInletAirTemp - - DesCoilLoad / (StdRhoAir * PsyCpAirFnWTdb(DataDesInletAirHumRat, DataDesInletAirTemp) * DataAirFlowUsedForSizing); + T1Out = DataDesInletAirTemp - DesCoilLoad / (StdRhoAir * PsyCpAirFnWTdb(DataDesInletAirHumRat) * DataAirFlowUsedForSizing); T2Out = PlantSizData(DataPltSizCoolNum).ExitTemp + 2.0; AutosizeDes = max(T1Out, T2Out); } else { @@ -1875,7 +1874,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat, AutosizeDes); + CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2073,7 +2072,7 @@ namespace ReportSizingManager { // add fan heat to coil load FanCoolLoad += DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DesVolFlow); PeakCoilLoad += FanCoolLoad; - CpAir = PsyCpAirFnWTdb(CoilInHumRat, CoilInTemp); + CpAir = PsyCpAirFnWTdb(CoilInHumRat); // adjust coil inlet/outlet temp with fan temperature rise if (DataDesAccountForFanHeat) { if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { @@ -2192,14 +2191,13 @@ namespace ReportSizingManager { if ((TermUnitSingDuct || TermUnitPIU) && (CurTermUnitSizingNum > 0)) { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; - CpAir = PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)); + CpAir = PsyCpAirFnWTdb(CoilOutHumRat); DesCoilLoad = CpAir * StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow * (CoilOutTemp - CoilInTemp); DesVolFlow = TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; } else if (TermUnitIU && (CurTermUnitSizingNum > 0)) { if (TermUnitSizing(CurTermUnitSizingNum).InducRat > 0.01) { DesVolFlow = TermUnitSizing(CurTermUnitSizingNum).AirVolFlow / TermUnitSizing(CurTermUnitSizingNum).InducRat; - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat, - TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp); + CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); // the design heating coil load is the zone load minus whatever the central system does.Note that // DesHeatCoilInTempTU is really the primary air inlet temperature for the unit. DesCoilLoad = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad - @@ -2212,7 +2210,7 @@ namespace ReportSizingManager { } else { CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - CpAir = PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)); + CpAir = PsyCpAirFnWTdb(CoilOutHumRat); DesCoilLoad = CpAir * FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow * (CoilOutTemp - CoilInTemp); DesVolFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow / StdRhoAir; } @@ -2280,8 +2278,7 @@ namespace ReportSizingManager { setHeatCoilInletHumRatForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - NominalCapacityDes = - PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + NominalCapacityDes = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); } AutosizeDes = NominalCapacityDes * DataHeatSizeRatio; if (DisplayExtraWarnings && AutosizeDes <= 0.0) { @@ -2350,7 +2347,7 @@ namespace ReportSizingManager { setHeatCoilInletHumRatForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - AutosizeDes = PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + AutosizeDes = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); } } else if (SizingType == HeatingWaterDesCoilWaterVolFlowUsedForUASizing) { if (TermUnitSingDuct) { @@ -2476,9 +2473,8 @@ namespace ReportSizingManager { } else if (SizingType == MinSATempCoolingSizing) { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).DesCoolCoilInTemp - - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat, - FinalZoneSizing(CurZoneEqNum).DesCoolCoilInTemp))); + (DataCapacityUsedForSizing / + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2488,9 +2484,8 @@ namespace ReportSizingManager { } else if (SizingType == MaxSATempHeatingSizing) { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).DesHeatCoilInTemp + - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesHeatCoilInHumRat, - FinalZoneSizing(CurZoneEqNum).DesHeatCoilInTemp))); + (DataCapacityUsedForSizing / + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesHeatCoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2500,9 +2495,8 @@ namespace ReportSizingManager { } else if (SizingType == ASHRAEMinSATCoolingSizing) { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).ZoneTempAtCoolPeak - - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtCoolPeak, - FinalZoneSizing(CurZoneEqNum).ZoneTempAtCoolPeak))); + (DataCapacityUsedForSizing / + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtCoolPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2512,9 +2506,8 @@ namespace ReportSizingManager { } else if (SizingType == ASHRAEMaxSATHeatingSizing) { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).ZoneTempAtHeatPeak + - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtHeatPeak, - FinalZoneSizing(CurZoneEqNum).ZoneTempAtHeatPeak))); + (DataCapacityUsedForSizing / + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtHeatPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2900,7 +2893,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat, AutosizeDes); + CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2938,7 +2931,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat, AutosizeDes); + CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2961,7 +2954,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat, AutosizeDes); + CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -3282,7 +3275,7 @@ namespace ReportSizingManager { PrimaryAirSystem(CurSysNum).FanDesCoolLoad = FanCoolLoad; PeakCoilLoad = max(0.0, (rhoair * DesVolFlow * (CoilInEnth - CoilOutEnth))); - CpAir = PsyCpAirFnWTdb(CoilInHumRat, CoilInTemp); + CpAir = PsyCpAirFnWTdb(CoilInHumRat); // adjust coil inlet/outlet temp with fan temperature rise if (DataDesAccountForFanHeat) { PeakCoilLoad += FanCoolLoad; @@ -3543,7 +3536,7 @@ namespace ReportSizingManager { CoilInTemp = OutAirFrac * FinalSysSizing(CurSysNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).HeatRetTemp; } // coil load - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); if (CurOASysNum > 0) { if (DataDesicRegCoil) { AutosizeDes = CpAirStd * StdRhoAir * DataAirFlowUsedForSizing * (DataDesOutletAirTemp - DataDesInletAirTemp); @@ -3688,8 +3681,7 @@ namespace ReportSizingManager { (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).RetHumRatAtCoolPeak; } } - AutosizeDes = - CoilInTemp - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat, CoilInTemp))); + AutosizeDes = CoilInTemp - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3718,8 +3710,7 @@ namespace ReportSizingManager { (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).HeatRetHumRat; } } - AutosizeDes = - CoilInTemp + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat, CoilInTemp))); + AutosizeDes = CoilInTemp + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3730,8 +3721,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0 && DataZoneUsedForSizing > 0) { AutosizeDes = FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtCoolPeak - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtCoolPeak, - FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtCoolPeak))); + PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtCoolPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3744,8 +3734,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0 && DataZoneUsedForSizing > 0) { AutosizeDes = FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtHeatPeak + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtHeatPeak, - FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtHeatPeak))); + PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtHeatPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index 9866791288d..a4e889ce5f3 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -612,7 +612,7 @@ namespace RoomAirModelAirflowNetwork { LinkInTemp = ThisRAFNNode.Link(linkNum).TempIn; LinkInHumRat = ThisRAFNNode.Link(linkNum).HumRatIn; LinkInMdot = ThisRAFNNode.Link(linkNum).MdotIn; - CpAir = PsyCpAirFnWTdb(LinkInHumRat, LinkInTemp); + CpAir = PsyCpAirFnWTdb(LinkInHumRat); SumLinkMCp = SumLinkMCp + CpAir * LinkInMdot; SumLinkMCpT = SumLinkMCpT + CpAir * LinkInMdot * LinkInTemp; SumLinkM = SumLinkM + LinkInMdot; @@ -628,7 +628,7 @@ namespace RoomAirModelAirflowNetwork { ThisRAFNNode.RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, ThisRAFNNode.AirTemp, ThisRAFNNode.HumRat, "InitRoomAirModelAirflowNetwork"); - ThisRAFNNode.CpAir = PsyCpAirFnWTdb(ThisRAFNNode.HumRat, ThisRAFNNode.AirTemp); + ThisRAFNNode.CpAir = PsyCpAirFnWTdb(ThisRAFNNode.HumRat); } // InitRoomAirModelAirflowNetwork @@ -990,7 +990,7 @@ namespace RoomAirModelAirflowNetwork { NodeW = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).HumRat; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate * RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).HVAC(EquipLoop).SupplyFraction; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; SumSysM += MassFlowRate; @@ -1003,7 +1003,7 @@ namespace RoomAirModelAirflowNetwork { // Get node conditions NodeTemp = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } // NodeNum @@ -1014,7 +1014,7 @@ namespace RoomAirModelAirflowNetwork { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -1022,7 +1022,7 @@ namespace RoomAirModelAirflowNetwork { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -1031,7 +1031,7 @@ namespace RoomAirModelAirflowNetwork { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 0151e425b77..8ba686e2764 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -1047,7 +1047,7 @@ namespace RoomAirModelUserTempPattern { // Add sensible heat gain from refrigerated cases with under case returns SumAllReturnAirConvectionGains(ZoneNum, QRetAir, ReturnNode); - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); // Need to add the energy to the return air from lights and from airflow windows. Where the heat // is added depends on if there is system flow or not. If there is system flow the heat is added diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index e1e45d3da3c..251bb8dc9b5 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -1097,8 +1097,8 @@ namespace RuntimeLanguageProcessor { TimeString = DuringWarmup + EnvironmentName + ", " + CurMnDy + ' ' + CreateSysTimeIntervalString(); if (OutputFullEMSTrace || (OutputEMSErrors && (ReturnValue.Type == ValueError))) { - ObjexxFCL::gio::write(OutputEMSFileUnitNum, fmtA) << NameString + ",Line " + LineNumString + ',' + LineString + ',' + cValueString + ',' + - TimeString; + ObjexxFCL::gio::write(OutputEMSFileUnitNum, fmtA) + << NameString + ",Line " + LineNumString + ',' + LineString + ',' + cValueString + ',' + TimeString; } if (seriousErrorFound) { // throw EnergyPlus severe then fatal @@ -2346,9 +2346,9 @@ namespace RuntimeLanguageProcessor { // (Pa) | drybulb (C) | Humidity ratio (kg water // vapor/kg dry air) | called from } else if (SELECT_CASE_var == FuncCpAirFnWTdb) { - ReturnValue = SetErlValueNumber(PsyCpAirFnWTdb(Operand(1).Number, Operand(2).Number)); // result => heat capacity of air - // {J/kg-C} | Humidity ratio (kg water - // vapor/kg dry air) | drybulb (C) + ReturnValue = SetErlValueNumber(PsyCpAirFnWTdb(Operand(1).Number)); // result => heat capacity of air + // {J/kg-C} | Humidity ratio (kg water + // vapor/kg dry air) | drybulb (C) } else if (SELECT_CASE_var == FuncHfgAirFnWTdb) { // BG comment these two psych funct seems confusing (?) is this the enthalpy of water in the air? ReturnValue = SetErlValueNumber(PsyHfgAirFnWTdb(Operand(1).Number, Operand(2).Number)); // result => heat of vaporization diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index f05d992460e..d05f9431642 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -3859,7 +3859,8 @@ namespace SetPointManager { } } if (!found) { - ShowSevereError(cSetPointManagerType + "=\"" + SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + NodeID(SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowSevereError(cSetPointManagerType + "=\"" + SingZoneHtSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(SingZoneHtSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); ShowContinueError("is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } @@ -3890,7 +3891,8 @@ namespace SetPointManager { } } if (!found) { - ShowSevereError(cSetPointManagerType + "=\"" + SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + NodeID(SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowSevereError(cSetPointManagerType + "=\"" + SingZoneClSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(SingZoneClSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); ShowContinueError("is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } @@ -4001,12 +4003,14 @@ namespace SetPointManager { } } if (!found) { - ShowSevereError(cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of "+NodeID(SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); - ShowContinueError("is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName +". Please check inputs."); + ShowSevereError(cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node of " + + NodeID(SingZoneRhSetPtMgr(SetPtMgrNum).ZoneInletNodeNum)); + ShowContinueError("is not found in Zone = " + ZoneEquipConfig(ConZoneNum).ZoneName + ". Please check inputs."); ErrorsFound = true; } if (AirLoopNum == 0) { - ShowSevereError(cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + "\", The zone inlet node is not connected to an air loop."); + ShowSevereError(cSetPointManagerType + "=\"" + SingZoneRhSetPtMgr(SetPtMgrNum).Name + + "\", The zone inlet node is not connected to an air loop."); ErrorsFound = true; continue; } @@ -5505,7 +5509,7 @@ namespace SetPointManager { FanDeltaT = 0.0; } TSupNoHC = TMixAtMinOA + FanDeltaT; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); ExtrRateNoHC = CpAir * ZoneMassFlow * (TSupNoHC - ZoneTemp); if (ZoneMassFlow <= SmallMassFlow) { TSetPt = TSupNoHC; @@ -5598,7 +5602,7 @@ namespace SetPointManager { if (ZoneMassFlow <= SmallMassFlow) { this->SetPt = this->MinSetTemp; } else { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); this->SetPt = ZoneTemp + ZoneLoadtoHeatSP / (CpAir * ZoneMassFlow); this->SetPt = max(this->SetPt, this->MinSetTemp); this->SetPt = min(this->SetPt, this->MaxSetTemp); @@ -5640,7 +5644,7 @@ namespace SetPointManager { if (ZoneMassFlow <= SmallMassFlow) { this->SetPt = this->MaxSetTemp; } else { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); this->SetPt = ZoneTemp + ZoneLoadtoCoolSP / (CpAir * ZoneMassFlow); this->SetPt = max(this->SetPt, this->MinSetTemp); this->SetPt = min(this->SetPt, this->MaxSetTemp); @@ -6161,7 +6165,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MaxSetTemp; if (ZoneLoad < 0.0) { TotCoolLoad += std::abs(ZoneLoad); - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6244,7 +6248,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MinSetTemp; if (ZoneLoad > 0.0) { TotHeatLoad += ZoneLoad; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6264,7 +6268,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MinSetTemp; if (ZoneLoad > 0.0) { TotHeatLoad += ZoneLoad; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6365,7 +6369,7 @@ namespace SetPointManager { ZoneFracFlow = MinFracFlow; if (ZoneLoad < 0.0) { TotCoolLoad += std::abs(ZoneLoad); - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { if (ControlStrategy == TempFirst) { // First find supply air temperature required to meet the load at minimum flow. If this is @@ -6565,11 +6569,11 @@ namespace SetPointManager { ZoneMassFlowRate = Node(ZoneInletNode).MassFlowRate; ZoneLoad = ZoneSysEnergyDemand(CtrlZoneNum).TotalOutputRequired; ZoneTemp = Node(ZoneNode).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, ZoneTemp); + CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); SumProductMdotCpTot += ZoneMassFlowRate * CpAir; SumProductMdotCpTZoneTot += ZoneMassFlowRate * CpAir * ZoneTemp; if (ZoneLoad > 0.0) { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); SumHeatLoad += ZoneLoad; SumProductMdotCp += ZoneMassFlowRate * CpAir; } @@ -6655,11 +6659,11 @@ namespace SetPointManager { ZoneMassFlowRate = Node(ZoneInletNode).MassFlowRate; ZoneLoad = ZoneSysEnergyDemand(CtrlZoneNum).TotalOutputRequired; ZoneTemp = Node(ZoneNode).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, ZoneTemp); + CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); SumProductMdotCpTot += ZoneMassFlowRate * CpAir; SumProductMdotCpTZoneTot += ZoneMassFlowRate * CpAir * ZoneTemp; if (ZoneLoad < 0.0) { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat, Node(ZoneInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); SumCoolLoad += ZoneLoad; SumProductMdotCp += ZoneMassFlowRate * CpAir; } @@ -7788,14 +7792,14 @@ namespace SetPointManager { std::string TypeOfComp; std::string NameOfComp; - Array1D_int VarIndexes; // Variable Numbers - Array1D_int VarTypes; // Variable Types (1=integer, 2=real, 3=meter) - Array1D IndexTypes; // Variable Index Types (1=Zone,2=HVAC) - Array1D unitsForVar; // units from enum for each variable - Array1D_int ResourceTypes; // ResourceTypes for each variable - Array1D_string EndUses; // EndUses for each variable - Array1D_string Groups; // Groups for each variable - Array1D_string Names; // Variable Names for each variable + Array1D_int VarIndexes; // Variable Numbers + Array1D_int VarTypes; // Variable Types (1=integer, 2=real, 3=meter) + Array1D IndexTypes; // Variable Index Types (1=Zone,2=HVAC) + Array1D unitsForVar; // units from enum for each variable + Array1D_int ResourceTypes; // ResourceTypes for each variable + Array1D_string EndUses; // EndUses for each variable + Array1D_string Groups; // Groups for each variable + Array1D_string Names; // Variable Names for each variable int NumVariables; int NumFound; @@ -8459,7 +8463,8 @@ namespace SetPointManager { } } - int getSPMBasedOnNode(int const NodeNum, int const SetPtType, int const SPMType, CtrlNodeType ctrlOrRefNode) { + int getSPMBasedOnNode(int const NodeNum, int const SetPtType, int const SPMType, CtrlNodeType ctrlOrRefNode) + { if (GetInputFlag) { GetSetPointManagerInputs(); @@ -8472,21 +8477,21 @@ namespace SetPointManager { if (SetPtType == AllSetPtMgr(SetPtMgrNum).CtrlTypeMode) { // SetPtType is e.g., iCtrlVarType_Temp, iCtrlVarType_HumRat, etc. switch (ctrlOrRefNode) { // ctrlOrRefNode is enum type of node to look for, either control node or reference node case CtrlNodeType::control: { - for (int NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { - // SPMType is type of set point manager, e.g., iSPMType_Scheduled, iSPMType_MixedAir, etc. - if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode) && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { - getSPMBasedOnNode = AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM - break; - } - } - break; - } - case CtrlNodeType::reference: { + for (int NumNode = 1; NumNode <= AllSetPtMgr(SetPtMgrNum).NumCtrlNodes; ++NumNode) { // SPMType is type of set point manager, e.g., iSPMType_Scheduled, iSPMType_MixedAir, etc. - if (NodeNum == AllSetPtMgr(SetPtMgrNum).RefNode && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { + if (NodeNum == AllSetPtMgr(SetPtMgrNum).CtrlNodes(NumNode) && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { getSPMBasedOnNode = AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM + break; } - break; + } + break; + } + case CtrlNodeType::reference: { + // SPMType is type of set point manager, e.g., iSPMType_Scheduled, iSPMType_MixedAir, etc. + if (NodeNum == AllSetPtMgr(SetPtMgrNum).RefNode && SPMType == AllSetPtMgr(SetPtMgrNum).SPMType) { + getSPMBasedOnNode = AllSetPtMgr(SetPtMgrNum).SPMIndex; // SPMIndex is index to specific type of SPM + } + break; } } } diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index f0f1bd1249c..1877ba7bbd6 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -59,8 +59,8 @@ #include // EnergyPlus Headers -#include #include +#include #include #include #include @@ -80,7 +80,6 @@ #include #include #include -#include #include #include #include @@ -112,6 +111,7 @@ #include #include #include +#include #include #include #include @@ -5568,8 +5568,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysCoolOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, system design supply air temp, and the mass flow rate // calculate the system sensible cooling capacity - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * - SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * + SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * (SysCoolMixTemp - SysSizing(CurOverallSimDay, AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); // calculate the system total cooling capacity @@ -5691,8 +5690,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * - SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -5782,8 +5780,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * - SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -6599,7 +6596,7 @@ namespace SimAirServingZones { } SysCoolMixTemp = OutAirTemp * OutAirFrac + SysCoolRetTemp * (1.0 - OutAirFrac); SysCoolMixHumRat = OutAirHumRat * OutAirFrac + SysCoolRetHumRat * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * + SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * (SysCoolMixTemp - CalcSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * @@ -6660,7 +6657,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6704,7 +6701,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6879,8 +6876,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysCoolRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysCoolMixHumRat = FinalSysSizing(AirLoopNum).SysCoolOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysCoolRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * - FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * + SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * (SysCoolMixTemp - FinalSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * @@ -6903,7 +6899,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).MixHumRatAtCoolPeak = FinalSysSizing(AirLoopNum).OutHumRatAtCoolPeak * OutAirFrac + FinalSysSizing(AirLoopNum).RetHumRatAtCoolPeak * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).SensCoolCap = - PsyCpAirFnWTdb(constant_zero, constant_twenty) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * + PsyCpAirFnWTdb(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * (FinalSysSizing(AirLoopNum).MixTempAtCoolPeak - FinalSysSizing(AirLoopNum).CoolSupTemp); FinalSysSizing(AirLoopNum).SensCoolCap = max(0.0, FinalSysSizing(AirLoopNum).SensCoolCap); FinalSysSizing(AirLoopNum).TotCoolCap = @@ -6961,8 +6957,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysHeatRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysHeatMixHumRat = FinalSysSizing(AirLoopNum).SysHeatOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysHeatRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * - FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * + SysHeatCap = PsyCpAirFnWTdb(constant_zero) * FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * (FinalSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); FinalSysSizing(AirLoopNum).HeatCapSeq(TimeStepIndex) = SysHeatCap; @@ -6979,8 +6974,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).HeatOutTemp * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetTemp * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).HeatMixHumRat = FinalSysSizing(AirLoopNum).HeatOutHumRat * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetHumRat * (1.0 - OutAirFrac); - FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnWTdb(constant_zero, constant_twenty) * RhoAir * - FinalSysSizing(AirLoopNum).DesHeatVolFlow * + FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnWTdb(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * (FinalSysSizing(AirLoopNum).HeatSupTemp - FinalSysSizing(AirLoopNum).HeatMixTemp); FinalSysSizing(AirLoopNum).HeatCap = max(0.0, FinalSysSizing(AirLoopNum).HeatCap); } @@ -7348,7 +7342,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnWTdb(constant_zero, constant_twenty); + CpAirStd = PsyCpAirFnWTdb(constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else if (FinalSysSizing(AirLoopNum).HeatingCapMethod == HeatingDesignCapacity) { @@ -7371,7 +7365,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnWTdb(constant_zero, constant_twenty); + CpAirStd = PsyCpAirFnWTdb(constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else { diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 90b3d08f4c2..a1218edf1c5 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -2930,8 +2930,7 @@ namespace SingleDuct { ZoneDesTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; ZoneDesHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + - PsyCpAirFnWTdb(ZoneDesHumRat, 0.5 * (CoilInTemp + ZoneDesTemp)) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(PlantLoop(Sys(SysNum).HWLoopNum).FluidName, @@ -3032,8 +3031,7 @@ namespace SingleDuct { ZoneDesTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; ZoneDesHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + - PsyCpAirFnWTdb(ZoneDesHumRat, 0.5 * (CoilInTemp + ZoneDesTemp)) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { TempSteamIn = 100.00; EnthSteamInDry = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 1.0, Sys(SysNum).FluidIndex, RoutineNameFull); @@ -3223,8 +3221,7 @@ namespace SingleDuct { QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP * LeakLoadMult; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirAvg = - PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat), 0.5 * (Node(ZoneNodeNum).Temp + SysInlet(SysNum).AirTemp)); + CpAirAvg = PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat)); MinFlowFrac = Sys(SysNum).ZoneMinAirFrac; MassFlowBasedOnOA = 0.0; ZoneTemp = Node(ZoneNodeNum).Temp; @@ -3783,7 +3780,7 @@ namespace SingleDuct { QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP * LeakLoadMult; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); MinFlowFrac = Sys(SysNum).ZoneMinAirFrac; MinMassAirFlow = MinFlowFrac * StdRhoAir * Sys(SysNum).MaxAirVolFlowRate; ZoneTemp = Node(ZoneNodeNum).Temp; @@ -3794,7 +3791,7 @@ namespace SingleDuct { // or the Max as specified for the VAV model. if (SysInlet(SysNum).AirMassFlowRateMaxAvail > 0.0) { // Calculate the flow required for cooling - CpAirSysIn = PsyCpAirFnWTdb(SysInlet(SysNum).AirHumRat, SysInlet(SysNum).AirTemp); + CpAirSysIn = PsyCpAirFnWTdb(SysInlet(SysNum).AirHumRat); DeltaTemp = CpAirSysIn * SysInlet(SysNum).AirTemp - CpAirZn * ZoneTemp; // Need to check DeltaTemp and ensure that it is not zero @@ -4157,7 +4154,7 @@ namespace SingleDuct { QTotLoad = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, Node(ZoneNodeNum).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); HCType = Sys(SysNum).ReheatComp_Num; FanType = Sys(SysNum).Fan_Num; MaxCoolMassFlow = SysInlet(SysNum).AirMassFlowRateMaxAvail; @@ -4551,7 +4548,7 @@ namespace SingleDuct { MassFlow = SysInlet(SysNum).AirMassFlowRateMaxAvail; // System massflow is set to the Available QMax2 = QToHeatSetPt; ZoneTemp = Node(ZoneNodeNum).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat, ZoneTemp); // zone air specific heat + CpAir = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); // zone air specific heat if (Sys(SysNum).MaxReheatTempSetByUser) { TAirMax = Sys(SysNum).MaxReheatTemp; QMax = CpAir * MassFlow * (TAirMax - ZoneTemp); @@ -4740,8 +4737,7 @@ namespace SingleDuct { MassFlow = SysInlet(SysNum).AirMassFlowRate; // system air mass flow rate if (GetCurrentScheduleValue(this->SchedPtr) > 0.0 && MassFlow > SmallMassFlow) { - Real64 CpAir = PsyCpAirFnWTdb(0.5 * (Node(this->OutletNodeNum).HumRat + Node(ZoneNodeNum).HumRat), - 0.5 * (Node(this->OutletNodeNum).Temp + Node(ZoneNodeNum).Temp)); + Real64 CpAir = PsyCpAirFnWTdb(0.5 * (Node(this->OutletNodeNum).HumRat + Node(ZoneNodeNum).HumRat)); SensOutputProvided = MassFlow * CpAir * (Node(this->OutletNodeNum).Temp - Node(ZoneNodeNum).Temp); } else { SensOutputProvided = 0.0; @@ -4830,7 +4826,7 @@ namespace SingleDuct { HotControlNode = Sys(SysNum).ReheatControlNode; AirMassFlow = AirFlow; Node(FanInNode).MassFlowRate = AirMassFlow; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); if (FanType == DataHVACGlobals::FanType_SimpleVAV && FanOn == 1) { Fans::SimulateFanComponents(Sys(SysNum).FanName, FirstHVACIteration, Sys(SysNum).Fan_Index); } else if (FanType == DataHVACGlobals::FanType_SystemModelObject && FanOn == 1) { diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 70557baeb12..89fc69c044a 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -749,7 +749,7 @@ namespace SteamCoils { DesVolFlow = 0.0; CpWater = 0.0; RhoAirStd = PsyRhoAirFnPbTdbW(StdBaroPress, 20.0, 0.0); - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); bool coilWasAutosized(false); // coil report // If this is a steam coil @@ -917,7 +917,7 @@ namespace SteamCoils { CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; DesMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow; DesVolFlow = DesMassFlow / RhoAirStd; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat, 0.5 * (CoilInTemp + CoilOutTemp)) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { TempSteamIn = 100.0; // RefrigIndex is set during GetInput for this module @@ -1129,7 +1129,7 @@ namespace SteamCoils { } if (AirMassFlow > 0.0) { // If the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win, TempAirIn) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; } else { CapacitanceAir = 0.0; } @@ -1197,7 +1197,7 @@ namespace SteamCoils { HeatingCoilLoad = QCoilCap; // Temperature of air at outlet - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win, TempAirIn)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); SteamCoil(CoilNum).OutletSteamMassFlowRate = SteamMassFlowRate; SteamCoil(CoilNum).InletSteamMassFlowRate = SteamMassFlowRate; @@ -1307,7 +1307,7 @@ namespace SteamCoils { QCoilCap = QSteamCoilMaxHT; // Temperature of air at outlet - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win, TempAirIn)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); // In practice Sensible & Superheated heat transfer is negligible compared to latent part. // This is required for outlet water temperature, otherwise it will be saturation temperature. @@ -1329,7 +1329,7 @@ namespace SteamCoils { // recalculate in case previous call changed mass flow rate QCoilCap = SteamMassFlowRate * (LatentHeatSteam + SubcoolDeltaTemp * CpWater); - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win, TempAirIn)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); // Total Heat Transfer to air HeatingCoilLoad = QCoilCap; @@ -1363,7 +1363,7 @@ namespace SteamCoils { // recalculate in case previous call changed mass flow rate QCoilCap = SteamMassFlowRate * (LatentHeatSteam + SubcoolDeltaTemp * CpWater); - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win, TempAirIn)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); // Total Heat Transfer to air HeatingCoilLoad = QCoilCap; diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index 560ea697cd4..68685e27141 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -642,7 +642,7 @@ namespace ThermalChimney { } AirDensityThermalChim = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); - AirSpecHeatThermalChim = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)); + AirSpecHeatThermalChim = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); AirOutletCrossAreaTC = ThermalChimneySys(Loop).AirOutletCrossArea; DischargeCoeffTC = ThermalChimneySys(Loop).DischargeCoeff; @@ -761,7 +761,7 @@ namespace ThermalChimney { for (TCZoneNum = 1; TCZoneNum <= ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { TCZoneNumCounter = ThermalChimneySys(Loop).ZonePtr(TCZoneNum); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(TCZoneNumCounter), ZoneAirHumRat(TCZoneNumCounter)); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(TCZoneNumCounter), MAT(TCZoneNumCounter)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(TCZoneNumCounter)); MCPThermChim(TCZoneNumCounter) = TCVolumeAirFlowRate * AirDensity * CpAir * ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum); if (MCPThermChim(TCZoneNumCounter) <= 0.0) { MCPThermChim(TCZoneNumCounter) = 0.0; @@ -850,7 +850,7 @@ namespace ThermalChimney { // Break the infiltration load into heat gain and loss components. AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneLoop), ZoneAirHumRat(ZoneLoop)); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneLoop), MAT(ZoneLoop)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneLoop)); ZnRptThermChim(ZoneLoop).ThermalChimneyVolume = (MCPThermChim(ZoneLoop) / CpAir / AirDensity) * TSMult; ZnRptThermChim(ZoneLoop).ThermalChimneyMass = (MCPThermChim(ZoneLoop) / CpAir) * TSMult; diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index 4849c9c3372..ac276be55e2 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -1004,7 +1004,7 @@ namespace TranspiredCollector { RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, Tamb, OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat, Tamb); + CpAir = PsyCpAirFnWTdb(OutHumRat); holeArea = UTSC(UTSCNum).ActualArea * UTSC(UTSCNum).Porosity; @@ -1557,9 +1557,7 @@ namespace TranspiredCollector { TsColl = UTSC(UTSCNum).Tcoll; } - int GetAirInletNodeNum(std::string const &UTSCName, - bool &ErrorsFound - ) + int GetAirInletNodeNum(std::string const &UTSCName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu @@ -1594,9 +1592,7 @@ namespace TranspiredCollector { return NodeNum; } - int GetAirOutletNodeNum(std::string const &UTSCName, - bool &ErrorsFound - ) + int GetAirOutletNodeNum(std::string const &UTSCName, bool &ErrorsFound) { // FUNCTION INFORMATION: // AUTHOR Lixing Gu @@ -1611,7 +1607,7 @@ namespace TranspiredCollector { // Return value int NodeNum; // node number returned - // FUNCTION LOCAL VARIABLE DECLARATIONS: + // FUNCTION LOCAL VARIABLE DECLARATIONS: int WhichUTSC; if (GetInputFlag) { @@ -1622,8 +1618,7 @@ namespace TranspiredCollector { WhichUTSC = UtilityRoutines::FindItemInList(UTSCName, UTSC); if (WhichUTSC != 0) { NodeNum = UTSC(WhichUTSC).OutletNode(1); - } - else { + } else { ShowSevereError("GetAirOutletNodeNum: Could not find TranspiredCollector = \"" + UTSCName + "\""); ErrorsFound = true; NodeNum = 0; diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 89b4b0469cf..5db2d72196f 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -1157,7 +1157,7 @@ namespace UFADManager { for (InNodeIndex = 1; InNodeIndex <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(OutBaroPress, NodeTemp, ZoneAirHumRat(ZoneNum)); @@ -1231,10 +1231,10 @@ namespace UFADManager { GainsFrac = max(0.6, min(GainsFrac, 1.0)); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATOC(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATMX(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); @@ -1634,7 +1634,7 @@ namespace UFADManager { for (InNodeIndex = 1; InNodeIndex <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(OutBaroPress, NodeTemp, ZoneAirHumRat(ZoneNum)); @@ -1743,10 +1743,10 @@ namespace UFADManager { } AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATOC(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MATMX(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index b6e2221e371..49f2c5bb537 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -1762,7 +1762,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat, Node(UnitHeat(UnitHeatNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } @@ -1775,7 +1775,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat, Node(UnitHeat(UnitHeatNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } @@ -1812,7 +1812,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat, Node(UnitHeat(UnitHeatNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); mdot = UnitHeat(UnitHeatNum).MaxHotWaterFlow * PartLoadFrac; @@ -1833,7 +1833,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat, Node(UnitHeat(UnitHeatNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); mdot = UnitHeat(UnitHeatNum).MaxHotSteamFlow * PartLoadFrac; @@ -1854,7 +1854,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat, Node(UnitHeat(UnitHeatNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index ad629fba185..5a118e959d7 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -3048,11 +3048,14 @@ namespace UnitVentilator { OAMassFlowRate = MinOAFrac * Node(OutsideAirNode).MassFlowRate; } else if (SELECT_CASE_var == VariablePercent) { - - OAMassFlowRate = SetOAMassFlowRateForCoolingVariablePercent(UnitVentNum,MinOAFrac,Node(OutsideAirNode).MassFlowRate, + + OAMassFlowRate = SetOAMassFlowRateForCoolingVariablePercent(UnitVentNum, + MinOAFrac, + Node(OutsideAirNode).MassFlowRate, GetCurrentScheduleValue(UnitVent(UnitVentNum).MaxOASchedPtr), - Tinlet,Toutdoor); - + Tinlet, + Toutdoor); + } else if (SELECT_CASE_var == FixedTemperature) { // This is basically the same algorithm as for the heating case... Tdesired = GetCurrentScheduleValue(UnitVent(UnitVentNum).TempSchedPtr); @@ -3118,9 +3121,12 @@ namespace UnitVentilator { } else if (SELECT_CASE_var == VariablePercent) { - OAMassFlowRate = SetOAMassFlowRateForCoolingVariablePercent(UnitVentNum,MinOAFrac,Node(OutsideAirNode).MassFlowRate, + OAMassFlowRate = SetOAMassFlowRateForCoolingVariablePercent(UnitVentNum, + MinOAFrac, + Node(OutsideAirNode).MassFlowRate, GetCurrentScheduleValue(UnitVent(UnitVentNum).MaxOASchedPtr), - Tinlet,Toutdoor); + Tinlet, + Toutdoor); } else if (SELECT_CASE_var == FixedTemperature) { // This is basically the same algorithm as for the heating case... @@ -3375,7 +3381,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat, Node(UnitVent(UnitVentNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -3390,7 +3396,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat, Node(UnitVent(UnitVentNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -3433,7 +3439,7 @@ namespace UnitVentilator { if (UnitVent(UnitVentNum).CCoilPresent) { - CalcMdotCCoilCycFan(mdot,QCoilReq,QZnReq,UnitVentNum,PartLoadRatio); + CalcMdotCCoilCycFan(mdot, QCoilReq, QZnReq, UnitVentNum, PartLoadRatio); SetComponentFlowRate(mdot, UnitVent(UnitVentNum).ColdControlNode, UnitVent(UnitVentNum).ColdCoilOutNodeNum, @@ -3462,7 +3468,7 @@ namespace UnitVentilator { mdot = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat, Node(UnitVent(UnitVentNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); mdot = UnitVent(UnitVentNum).MaxHotWaterFlow * PartLoadRatio; @@ -3490,7 +3496,7 @@ namespace UnitVentilator { mdot = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat, Node(UnitVent(UnitVentNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); mdot = UnitVent(UnitVentNum).MaxHotSteamFlow * PartLoadFrac; @@ -3518,7 +3524,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat, Node(UnitVent(UnitVentNum).AirInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -3982,22 +3988,22 @@ namespace UnitVentilator { } return Residuum; } - - Real64 SetOAMassFlowRateForCoolingVariablePercent(int const UnitVentNum, // Unit Ventilator index - Real64 const MinOAFrac, // Minimum Outside Air Fraction - Real64 const MassFlowRate, // Design Outside Air Mass Flow Rate - Real64 const MaxOAFrac, // Maximum Outside Air Fraction - Real64 const Tinlet, // Inlet Temperature to Unit or Zone Temperature - Real64 const Toutdoor // Outdoor Air Temperature + + Real64 SetOAMassFlowRateForCoolingVariablePercent(int const UnitVentNum, // Unit Ventilator index + Real64 const MinOAFrac, // Minimum Outside Air Fraction + Real64 const MassFlowRate, // Design Outside Air Mass Flow Rate + Real64 const MaxOAFrac, // Maximum Outside Air Fraction + Real64 const Tinlet, // Inlet Temperature to Unit or Zone Temperature + Real64 const Toutdoor // Outdoor Air Temperature ) { - Real64 ActualOAMassFlowRate(0.0); // Result or return value - + Real64 ActualOAMassFlowRate(0.0); // Result or return value + if (Tinlet <= Toutdoor) { - + ActualOAMassFlowRate = MinOAFrac * MassFlowRate; - + } else { // Tinlet > Toutdoor // Use cooler outside air to provide "free" cooling without over-cooling. // First, use a simple load equals mass flow times Cp time Delta T equation to find OA Mass Flow Rate. @@ -4005,7 +4011,7 @@ namespace UnitVentilator { // small load on the cooling coil (if it exists) or will leave a small load that is not met when it could be. // Then, limit the OA Mass Flow Rate between the MinOA flow and the MaxOA flow. - Real64 EnthDiffAcrossFan(0.0); // Temperature difference across the fan + Real64 EnthDiffAcrossFan(0.0); // Temperature difference across the fan if (!UnitVent(UnitVentNum).ATMixerExists) { EnthDiffAcrossFan = Node(UnitVent(UnitVentNum).FanOutletNode).Enthalpy - Node(UnitVent(UnitVentNum).OAMixerOutNode).Enthalpy; } else { @@ -4017,42 +4023,42 @@ namespace UnitVentilator { } } - ActualOAMassFlowRate = (std::abs(QZnReq)+(MassFlowRate*std::abs(EnthDiffAcrossFan))) / (PsyCpAirFnWTdb(DataEnvironment::OutHumRat,Tinlet) * (Tinlet-Toutdoor)); - - ActualOAMassFlowRate = max(ActualOAMassFlowRate,(MinOAFrac*MassFlowRate)); - ActualOAMassFlowRate = min(ActualOAMassFlowRate,(MaxOAFrac*MassFlowRate)); + ActualOAMassFlowRate = (std::abs(QZnReq) + (MassFlowRate * std::abs(EnthDiffAcrossFan))) / + (PsyCpAirFnWTdb(DataEnvironment::OutHumRat) * (Tinlet - Toutdoor)); + + ActualOAMassFlowRate = max(ActualOAMassFlowRate, (MinOAFrac * MassFlowRate)); + ActualOAMassFlowRate = min(ActualOAMassFlowRate, (MaxOAFrac * MassFlowRate)); } - + return ActualOAMassFlowRate; } - void CalcMdotCCoilCycFan(Real64 &mdot, // mass flow rate - Real64 &QCoilReq, // Remaining load to cooling coil - Real64 const QZnReq, // Zone load to setpoint - int const UnitVentNum, // Unit Ventilator index - Real64 const PartLoadRatio // Part load ratio for unit ventilator + void CalcMdotCCoilCycFan(Real64 &mdot, // mass flow rate + Real64 &QCoilReq, // Remaining load to cooling coil + Real64 const QZnReq, // Zone load to setpoint + int const UnitVentNum, // Unit Ventilator index + Real64 const PartLoadRatio // Part load ratio for unit ventilator ) { - if (QZnReq >= 0.0) { // Heating requested so no cooling coil needed + if (QZnReq >= 0.0) { // Heating requested so no cooling coil needed mdot = 0.0; - } else { // Cooling so set first guess at flow rate + } else { // Cooling so set first guess at flow rate mdot = UnitVent(UnitVentNum).MaxColdWaterFlow * PartLoadRatio; } - - // Check to see what outside air will do, "turn off" cooling coil if OA can handle the load + + // Check to see what outside air will do, "turn off" cooling coil if OA can handle the load int CCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; int AirInNode = UnitVent(UnitVentNum).AirInNode; - Real64 const SmallLoad = -1.0; // Watts - Real64 CpAirZn = PsyCpAirFnWTdb(Node(AirInNode).HumRat, Node(AirInNode).Temp); + Real64 const SmallLoad = -1.0; // Watts + Real64 CpAirZn = PsyCpAirFnWTdb(Node(AirInNode).HumRat); QCoilReq = QZnReq - Node(CCoilInAirNode).MassFlowRate * CpAirZn * (Node(CCoilInAirNode).Temp - Node(AirInNode).Temp); if (QCoilReq > SmallLoad) { QCoilReq = 0.0; mdot = 0.0; } - } - + } // namespace UnitVentilator } // namespace EnergyPlus diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index 3e8a96b6485..f963a765734 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -1369,7 +1369,8 @@ namespace UnitarySystems { if ((this->m_DehumidControlType_Num != DehumCtrlType::None) && (DataLoopNode::Node(ControlNode).HumRatMax == DataLoopNode::SensedNodeFlagValue) && this->m_ControlType == ControlType::Setpoint && CoilType == CoolingCoil) { - if (!DataGlobals::AnyEnergyManagementSystemInModel && DataLoopNode::Node(this->CoolCoilOutletNodeNum).HumRatMax == DataLoopNode::SensedNodeFlagValue) { + if (!DataGlobals::AnyEnergyManagementSystemInModel && + DataLoopNode::Node(this->CoolCoilOutletNodeNum).HumRatMax == DataLoopNode::SensedNodeFlagValue) { ShowSevereError(this->UnitType + ": Missing humidity ratio setpoint (HUMRATMAX) for unitary system = " + this->Name); ShowContinueError(" use a Setpoint Manager to establish a setpoint at the coil control node."); SetPointErrorFlag = true; @@ -2931,12 +2932,11 @@ namespace UnitarySystems { } if (loc_controlZoneName != "") thisSys.ControlZoneNum = UtilityRoutines::FindItemInList(loc_controlZoneName, DataHeatBalance::Zone); // check that control zone name is valid for load based control - if (thisSys.m_ControlType == ControlType::Load || thisSys.m_ControlType == ControlType::CCMASHRAE) { + if (thisSys.m_ControlType == ControlType::Load || thisSys.m_ControlType == ControlType::CCMASHRAE) { if (thisSys.ControlZoneNum == 0) { ShowSevereError("Input errors for " + cCurrentModuleObject + ":" + thisObjectName); ShowContinueError("When Control Type = Load or SingleZoneVAV"); - ShowContinueError(" Controlling Zone or Thermostat Location must be a valid zone name, zone name = " + - loc_controlZoneName); + ShowContinueError(" Controlling Zone or Thermostat Location must be a valid zone name, zone name = " + loc_controlZoneName); errorsFound = true; } } @@ -3336,7 +3336,7 @@ namespace UnitarySystems { if (isNotOK) { ShowContinueError("Occurs in " + cCurrentModuleObject + " = " + thisObjectName); errorsFound = true; - } else { // mine data from fan object + } else { // mine data from fan object if (HVACFan::getFanObjectVectorIndex(loc_m_FanName, false) < 0) { HVACFan::fanObjs.emplace_back(new HVACFan::FanSystem(loc_m_FanName)); // call constructor } @@ -5571,8 +5571,7 @@ namespace UnitarySystems { if (thisSys.m_CoolCoilExists && thisSys.m_MaxCoolAirVolFlow == 0) { ShowSevereError(cCurrentModuleObject + " = " + thisObjectName); if (thisSys.m_HeatCoilExists) { - ShowContinueError( - "Blank field not allowed for this coil type when heating coil air flow rate is not AutoSized."); + ShowContinueError("Blank field not allowed for this coil type when heating coil air flow rate is not AutoSized."); } else { ShowContinueError("Blank field not allowed for this type of cooling coil."); } @@ -5695,8 +5694,7 @@ namespace UnitarySystems { if (thisSys.m_HeatCoilExists && thisSys.m_MaxHeatAirVolFlow == 0) { ShowSevereError(cCurrentModuleObject + " = " + thisObjectName); if (thisSys.m_CoolCoilExists) { - ShowContinueError( - "Blank field not allowed for this coil type when cooling coil air flow rate is not AutoSized."); + ShowContinueError("Blank field not allowed for this coil type when cooling coil air flow rate is not AutoSized."); } else { ShowContinueError("Blank field not allowed for this type of heating coil."); } @@ -6443,7 +6441,7 @@ namespace UnitarySystems { "In order to perform Single Mode Operation, the valid cooling coil type is Coil:Cooling:DX:MultiSpeed and " "the valid heating is Coil:Heating:DX:MultiSpeed or Coil:Heating:Fuel."); ShowContinueError("The input cooling coil type = " + loc_coolingCoilType + - " and the input heating coil type = " + loc_heatingCoilType); + " and the input heating coil type = " + loc_heatingCoilType); } } } @@ -8518,8 +8516,7 @@ namespace UnitarySystems { FullSensibleOutput = TempSensOutput; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->CoolCoilInletNodeNum).HumRat, - DataLoopNode::Node(this->CoolCoilInletNodeNum).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->CoolCoilInletNodeNum).HumRat); CoolingOnlySensibleOutput = DataLoopNode::Node(this->CoolCoilInletNodeNum).MassFlowRate * CpAir * ((DataLoopNode::Node(this->NodeNumOfControlledZone).Temp - DataLoopNode::Node(this->CoolCoilOutletNodeNum).Temp) - (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp)); @@ -9608,10 +9605,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9635,10 +9630,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9653,10 +9646,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9678,10 +9669,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat, - DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9708,10 +9697,8 @@ namespace UnitarySystems { this->calcUnitarySuppHeatingSystem(FirstHVACIteration, SuppPLR, SuppCoilLoad); if ((DataLoopNode::Node(this->m_SuppCoilAirOutletNode).Temp > this->DesignMaxOutletTemp) && SuppPLR > 0.0 && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->m_SuppCoilAirInletNode).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirInletNode).HumRat, - DataLoopNode::Node(this->m_SuppCoilAirInletNode).Temp); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirOutletNode).HumRat, - DataLoopNode::Node(this->m_SuppCoilAirOutletNode).Temp); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirInletNode).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirOutletNode).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = max(0.0, this->DesignMaxOutletTemp - DataLoopNode::Node(this->m_SuppCoilAirInletNode).Temp); Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 1e66b6e0855..5cf1ad9add5 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -2210,8 +2210,7 @@ namespace UserDefinedComponents { if (UserPlantComp(CompNum).Air.InletNodeNum > 0) { UserPlantComp(CompNum).Air.InletRho = PsyRhoAirFnPbTdbW( OutBaroPress, Node(UserPlantComp(CompNum).Air.InletNodeNum).Temp, Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat, RoutineName); - UserPlantComp(CompNum).Air.InletCp = - PsyCpAirFnWTdb(Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat, Node(UserPlantComp(CompNum).Air.InletNodeNum).Temp); + UserPlantComp(CompNum).Air.InletCp = PsyCpAirFnWTdb(Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat); UserPlantComp(CompNum).Air.InletTemp = Node(UserPlantComp(CompNum).Air.InletNodeNum).Temp; UserPlantComp(CompNum).Air.InletMassFlowRate = Node(UserPlantComp(CompNum).Air.InletNodeNum).MassFlowRate; UserPlantComp(CompNum).Air.InletHumRat = Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat; @@ -2303,8 +2302,7 @@ namespace UserDefinedComponents { Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat, RoutineName); - UserCoil(CompNum).Air(Loop).InletCp = - PsyCpAirFnWTdb(Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat, Node(UserCoil(CompNum).Air(Loop).InletNodeNum).Temp); + UserCoil(CompNum).Air(Loop).InletCp = PsyCpAirFnWTdb(Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat); UserCoil(CompNum).Air(Loop).InletTemp = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).Temp; UserCoil(CompNum).Air(Loop).InletMassFlowRate = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).MassFlowRate; UserCoil(CompNum).Air(Loop).InletHumRat = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat; @@ -2418,8 +2416,7 @@ namespace UserDefinedComponents { Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).Temp, Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat, RoutineName); - UserZoneAirHVAC(CompNum).ZoneAir.InletCp = - PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat, Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).Temp); + UserZoneAirHVAC(CompNum).ZoneAir.InletCp = PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat); UserZoneAirHVAC(CompNum).ZoneAir.InletTemp = Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).Temp; UserZoneAirHVAC(CompNum).ZoneAir.InletHumRat = Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat; @@ -2428,8 +2425,7 @@ namespace UserDefinedComponents { Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).Temp, Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat, RoutineName); - UserZoneAirHVAC(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat, - Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).Temp); + UserZoneAirHVAC(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat); UserZoneAirHVAC(CompNum).SourceAir.InletTemp = Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).Temp; UserZoneAirHVAC(CompNum).SourceAir.InletHumRat = Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat; } @@ -2544,8 +2540,7 @@ namespace UserDefinedComponents { Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).Temp, Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat, RoutineName); - UserAirTerminal(CompNum).AirLoop.InletCp = - PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat, Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).Temp); + UserAirTerminal(CompNum).AirLoop.InletCp = PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat); UserAirTerminal(CompNum).AirLoop.InletTemp = Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).Temp; UserAirTerminal(CompNum).AirLoop.InletHumRat = Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat; @@ -2554,8 +2549,7 @@ namespace UserDefinedComponents { Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).Temp, Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat, RoutineName); - UserAirTerminal(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat, - Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).Temp); + UserAirTerminal(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat); UserAirTerminal(CompNum).SourceAir.InletTemp = Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).Temp; UserAirTerminal(CompNum).SourceAir.InletHumRat = Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat; } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index caf763703d8..ec4ac99af50 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -4072,7 +4072,7 @@ namespace VariableSpeedCoils { // design fan heat will be added to coil load Real64 FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, VolFlowRate); // inlet/outlet temp is adjusted after enthalpy is calculcated so fan heat is not double counted - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -4142,7 +4142,7 @@ namespace VariableSpeedCoils { // design fan heat will be added to coil load Real64 FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, VolFlowRate); // inlet/outlet temp is adjusted after enthalpy is calculcated so fan heat is not double counted - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); @@ -5135,7 +5135,7 @@ namespace VariableSpeedCoils { LoadSideInletDBTemp_Init = 26.7; LoadSideInletHumRat_Init = 0.0111; LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init); - CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init, LoadSideInletDBTemp_Init); + CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init); firstTime = false; } LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, OutBaroPress, RoutineName); @@ -5203,7 +5203,7 @@ namespace VariableSpeedCoils { SourceSideMassFlowRate = CondAirMassFlow; SourceSideInletTemp = CondInletTemp; SourceSideInletEnth = PsyHFnTdbW(CondInletTemp, CondInletHumRat); - CpSource = PsyCpAirFnWTdb(CondInletHumRat, CondInletTemp); + CpSource = PsyCpAirFnWTdb(CondInletHumRat); VarSpeedCoil(DXCoilNum).CondInletTemp = CondInletTemp; // If used in a heat pump, the value of MaxOAT in the heating coil overrides that in the cooling coil (in GetInput) @@ -5267,7 +5267,7 @@ namespace VariableSpeedCoils { LoadSideInletHumRat_Unit = VarSpeedCoil(DXCoilNum).InletAirHumRat; LoadSideInletWBTemp_Unit = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit, OutBaroPress, RoutineName); LoadSideInletEnth_Unit = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit, LoadSideInletDBTemp_Unit); + CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); RuntimeFrac = 1.0; OnOffFanPartLoadFraction = 1.0; @@ -6113,7 +6113,7 @@ namespace VariableSpeedCoils { // calculate coil outlet state variables LoadSideOutletEnth = LoadSideInletEnth - QLoadTotal / LoadSideMassFlowRate; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat, LoadSideInletDBTemp); + CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); LoadSideOutletDBTemp = LoadSideInletDBTemp - QSensible / (LoadSideMassFlowRate * CpAir); MaxHumRat = PsyWFnTdbRhPb(LoadSideOutletDBTemp, 0.9999, VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); @@ -6325,7 +6325,7 @@ namespace VariableSpeedCoils { LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp, LoadSideInletHumRat, OutBaroPress, RoutineName); LoadSideInletEnth = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat, LoadSideInletDBTemp); + CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // Get condenser outdoor node info from DX Heating Coil @@ -6343,7 +6343,7 @@ namespace VariableSpeedCoils { SourceSideMassFlowRate = 1.0; // not used and avoid divided by zero SourceSideInletTemp = OutdoorDryBulb; SourceSideInletEnth = PsyHFnTdbW(OutdoorDryBulb, OutdoorHumRat); - CpSource = PsyCpAirFnWTdb(OutHumRat, OutdoorDryBulb); + CpSource = PsyCpAirFnWTdb(OutHumRat); // Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil if (OutdoorDryBulb < VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index f476732db58..86c0ffedb14 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -2961,7 +2961,7 @@ namespace VentilatedSlab { VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } - CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat, Node(FanOutletNode).Temp); + CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat); QZnReq = (Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - Node(FanOutletNode).Temp); // Setup the coil configuration @@ -3214,7 +3214,7 @@ namespace VentilatedSlab { VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } - CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat, Node(FanOutletNode).Temp); + CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat); QZnReq = (Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - Node(FanOutletNode).Temp); ControlCompOutput(VentSlab(Item).Name, @@ -3362,7 +3362,7 @@ namespace VentilatedSlab { QCoilReq = 0.0; } else { HCoilInAirNode = VentSlab(Item).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(HCoilInAirNode).HumRat, Node(HCoilInAirNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(HCoilInAirNode).HumRat); QCoilReq = Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(VentSlab(Item).RadInNode).Temp) - (Node(HCoilInAirNode).Temp); } @@ -3377,7 +3377,7 @@ namespace VentilatedSlab { } else { HCoilInAirTemp = Node(VentSlab(Item).FanOutletNode).Temp; HCoilOutAirTemp = Node(VentSlab(Item).RadInNode).Temp; - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); QCoilReq = Node(VentSlab(Item).FanOutletNode).MassFlowRate * CpAirZn * (HCoilOutAirTemp - HCoilInAirTemp); } @@ -3679,7 +3679,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * VentSlab(Item).SurfaceFlowFrac(RadSurfNum); - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = VentSlab(Item).CoreNumbers * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); @@ -3818,7 +3818,7 @@ namespace VentilatedSlab { // Return Air temp Check if (VentSlab(Item).SysConfg == SlabOnly) { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && (std::abs(TotalVentSlabRadPower) > ZeroSystemResp)) { @@ -3935,7 +3935,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * FlowFrac; - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = CNumDS * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); @@ -4082,7 +4082,7 @@ namespace VentilatedSlab { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); Node(MSlabInletNode).Temp = MSlabAirInTemp; Node(MSlabOutletNode).Temp = Node(MSlabInletNode).Temp - (QRadSysSource(SurfNum) / (AirMassFlow * CpAirZn)); @@ -4096,7 +4096,7 @@ namespace VentilatedSlab { // Return Air temp Check if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && @@ -4314,7 +4314,7 @@ namespace VentilatedSlab { FanOutNode = VentSlab(Item).FanOutletNode; AirMassFlow = Node(AirOutletNode).MassFlowRate; ZoneInletNode = VentSlab(Item).ZoneAirInNode; - CpAppAir = PsyCpAirFnWTdb(Node(AirOutletNode).HumRat, Node(AirOutletNode).Temp); + CpAppAir = PsyCpAirFnWTdb(Node(AirOutletNode).HumRat); AirInletNode = VentSlab(Item).ReturnAirNode; for (RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { @@ -4512,7 +4512,7 @@ namespace VentilatedSlab { PRactual = Pr(Index - 1) + InterpFrac * (Pr(Index) - Pr(Index - 1)); } // arguments are glycol name, temperature, and concentration - CpAppAir = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat, Node(VentSlab(Item).RadInNode).Temp); + CpAppAir = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); SysAirMassFlow = AirMassFlow / CoreNumbers; // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index c403d3e8647..eb9ead6ea5d 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -1199,7 +1199,7 @@ namespace WaterCoils { WaterInletNode = WaterCoil(CoilNum).WaterInletNodeNum; WaterOutletNode = WaterCoil(CoilNum).WaterOutletNodeNum; - DesCpAir(CoilNum) = PsyCpAirFnWTdb(0.0, WaterCoil(CoilNum).DesInletAirTemp); + DesCpAir(CoilNum) = PsyCpAirFnWTdb(0.0); DesUARangeCheck(CoilNum) = (-1568.6 * WaterCoil(CoilNum).DesInletAirHumRat + 20.157); if (WaterCoil(CoilNum).WaterCoilType == CoilType_Cooling) { // 'Cooling' @@ -1230,7 +1230,7 @@ namespace WaterCoils { Node(WaterInletNode).HumRat = 0.0; MyUAAndFlowCalcFlag(CoilNum) = false; // fill values for variable UA - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); WaterCoil(CoilNum).DesAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum).DesAirVolFlowRate; WaterCoil(CoilNum).LiquidSideNominalConvect = WaterCoil(CoilNum).UACoil * (WaterCoil(CoilNum).RatioAirSideToWaterSideConvect + 1) / WaterCoil(CoilNum).RatioAirSideToWaterSideConvect; @@ -1394,14 +1394,14 @@ namespace WaterCoils { WaterCoil(CoilNum).DesOutletAirHumRat = WOutNew; WaterCoil(CoilNum).DesOutletAirTemp = TOutNew; // update outlet air conditions used for sizing - std::string CompType; - if (WaterCoil(CoilNum).WaterCoilModel == CoilModel_Detailed) { - CompType = cAllCoilTypes(Coil_CoolingWaterDetailed); - } else { - CompType = cAllCoilTypes(Coil_CoolingWater); - } - coilSelectionReportObj->setCoilLvgAirTemp(WaterCoil(CoilNum).Name, CompType, TOutNew); - coilSelectionReportObj->setCoilLvgAirHumRat(WaterCoil(CoilNum).Name, CompType, WOutNew); + std::string CompType; + if (WaterCoil(CoilNum).WaterCoilModel == CoilModel_Detailed) { + CompType = cAllCoilTypes(Coil_CoolingWaterDetailed); + } else { + CompType = cAllCoilTypes(Coil_CoolingWater); + } + coilSelectionReportObj->setCoilLvgAirTemp(WaterCoil(CoilNum).Name, CompType, TOutNew); + coilSelectionReportObj->setCoilLvgAirHumRat(WaterCoil(CoilNum).Name, CompType, WOutNew); // end update outlet air conditions used for sizing } } @@ -1523,8 +1523,7 @@ namespace WaterCoils { LogMeanEnthDiff = 2000.0; // UA will be 1/2 the design coil load } DesUACoilExternalEnth = WaterCoil(CoilNum).DesTotWaterCoilLoad / LogMeanEnthDiff; - WaterCoil(CoilNum).UACoilExternal = - DesUACoilExternalEnth * PsyCpAirFnWTdb(WaterCoil(CoilNum).DesInletAirHumRat, WaterCoil(CoilNum).DesInletAirTemp); + WaterCoil(CoilNum).UACoilExternal = DesUACoilExternalEnth * PsyCpAirFnWTdb(WaterCoil(CoilNum).DesInletAirHumRat); if (Ipass == 1 && (NoSatCurveIntersect || CBFTooLarge || BelowInletWaterTemp)) { // reset outlet conditions to 90% relative humidity at the same outlet enthalpy @@ -1654,8 +1653,7 @@ namespace WaterCoils { WaterCoil(CoilNum).InletAirEnthalpy = PsyHFnTdbW(WaterCoil(CoilNum).InletAirTemp, WaterCoil(CoilNum).InletAirHumRat); WaterCoil(CoilNum).InletWaterMassFlowRate = WaterCoil(CoilNum).MaxWaterMassFlowRate; WaterCoil(CoilNum).InletAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum).DesAirVolFlowRate; - CapacitanceAir = - WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat, WaterCoil(CoilNum).InletAirTemp); + CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterCoil(CoilNum).InletWaterTemp, @@ -1717,8 +1715,9 @@ namespace WaterCoils { addFootNoteSubTable( pdstHeatCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "Water Heating Coil Capacity Information,Coil:Heating:Water," + WaterCoil(CoilNum).Name + - ',' + RoundSigDigits(WaterCoil(CoilNum).TotWaterHeatingCoilRate, 2); + ObjexxFCL::gio::write(OutputFileInits, fmtA) << "Water Heating Coil Capacity Information,Coil:Heating:Water," + + WaterCoil(CoilNum).Name + ',' + + RoundSigDigits(WaterCoil(CoilNum).TotWaterHeatingCoilRate, 2); coilSelectionReportObj->setCoilAirFlow(WaterCoil(CoilNum).Name, "Coil:Heating:Water", WaterCoil(CoilNum).DesAirVolFlowRate, @@ -1732,9 +1731,10 @@ namespace WaterCoils { WaterCoil(CoilNum).WaterLoopNum); // coil report } else if (SELECT_CASE_var == WaterCoil_DetFlatFinCooling) { if (RptCoilHeaderFlag(2)) { - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Component Type,Name,Nominal Total " - "Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},Nominal " - "Sensible Heat Ratio"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Component Type,Name,Nominal Total " + "Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},Nominal " + "Sensible Heat Ratio"; RptCoilHeaderFlag(2) = false; } RatedLatentCapacity = WaterCoil(CoilNum).TotWaterCoolingCoilRate - WaterCoil(CoilNum).SenWaterCoolingCoilRate; @@ -1749,11 +1749,11 @@ namespace WaterCoils { addFootNoteSubTable( pdstCoolCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "Water Cooling Coil Capacity Information,Coil:Cooling:Water:DetailedGeometry," + - WaterCoil(CoilNum).Name + ',' + - RoundSigDigits(WaterCoil(CoilNum).TotWaterCoolingCoilRate, 2) + ',' + - RoundSigDigits(WaterCoil(CoilNum).SenWaterCoolingCoilRate, 2) + ',' + - RoundSigDigits(RatedLatentCapacity, 2) + ',' + RoundSigDigits(RatedSHR, 2); + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "Water Cooling Coil Capacity Information,Coil:Cooling:Water:DetailedGeometry," + WaterCoil(CoilNum).Name + ',' + + RoundSigDigits(WaterCoil(CoilNum).TotWaterCoolingCoilRate, 2) + ',' + + RoundSigDigits(WaterCoil(CoilNum).SenWaterCoolingCoilRate, 2) + ',' + RoundSigDigits(RatedLatentCapacity, 2) + + ',' + RoundSigDigits(RatedSHR, 2); coilSelectionReportObj->setCoilAirFlow(WaterCoil(CoilNum).Name, "Coil:Cooling:Water:DetailedGeometry", WaterCoil(CoilNum).DesAirVolFlowRate, @@ -1767,9 +1767,10 @@ namespace WaterCoils { WaterCoil(CoilNum).WaterLoopNum); // Coil Report } else if (SELECT_CASE_var == WaterCoil_Cooling) { if (RptCoilHeaderFlag(2)) { - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Component Type,Name,Nominal Total " - "Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},Nominal " - "Sensible Heat Ratio, Nominal Coil UA Value {W/C}, Nominal Coil Surface Area {m2}"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Component Type,Name,Nominal Total " + "Capacity {W},Nominal Sensible Capacity {W},Nominal Latent Capacity {W},Nominal " + "Sensible Heat Ratio, Nominal Coil UA Value {W/C}, Nominal Coil Surface Area {m2}"; RptCoilHeaderFlag(2) = false; } RatedLatentCapacity = WaterCoil(CoilNum).TotWaterCoolingCoilRate - WaterCoil(CoilNum).SenWaterCoolingCoilRate; @@ -1786,11 +1787,11 @@ namespace WaterCoils { addFootNoteSubTable( pdstCoolCoil, "Nominal values are gross at rated conditions, i.e., the supply air fan heat and electric power NOT accounted for."); - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "Water Cooling Coil Capacity Information,Coil:Cooling:Water," + WaterCoil(CoilNum).Name + - ',' + RoundSigDigits(WaterCoil(CoilNum).TotWaterCoolingCoilRate, 2) + ',' + - RoundSigDigits(WaterCoil(CoilNum).SenWaterCoolingCoilRate, 2) + ',' + - RoundSigDigits(RatedLatentCapacity, 2) + ',' + RoundSigDigits(RatedSHR, 2) + ',' + - RoundSigDigits(UATotal, 2) + ',' + RoundSigDigits(SurfaceArea, 2); + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "Water Cooling Coil Capacity Information,Coil:Cooling:Water," + WaterCoil(CoilNum).Name + ',' + + RoundSigDigits(WaterCoil(CoilNum).TotWaterCoolingCoilRate, 2) + ',' + + RoundSigDigits(WaterCoil(CoilNum).SenWaterCoolingCoilRate, 2) + ',' + RoundSigDigits(RatedLatentCapacity, 2) + + ',' + RoundSigDigits(RatedSHR, 2) + ',' + RoundSigDigits(UATotal, 2) + ',' + RoundSigDigits(SurfaceArea, 2); coilSelectionReportObj->setCoilAirFlow(WaterCoil(CoilNum).Name, "Coil:Cooling:Water", WaterCoil(CoilNum).DesAirVolFlowRate, @@ -2095,7 +2096,7 @@ namespace WaterCoils { DesCoilAirFlow = 0.0; DesCoilExitTemp = 0.0; LoopErrorsFound = false; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); // cooling coils if (WaterCoil(CoilNum).WaterCoilType == CoilType_Cooling && WaterCoil(CoilNum).RequestingAutoSize) { @@ -2763,7 +2764,7 @@ namespace WaterCoils { } if (WaterMassFlowRate > MassFlowTolerance) { // If the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win, 0.5 * (TempAirIn + TempWaterIn)) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, @@ -3043,8 +3044,8 @@ namespace WaterCoils { // known thermodynamic functions // All coil calcs are done in KJoules. Convert to KJ here and then convert // back to Joules at the end of the Subroutine. - DryAirSpecHeat = PsyCpAirFnWTdb(zero, TempAirIn) * ConvK; - MoistAirSpecificHeat = PsyCpAirFnWTdb(InletAirHumRat, TempAirIn) * ConvK; + DryAirSpecHeat = PsyCpAirFnWTdb(zero) * ConvK; + MoistAirSpecificHeat = PsyCpAirFnWTdb(InletAirHumRat) * ConvK; InletAirEnthalpy = WaterCoil(CoilNum).InletAirEnthalpy * ConvK; EnterAirDewPoint = PsyTdpFnWPb(InletAirHumRat, OutBaroPress, RoutineName); @@ -3448,9 +3449,7 @@ namespace WaterCoils { // Implementation of epsilon*NTU method TempAirOut = AirExitCoilSurfTemp + (AirWetDryInterfcTemp - AirExitCoilSurfTemp) * y; OutletAirHumRat = PsyWFnTdbH(TempAirOut, 1000.0 * OutletAirEnthalpy, RoutineName); - SenWaterCoilLoad = - AirMassFlow * (PsyCpAirFnWTdb(InletAirHumRat, TempAirIn) * TempAirIn - PsyCpAirFnWTdb(OutletAirHumRat, TempAirOut) * TempAirOut) * - ConvK; + SenWaterCoilLoad = AirMassFlow * (PsyCpAirFnWTdb(InletAirHumRat) * TempAirIn - PsyCpAirFnWTdb(OutletAirHumRat) * TempAirOut) * ConvK; } if (FanOpMode == CycFanCycCoil) { @@ -3685,7 +3684,7 @@ namespace WaterCoils { } // End if for dry coil } } - + // Report outlet variables at nodes WaterCoil(CoilNum).OutletAirTemp = OutletAirTemp; WaterCoil(CoilNum).OutletAirHumRat = OutletAirHumRat; @@ -3795,7 +3794,7 @@ namespace WaterCoils { } // Calculate air and water capacity rates - CapacitanceAir = AirMassFlow * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat, WaterCoil(CoilNum).InletAirTemp); + CapacitanceAir = AirMassFlow * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); // Water Capacity Rate Cp = GetSpecificHeatGlycol( PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); @@ -3936,7 +3935,7 @@ namespace WaterCoils { // Determine air and water enthalpy outlet conditions by modeling // coil as counterflow enthalpy heat exchanger - UACoilTotalEnth = 1.0 / (IntermediateCpSat * WaterSideResist + AirSideResist * PsyCpAirFnWTdb(0.0, AirTempIn)); + UACoilTotalEnth = 1.0 / (IntermediateCpSat * WaterSideResist + AirSideResist * PsyCpAirFnWTdb(0.0)); CapacityRateAirWet = AirMassFlow; Cp = GetSpecificHeatGlycol( PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); @@ -3952,7 +3951,7 @@ namespace WaterCoils { // Calculate entering and leaving external surface conditions from // air and water conditions and the ratio of resistances - ResistRatio = (WaterSideResist) / (WaterSideResist + PsyCpAirFnWTdb(0.0, AirTempIn) / IntermediateCpSat * AirSideResist); + ResistRatio = (WaterSideResist) / (WaterSideResist + PsyCpAirFnWTdb(0.0) / IntermediateCpSat * AirSideResist); EnthSatAirCoilSurfaceEntryTemp = EnthSatAirOutletWaterTemp + ResistRatio * (EnthAirInlet - EnthSatAirOutletWaterTemp); EnthSatAirCoilSurfaceExitTemp = EnthSatAirInletWaterTemp + ResistRatio * (EnthAirOutlet - EnthSatAirInletWaterTemp); @@ -4528,7 +4527,7 @@ namespace WaterCoils { // Determine the temperature effectiveness, assuming the temperature // of the condensate is constant (MinimumCapacityStream/MaximumCapacityStream = 0) and the specific heat // of moist air is constant - CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat, AirTempIn); + CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); // Calculating NTU from UA and Capacitance. // del NTU = UACoilExternal/MAX(CapacitanceAir,SmallNo) @@ -6677,7 +6676,7 @@ namespace WaterCoils { WaterMassFlowRate = WaterCoil(CoilNum).InletWaterMassFlowRate; } if (WaterMassFlowRate > MassFlowTolerance) { // if the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win, 0.5 * (TempAirIn + TempWaterIn)) * AirMassFlow; + CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 48a2989d227..4d6fa8f2e5c 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -1110,16 +1110,19 @@ namespace WaterThermalTanks { Array1D CoilSaveNodeNames; // temporary for coil node names used in later checks // Formats - static ObjexxFCL::gio::Fmt Format_720("('! ,Type,Name,Volume {m3},Maximum Capacity {W},Standard Rated Recovery Efficiency, " - "','Standard Rated Energy Factor')"); - static ObjexxFCL::gio::Fmt Format_721("('! ,Type,Name,Volume {m3},Maximum Capacity {W},','Standard Rated Recovery " - "Efficiency,Standard Rated Energy Factor,\"DX Coil Total Cooling Rate {W, HPWH Only}\"')"); + static ObjexxFCL::gio::Fmt Format_720( + "('! ,Type,Name,Volume {m3},Maximum Capacity {W},Standard Rated Recovery Efficiency, " + "','Standard Rated Energy Factor')"); + static ObjexxFCL::gio::Fmt Format_721( + "('! ,Type,Name,Volume {m3},Maximum Capacity {W},','Standard Rated Recovery " + "Efficiency,Standard Rated Energy Factor,\"DX Coil Total Cooling Rate {W, HPWH Only}\"')"); static ObjexxFCL::gio::Fmt Format_722("('! ,Node Number,Height {m},Volume {m3},Maximum Capacity " - "{W},','Off-Cycle UA {W/K},On-Cycle UA {W/K},Number Of Inlets,Number Of Outlets')"); + "{W},','Off-Cycle UA {W/K},On-Cycle UA {W/K},Number Of Inlets,Number Of Outlets')"); static ObjexxFCL::gio::Fmt Format_725( "('! ,Type,Name,Volume {m3},Use Side Design Flow Rate {m3/s}, ','Source Side Design Flow Rate {m3/s}')"); - static ObjexxFCL::gio::Fmt Format_726("('! ,Node Number,Height {m},Volume {m3},','UA {W/K},Number Of " - "Inlets,Number Of Outlets')"); + static ObjexxFCL::gio::Fmt Format_726( + "('! ,Node Number,Height {m},Volume {m3},','UA {W/K},Number Of " + "Inlets,Number Of Outlets')"); static ObjexxFCL::gio::Fmt Format_723("('Water Heater Stratified Node Information',8(',',A))"); static ObjexxFCL::gio::Fmt Format_724("('Chilled Water Tank Stratified Node Information',6(',',A))"); @@ -1322,37 +1325,51 @@ namespace WaterThermalTanks { } } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:SingleSpeed")) { WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource = COIL_DX_COOLING; - GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, errFlag, cCurrentModuleObject); + GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, + errFlag, + cCurrentModuleObject); if (allocated(HeatReclaimDXCoil)) ValidSourceType(DesuperheaterNum) = true; - } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:TwoSpeed") || UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:MultiSpeed")) { + } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:TwoSpeed") || + UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:MultiSpeed")) { WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource = COIL_DX_MULTISPEED; - GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, errFlag, cCurrentModuleObject); + GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, + errFlag, + cCurrentModuleObject); if (allocated(HeatReclaimDXCoil)) ValidSourceType(DesuperheaterNum) = true; } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:TwoStageWithHumidityControlMode")) { WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource = COIL_DX_MULTIMODE; - GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, errFlag, cCurrentModuleObject); + GetDXCoilIndex(WaterHeaterDesuperheater(DesuperheaterNum).HeatingSourceName, + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum, + errFlag, + cCurrentModuleObject); if (allocated(HeatReclaimDXCoil)) ValidSourceType(DesuperheaterNum) = true; } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:DX:VariableSpeed")) { WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource = COIL_DX_VARIABLE_COOLING; - WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum = VariableSpeedCoils::GetCoilIndexVariableSpeed(cAlphaArgs(9), cAlphaArgs(10), errFlag); + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum = + VariableSpeedCoils::GetCoilIndexVariableSpeed(cAlphaArgs(9), cAlphaArgs(10), errFlag); if (allocated(DataHeatBalance::HeatReclaimVS_DXCoil)) ValidSourceType(DesuperheaterNum) = true; } else if (UtilityRoutines::SameString(cAlphaArgs(9), "Coil:Cooling:WaterToAirHeatPump:EquationFit")) { WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource = COIL_AIR_WATER_HEATPUMP_EQ; - WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum = WaterToAirHeatPumpSimple::GetCoilIndex(cAlphaArgs(9), cAlphaArgs(10), errFlag); + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum = + WaterToAirHeatPumpSimple::GetCoilIndex(cAlphaArgs(9), cAlphaArgs(10), errFlag); if (allocated(DataHeatBalance::HeatReclaimSimple_WAHPCoil)) { - DataHeatBalance::HeatReclaimHPCoilData &HeatReclaim = HeatReclaimSimple_WAHPCoil(WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum); - if (!allocated(HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat)){ - HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat.allocate(NumWaterHeaterDesuperheater); - for (auto& num : HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat) num = 0.0; + DataHeatBalance::HeatReclaimHPCoilData &HeatReclaim = + HeatReclaimSimple_WAHPCoil(WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSourceIndexNum); + if (!allocated(HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat)) { + HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat.allocate(NumWaterHeaterDesuperheater); + for (auto &num : HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat) + num = 0.0; } ValidSourceType(DesuperheaterNum) = true; } } else { ShowSevereError(cCurrentModuleObject + " = " + WaterHeaterDesuperheater(DesuperheaterNum).Name + ':'); ShowContinueError(" desuperheater can only be used with Coil:Cooling:DX:SingleSpeed, "); - ShowContinueError( - " Coil:Cooling:DX:TwoSpeed, Coil:Cooling:DX:MultiSpeed, Coil:Cooling:DX:TwoStageWithHumidityControlMode, Coil:Cooling:DX:VariableSpeed, " - "Coil:Cooling:WaterToAirHeatPump:EquationFit, Refrigeration:CompressorRack,"); + ShowContinueError(" Coil:Cooling:DX:TwoSpeed, Coil:Cooling:DX:MultiSpeed, Coil:Cooling:DX:TwoStageWithHumidityControlMode, " + "Coil:Cooling:DX:VariableSpeed, " + "Coil:Cooling:WaterToAirHeatPump:EquationFit, Refrigeration:CompressorRack,"); ShowContinueError(" Refrigeration:Condenser:AirCooled ,Refrigeration:Condenser:EvaporativeCooled, "); ShowContinueError(" or Refrigeration:Condenser:WaterCooled."); ShowContinueError(" Invalid desuperheater heat source object: " + cAlphaArgs(9) + " \"" + cAlphaArgs(10) + "\""); @@ -7545,19 +7562,19 @@ namespace WaterThermalTanks { Tank.Mode = Mode; // Operating mode for carry-over to next timestep - Tank.TankTemp = TankTemp; // Final tank temperature for carry-over to next timestep - Tank.TankTempAvg = TankTempAvg; // Average tank temperature over the timestep for reporting + Tank.TankTemp = TankTemp; // Final tank temperature for carry-over to next timestep + Tank.TankTempAvg = TankTempAvg; // Average tank temperature over the timestep for reporting if (!WarmupFlag) { // Warn for potential freezing when avg of final temp over all nodes is below 2°C (nearing 0°C) if (Tank.TankTemp < 2) { if (Tank.FreezingErrorIndex == 0) { - ShowWarningError(RoutineName + ": " + Tank.Type +" = '" - + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " - + General::RoundSigDigits(Tank.TankTemp, 2) + " C."); + ShowWarningError(RoutineName + ": " + Tank.Type + " = '" + Tank.Name + + "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " + + General::RoundSigDigits(Tank.TankTemp, 2) + " C."); ShowContinueErrorTimeStamp(""); } - ShowRecurringWarningErrorAtEnd(Tank.Type +" = '" + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze", + ShowRecurringWarningErrorAtEnd(Tank.Type + " = '" + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze", Tank.FreezingErrorIndex, Tank.TankTemp, // Report Max Tank.TankTemp, // Report Min @@ -7907,7 +7924,7 @@ namespace WaterThermalTanks { static std::string const RoutineName("CalcWaterThermalTankStratified"); const Real64 TemperatureConvergenceCriteria = 0.0001; const Real64 SubTimestepMax = 60.0 * 10.0; // seconds - const Real64 SubTimestepMin = 10.0; // seconds + const Real64 SubTimestepMin = 10.0; // seconds Real64 dt; // Using/Aliasing @@ -7958,7 +7975,7 @@ namespace WaterThermalTanks { const int HPWHCondenserConfig = Tank.HeatPumpNum > 0 ? HPWaterHeater(Tank.HeatPumpNum).TypeNum : 0; // Heat rate from the heat pump (W) - const Real64 Qheatpump = [&Tank]{ + const Real64 Qheatpump = [&Tank] { if (Tank.HeatPumpNum == 0) return 0.0; HeatPumpWaterHeaterData const &HPWH = HPWaterHeater(Tank.HeatPumpNum); Real64 CoilTotalHeatingEnergyRate; @@ -7980,34 +7997,35 @@ namespace WaterThermalTanks { // Specific Heat of water (J/kg K) static int DummyWaterIndex = 1; - const Real64 Cp = [&]{ + const Real64 Cp = [&] { if (Tank.UseSidePlantLoopNum > 0) { - return GetSpecificHeatGlycol(PlantLoop(Tank.UseSidePlantLoopNum).FluidName, Tank.TankTemp, PlantLoop(Tank.UseSidePlantLoopNum).FluidIndex, RoutineName); + return GetSpecificHeatGlycol( + PlantLoop(Tank.UseSidePlantLoopNum).FluidName, Tank.TankTemp, PlantLoop(Tank.UseSidePlantLoopNum).FluidIndex, RoutineName); } else { return GetSpecificHeatGlycol(fluidNameWater, Tank.TankTemp, DummyWaterIndex, RoutineName); } }(); - Real64 Eloss = 0.0; // Energy change due to ambient losses over the timestep (J) - Real64 Euse = 0.0; // Energy change due to use side mass flow over the timestep (J) - Real64 Esource = 0.0; // Energy change due to source side mass flow over the timestep (J) - Real64 Eheater1 = 0.0; // Energy change due to heater 1 over the timestep (J) - Real64 Eheater2 = 0.0; // Energy change due to heater 2 over the timestep (J) - Real64 Eunmet = 0.0; // Energy change unmet over the timestep (J) - Real64 Event = 0.0; // Energy change due to venting over the timestep (J) - int CycleOnCount1 = 0; // Number of times heater 1 cycles on in the current time step - int CycleOnCount2 = 0; // Number of times heater 2 cycles on in the current time step - Real64 Runtime = 0.0; // Time that either heater is running (s) - Real64 Runtime1 = 0.0; // Time that heater 1 is running (s) - Real64 Runtime2 = 0.0; // Time that heater 2 is running (s) - bool SetPointRecovered = false; // Flag to indicate when set point is recovered for the first time - //Added three variables for desuperheater sourceinlet temperature update - Real64 MdotDesuperheaterWater = 0.0; // mass flow rate of desuperheater source side water, kg/s - Real64 DesuperheaterPLR = 0.0; // Desuperheater part load ratio - Real64 DesuperheaterHeaterRate = 0.0; // Desuperheater heater rate (W) - Real64 SourceInletTempSum = 0.0; // Sum the source inlet temperature in sub time step to calculate average tempearature - Real64 Qheater1; // Heating rate of burner or electric heating element 1 (W) - Real64 Qheater2; // Heating rate of burner or electric heating element 2 (W) + Real64 Eloss = 0.0; // Energy change due to ambient losses over the timestep (J) + Real64 Euse = 0.0; // Energy change due to use side mass flow over the timestep (J) + Real64 Esource = 0.0; // Energy change due to source side mass flow over the timestep (J) + Real64 Eheater1 = 0.0; // Energy change due to heater 1 over the timestep (J) + Real64 Eheater2 = 0.0; // Energy change due to heater 2 over the timestep (J) + Real64 Eunmet = 0.0; // Energy change unmet over the timestep (J) + Real64 Event = 0.0; // Energy change due to venting over the timestep (J) + int CycleOnCount1 = 0; // Number of times heater 1 cycles on in the current time step + int CycleOnCount2 = 0; // Number of times heater 2 cycles on in the current time step + Real64 Runtime = 0.0; // Time that either heater is running (s) + Real64 Runtime1 = 0.0; // Time that heater 1 is running (s) + Real64 Runtime2 = 0.0; // Time that heater 2 is running (s) + bool SetPointRecovered = false; // Flag to indicate when set point is recovered for the first time + // Added three variables for desuperheater sourceinlet temperature update + Real64 MdotDesuperheaterWater = 0.0; // mass flow rate of desuperheater source side water, kg/s + Real64 DesuperheaterPLR = 0.0; // Desuperheater part load ratio + Real64 DesuperheaterHeaterRate = 0.0; // Desuperheater heater rate (W) + Real64 SourceInletTempSum = 0.0; // Sum the source inlet temperature in sub time step to calculate average tempearature + Real64 Qheater1; // Heating rate of burner or electric heating element 1 (W) + Real64 Qheater2; // Heating rate of burner or electric heating element 2 (W) if (Tank.InletMode == InletModeFixed) CalcNodeMassFlows(WaterThermalTankNum, InletModeFixed); @@ -8030,7 +8048,7 @@ namespace WaterThermalTanks { int SubTimestepCount = 0; - while(TimeRemaining > 0.0) { + while (TimeRemaining > 0.0) { ++SubTimestepCount; @@ -8163,7 +8181,8 @@ namespace WaterThermalTanks { auto &node(Tank.Node[i]); Real64 NodeCapacitance = node.Mass * Cp; A[i] += (node.OffCycLossCoeff - node.OnCycLossCoeff) / NodeCapacitance; - B[i] += (- node.OffCycParaLoad + node.OnCycParaLoad + (node.OnCycLossCoeff - node.OffCycLossCoeff) * Tank.AmbientTemp) / NodeCapacitance; + B[i] += (-node.OffCycParaLoad + node.OnCycParaLoad + (node.OnCycLossCoeff - node.OffCycLossCoeff) * Tank.AmbientTemp) / + NodeCapacitance; } } else if (!(Tank.HeaterOn1 || Tank.HeaterOn2) and (PrevHeaterOn1 || PrevHeaterOn2)) { // Remove on cycle loads @@ -8172,7 +8191,8 @@ namespace WaterThermalTanks { auto &node(Tank.Node[i]); Real64 NodeCapacitance = node.Mass * Cp; A[i] -= (node.OffCycLossCoeff - node.OnCycLossCoeff) / NodeCapacitance; - B[i] -= (- node.OffCycParaLoad + node.OnCycParaLoad + (node.OnCycLossCoeff - node.OffCycLossCoeff) * Tank.AmbientTemp) / NodeCapacitance; + B[i] -= (-node.OffCycParaLoad + node.OnCycParaLoad + (node.OnCycLossCoeff - node.OffCycLossCoeff) * Tank.AmbientTemp) / + NodeCapacitance; } } @@ -8180,8 +8200,7 @@ namespace WaterThermalTanks { dt = TimeRemaining; for (int i = 0; i < nTankNodes; ++i) { const Real64 Denominator = fabs(A[i] * Tavg[i] + B[i]); - if (Denominator != 0.0) - dt = min(dt, dT_max / Denominator); + if (Denominator != 0.0) dt = min(dt, dT_max / Denominator); } dt = max(min(SubTimestepMin, TimeRemaining), dt); dt = min(SubTimestepMax, dt); @@ -8224,8 +8243,8 @@ namespace WaterThermalTanks { // Conduction to adjacent nodes A[i] += -(tank_node.CondCoeffDn + tank_node.CondCoeffUp); - if (NodeNum > 1) B[i] += tank_node.CondCoeffUp * Tavg[i-1]; - if (NodeNum < nTankNodes) B[i] += tank_node.CondCoeffDn * Tavg[i+1]; + if (NodeNum > 1) B[i] += tank_node.CondCoeffUp * Tavg[i - 1]; + if (NodeNum < nTankNodes) B[i] += tank_node.CondCoeffDn * Tavg[i + 1]; // Use side plant connection const Real64 use_e_mdot_cp = tank_node.UseMassFlowRate * Cp; @@ -8249,21 +8268,20 @@ namespace WaterThermalTanks { } // Internodal flow - A[i] += - (tank_node.MassFlowFromUpper + tank_node.MassFlowFromLower) * Cp; - if (NodeNum > 1) B[i] += tank_node.MassFlowFromUpper * Cp * Tavg[i-1]; - if (NodeNum < nTankNodes) B[i] += tank_node.MassFlowFromLower * Cp * Tavg[i+1]; + A[i] += -(tank_node.MassFlowFromUpper + tank_node.MassFlowFromLower) * Cp; + if (NodeNum > 1) B[i] += tank_node.MassFlowFromUpper * Cp * Tavg[i - 1]; + if (NodeNum < nTankNodes) B[i] += tank_node.MassFlowFromLower * Cp * Tavg[i + 1]; // Divide by mass and specific heat // m * cp * dT/dt = q_net => dT/dt = a * T + b A[i] /= tank_node.Mass * Cp; B[i] /= tank_node.Mass * Cp; - } // end for each node // Calculate the average and final temperatures over the interval Real64 TfinalDiff = 0.0; - for (int i=0; i < nTankNodes; ++i) { + for (int i = 0; i < nTankNodes; ++i) { const Real64 Tstart = Tank.Node[i].Temp; const Real64 b_a = B[i] / A[i]; const Real64 e_a_dt = exp(A[i] * dt); @@ -8275,13 +8293,15 @@ namespace WaterThermalTanks { if (TfinalDiff < TemperatureConvergenceCriteria) break; - if (Tank.DesuperheaterNum > 0){ + if (Tank.DesuperheaterNum > 0) { DesuperheaterPLR = WaterHeaterDesuperheater(Tank.DesuperheaterNum).DesuperheaterPLR; DesuperheaterHeaterRate = WaterHeaterDesuperheater(Tank.DesuperheaterNum).HeaterRate; - MdotDesuperheaterWater = WaterHeaterDesuperheater(Tank.DesuperheaterNum).OperatingWaterFlowRate * Psychrometrics::RhoH2O(Tavg[Tank.SourceOutletStratNode - 1]); - if (DesuperheaterPLR > 0.0 && MdotDesuperheaterWater > 0.0){ - Tank.SourceInletTemp = Tavg[Tank.SourceOutletStratNode - 1] + (DesuperheaterHeaterRate/DesuperheaterPLR) / (MdotDesuperheaterWater * Cp); - }else{ + MdotDesuperheaterWater = WaterHeaterDesuperheater(Tank.DesuperheaterNum).OperatingWaterFlowRate * + Psychrometrics::RhoH2O(Tavg[Tank.SourceOutletStratNode - 1]); + if (DesuperheaterPLR > 0.0 && MdotDesuperheaterWater > 0.0) { + Tank.SourceInletTemp = + Tavg[Tank.SourceOutletStratNode - 1] + (DesuperheaterHeaterRate / DesuperheaterPLR) / (MdotDesuperheaterWater * Cp); + } else { Tank.SourceInletTemp = Tavg[Tank.SourceOutletStratNode - 1]; } } @@ -8335,7 +8355,7 @@ namespace WaterThermalTanks { break; } } - } while ( HasInversion ); + } while (HasInversion); // Venting if (!Tank.IsChilledWaterTank) { @@ -8361,7 +8381,7 @@ namespace WaterThermalTanks { Real64 Qloss_node = (Tank.AmbientTemp - Tavg[i]); Real64 Qheat_node = 0.0; const Real64 Quse_node = node.UseMassFlowRate * Cp * (Tank.UseInletTemp - Tavg[i]); - const Real64 Qsource_node = [&]{ + const Real64 Qsource_node = [&] { if (Tank.HeatPumpNum > 0) { if (HPWHCondenserConfig == TypeOf_HeatPumpWtrHeaterPumped) { if (node.SourceMassFlowRate > 0.0) { @@ -8393,9 +8413,11 @@ namespace WaterThermalTanks { SourceInletTempSum += Tank.SourceInletTemp * dt; // More bookkeeping for reporting variables Eloss += Qloss * dt; - const Real64 Quse = (Tank.UseOutletStratNode > 0) ? Tank.UseEffectiveness * Tank.UseMassFlowRate * Cp * (Tank.UseInletTemp - Tavg[Tank.UseOutletStratNode - 1]) : 0.0; + const Real64 Quse = (Tank.UseOutletStratNode > 0) + ? Tank.UseEffectiveness * Tank.UseMassFlowRate * Cp * (Tank.UseInletTemp - Tavg[Tank.UseOutletStratNode - 1]) + : 0.0; Euse += Quse * dt; - const Real64 Qsource = [&]{ + const Real64 Qsource = [&] { if (Tank.HeatPumpNum > 0) { if (HPWHCondenserConfig == TypeOf_HeatPumpWtrHeaterPumped) { return Qheatpump; @@ -8405,7 +8427,8 @@ namespace WaterThermalTanks { } } else { if (Tank.SourceOutletStratNode > 0) { - return Tank.SourceEffectiveness * Tank.SourceMassFlowRate * Cp * (Tank.SourceInletTemp - Tavg[Tank.SourceOutletStratNode - 1]); + return Tank.SourceEffectiveness * Tank.SourceMassFlowRate * Cp * + (Tank.SourceInletTemp - Tavg[Tank.SourceOutletStratNode - 1]); } else { return 0.0; } @@ -8443,12 +8466,12 @@ namespace WaterThermalTanks { // Warn for potential freezing when avg of final temp over all nodes is below 2°C (nearing 0°C) if (Tank.TankTemp < 2) { if (Tank.FreezingErrorIndex == 0) { - ShowWarningError(RoutineName + ": " + Tank.Type +" = '" - + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " - + General::RoundSigDigits(Tank.TankTemp, 2) + " C."); + ShowWarningError(RoutineName + ": " + Tank.Type + " = '" + Tank.Name + + "': Temperature of tank < 2C indicates of possibility of freeze. Tank Temperature = " + + General::RoundSigDigits(Tank.TankTemp, 2) + " C."); ShowContinueErrorTimeStamp(""); } - ShowRecurringWarningErrorAtEnd(Tank.Type +" = '" + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze", + ShowRecurringWarningErrorAtEnd(Tank.Type + " = '" + Tank.Name + "': Temperature of tank < 2C indicates of possibility of freeze", Tank.FreezingErrorIndex, Tank.TankTemp, // Report Max Tank.TankTemp, // Report Min @@ -8511,14 +8534,16 @@ namespace WaterThermalTanks { Tank.OnCycParaFuelRate = Tank.OnCycParaLoad * Runtime / SecInTimeStep; Tank.OffCycParaRateToTank = Tank.OffCycParaFuelRate * Tank.OffCycParaFracToTank; Tank.OnCycParaRateToTank = Tank.OnCycParaFuelRate * Tank.OnCycParaFracToTank; - Tank.TotalDemandRate = -Tank.UseRate - Tank.SourceRate - Tank.LossRate - Tank.OffCycParaRateToTank - Tank.OnCycParaRateToTank - WrappedCondenserHeatPumpRate; + Tank.TotalDemandRate = + -Tank.UseRate - Tank.SourceRate - Tank.LossRate - Tank.OffCycParaRateToTank - Tank.OnCycParaRateToTank - WrappedCondenserHeatPumpRate; Tank.HeaterRate1 = Eheater1 / SecInTimeStep; Tank.HeaterRate2 = Eheater2 / SecInTimeStep; Tank.HeaterRate = Tank.HeaterRate1 + Tank.HeaterRate2; Tank.UnmetRate = Eunmet / SecInTimeStep; Tank.VentRate = Event / SecInTimeStep; - Tank.NetHeatTransferRate = Tank.UseRate + Tank.SourceRate + Tank.LossRate + Tank.OffCycParaRateToTank + Tank.OnCycParaRateToTank + Tank.HeaterRate + Tank.VentRate + WrappedCondenserHeatPumpRate; + Tank.NetHeatTransferRate = Tank.UseRate + Tank.SourceRate + Tank.LossRate + Tank.OffCycParaRateToTank + Tank.OnCycParaRateToTank + + Tank.HeaterRate + Tank.VentRate + WrappedCondenserHeatPumpRate; Tank.CycleOnCount = CycleOnCount1 + CycleOnCount2; Tank.CycleOnCount1 = CycleOnCount1; @@ -8532,7 +8557,6 @@ namespace WaterThermalTanks { // Add water heater skin losses and venting losses to ambient zone, if specified if (Tank.AmbientTempZone > 0) Tank.AmbientZoneGain = -Tank.LossRate * Tank.SkinLossFracToZone - Tank.VentRate; - } void CalcNodeMassFlows(int const WaterThermalTankNum, // Water Heater being simulated @@ -8722,17 +8746,17 @@ namespace WaterThermalTanks { using CurveManager::CurveValue; using DataEnvironment::OutDryBulbTemp; using DataGlobals::DoingSizing; + using DataGlobals::HourOfDay; using DataGlobals::KickOffSimulation; using DataGlobals::SecInHour; + using DataGlobals::TimeStep; + using DataGlobals::TimeStepZone; using DataGlobals::WarmupFlag; using DataHeatBalance::HeatReclaimDXCoil; using DataHeatBalance::HeatReclaimSimple_WAHPCoil; using DataHVACGlobals::ShortenTimeStepSys; - using DataGlobals::HourOfDay; - using DataGlobals::TimeStep; - using DataGlobals::TimeStepZone; - using DataHVACGlobals::TimeStepSys; using DataHVACGlobals::SysTimeElapsed; + using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; using DXCoils::DXCoil; using General::RoundSigDigits; @@ -8746,7 +8770,7 @@ namespace WaterThermalTanks { // SUBROUTINE ARGUMENT DEFINITIONS: // SUBROUTINE PARAMETER DEFINITIONS: - int const MaxIte(500); // Maximum number of iterations for RegulaFalsi + int const MaxIte(500); // Maximum number of iterations for RegulaFalsi // SUBROUTINE LOCAL VARIABLE DECLARATIONS: Real64 AvailSchedule; // desuperheater availability schedule @@ -8935,8 +8959,7 @@ namespace WaterThermalTanks { Real64 Acc; // Accuracy of result from RegulaFalsi if (WaterHeaterDesuperheater(DesuperheaterNum).TankTypeNum == StratifiedWaterHeater) { Acc = 0.001; - } - else { + } else { Acc = 0.00001; } @@ -8958,7 +8981,7 @@ namespace WaterThermalTanks { { auto const TankType(WaterHeaterDesuperheater(DesuperheaterNum).TankTypeNum); - if (TankType == MixedWaterHeater||TankType == StratifiedWaterHeater) { + if (TankType == MixedWaterHeater || TankType == StratifiedWaterHeater) { WaterHeaterDesuperheater(DesuperheaterNum).SaveWHMode = WaterThermalTank(WaterThermalTankNum).Mode; @@ -9213,14 +9236,15 @@ namespace WaterThermalTanks { } else if (WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == CONDENSER_REFRIGERATION) { HeatReclaimRefrigCondenser(SourceID).UsedWaterHeater = WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; } else if (WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_COOLING || - WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_MULTISPEED || - WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_MULTIMODE) { + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_MULTISPEED || + WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_MULTIMODE) { HeatReclaimDXCoil(SourceID).AvailCapacity -= WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; } else if (WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_DX_VARIABLE_COOLING) { DataHeatBalance::HeatReclaimVS_DXCoil(SourceID).AvailCapacity -= WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; } else if (WaterHeaterDesuperheater(DesuperheaterNum).ReclaimHeatingSource == COIL_AIR_WATER_HEATPUMP_EQ) { DataHeatBalance::HeatReclaimSimple_WAHPCoil(SourceID).AvailCapacity -= WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; - DataHeatBalance::HeatReclaimSimple_WAHPCoil(SourceID).WaterHeatingDesuperheaterReclaimedHeat(DesuperheaterNum) = WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; + DataHeatBalance::HeatReclaimSimple_WAHPCoil(SourceID).WaterHeatingDesuperheaterReclaimedHeat(DesuperheaterNum) = + WaterHeaterDesuperheater(DesuperheaterNum).HeaterRate; } } } @@ -10388,7 +10412,7 @@ namespace WaterThermalTanks { // calculate sensible capacity to zone for inlet air configuration equals Zone Only or Zone And Outdoor Air configurations } else { - CpAir = PsyCpAirFnWTdb(Node(HPAirInletNode).HumRat, Node(HPAirInletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(HPAirInletNode).HumRat); // add parasitics to zone heat balance if parasitic heat load is to zone otherwise neglect parasitics if (HeatPump.ParasiticTempIndicator == AmbientTempZone) { @@ -10664,7 +10688,7 @@ namespace WaterThermalTanks { } Real64 PLRResidualWaterThermalTank(Real64 const HPPartLoadRatio, // compressor cycling ratio (1.0 is continuous, 0.0 is off) - Array1 const &Par // par(1) = HP set point temperature [C] + Array1 const &Par // par(1) = HP set point temperature [C] ) { // FUNCTION INFORMATION: @@ -10767,11 +10791,8 @@ namespace WaterThermalTanks { return PLRResidualHPWH; } - bool SourceHeatNeed(WaterThermalTankData const Tank, - Real64 const OutletTemp, - Real64 const DeadBandTemp, - Real64 const SetPointTemp - ){ + bool SourceHeatNeed(WaterThermalTankData const Tank, Real64 const OutletTemp, Real64 const DeadBandTemp, Real64 const SetPointTemp) + { // FUNCTION INFORMATION: // AUTHOR Yueyue Zhou // DATE WRITTEN May 2019 @@ -10781,8 +10802,7 @@ namespace WaterThermalTanks { // PURPOSE OF THIS FUNCTION: // Determine by tank type, tank temperature and control mode if source side flow is needed - - //return value initialization + // return value initialization bool NeedsHeatOrCool = false; if (!Tank.IsChilledWaterTank) { @@ -13162,9 +13182,10 @@ namespace WaterThermalTanks { MaxCapacity = WaterThermalTank(WaterThermalTankNum).MaxCapacity; } - ObjexxFCL::gio::write(OutputFileInits, Format_720) << WaterThermalTank(WaterThermalTankNum).Type << WaterThermalTank(WaterThermalTankNum).Name - << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).Volume, 4) << TrimSigDigits(MaxCapacity, 1) - << TrimSigDigits(RecoveryEfficiency, 3) << TrimSigDigits(EnergyFactor, 4); + ObjexxFCL::gio::write(OutputFileInits, Format_720) + << WaterThermalTank(WaterThermalTankNum).Type << WaterThermalTank(WaterThermalTankNum).Name + << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).Volume, 4) << TrimSigDigits(MaxCapacity, 1) + << TrimSigDigits(RecoveryEfficiency, 3) << TrimSigDigits(EnergyFactor, 4); } else { ObjexxFCL::gio::write(OutputFileInits, Format_721) << HPWaterHeater(WaterThermalTank(WaterThermalTankNum).HeatPumpNum).Type @@ -13226,9 +13247,9 @@ namespace WaterThermalTanks { } ObjexxFCL::gio::write(OutputFileInits, Format_728) << WaterThermalTank(WaterThermalTankNum).Type << WaterThermalTank(WaterThermalTankNum).Name - << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).Volume, 4) - << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).UseDesignVolFlowRate, 4) - << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).SourceDesignVolFlowRate, 4); + << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).Volume, 4) + << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).UseDesignVolFlowRate, 4) + << TrimSigDigits(WaterThermalTank(WaterThermalTankNum).SourceDesignVolFlowRate, 4); AlreadyReported(WaterThermalTankNum) = true; } diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 497f5b62b3d..9201768fe37 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -1287,7 +1287,7 @@ namespace WaterToAirHeatPump { // Set indoor air conditions to the actual condition LoadSideInletDBTemp_Unit = WatertoAirHP(HPNum).InletAirDBTemp; LoadSideInletHumRat_Unit = WatertoAirHP(HPNum).InletAirHumRat; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit, LoadSideInletDBTemp_Unit); + CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); LoadSideAirInletEnth_Unit = PsyHFnTdbW(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit); SourceSideInletTemp = WatertoAirHP(HPNum).InletWaterTemp; @@ -1920,7 +1920,7 @@ namespace WaterToAirHeatPump { LoadSideMassFlowRate = WatertoAirHP(HPNum).InletAirMassFlowRate; LoadSideInletDBTemp = WatertoAirHP(HPNum).InletAirDBTemp; LoadSideInletHumRat = WatertoAirHP(HPNum).InletAirHumRat; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat, LoadSideInletDBTemp); + CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); SourceSideInletTemp = WatertoAirHP(HPNum).InletWaterTemp; SourceSideWaterInletEnth = WatertoAirHP(HPNum).InletWaterEnthalpy; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index e5222366266..60de81f30e7 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include @@ -76,9 +77,8 @@ #include #include #include -#include -#include #include +#include namespace EnergyPlus { @@ -120,6 +120,7 @@ namespace WaterToAirHeatPumpSimple { using namespace DataSizing; using DataEnvironment::OutBaroPress; using DataEnvironment::StdBaroPress; + using DataHeatBalance::HeatReclaimSimple_WAHPCoil; using DataHVACGlobals::ContFanCycCoil; using DataHVACGlobals::Cooling; using DataHVACGlobals::CycFanCycCoil; @@ -130,7 +131,6 @@ namespace WaterToAirHeatPumpSimple { using DataHVACGlobals::WaterCycling; using DataPlant::TypeOf_CoilWAHPCoolingEquationFit; using DataPlant::TypeOf_CoilWAHPHeatingEquationFit; - using DataHeatBalance::HeatReclaimSimple_WAHPCoil; // Data // MODULE PARAMETER DEFINITIONS @@ -1408,7 +1408,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -1497,7 +1497,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else { @@ -1601,7 +1601,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -1688,7 +1688,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat, MixTemp); + Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else { @@ -2221,7 +2221,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletDBTemp_Init = 26.7; LoadSideInletHumRat_Init = 0.0111; LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init); - CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init, LoadSideInletDBTemp_Init); + CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init); firstTime = false; } LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, OutBaroPress, RoutineName); @@ -2293,7 +2293,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletHumRat_Unit = SimpleWatertoAirHP(HPNum).InletAirHumRat; LoadSideInletWBTemp_Unit = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit, OutBaroPress, RoutineName); LoadSideInletEnth_Unit = SimpleWatertoAirHP(HPNum).InletAirEnthalpy; - CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit, LoadSideInletDBTemp_Unit); + CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); while (true) { ++NumIteration; @@ -2385,7 +2385,7 @@ namespace WaterToAirHeatPumpSimple { Winput *= RuntimeFrac; QSource = QSource_fullload * PartLoadRatio; DataHeatBalance::HeatReclaimSimple_WAHPCoil(HPNum).AvailCapacity = QSource; - + // Add power to global variable so power can be summed by parent object DXElecCoolingPower = Winput; @@ -2393,7 +2393,8 @@ namespace WaterToAirHeatPumpSimple { DataHeatBalance::HeatReclaimHPCoilData &HeatReclaim = HeatReclaimSimple_WAHPCoil(HPNum); HeatReclaim.WaterHeatingDesuperheaterReclaimedHeatTotal = 0.0; if (allocated(HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat)) { - for (auto& num : HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat) HeatReclaim.WaterHeatingDesuperheaterReclaimedHeatTotal += num; + for (auto &num : HeatReclaim.WaterHeatingDesuperheaterReclaimedHeat) + HeatReclaim.WaterHeatingDesuperheaterReclaimedHeatTotal += num; } QSource -= HeatReclaim.WaterHeatingDesuperheaterReclaimedHeatTotal; @@ -2563,7 +2564,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp, LoadSideInletHumRat, OutBaroPress, RoutineName); LoadSideInletEnth = SimpleWatertoAirHP(HPNum).InletAirEnthalpy; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat, LoadSideInletDBTemp); + CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); SourceSideMassFlowRate = SimpleWatertoAirHP(HPNum).WaterMassFlowRate; SourceSideInletTemp = SimpleWatertoAirHP(HPNum).InletWaterTemp; SourceSideInletEnth = SimpleWatertoAirHP(HPNum).InletWaterEnthalpy; diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 58dcc51b31b..8bc43c17b9c 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -1256,7 +1256,7 @@ namespace WindowAC { InletNode = WindAC(WindACNum).AirInNode; AirMassFlow = Node(InletNode).MassFlowRate; Test = AirMassFlow; - CpAir = PsyCpAirFnWTdb(Node(InletNode).HumRat, Node(InletNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(InletNode).HumRat); OpMode = WindAC(WindACNum).OpMode; // set the on/off flags diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index b4fd9d397a6..07127233667 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -3319,7 +3319,7 @@ namespace WindowComplexManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3364,7 +3364,7 @@ namespace WindowComplexManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3930,8 +3930,8 @@ namespace WindowComplexManager { InletAirHumRat = OutHumRat; } ZoneTemp = MAT(ZoneNum); // this should be Tin (account for different reference temps) - CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat, TAirflowGapOutletC); - CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), ZoneTemp); + CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat); + CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); ConvHeatGainToZoneAir = TotAirflowGap * (CpAirOutlet * (TAirflowGapOutletC)-CpAirZone * ZoneTemp); if (SurfaceWindow(SurfNum).AirflowDestination == AirFlowWindow_Destination_IndoorAir) { SurfaceWindow(SurfNum).ConvHeatGainToZoneAir = ConvHeatGainToZoneAir; diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index c805db1a5bd..a5302df38f0 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -903,7 +903,7 @@ namespace WindowEquivalentLayer { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -947,7 +947,7 @@ namespace WindowEquivalentLayer { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index a1c84f030b0..23b23345c45 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -81,9 +81,9 @@ #include #include #include +#include #include #include -#include #include namespace EnergyPlus { @@ -886,9 +886,9 @@ namespace WindowManager { for (ILam = 1; ILam <= (int)wle.size(); ++ILam) { auto lam = wle(ILam); wlt(IGlass, ILam) = lam; - t(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngTransDataPtr,0.0,lam); - rff(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngFRefleDataPtr,0.0,lam); - rbb(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngBRefleDataPtr,0.0,lam); + t(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngTransDataPtr, 0.0, lam); + rff(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngFRefleDataPtr, 0.0, lam); + rbb(IGlass, ILam) = CurveManager::CurveValue(Material(LayPtr).GlassSpecAngBRefleDataPtr, 0.0, lam); } SolarSprectrumAverage(t, tmpTrans); SolarSprectrumAverage(rff, tmpReflectSolBeamFront); @@ -2680,7 +2680,7 @@ namespace WindowManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -2902,7 +2902,7 @@ namespace WindowManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3935,8 +3935,8 @@ namespace WindowManager { InletAirHumRat = OutHumRat; } ZoneTemp = MAT(ZoneNum); // this should be Tin (account for different reference temps) - CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat, TAirflowGapOutletC); - CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), ZoneTemp); + CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat); + CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); ConvHeatGainToZoneAir = TotAirflowGap * (CpAirOutlet * (TAirflowGapOutletC)-CpAirZone * ZoneTemp); if (SurfaceWindow(SurfNum).AirflowDestination == AirFlowWindow_Destination_IndoorAir) { SurfaceWindow(SurfNum).ConvHeatGainToZoneAir = ConvHeatGainToZoneAir; @@ -7684,71 +7684,82 @@ namespace WindowManager { if (DoReport && (HasWindows || HasComplexWindows || HasEQLWindows)) { // Write Descriptions - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Construction Name,Index,#Layers,Roughness,Conductance {W/m2-K},SHGC,Solar " - "Transmittance at Normal Incidence,Visible Transmittance at Normal Incidence"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Construction Name,Index,#Layers,Roughness,Conductance {W/m2-K},SHGC,Solar " + "Transmittance at Normal Incidence,Visible Transmittance at Normal Incidence"; if ((TotSimpleWindow > 0) || (W5GlsMat > 0) || (W5GlsMatAlt > 0)) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Optical Data Type, Spectral Data Set Name, " - "Thickness {m}, Solar Transmittance,Front Solar Reflectance, Back Solar Reflectance, Visible " - "Transmittance, Front Visible Reflectance,Back Visible Reflectance,Infrared Transmittance, " - "Front Thermal Emissivity, Back Thermal Emissivity,Conductivity {W/m-K},Dirt Factor,Solar " - "Diffusing"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Optical Data Type, Spectral Data Set Name, " + "Thickness {m}, Solar Transmittance,Front Solar Reflectance, Back Solar Reflectance, Visible " + "Transmittance, Front Visible Reflectance,Back Visible Reflectance,Infrared Transmittance, " + "Front Thermal Emissivity, Back Thermal Emissivity,Conductivity {W/m-K},Dirt Factor,Solar " + "Diffusing"; if ((W5GasMat > 0) || (W5GasMatMixture > 0)) ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Material Name,GasType,Thickness {m}"; if (TotShades > 0) ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Material Name,Thickness {m},Conductivity {W/m-K},Thermal " - "Absorptance,Transmittance,Visible Transmittance,Shade Reflectance"; + "Absorptance,Transmittance,Visible Transmittance,Shade Reflectance"; if (TotScreens > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Material Name,Thickness {m},Conductivity {W/m-K},Thermal " - "Absorptance,Transmittance,Reflectance,Visible Reflectance,Diffuse Reflectance,Diffuse Visible " - "Reflectance,Screen Material Diameter To Spacing Ratio,Screen To GlassDistance {m}"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Material Name,Thickness {m},Conductivity {W/m-K},Thermal " + "Absorptance,Transmittance,Reflectance,Visible Reflectance,Diffuse Reflectance,Diffuse Visible " + "Reflectance,Screen Material Diameter To Spacing Ratio,Screen To GlassDistance {m}"; if (TotBlinds > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Material Name,Slat Width {m},Slat Separation {m},Slat Thickness " - "{m},Slat Angle {deg},Slat Beam Solar Transmittance,Slat Beam Solar Front Reflectance,Blind To " - "Glass Distance {m}"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Material Name,Slat Width {m},Slat Separation {m},Slat Thickness " + "{m},Slat Angle {deg},Slat Beam Solar Transmittance,Slat Beam Solar Front Reflectance,Blind To " + "Glass Distance {m}"; if (HasComplexWindows) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Construction Name,Index,#Layers,U-factor {W/m2-K},SHGC"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Construction Name,Index,#Layers,U-factor {W/m2-K},SHGC"; if (HasEQLWindows) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! ,Construction Name,Index,#Layers,U-factor {W/m2-K},SHGC, " - "Solar Transmittance at Normal Incidence"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! ,Construction Name,Index,#Layers,U-factor {W/m2-K},SHGC, " + "Solar Transmittance at Normal Incidence"; if (W5GlsMatEQL > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Optical Data Type, Spectral Data " - "Set Name, Front Side Beam-Beam Solar Transmittance, Back Side Beam-Beam Solar Transmittance, " - "Front Side Beam-Beam Solar Reflectance, Back Side Beam-Beam Solar Reflectance, Front Side " - "Beam-Diffuse Solar Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side " - "Beam-Diffuse Solar Reflectance, Back Side Beam-Diffuse Solar Reflectance, Diffuse-Diffuse " - "Solar Transmittance, Front Side Diffuse-Diffuse Solar Reflectance, Back Side Diffuse-Diffuse " - "Solar Reflectance, Infrared Transmittance, Front Side Infrared Emissivity, Back Side Infrared " - "Emissivity"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Optical Data Type, Spectral Data " + "Set Name, Front Side Beam-Beam Solar Transmittance, Back Side Beam-Beam Solar Transmittance, " + "Front Side Beam-Beam Solar Reflectance, Back Side Beam-Beam Solar Reflectance, Front Side " + "Beam-Diffuse Solar Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side " + "Beam-Diffuse Solar Reflectance, Back Side Beam-Diffuse Solar Reflectance, Diffuse-Diffuse " + "Solar Transmittance, Front Side Diffuse-Diffuse Solar Reflectance, Back Side Diffuse-Diffuse " + "Solar Reflectance, Infrared Transmittance, Front Side Infrared Emissivity, Back Side Infrared " + "Emissivity"; if (TotShadesEQL > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Front Side Beam-Beam Solar " - "Transmittance, Back Side Beam-Beam Solar Transmittance, Front Side Beam-Diffuse Solar " - "Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side Beam-Diffuse Solar " - "Reflectance, Back Side Beam-Diffuse Solar Reflectance, Infrared Transmittance, Front Side " - "Infrared Emissivity, Back Side Infrared Emissivity"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Front Side Beam-Beam Solar " + "Transmittance, Back Side Beam-Beam Solar Transmittance, Front Side Beam-Diffuse Solar " + "Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side Beam-Diffuse Solar " + "Reflectance, Back Side Beam-Diffuse Solar Reflectance, Infrared Transmittance, Front Side " + "Infrared Emissivity, Back Side Infrared Emissivity"; if (TotDrapesEQL > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Front Side Beam-Beam Solar " - "Transmittance, Back Side Beam-Beam Solar Transmittance, Front Side Beam-Diffuse Solar " - "Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side Beam-Diffuse Solar " - "Reflectance, Back Side Beam-Diffuse Solar Reflectance, Infrared Transmittance, Front Side " - "Infrared Emissivity, Back Side Infrared Emissivity, Width of Pleated Fabric, Length of Pleated " - "Fabric"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Front Side Beam-Beam Solar " + "Transmittance, Back Side Beam-Beam Solar Transmittance, Front Side Beam-Diffuse Solar " + "Transmittance, Back Side Beam-Diffuse Solar Transmittance, , Front Side Beam-Diffuse Solar " + "Reflectance, Back Side Beam-Diffuse Solar Reflectance, Infrared Transmittance, Front Side " + "Infrared Emissivity, Back Side Infrared Emissivity, Width of Pleated Fabric, Length of Pleated " + "Fabric"; if (TotBlindsEQL > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Slat Orientation, Slat Width, Slat " - "Separation, Slat Crown, Slat Angle, Front Side Slate Beam-Diffuse Solar Transmittance, Back " - "Side Slate Beam-Diffuse Solar Transmittance, Front Side Slate Beam-Diffuse Solar Reflectance, " - "Back Side Slate Beam-Diffuse Solar Reflectance, Slat Diffuse-Diffuse Solar Transmittance, " - "Front Side Slat Diffuse-Diffuse Solar Reflectance, Back Side Slat Diffuse-Diffuse Solar " - "Reflectance, Infrared Transmittance, Front Side Infrared Emissivity, Back Side Infrared " - "Emissivity, Slat Angle Control"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Slat Orientation, Slat Width, Slat " + "Separation, Slat Crown, Slat Angle, Front Side Slate Beam-Diffuse Solar Transmittance, Back " + "Side Slate Beam-Diffuse Solar Transmittance, Front Side Slate Beam-Diffuse Solar Reflectance, " + "Back Side Slate Beam-Diffuse Solar Reflectance, Slat Diffuse-Diffuse Solar Transmittance, " + "Front Side Slat Diffuse-Diffuse Solar Reflectance, Back Side Slat Diffuse-Diffuse Solar " + "Reflectance, Infrared Transmittance, Front Side Infrared Emissivity, Back Side Infrared " + "Emissivity, Slat Angle Control"; if (TotScreensEQL > 0) - ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, Screen Beam-Beam Solar " - "Transmittance, Screen Beam-Diffuse Solar Transmittance, Screen Beam-Diffuse Solar Reflectance, " - "Screen Infrared Transmittance, Screen Infrared Emissivity, Screen Wire Spacing, Screen Wire " - "Diameter"; + ObjexxFCL::gio::write(OutputFileInits, fmtA) + << "! , Material Name, Screen Beam-Beam Solar " + "Transmittance, Screen Beam-Diffuse Solar Transmittance, Screen Beam-Diffuse Solar Reflectance, " + "Screen Infrared Transmittance, Screen Infrared Emissivity, Screen Wire Spacing, Screen Wire " + "Diameter"; if (W5GapMatEQL > 0) ObjexxFCL::gio::write(OutputFileInits, fmtA) << "! , Material Name, GasType, Gap Thickness {m}, Gap Vent Type"; @@ -7824,7 +7835,7 @@ namespace WindowManager { auto const SELECT_CASE_var(Material(Layer).Group); if (SELECT_CASE_var == WindowGas) { ObjexxFCL::gio::write(OutputFileInits, Format_702) << Material(Layer).Name << GasTypeName(Material(Layer).GasType(1)) - << RoundSigDigits(Material(Layer).Thickness, 3); + << RoundSigDigits(Material(Layer).Thickness, 3); //! fw CASE(WindowGasMixture) @@ -7941,7 +7952,7 @@ namespace WindowManager { GapVentType = "VentedOutdoor"; } ObjexxFCL::gio::write(OutputFileInits, Format_713) << Material(Layer).Name << GasTypeName(Material(Layer).GasType(1)) - << RoundSigDigits(Material(Layer).Thickness, 3) << GapVentType; + << RoundSigDigits(Material(Layer).Thickness, 3) << GapVentType; } } } @@ -8390,9 +8401,11 @@ namespace WindowManager { } } - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << "MATERIAL:WINDOWSCREEN:" + Material(SurfaceScreens(ScreenNum).MaterialNumber).Name; - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << "Tabular data for beam solar transmittance at varying \"relative\" azimuth (row) and " - "altitude (column) angles (deg) [relative to surface normal]."; + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) + << "MATERIAL:WINDOWSCREEN:" + Material(SurfaceScreens(ScreenNum).MaterialNumber).Name; + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) + << "Tabular data for beam solar transmittance at varying \"relative\" azimuth (row) and " + "altitude (column) angles (deg) [relative to surface normal]."; { IOFlags flags; flags.ADVANCE("No"); @@ -8402,7 +8415,8 @@ namespace WindowManager { { IOFlags flags; flags.ADVANCE("No"); - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA, flags) << "," + RoundSigDigits(((i - 1) * Material(MatNum).ScreenMapResolution)); + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA, flags) + << "," + RoundSigDigits(((i - 1) * Material(MatNum).ScreenMapResolution)); } } ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << ",0"; @@ -8425,14 +8439,17 @@ namespace WindowManager { ObjexxFCL::gio::write(ScreenTransUnitNo); ObjexxFCL::gio::write(ScreenTransUnitNo); - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << "MATERIAL:WINDOWSCREEN:" + Material(SurfaceScreens(ScreenNum).MaterialNumber).Name; - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << "Tabular data for scattered solar transmittance at varying \"relative\" azimuth (row) and " - "altitude (column) angles (deg) [relative to surface normal]."; + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) + << "MATERIAL:WINDOWSCREEN:" + Material(SurfaceScreens(ScreenNum).MaterialNumber).Name; + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) + << "Tabular data for scattered solar transmittance at varying \"relative\" azimuth (row) and " + "altitude (column) angles (deg) [relative to surface normal]."; for (i = 1; i <= 90 / Material(MatNum).ScreenMapResolution; ++i) { { IOFlags flags; flags.ADVANCE("No"); - ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA, flags) << "," + RoundSigDigits(((i - 1) * Material(MatNum).ScreenMapResolution)); + ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA, flags) + << "," + RoundSigDigits(((i - 1) * Material(MatNum).ScreenMapResolution)); } } ObjexxFCL::gio::write(ScreenTransUnitNo, fmtA) << "," + RoundSigDigits(((i - 1) * Material(MatNum).ScreenMapResolution)); diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 6773f0680a8..70bf59a47ad 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -891,9 +891,7 @@ namespace ZoneAirLoopEquipmentManager { // SysOutputProvided >0 Zone is heated SpecHumOut = Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).HumRat; SpecHumIn = Node(ZoneEquipConfig(ControlledZoneNum).ZoneNode).HumRat; - Real64 CpAirAvg = - PsyCpAirFnWTdb(0.5 * (SpecHumOut + SpecHumOut), - 0.5 * (Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).Temp + Node(ZoneEquipConfig(ControlledZoneNum).ZoneNode).Temp)); + Real64 CpAirAvg = PsyCpAirFnWTdb(0.5 * (SpecHumOut + SpecHumOut)); SysOutputProvided = Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).MassFlowRate * CpAirAvg * (Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).Temp - Node(ZoneEquipConfig(ControlledZoneNum).ZoneNode).Temp); // AirDistUnit( AirDistUnitNum ).HeatRate = max( 0.0, SysOutputProvided ); diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index bbc1596a165..d97ab6f7d99 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -2374,7 +2374,7 @@ namespace ZoneContaminantPredictorCorrector { zone_M_CO2 = Zone(ZoneNum).ZoneMeasuredCO2Concentration; delta_CO2 = (Zone(ZoneNum).ZoneMeasuredCO2Concentration - OutdoorCO2) / 1000; - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneNum).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineNameInfiltration); if (Zone(ZoneNum).ZoneMeasuredCO2Concentration == OutdoorCO2) { diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index b41fe0c8d9c..056c885db2e 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -399,13 +399,12 @@ namespace ZoneDehumidifier { ErrorsFound = true; } else { // Verify Curve object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims( - ZoneDehumid(ZoneDehumidIndex).WaterRemovalCurveIndex, // Curve index - {2}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - ZoneDehumid(ZoneDehumidIndex).Name, // Object Name - cAlphaFields(5)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(ZoneDehumid(ZoneDehumidIndex).WaterRemovalCurveIndex, // Curve index + {2}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + ZoneDehumid(ZoneDehumidIndex).Name, // Object Name + cAlphaFields(5)); // Field Name if (!ErrorsFound) { CurveVal = CurveValue(ZoneDehumid(ZoneDehumidIndex).WaterRemovalCurveIndex, RatedInletAirTemp, RatedInletAirRH); @@ -430,13 +429,12 @@ namespace ZoneDehumidifier { ErrorsFound = true; } else { // Verify Curve Object, only legal type is BiQuadratic - ErrorsFound |= CurveManager::CheckCurveDims( - ZoneDehumid(ZoneDehumidIndex).EnergyFactorCurveIndex, // Curve index - {2}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - ZoneDehumid(ZoneDehumidIndex).Name, // Object Name - cAlphaFields(6)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(ZoneDehumid(ZoneDehumidIndex).EnergyFactorCurveIndex, // Curve index + {2}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + ZoneDehumid(ZoneDehumidIndex).Name, // Object Name + cAlphaFields(6)); // Field Name if (!ErrorsFound) { CurveVal = CurveValue(ZoneDehumid(ZoneDehumidIndex).EnergyFactorCurveIndex, RatedInletAirTemp, RatedInletAirRH); @@ -461,13 +459,12 @@ namespace ZoneDehumidifier { ErrorsFound = true; } else { // Verify Curve Object, legal types are Quadratic and Cubic - ErrorsFound |= CurveManager::CheckCurveDims( - ZoneDehumid(ZoneDehumidIndex).PartLoadCurveIndex, // Curve index - {1}, // Valid dimensions - RoutineName, // Routine name - CurrentModuleObject, // Object Type - ZoneDehumid(ZoneDehumidIndex).Name, // Object Name - cAlphaFields(7)); // Field Name + ErrorsFound |= CurveManager::CheckCurveDims(ZoneDehumid(ZoneDehumidIndex).PartLoadCurveIndex, // Curve index + {1}, // Valid dimensions + RoutineName, // Routine name + CurrentModuleObject, // Object Type + ZoneDehumid(ZoneDehumidIndex).Name, // Object Name + cAlphaFields(7)); // Field Name } // N4, \field Minimum Dry-Bulb Temperature for Dehumidifier Operation @@ -1001,7 +998,7 @@ namespace ZoneDehumidifier { Node(AirInletNodeNum).MassFlowRate = ZoneDehumid(ZoneDehumNum).RatedAirMassFlow * PLR; AirMassFlowRate = Node(AirInletNodeNum).MassFlowRate; // Average air mass flow for this timestep - Cp = PsyCpAirFnWTdb(InletAirHumRat, InletAirTemp); // Heat capacity of air + Cp = PsyCpAirFnWTdb(InletAirHumRat); // Heat capacity of air if (AirMassFlowRate > 0.0 && Cp > 0.0) { OutletAirTemp = InletAirTemp + (ElectricPowerOnCycle + (WaterRemovalMassRate * hfg)) / (ZoneDehumid(ZoneDehumNum).RatedAirMassFlow * Cp); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 7bea935d5e3..77694e7b4b1 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -670,7 +670,7 @@ namespace ZoneEquipmentManager { HR90L, DOASSupplyTemp, DOASSupplyHumRat); - DOASCpAir = PsyCpAirFnWTdb(DOASSupplyHumRat, DOASSupplyTemp); + DOASCpAir = PsyCpAirFnWTdb(DOASSupplyHumRat); DOASSysOutputProvided = DOASMassFlowRate * DOASCpAir * (DOASSupplyTemp - Node(ZoneNode).Temp); TotDOASSysOutputProvided = DOASMassFlowRate * (PsyHFnTdbW(DOASSupplyTemp, DOASSupplyHumRat) - PsyHFnTdbW(Node(ZoneNode).Temp, Node(ZoneNode).HumRat)); @@ -741,7 +741,7 @@ namespace ZoneEquipmentManager { Enthalpy = PsyHFnTdbW(Temp, HumRat); SysOutputProvided = ZoneSysEnergyDemand(ActualZoneNum).RemainingOutputRequired; - CpAir = PsyCpAirFnWTdb(HumRat, Temp); + CpAir = PsyCpAirFnWTdb(HumRat); if (std::abs(DeltaTemp) > SmallTempDiff) { //!!PH/WFB/LKL (UCDV model) MassFlowRate = SysOutputProvided / (CpAir*DeltaTemp) MassFlowRate = max(SysOutputProvided / (CpAir * DeltaTemp), 0.0); @@ -5300,7 +5300,7 @@ namespace ZoneEquipmentManager { // cases the heat to return air is treated as a zone heat gain and dealt with in CalcZoneSums in // MODULE ZoneTempPredictorCorrector. if (!Zone(ActualZoneNum).NoHeatToReturnAir) { - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat, Node(ZoneNode).Temp); + CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); if (MassFlowRA > 0.0) { if (WinGapFlowToRA > 0.0) { // Add heat-to-return from window gap airflow @@ -5698,7 +5698,7 @@ namespace ZoneEquipmentManager { EnthalpyExt = OutEnthalpy; } AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, TempExt, HumRatExt); - CpAir = PsyCpAirFnWTdb(HumRatExt, TempExt); + CpAir = PsyCpAirFnWTdb(HumRatExt); // CR7751 should maybe use code below, indoor conditions instead of outdoor conditions // AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZMAT(NZ), ZHumRat(NZ)) // CpAir = PsyCpAirFnWTdb(ZHumRat(NZ),ZMAT(NZ)) @@ -6007,7 +6007,7 @@ namespace ZoneEquipmentManager { // RhoAirM = PsyRhoAirFnPbTdbW(OutBaroPress,tzm,ZHumRat(m)) // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0); - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0, (TZN + TZM) / 2.0); // Use average conditions + CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6038,7 +6038,7 @@ namespace ZoneEquipmentManager { // RhoAirM = PsyRhoAirFnPbTdbW(OutBaroPress,tzm,ZHumRat(m)) // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0); // Use avg conditions - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0, (TZN + TZM) / 2.0); // Use average conditions + CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6068,7 +6068,7 @@ namespace ZoneEquipmentManager { // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0, RoutineNameMixing); // Use avg conditions - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0, (TZN + TZM) / 2.0); // Use average conditions + CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6203,7 +6203,7 @@ namespace ZoneEquipmentManager { Tavg = (TZN + TZM) / 2.0; Wavg = (ZHumRat(n) + ZHumRat(m)) / 2.0; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Tavg, Wavg, RoutineNameCrossMixing); - CpAir = PsyCpAirFnWTdb(Wavg, Tavg); + CpAir = PsyCpAirFnWTdb(Wavg); MCPxN = CrossMixing(j).DesiredAirFlowRate * CpAir * AirDensity; MCPM(n) += MCPxN; @@ -6243,9 +6243,9 @@ namespace ZoneEquipmentManager { HumRatZoneA = ZHumRat(ZoneA); HumRatZoneB = ZHumRat(ZoneB); AirDensityZoneA = PsyRhoAirFnPbTdbW(OutBaroPress, TZoneA, HumRatZoneA, RoutineNameRefrigerationDoorMixing); - CpAirZoneA = PsyCpAirFnWTdb(HumRatZoneA, TZoneA); + CpAirZoneA = PsyCpAirFnWTdb(HumRatZoneA); AirDensityZoneB = PsyRhoAirFnPbTdbW(OutBaroPress, TZoneB, HumRatZoneB, RoutineNameRefrigerationDoorMixing); - CpAirZoneB = PsyCpAirFnWTdb(HumRatZoneB, TZoneB); + CpAirZoneB = PsyCpAirFnWTdb(HumRatZoneB); Tavg = (TZoneA + TZoneB) / 2.0; Wavg = (HumRatZoneA + HumRatZoneB) / 2.0; AirDensityAvg = PsyRhoAirFnPbTdbW(OutBaroPress, Tavg, Wavg, RoutineNameRefrigerationDoorMixing); @@ -6330,7 +6330,7 @@ namespace ZoneEquipmentManager { } AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, TempExt, HumRatExt, RoutineNameInfiltration); - CpAir = PsyCpAirFnWTdb(HumRatExt, TempExt); + CpAir = PsyCpAirFnWTdb(HumRatExt); // CR7751 should maybe use code below, indoor conditions instead of outdoor conditions // AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZMAT(NZ), ZHumRat(NZ)) @@ -6452,7 +6452,7 @@ namespace ZoneEquipmentManager { } NZ = ZoneAirBalance(j).ZonePtr; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(NZ).OutDryBulbTemp, HumRatExt, RoutineNameZoneAirBalance); - CpAir = PsyCpAirFnWTdb(HumRatExt, Zone(NZ).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(HumRatExt); ZoneAirBalance(j).ERVMassFlowRate *= AirDensity; MDotOA(NZ) = std::sqrt(pow_2(ZoneAirBalance(j).NatMassFlowRate) + pow_2(ZoneAirBalance(j).IntMassFlowRate) + diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 7ce17b9c811..e42d9a1b73a 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -491,8 +491,9 @@ namespace ZoneTempPredictorCorrector { Array1D TComfortControlTypes; // Formats - static ObjexxFCL::gio::Fmt Format_700("('! , Sensible Heat Capacity Multiplier, Moisture Capacity Multiplier, " - "','Carbon Dioxide Capacity Multiplier, Generic Contaminant Capacity Multiplier')"); + static ObjexxFCL::gio::Fmt Format_700( + "('! , Sensible Heat Capacity Multiplier, Moisture Capacity Multiplier, " + "','Carbon Dioxide Capacity Multiplier, Generic Contaminant Capacity Multiplier')"); static ObjexxFCL::gio::Fmt Format_701("('Zone Volume Capacitance Multiplier,',F8.3,' ,',F8.3,',',F8.3,',',F8.3)"); // FLOW: @@ -1885,7 +1886,8 @@ namespace ZoneTempPredictorCorrector { } ObjexxFCL::gio::write(OutputFileInits, Format_700); - ObjexxFCL::gio::write(OutputFileInits, Format_701) << ZoneVolCapMultpSens << ZoneVolCapMultpMoist << ZoneVolCapMultpCO2 << ZoneVolCapMultpGenContam; + ObjexxFCL::gio::write(OutputFileInits, Format_701) + << ZoneVolCapMultpSens << ZoneVolCapMultpMoist << ZoneVolCapMultpCO2 << ZoneVolCapMultpGenContam; cCurrentModuleObject = cZControlTypes(iZC_OTTStat); NumOpTempControlledZones = inputProcessor->getNumObjectsFound(cCurrentModuleObject); @@ -3695,8 +3697,8 @@ namespace ZoneTempPredictorCorrector { } AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)) / (TimeStepSys * SecInHour); + PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) * PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / + (TimeStepSys * SecInHour); AirCap = AIRRAT(ZoneNum); RAFNFrac = 0.0; @@ -4979,7 +4981,7 @@ namespace ZoneTempPredictorCorrector { AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum), RoutineName) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AirCap = AIRRAT(ZoneNum); @@ -5083,7 +5085,7 @@ namespace ZoneTempPredictorCorrector { } // Sensible load is the enthalpy into the zone minus the enthalpy that leaves the zone. - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), Node(ZoneNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); ZoneEnthalpyIn = SumSysMCpT; // SNLOAD is the single zone load, without Zone Multiplier or Zone List Multiplier @@ -5858,7 +5860,7 @@ namespace ZoneTempPredictorCorrector { GetCurrentScheduleValue(HybridModelZone(ZoneNum).ZoneSupplyAirHumidityRatioSchedulePtr); // Calculate the air humidity ratio at supply air inlet. Real64 CpAirInlet(0.0); - CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio, Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature); + CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); SumSysMCp_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet; SumSysMCpT_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet * Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature; @@ -5877,7 +5879,7 @@ namespace ZoneTempPredictorCorrector { zone_M_T = Zone(ZoneNum).ZoneMeasuredTemperature; delta_T = (Zone(ZoneNum).ZoneMeasuredTemperature - Zone(ZoneNum).OutDryBulbTemp); - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneNum).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineNameInfiltration); Zone(ZoneNum).delta_T = delta_T; @@ -5932,7 +5934,7 @@ namespace ZoneTempPredictorCorrector { if (std::abs(ZT(ZoneNum) - PreviousMeasuredZT1(ZoneNum)) > 0.05) { // Filter MultpHM = AirCapHM / (Zone(ZoneNum).Volume * PsyRhoAirFnPbTdbW(OutBaroPress, ZT(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), ZT(ZoneNum))) * + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))) * (TimeStepZone * SecInHour); // Inverse equation if ((MultpHM < 1.0) || (MultpHM > 30.0)) { // Temperature capacity multiplier greater than // 1 and less than 30 @@ -6000,7 +6002,7 @@ namespace ZoneTempPredictorCorrector { // Calculate the air humidity ratio at supply air inlet. Real64 CpAirInlet(0.0); - CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio, Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature); + CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); SumSysMCp_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet; SumSysMCpT_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet * Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature; @@ -6113,7 +6115,7 @@ namespace ZoneTempPredictorCorrector { zone_M_HR = Zone(ZoneNum).ZoneMeasuredHumidityRatio; delta_HR = (Zone(ZoneNum).ZoneMeasuredHumidityRatio - OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat, Zone(ZoneNum).OutDryBulbTemp); + CpAir = PsyCpAirFnWTdb(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineName); if (std::abs(Zone(ZoneNum).ZoneMeasuredHumidityRatio - OutHumRat) < 0.0000001) { @@ -6314,7 +6316,7 @@ namespace ZoneTempPredictorCorrector { auto const &node(Node(zec.InletNode(NodeNum))); NodeTemp = node.Temp; MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; @@ -6330,7 +6332,7 @@ namespace ZoneTempPredictorCorrector { auto const &node(Node(zrpc.InletNode(NodeNum))); NodeTemp = node.Temp; MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnWTdb(air_hum_rat, NodeTemp); + CpAir = PsyCpAirFnWTdb(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; @@ -6344,7 +6346,7 @@ namespace ZoneTempPredictorCorrector { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(air_hum_rat, NodeTemp); + CpAir = PsyCpAirFnWTdb(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; @@ -6353,7 +6355,7 @@ namespace ZoneTempPredictorCorrector { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(air_hum_rat, NodeTemp); + CpAir = PsyCpAirFnWTdb(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; @@ -6365,7 +6367,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; @@ -6628,7 +6630,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); @@ -6636,7 +6638,7 @@ namespace ZoneTempPredictorCorrector { if (ADUNum > 0) { NodeTemp = Node(AirDistUnit(ADUNum).OutletNodeNum).Temp; MassFlowRate = Node(AirDistUnit(ADUNum).OutletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); ADUHeatAddRate = MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); AirDistUnit(ADUNum).HeatRate = max(0.0, ADUHeatAddRate); AirDistUnit(ADUNum).CoolRate = std::abs(min(0.0, ADUHeatAddRate)); @@ -6648,7 +6650,7 @@ namespace ZoneTempPredictorCorrector { if (SDUNum > 0) { NodeTemp = Node(DirectAir(SDUNum).ZoneSupplyAirNode).Temp; MassFlowRate = Node(DirectAir(SDUNum).ZoneSupplyAirNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SDUHeatAddRate = MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); DirectAir(SDUNum).HeatRate = max(SDUHeatAddRate, 0.0); DirectAir(SDUNum).CoolRate = std::abs(min(SDUHeatAddRate, 0.0)); @@ -6664,7 +6666,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); @@ -6676,14 +6678,14 @@ namespace ZoneTempPredictorCorrector { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } if (AirDistUnit(ADUNum).DownStreamLeak) { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } } @@ -6693,7 +6695,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } @@ -6726,7 +6728,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; @@ -6801,7 +6803,7 @@ namespace ZoneTempPredictorCorrector { // now calculate air energy storage source term. // capacitance is volume * density * heat capacity - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum)); + CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); { diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc index 38082c511ab..0fa3e45cf15 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc @@ -351,8 +351,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) Node(ZoneAirNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(ZoneAirNodeNum).Temp, Node(ZoneAirNodeNum).HumRat); ; // calculate the heating rate provided by TA unit - Real64 CpAir = - PsyCpAirFnWTdb(0.5 * (Node(InletNode).HumRat + Node(ZoneAirNodeNum).HumRat), 0.5 * (Node(InletNode).Temp + Node(ZoneAirNodeNum).Temp)); + Real64 CpAir = PsyCpAirFnWTdb(0.5 * (Node(InletNode).HumRat + Node(ZoneAirNodeNum).HumRat)); Real64 SensHeatRateProvided = MassFlowRateMaxAvail * CpAir * (Node(InletNode).Temp - Node(ZoneAirNodeNum).Temp); // set inlet mass flow rate to zero diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index e33753a9d77..bce961808b4 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -51,13 +51,14 @@ #include // EnergyPlus Headers -#include #include #include #include #include #include #include +#include +#include #include #include #include @@ -67,7 +68,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -2839,7 +2839,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatRetTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesOutAirVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0, 20.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { @@ -4019,7 +4019,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnPrimaryAirSystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatOutTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0, 20.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { @@ -5440,7 +5440,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) RegCoilDesOutletTemp = DesiccantDehumidifiers::DesicDehum(DesicDehumNum).RegenSetPointTemp; DataSizing::FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow = 1.07; RegCoilInletAirMassFlowRate = DataEnvironment::StdRhoAir * DataSizing::FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0, 20.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); // simulate to determine HW coil design capacity SimDesiccantDehumidifier(CompName, FirstHVACIteration, CompIndex); @@ -6686,7 +6686,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_VSCoolingCoilOnPrimaryAirSystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatOutTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0, 20.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { diff --git a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc index 4cd7fe62374..44e25bb8c4f 100644 --- a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc +++ b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc @@ -48,6 +48,7 @@ #include // EnergyPlus Headers +#include "Fixtures/EnergyPlusFixture.hh" #include #include #include @@ -57,7 +58,6 @@ #include #include #include -#include "Fixtures/EnergyPlusFixture.hh" #include #include #include @@ -464,7 +464,7 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1) mySys->simulate(compName, FirstHVACIteration, AirLoopNum, CompIndex, HeatingActive, CoolingActive, OAUnitNum, OAUCoilOutTemp, zoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -496,7 +496,7 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1) mySys->simulate(compName, FirstHVACIteration, AirLoopNum, CompIndex, HeatingActive, CoolingActive, OAUnitNum, OAUCoilOutTemp, zoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index 32ed553bf42..c8ca9a53c09 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -55,12 +55,12 @@ #include "Fixtures/EnergyPlusFixture.hh" #include #include +#include #include #include #include #include #include -#include using namespace EnergyPlus; using namespace ObjexxFCL; @@ -2036,9 +2036,10 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim) EXPECT_NEAR(11.6, WaterCoil(1).OutletAirTemp, 0.01); // preheat hot water coil is on and is heating the OA air stream AirInletNodeNum = WaterCoil(1).AirInletNodeNum; - CpAir = PsyCpAirFnWTdb(Node(AirInletNodeNum).HumRat, Node(AirInletNodeNum).Temp); + CpAir = PsyCpAirFnWTdb(Node(AirInletNodeNum).HumRat); EXPECT_NEAR(WaterCoil(1).TotWaterHeatingCoilRate, - WaterCoil(1).InletAirMassFlowRate * CpAir * (WaterCoil(1).OutletAirTemp - WaterCoil(1).InletAirTemp), 1.0); + WaterCoil(1).InletAirMassFlowRate * CpAir * (WaterCoil(1).OutletAirTemp - WaterCoil(1).InletAirTemp), + 1.0); // test that OA sys water coil bypasses normal controller calls before air loop simulation EXPECT_EQ("PREHEAT COIL CONTROLLER", HVACControllers::ControllerProps(1).ControllerName); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 0b038465c1a..1fa182fbee2 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -52,7 +52,6 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" -#include #include #include #include @@ -61,19 +60,20 @@ #include #include #include +#include #include #include #include -#include -#include -#include #include #include #include #include +#include #include #include #include +#include +#include using namespace EnergyPlus; using namespace EnergyPlus::CurveManager; @@ -662,7 +662,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_WaterCoolingCoilAutoSizeTest) // calculate fan heat to get fan air-side delta T DataSizing::DataFanEnumType = DataAirSystems::objectVectorOOFanSystemModel; DataSizing::DataFanIndex = 0; - DataSizing::DataAirFlowUsedForSizing = FinalZoneSizing( CurZoneEqNum ).DesCoolVolFlow; + DataSizing::DataAirFlowUsedForSizing = FinalZoneSizing(CurZoneEqNum).DesCoolVolFlow; Real64 FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); // do water flow rate sizing calculation @@ -969,7 +969,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) Real64 DesCoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; Real64 DesAirMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow; // DesVolFlow = DesMassFlow / RhoAirStd; - Real64 CpAirAvg = PsyCpAirFnWTdb(DesCoilOutHumRat, 0.5 * (DesCoilInTemp + DesCoilOutTemp)); + Real64 CpAirAvg = PsyCpAirFnWTdb(DesCoilOutHumRat); Real64 DesSteamCoilLoad = DesAirMassFlow * CpAirAvg * (DesCoilOutTemp - DesCoilInTemp); // do steam flow rate sizing calculation diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index bf908aa41fd..94f905e3488 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -67,10 +67,10 @@ #include #include #include +#include #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -294,9 +294,9 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) RhoVaporAirIn(1) = PsyRhovFnTdbWPb(MAT(ZoneNum), ZoneAirHumRat(ZoneNum), OutBaroPress); RhoVaporAirIn(2) = PsyRhovFnTdbWPb(MAT(ZoneNum), ZoneAirHumRat(ZoneNum), OutBaroPress); HMassConvInFD(1) = HConvIn(1) / ((PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) + RhoVaporAirIn(1)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum))); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))); HMassConvInFD(2) = HConvIn(2) / ((PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) + RhoVaporAirIn(2)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), MAT(ZoneNum))); + PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))); RoomAirNode = 1; auto &thisRAFN(RAFN(ZoneNum)); diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 0f473bb2bb3..16942d0deeb 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -57,6 +57,8 @@ // EnergyPlus Headers #include "Fixtures/EnergyPlusFixture.hh" +#include +#include #include #include #include @@ -67,23 +69,20 @@ #include #include #include -#include -#include #include #include #include +#include +#include #include +#include +#include +#include #include #include #include #include #include -#include -#include -#include -#include -#include -#include using namespace EnergyPlus; @@ -438,8 +437,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) // first pass through, leave totEnergyPrevious == 0 to kick things off but initialize current energy totEnergy = 1000.0; - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); // the values should be initialized // the setpoint should be set to max - 1 @@ -453,8 +456,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) // second pass through, continue the optimization by having it find a lower energy usage totEnergy = 800.0; - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); // the optimization should decrement the setpoint and continue searching, storing this energy for next time EXPECT_NEAR(23, condenserWaterSetPoint, 0.0001); @@ -463,8 +470,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) // third pass through have it pass the optimal point by going higher energy totEnergy = 900; - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); // the optimization should realize it passed the optimal point, back track and then set the sub-optimazation flags EXPECT_NEAR(23.8, condenserWaterSetPoint, 0.0001); @@ -474,8 +485,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) // fourth pass through it will be doing the sub-optimization search; perform one search; energy goes down this time totEnergyPrevious = 900; totEnergy = 890; - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); // the optimization should realize it has yet again overshot and start trying to work downward carefully EXPECT_NEAR(23.6, condenserWaterSetPoint, 0.0001); @@ -484,8 +499,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) // fifth pass through it will have hit the optimal point; it will set the setpoint back and set the final run flags totEnergy = 895; - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); // the optimization should increment the energy back to where it was, and set the final flags EXPECT_NEAR(23.8, condenserWaterSetPoint, 0.0001); @@ -494,8 +513,12 @@ TEST_F(EnergyPlusFixture, SetPointManager_setupSetPointAndFlags) EXPECT_TRUE(statusRunFinalOptimalCondenserEnteringTemp); // and finally, the sixth pass through when it is set to run final; totEnergy doesn't matter when that flag is true, and the sp shouldn't change - thisSPM.setupSetPointAndFlags(totEnergy, totEnergyPrevious, condenserWaterSetPoint, condenserWaterSetPointLimit, - statusRunOptimalCondenserEnteringTemp, statusRunSubOptimalCondenserEnteringTemp, + thisSPM.setupSetPointAndFlags(totEnergy, + totEnergyPrevious, + condenserWaterSetPoint, + condenserWaterSetPointLimit, + statusRunOptimalCondenserEnteringTemp, + statusRunSubOptimalCondenserEnteringTemp, statusRunFinalOptimalCondenserEnteringTemp); EXPECT_NEAR(23.8, condenserWaterSetPoint, 0.0001); EXPECT_FALSE(statusRunOptimalCondenserEnteringTemp); @@ -583,35 +606,71 @@ TEST_F(EnergyPlusFixture, SZRHOAFractionImpact) DataZoneEnergyDemands::DeadBandOrSetback.allocate(1); DataAirSystems::PrimaryAirSystem.allocate(1); - DataAirSystems::PrimaryAirSystem(1).OASysOutletNodeNum = - NodeInputManager::GetOnlySingleNode("FAN INLET NODE", ErrorsFound, "FAN", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Internal, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); - DataAirSystems::PrimaryAirSystem(1).OASysInletNodeNum = - NodeInputManager::GetOnlySingleNode("RETURN NODE", ErrorsFound, "OA MIXER", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); - DataAirSystems::PrimaryAirSystem(1).OAMixOAInNodeNum = - NodeInputManager::GetOnlySingleNode("OA INLET TO MIXER", ErrorsFound, "OA MIXER", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Internal, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); + DataAirSystems::PrimaryAirSystem(1).OASysOutletNodeNum = NodeInputManager::GetOnlySingleNode("FAN INLET NODE", + ErrorsFound, + "FAN", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Internal, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); + DataAirSystems::PrimaryAirSystem(1).OASysInletNodeNum = NodeInputManager::GetOnlySingleNode("RETURN NODE", + ErrorsFound, + "OA MIXER", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Inlet, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); + DataAirSystems::PrimaryAirSystem(1).OAMixOAInNodeNum = NodeInputManager::GetOnlySingleNode("OA INLET TO MIXER", + ErrorsFound, + "OA MIXER", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Internal, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); DataAirSystems::PrimaryAirSystem(1).NumBranches = 1; DataAirSystems::PrimaryAirSystem(1).InletBranchNum.allocate(1); DataAirSystems::PrimaryAirSystem(1).InletBranchNum(1) = 1; DataAirSystems::PrimaryAirSystem(1).Branch.allocate(DataAirSystems::PrimaryAirSystem(1).NumBranches); - DataAirSystems::PrimaryAirSystem(1).Branch(1).NodeNumIn = - NodeInputManager::GetOnlySingleNode("RETURN NODE", ErrorsFound, "OAsysinlet", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Inlet, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); + DataAirSystems::PrimaryAirSystem(1).Branch(1).NodeNumIn = NodeInputManager::GetOnlySingleNode("RETURN NODE", + ErrorsFound, + "OAsysinlet", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Inlet, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); DataAirSystems::PrimaryAirSystem(1).Branch(1).TotalComponents = 1; DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp.allocate(1); DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).TypeOf = "Fan:ConstantVolume"; - DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).NodeNumIn = - NodeInputManager::GetOnlySingleNode("FAN INLET NODE", ErrorsFound, "FAN", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Internal, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); - - DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).NodeNumOut = - NodeInputManager::GetOnlySingleNode("FAN OUTLET NODE", ErrorsFound, "FAN", "SZRHtest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_Internal, 1, DataLoopNode::ObjectIsNotParent, "AHU node"); + DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).NodeNumIn = NodeInputManager::GetOnlySingleNode("FAN INLET NODE", + ErrorsFound, + "FAN", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Internal, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); + + DataAirSystems::PrimaryAirSystem(1).Branch(1).Comp(1).NodeNumOut = NodeInputManager::GetOnlySingleNode("FAN OUTLET NODE", + ErrorsFound, + "FAN", + "SZRHtest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_Internal, + 1, + DataLoopNode::ObjectIsNotParent, + "AHU node"); DataZoneEquipment::ZoneEquipConfig.allocate(1); DataZoneEquipment::ZoneEquipConfig(1).NumInletNodes = 1; @@ -620,13 +679,25 @@ TEST_F(EnergyPlusFixture, SZRHOAFractionImpact) DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum.allocate(1); DataZoneEquipment::ZoneEquipConfig(1).AirDistUnitCool.allocate(1); DataZoneEquipment::ZoneEquipConfig(1).AirDistUnitHeat.allocate(1); - int zoneAirNode = - NodeInputManager::GetOnlySingleNode("KITCHEN AIR NODE", ErrorsFound, "Zone", "SZRHspmTest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_ZoneNode, 1, DataLoopNode::ObjectIsNotParent, "Test zone node"); + int zoneAirNode = NodeInputManager::GetOnlySingleNode("KITCHEN AIR NODE", + ErrorsFound, + "Zone", + "SZRHspmTest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_ZoneNode, + 1, + DataLoopNode::ObjectIsNotParent, + "Test zone node"); DataZoneEquipment::ZoneEquipConfig(1).ZoneNode = zoneAirNode; - int zoneInletNode = - NodeInputManager::GetOnlySingleNode("KITCHEN DIRECT AIR INLET NODE NAME", ErrorsFound, "Zone", "SZRHspmTest", DataLoopNode::NodeType_Air, - DataLoopNode::NodeConnectionType_ZoneInlet, 1, DataLoopNode::ObjectIsNotParent, "Test zone inlet node"); + int zoneInletNode = NodeInputManager::GetOnlySingleNode("KITCHEN DIRECT AIR INLET NODE NAME", + ErrorsFound, + "Zone", + "SZRHspmTest", + DataLoopNode::NodeType_Air, + DataLoopNode::NodeConnectionType_ZoneInlet, + 1, + DataLoopNode::ObjectIsNotParent, + "Test zone inlet node"); DataZoneEquipment::ZoneEquipConfig(1).InletNode(1) = zoneInletNode; DataZoneEquipment::ZoneEquipConfig(1).InletNodeAirLoopNum(1) = 1; @@ -1169,7 +1240,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) Real64 CpAir(0.0); Real64 ZoneSetPointTemp(0.0); - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(2).HumRat, DataLoopNode::Node(2).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(2).HumRat); ZoneSetPointTemp = DataLoopNode::Node(5).Temp + DataZoneEnergyDemands::ZoneSysEnergyDemand(1).TotalOutputRequired / (CpAir * DataLoopNode::Node(2).MassFlowRateMax); // check the value of ZoneSetPointTemp matches to the value calculated by ColdestSetPtMgr @@ -1307,7 +1378,7 @@ TEST_F(EnergyPlusFixture, SingZoneRhSetPtMgrZoneInletNodeTest) " Kitchen Inlet Node Name, !- Zone Inlet Node Name", " Equipment Outlet Node; !- Setpoint Node or NodeList Name", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); DataGlobals::NumOfZones = 1; @@ -1342,14 +1413,14 @@ TEST_F(EnergyPlusFixture, SingZoneRhSetPtMgrZoneInletNodeTest) " ** Fatal ** InitSetPointManagers: Errors found in getting SetPointManager input.", " ...Summary of Errors that led to program termination:", " ..... Reference severe error count=2", - " ..... Last severe error=SetpointManager:SingleZone:Reheat=\"SUPAIRTEMP MNGRKITCHEN\", The zone inlet node is not connected to an air loop.", - }); + " ..... Last severe error=SetpointManager:SingleZone:Reheat=\"SUPAIRTEMP MNGRKITCHEN\", The zone inlet node is not connected to an air " + "loop.", + }); EXPECT_TRUE(compare_err_stream(error_string, true)); DataZoneEquipment::ZoneEquipInputsFilled = false; DataAirLoop::AirLoopInputsFilled = false; - } TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrZoneInletNodeTest) { @@ -1374,7 +1445,7 @@ TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrZoneInletNodeTest) " ZNF1 Inlet Node, !- Zone Inlet Node Name", " Zone Equipment 1 Inlet Node; !- Setpoint Node or NodeList Name", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); DataGlobals::NumOfZones = 1; @@ -1411,13 +1482,12 @@ TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrZoneInletNodeTest) " ...Summary of Errors that led to program termination:", " ..... Reference severe error count=2", " ..... Last severe error=SetpointManager:SingleZone:Cooling=\"COOLING SUPPLY AIR TEMP MANAGER 1\", The zone inlet node of ZNF1 INLET NODE", - }); + }); EXPECT_TRUE(compare_err_stream(error_string, true)); DataZoneEquipment::ZoneEquipInputsFilled = false; DataAirLoop::AirLoopInputsFilled = false; - } TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrSetPtTest) { @@ -1442,7 +1512,7 @@ TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrSetPtTest) " ZSF1 Inlet Node, !- Zone Inlet Node Name", " Zone Equipment 1 Inlet Node; !- Setpoint Node or NodeList Name", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); DataGlobals::NumOfZones = 1; @@ -1466,10 +1536,10 @@ TEST_F(EnergyPlusFixture, SingZoneCoolHeatSetPtMgrSetPtTest) int coolSPNodeNum = UtilityRoutines::FindItemInList("ZONE EQUIPMENT 1 INLET NODE", DataLoopNode::NodeID); int heatSPNodeNum = UtilityRoutines::FindItemInList("AIR LOOP 1 OUTLET NODE", DataLoopNode::NodeID); - auto & zoneNode(DataLoopNode::Node(zoneNodeNum)); - auto & inletNode(DataLoopNode::Node(inletNodeNum)); - auto & coolSPNode(DataLoopNode::Node(coolSPNodeNum)); - auto & heatSPNode(DataLoopNode::Node(heatSPNodeNum)); + auto &zoneNode(DataLoopNode::Node(zoneNodeNum)); + auto &inletNode(DataLoopNode::Node(inletNodeNum)); + auto &coolSPNode(DataLoopNode::Node(coolSPNodeNum)); + auto &heatSPNode(DataLoopNode::Node(heatSPNodeNum)); DataZoneEnergyDemands::ZoneSysEnergyDemand.allocate(1); DataZoneEnergyDemands::ZoneSysEnergyDemand(1).OutputRequiredToHeatingSP = 0.0; diff --git a/tst/EnergyPlus/unit/SingleDuct.unit.cc b/tst/EnergyPlus/unit/SingleDuct.unit.cc index 71d4ea87429..a86c3277300 100644 --- a/tst/EnergyPlus/unit/SingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/SingleDuct.unit.cc @@ -2476,8 +2476,7 @@ TEST_F(EnergyPlusFixture, SingleDuct_VAVWaterCoilSizing) Real64 ZoneDesTemp = FinalZoneSizing(1).ZoneTempAtHeatPeak; Real64 ZoneDesHumRat = FinalZoneSizing(1).ZoneHumRatAtHeatPeak; - Real64 DesCoilLoad = - DesZoneHeatLoad + Psychrometrics::PsyCpAirFnWTdb(ZoneDesHumRat, 0.5 * (CoilInTemp + ZoneDesTemp)) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + Real64 DesCoilLoad = DesZoneHeatLoad + Psychrometrics::PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); EXPECT_EQ(CoilInTemp, 16.0); EXPECT_EQ(DesZoneHeatLoad, 0.0); diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 28be045fa32..1e5c4afd40b 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -71,6 +71,7 @@ #include #include #include +#include #include #include #include @@ -86,7 +87,6 @@ #include #include #include -#include using namespace EnergyPlus; using namespace UnitarySystems; @@ -2967,7 +2967,6 @@ TEST_F(ZoneUnitarySysTest, UnitarySystemModel_WaterCoilSPControl_Latent) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); // should get same answer as before EXPECT_NEAR(thisSys->m_CoolingPartLoadFrac, partLoadRatio, 0.0000001); - } TEST_F(EnergyPlusFixture, UnitarySystemModel_SetOnOffMassFlowRateTest) @@ -4034,7 +4033,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4075,7 +4074,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4901,7 +4900,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4938,7 +4937,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -5357,7 +5356,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils_CyclingFan) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -5401,7 +5400,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils_CyclingFan) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7203,7 +7202,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7241,7 +7240,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7549,7 +7548,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7608,7 +7607,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7642,7 +7641,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7672,7 +7671,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7717,7 +7716,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7753,7 +7752,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7801,7 +7800,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7831,7 +7830,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat, DataLoopNode::Node(InletNode).Temp); + CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 410d8554803..0c00b7081c5 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -74,7 +74,6 @@ #include #include #include -#include #include "Fixtures/EnergyPlusFixture.hh" @@ -477,7 +476,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -629,7 +628,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -786,7 +785,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -1111,7 +1110,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); DesMassFlow = FinalSysSizing(1).DesMainVolFlow * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -1212,7 +1211,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) Real64 DesMassFlow(0.0); Real64 DesCoilHeatingLoad(0.0); - CpAirStd = PsyCpAirFnWTdb(0.0, 20.0); + CpAirStd = PsyCpAirFnWTdb(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = DesMassFlow * CpAirStd * (40.0 - 5.0); From 704b567acace4388c5e95d6d677c400c1a75c2f8 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Mon, 4 Nov 2019 14:59:45 -0500 Subject: [PATCH 5/9] Removed unused parameter --- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 15 ++-- src/EnergyPlus/HVACVariableRefrigerantFlow.hh | 5 +- .../unit/HVACVariableRefrigerantFlow.unit.cc | 84 ++++++++++--------- 3 files changed, 50 insertions(+), 54 deletions(-) diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 846954a063f..164e8189855 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -8038,8 +8038,7 @@ namespace HVACVariableRefrigerantFlow { this->CalcVRFSuppHeatingCoil(VRFTUNum, FirstHVACIteration, SuppPLR, SuppHeatCoilLoad); if ((DataLoopNode::Node(this->SuppHeatCoilAirOutletNode).Temp > this->MaxSATFromSuppHeatCoil) && SuppPLR > 0.0) { // adjust the heating load to maximum allowed - Real64 MaxHeatCoilLoad = - this->HeatingCoilCapacityLimit(this->SuppHeatCoilAirInletNode, this->SuppHeatCoilAirOutletNode, this->MaxSATFromSuppHeatCoil); + Real64 MaxHeatCoilLoad = this->HeatingCoilCapacityLimit(this->SuppHeatCoilAirInletNode, this->MaxSATFromSuppHeatCoil); this->CalcVRFSuppHeatingCoil(VRFTUNum, FirstHVACIteration, SuppPLR, MaxHeatCoilLoad); SuppHeatCoilLoad = MaxHeatCoilLoad; } @@ -11067,8 +11066,7 @@ namespace HVACVariableRefrigerantFlow { this->CalcVRFSuppHeatingCoil(VRFTUNum, FirstHVACIteration, SuppPLR, SuppHeatCoilLoad); if ((DataLoopNode::Node(this->SuppHeatCoilAirOutletNode).Temp > this->MaxSATFromSuppHeatCoil) && SuppPLR > 0.0) { // adjust the heating load to maximum allowed - Real64 MaxHeatCoilLoad = - this->HeatingCoilCapacityLimit(this->SuppHeatCoilAirInletNode, this->SuppHeatCoilAirOutletNode, this->MaxSATFromSuppHeatCoil); + Real64 MaxHeatCoilLoad = this->HeatingCoilCapacityLimit(this->SuppHeatCoilAirInletNode, this->MaxSATFromSuppHeatCoil); this->CalcVRFSuppHeatingCoil(VRFTUNum, FirstHVACIteration, SuppPLR, MaxHeatCoilLoad); SuppHeatCoilLoad = MaxHeatCoilLoad; } @@ -13807,9 +13805,8 @@ namespace HVACVariableRefrigerantFlow { } Real64 VRFTerminalUnitEquipment::HeatingCoilCapacityLimit( - Real64 const HeatCoilAirInletNode, // supplemental heating coil air inlet node - Real64 const HeatCoilAirOutletNode, // supplemental heating coil air outlet node - Real64 const HeatCoilMaxSATAllowed // supplemental heating coil maximum supply air temperature allowed [C] + Real64 const HeatCoilAirInletNode, // supplemental heating coil air inlet node + Real64 const HeatCoilMaxSATAllowed // supplemental heating coil maximum supply air temperature allowed [C] ) { // PURPOSE OF THIS FUNCTION: @@ -13824,10 +13821,8 @@ namespace HVACVariableRefrigerantFlow { Real64 MDotAir = DataLoopNode::Node(HeatCoilAirInletNode).MassFlowRate; Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); - Real64 CpAirAvg = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = max(0.0, HeatCoilMaxSATAllowed - DataLoopNode::Node(HeatCoilAirInletNode).Temp); - HeatCoilCapacityAllowed = MDotAir * CpAirAvg * HCDeltaT; + HeatCoilCapacityAllowed = MDotAir * CpAirIn * HCDeltaT; return HeatCoilCapacityAllowed; } diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh index 8b8fcef527f..7d7637c5bbc 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.hh +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.hh @@ -817,9 +817,8 @@ namespace HVACVariableRefrigerantFlow { ); static Real64 - HeatingCoilCapacityLimit(Real64 const HeatCoilAirInletNode, // supplemental heating coil air inlet node - Real64 const HeatCoilAirOutletNode, // supplemental heating coil air outlet node - Real64 const HeatCoilMaxSATAllowed // supplemental heating coil maximum supply air temperature allowed [C] + HeatingCoilCapacityLimit(Real64 const HeatCoilAirInletNode, // supplemental heating coil air inlet node + Real64 const HeatCoilMaxSATAllowed // supplemental heating coil maximum supply air temperature allowed [C] ); }; diff --git a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc index 54060add114..73d4d308dc3 100644 --- a/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc +++ b/tst/EnergyPlus/unit/HVACVariableRefrigerantFlow.unit.cc @@ -7603,8 +7603,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SupplementalHeatingCoilCapacityLimitTest) thisVRFTU.MaxSATFromSuppHeatCoil = 50.0; Real64 ExpectedResult = 1.0 * 1017.8526499999862 * 30.0; // m_dot * Cp_avg * DeltaT - Real64 SuppHeatCoilCapMax = - thisVRFTU.HeatingCoilCapacityLimit(thisVRFTU.SuppHeatCoilAirInletNode, thisVRFTU.SuppHeatCoilAirOutletNode, thisVRFTU.MaxSATFromSuppHeatCoil); + Real64 SuppHeatCoilCapMax = thisVRFTU.HeatingCoilCapacityLimit(thisVRFTU.SuppHeatCoilAirInletNode, thisVRFTU.MaxSATFromSuppHeatCoil); EXPECT_NEAR(ExpectedResult, SuppHeatCoilCapMax, 0.0001); } @@ -9868,7 +9867,7 @@ TEST_F(EnergyPlusFixture, VRFFluidControl_FanSysModel_OnOffModeTest) " , !- Zone Equipment 1 Sequential Cooling Load Fraction", " ; !- Zone Equipment 1 Sequential Heating Load Fraction", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); SimulationManager::ManageSimulation(); @@ -10462,7 +10461,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) " 1.5, !- Maximum Curve Output", " Temperature, !- Input Unit Type for X", " Dimensionless; !- Output Unit Type", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -10506,7 +10505,8 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = + Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -10528,7 +10528,8 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF( + VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); @@ -10546,7 +10547,7 @@ TEST_F(EnergyPlusFixture, VRFTU_SysCurve_ReportOutputVerificationTest) EXPECT_NEAR(368.1510, thisFan.FanPower, 0.0001); EXPECT_NEAR(thisDXCoolingCoil.TotalCoolingEnergyRate, (thisVRFTU.TotalCoolingRate + thisFan.FanPower), 0.0001); } - + TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) { // PURPOSE OF THIS TEST: @@ -10765,35 +10766,35 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " Dimensionless; !- Output Unit Type ", "Zone,", - " SPACE1-1, !- Name", - " 0, !- Direction of Relative North {deg}", - " 0, !- X Origin {m}", - " 0, !- Y Origin {m}", - " 0, !- Z Origin {m}", - " 1, !- Type", - " 1, !- Multiplier", - " 2.438400269, !- Ceiling Height {m}", - " 239.247360229; !- Volume {m3}", - - "ZoneHVAC:EquipmentConnections,", - " SPACE1-1, !- Zone Name", - " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", - " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", - " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", - " SPACE1-1 Node, !- Zone Air Node Name", - " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file - - "ZoneHVAC:EquipmentList,", - " SPACE1-1 Eq, !- Name", - " SequentialLoad, !- Load Distribution Scheme", - " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", - " TU1, !- Zone Equipment 1 Name", - " 1, !- Zone Equipment 1 Cooling Sequence", - " 1; !- Zone Equipment 1 Heating or No-Load Sequence", - - "ZoneTerminalUnitList,", - " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", - " TU1; !- Zone Terminal Unit Name 1", + " SPACE1-1, !- Name", + " 0, !- Direction of Relative North {deg}", + " 0, !- X Origin {m}", + " 0, !- Y Origin {m}", + " 0, !- Z Origin {m}", + " 1, !- Type", + " 1, !- Multiplier", + " 2.438400269, !- Ceiling Height {m}", + " 239.247360229; !- Volume {m3}", + + "ZoneHVAC:EquipmentConnections,", + " SPACE1-1, !- Zone Name", + " SPACE1-1 Eq, !- Zone Conditioning Equipment List Name", + " TU1 Outlet Node, !- Zone Air Inlet Node or NodeList Name", + " TU1 Inlet Node, !- Zone Air Exhaust Node or NodeList Name", + " SPACE1-1 Node, !- Zone Air Node Name", + " SPACE1-1 Out Node; !- Zone Return Air Node Name", // not used anywhere else in the example file + + "ZoneHVAC:EquipmentList,", + " SPACE1-1 Eq, !- Name", + " SequentialLoad, !- Load Distribution Scheme", + " ZoneHVAC:TerminalUnit:VariableRefrigerantFlow, !- Zone Equipment 1 Object Type", + " TU1, !- Zone Equipment 1 Name", + " 1, !- Zone Equipment 1 Cooling Sequence", + " 1; !- Zone Equipment 1 Heating or No-Load Sequence", + + "ZoneTerminalUnitList,", + " VRF Heat Pump TU List, !- Zone Terminal Unit List Name", + " TU1; !- Zone Terminal Unit Name 1", "ZoneHVAC:TerminalUnit:VariableRefrigerantFlow,", " TU1, !- Zone Terminal Unit Name", @@ -10901,7 +10902,6 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " TU1 Outlet Node, !- Air Outlet Node Name", " General; !- End-Use Subcategory", - " !- =========== ALL OBJECTS IN CLASS: FLUIDPROPERTIES:NAME =========== ", " ", " FluidProperties:Name, ", @@ -12170,7 +12170,7 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) " 0.0000E+00,3.1758E+02; ", " ", " !*************************************************************************** ", - }); + }); ASSERT_TRUE(process_idf(idf_objects)); @@ -12212,11 +12212,12 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) Node(thisZoneEquip.ZoneNode).Temp = 24.0; Node(thisZoneEquip.ZoneNode).HumRat = 0.0075; Node(thisZoneEquip.ZoneNode).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisZoneEquip.ZoneNode).Temp, Node(thisZoneEquip.ZoneNode).HumRat); - + auto &thisVRFTU(VRFTU(1)); Node(thisVRFTU.VRFTUInletNodeNum).Temp = 24.0; Node(thisVRFTU.VRFTUInletNodeNum).HumRat = 0.0075; - Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); + Node(thisVRFTU.VRFTUInletNodeNum).Enthalpy = + Psychrometrics::PsyHFnTdbW(Node(thisVRFTU.VRFTUInletNodeNum).Temp, Node(thisVRFTU.VRFTUInletNodeNum).HumRat); DataEnvironment::OutDryBulbTemp = 35.0; DataEnvironment::OutHumRat = 0.0100; @@ -12239,7 +12240,8 @@ TEST_F(EnergyPlusFixture, VRF_FluidTCtrl_ReportOutputVerificationTest) auto &thisDXCoolingCoil(DXCoil(1)); auto &thisDXHeatingCoil(DXCoil(2)); // run the model - SimulateVRF(VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); + SimulateVRF( + VRFTU(VRFTUNum).Name, CurZoneNum, FirstHVACIteration, SysOutputProvided, LatOutputProvided, ZoneEquipList(CurZoneEqNum).EquipIndex(EquipPtr)); // check model inputs ASSERT_EQ(1, NumVRFCond); ASSERT_EQ(1, NumVRFTU); From 70989b2f84c603a98d55b2ec1354324dc461fb18 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Tue, 5 Nov 2019 09:43:01 -0500 Subject: [PATCH 6/9] Cleanup --- .../include/AirflowNetwork/Properties.hpp | 2 +- .../AirflowNetwork/src/Properties.cpp | 2 +- .../AirflowNetworkBalanceManager.cc | 62 ++++++++-------- src/EnergyPlus/BaseboardElectric.cc | 4 +- src/EnergyPlus/BaseboardRadiator.cc | 4 +- src/EnergyPlus/ChillerElectricEIR.cc | 2 +- src/EnergyPlus/ChillerExhaustAbsorption.cc | 8 +-- src/EnergyPlus/ChillerReformulatedEIR.cc | 4 +- src/EnergyPlus/CondenserLoopTowers.cc | 2 +- src/EnergyPlus/ConvectionCoefficients.cc | 4 +- src/EnergyPlus/CoolTower.cc | 4 +- src/EnergyPlus/CrossVentMgr.cc | 2 +- src/EnergyPlus/DataSurfaces.cc | 2 +- src/EnergyPlus/DesiccantDehumidifiers.cc | 6 +- src/EnergyPlus/DisplacementVentMgr.cc | 10 +-- src/EnergyPlus/DualDuct.cc | 24 +++---- src/EnergyPlus/EarthTube.cc | 4 +- src/EnergyPlus/ElectricBaseboardRadiator.cc | 4 +- src/EnergyPlus/EvaporativeCoolers.cc | 12 ++-- src/EnergyPlus/EvaporativeFluidCoolers.cc | 4 +- src/EnergyPlus/FanCoilUnits.cc | 2 +- src/EnergyPlus/Fans.cc | 6 +- src/EnergyPlus/FluidCoolers.cc | 2 +- src/EnergyPlus/Furnaces.cc | 16 ++--- src/EnergyPlus/GeneralRoutines.cc | 12 ++-- src/EnergyPlus/HVACCooledBeam.cc | 8 +-- src/EnergyPlus/HVACFan.cc | 2 +- src/EnergyPlus/HVACFourPipeBeam.cc | 18 ++--- src/EnergyPlus/HVACManager.cc | 18 ++--- src/EnergyPlus/HVACMultiSpeedHeatPump.cc | 4 +- src/EnergyPlus/HVACSingleDuctInduc.cc | 8 +-- src/EnergyPlus/HVACUnitaryBypassVAV.cc | 8 +-- src/EnergyPlus/HVACVariableRefrigerantFlow.cc | 2 +- src/EnergyPlus/HWBaseboardRadiator.cc | 4 +- src/EnergyPlus/HeatBalanceAirManager.cc | 2 +- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 33 ++++----- src/EnergyPlus/HeatRecovery.cc | 28 ++++---- src/EnergyPlus/HeatingCoils.cc | 8 +-- src/EnergyPlus/HybridEvapCoolingModel.cc | 12 ++-- src/EnergyPlus/InternalHeatGains.cc | 2 +- .../MicroturbineElectricGenerator.cc | 4 +- src/EnergyPlus/MixedAir.cc | 2 +- src/EnergyPlus/MoistureBalanceEMPDManager.cc | 2 +- src/EnergyPlus/MundtSimMgr.cc | 6 +- src/EnergyPlus/NodeInputManager.cc | 6 +- src/EnergyPlus/OutdoorAirUnit.cc | 14 ++-- src/EnergyPlus/PackagedTerminalHeatPump.cc | 12 ++-- .../PhotovoltaicThermalCollectors.cc | 8 +-- src/EnergyPlus/PlantCentralGSHP.cc | 2 +- src/EnergyPlus/PlantChillers.cc | 10 +-- src/EnergyPlus/PondGroundHeatExchanger.cc | 4 +- src/EnergyPlus/PoweredInductionUnits.cc | 10 +-- src/EnergyPlus/Psychrometrics.hh | 70 ++++++++++++++++++- src/EnergyPlus/PurchasedAirManager.cc | 42 +++++------ src/EnergyPlus/RefrigeratedCase.cc | 6 +- src/EnergyPlus/ReportCoilSelection.cc | 6 +- src/EnergyPlus/ReportSizingManager.cc | 50 ++++++------- src/EnergyPlus/RoomAirModelAirflowNetwork.cc | 18 ++--- src/EnergyPlus/RoomAirModelUserTempPattern.cc | 4 +- src/EnergyPlus/RuntimeLanguageProcessor.cc | 6 +- src/EnergyPlus/SetPointManager.cc | 24 +++---- src/EnergyPlus/SimAirServingZones.cc | 28 ++++---- src/EnergyPlus/SingleDuct.cc | 23 +++--- src/EnergyPlus/SteamBaseboardRadiator.cc | 5 +- src/EnergyPlus/SteamCoils.cc | 14 ++-- src/EnergyPlus/ThermalChimney.cc | 6 +- src/EnergyPlus/TranspiredCollector.cc | 4 +- src/EnergyPlus/UFADManager.cc | 16 ++--- src/EnergyPlus/UnitHeater.cc | 12 ++-- src/EnergyPlus/UnitVentilator.cc | 16 ++--- src/EnergyPlus/UnitarySystem.cc | 22 +++--- src/EnergyPlus/UserDefinedComponents.cc | 20 +++--- src/EnergyPlus/VariableSpeedCoils.cc | 20 +++--- src/EnergyPlus/VentilatedSlab.cc | 22 +++--- src/EnergyPlus/WaterCoils.cc | 30 ++++---- src/EnergyPlus/WaterThermalTanks.cc | 4 +- src/EnergyPlus/WaterToAirHeatPump.cc | 8 +-- src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 18 ++--- src/EnergyPlus/WindowAC.cc | 4 +- src/EnergyPlus/WindowComplexManager.cc | 10 +-- src/EnergyPlus/WindowEquivalentLayer.cc | 6 +- src/EnergyPlus/WindowManager.cc | 12 ++-- src/EnergyPlus/ZoneAirLoopEquipmentManager.cc | 4 +- .../ZoneContaminantPredictorCorrector.cc | 2 +- src/EnergyPlus/ZoneDehumidifier.cc | 4 +- src/EnergyPlus/ZoneEquipmentManager.cc | 38 +++++----- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 45 ++++++------ ...alSingleDuctConstantVolumeNoReheat.unit.cc | 2 +- .../unit/DesiccantDehumidifiers.unit.cc | 8 +-- .../unit/HVACHXAssistedCoolingCoil.unit.cc | 4 +- .../unit/OASystemHWPreheatCoil.unit.cc | 2 +- tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc | 2 +- .../unit/RoomAirflowNetwork.unit.cc | 4 +- tst/EnergyPlus/unit/SetPointManager.unit.cc | 2 +- tst/EnergyPlus/unit/SingleDuct.unit.cc | 2 +- tst/EnergyPlus/unit/UnitarySystem.unit.cc | 32 ++++----- tst/EnergyPlus/unit/WaterCoils.unit.cc | 10 +-- 97 files changed, 599 insertions(+), 529 deletions(-) diff --git a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp index b2f9afe64e6..ff41aa6d625 100644 --- a/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp +++ b/src/EnergyPlus/AirflowNetwork/include/AirflowNetwork/Properties.hpp @@ -51,7 +51,7 @@ #ifndef AIRDENSITY #include "../../../Psychrometrics.hh" #define AIRDENSITY(P, T, W) Psychrometrics::PsyRhoAirFnPbTdbW(P, T, W) -#define AIRCP(W, T) Psychrometrics::PsyCpAirFnWTdb(W) +#define AIRCP(W) Psychrometrics::PsyCpAirFnW(W) #else // Need a fallback #endif diff --git a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp index cf30c5bbc9d..bcbd6732292 100644 --- a/src/EnergyPlus/AirflowNetwork/src/Properties.cpp +++ b/src/EnergyPlus/AirflowNetwork/src/Properties.cpp @@ -121,7 +121,7 @@ namespace AirflowNetwork { T = UpperLimit; } - return airThermConductivity(T) / (AIRCP(W, T) * AIRDENSITY(P, T, W)); + return airThermConductivity(T) / (AIRCP(W) * AIRDENSITY(P, T, W)); } Real64 airPrandtl(Real64 T, // Temperature in Celsius diff --git a/src/EnergyPlus/AirflowNetworkBalanceManager.cc b/src/EnergyPlus/AirflowNetworkBalanceManager.cc index 9b5e30ee5f4..b48f7baff5b 100644 --- a/src/EnergyPlus/AirflowNetworkBalanceManager.cc +++ b/src/EnergyPlus/AirflowNetworkBalanceManager.cc @@ -198,7 +198,7 @@ namespace AirflowNetworkBalanceManager { using Fans::GetFanType; using Fans::GetFanVolFlow; using General::RoundSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ScheduleManager::GetCurrentScheduleValue; @@ -6820,9 +6820,9 @@ namespace AirflowNetworkBalanceManager { CompNum = AirflowNetworkLinkageData(i).CompNum; CompTypeNum = AirflowNetworkCompData(CompNum).CompTypeNum; CompName = AirflowNetworkCompData(CompNum).EPlusName; - CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[0]).WZ + - AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[1]).WZ) / - 2.0); + CpAir = PsyCpAirFnW((AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[0]).WZ + + AirflowNetworkNodeSimu(AirflowNetworkLinkageData(i).NodeNums[1]).WZ) / + 2.0); // Calculate duct conduction loss if (CompTypeNum == CompTypeNum_DWC && CompName == BlankString) { // Duct element only TypeNum = AirflowNetworkCompData(CompNum).TypeNum; @@ -7164,7 +7164,7 @@ namespace AirflowNetworkBalanceManager { LT = AirflowNetworkLinkageData(i).NodeNums[0]; load = Node(NF).Temp - Node(NT).Temp; } - CpAir = PsyCpAirFnWTdb(Node(NT).HumRat); + CpAir = PsyCpAirFnW(Node(NT).HumRat); MV(LT) += AirflowNetworkLinkSimu(i).FLOW * CpAir * load; } } @@ -8286,11 +8286,11 @@ namespace AirflowNetworkBalanceManager { if (ZN1 > 0 && ZN2 == 0) { if (Surface(MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { Tamb = Surface(MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb( - Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); + CpAir = + PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); } else { Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); } hfg = Psychrometrics::PsyHfgAirFnWTdb(ZoneAirHumRat(ZN1), (MAT(ZN1) + Tamb) / 2.0); @@ -8318,11 +8318,11 @@ namespace AirflowNetworkBalanceManager { if (ZN1 == 0 && ZN2 > 0) { if (Surface(MultizoneSurfaceData(i).SurfNum).HasLinkedOutAirNode) { Tamb = Surface(MultizoneSurfaceData(i).SurfNum).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb( - Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); + CpAir = + PsyCpAirFnW(Psychrometrics::PsyWFnTdbTwbPb(Tamb, Surface(MultizoneSurfaceData(i).SurfNum).OutWetBulbTemp, OutBaroPress)); } else { Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); } hfg = Psychrometrics::PsyHfgAirFnWTdb(ZoneAirHumRat(ZN2), (MAT(ZN2) + Tamb) / 2.0); @@ -8349,7 +8349,7 @@ namespace AirflowNetworkBalanceManager { } if (ZN1 > 0 && ZN2 > 0) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN1)); hfg = Psychrometrics::PsyHfgAirFnWTdb((ZoneAirHumRat(ZN1) + ZoneAirHumRat(ZN2)) / 2.0, (MAT(ZN1) + MAT(ZN2)) / 2.0); if (MAT(ZN1) > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneMixSenGainW += (AirflowNetworkLinkSimu(i).FLOW * CpAir * (MAT(ZN1) - MAT(ZN2))); @@ -8371,7 +8371,7 @@ namespace AirflowNetworkBalanceManager { AirflowNetworkReportData(ZN2).MultiZoneMixLatLossJ += (AirflowNetworkLinkSimu(i).FLOW * (ZoneAirHumRat(ZN2) - ZoneAirHumRat(ZN1))) * hfg * ReportingConstant; } - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN2)); if (MAT(ZN2) > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneMixSenGainW += (AirflowNetworkLinkSimu(i).FLOW2 * CpAir * (MAT(ZN2) - MAT(ZN1))); AirflowNetworkReportData(ZN1).MultiZoneMixSenGainJ += @@ -8519,7 +8519,7 @@ namespace AirflowNetworkBalanceManager { if (AirflowNetworkNodeData(n).AirLoopNum == 0 && onceSurfFlag(i)) continue; ReportingFraction = (1.0 - RepOnOffFanRunTimeFraction); Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); if (Tamb > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneInfiSenGainW += (AirflowNetworkLinkReport1(i).FLOW2OFF * CpAir * (Tamb - MAT(ZN1))) * (1.0 - RepOnOffFanRunTimeFraction); @@ -8557,7 +8557,7 @@ namespace AirflowNetworkBalanceManager { if (AirflowNetworkNodeData(M).AirLoopNum == 0 && onceSurfFlag(i)) continue; ReportingFraction = (1.0 - RepOnOffFanRunTimeFraction); Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); if (Tamb > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneInfiSenGainW += (AirflowNetworkLinkReport1(i).FLOWOFF * CpAir * (Tamb - MAT(ZN2))) * ReportingFraction; @@ -8587,7 +8587,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 > 0 && ZN2 > 0) { ReportingFraction = (1.0 - MaxOnOffFanRunTimeFraction); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN1)); if (MAT(ZN1) > MAT(ZN2)) { AirflowNetworkReportData(ZN2).MultiZoneMixSenGainW += (AirflowNetworkLinkReport1(i).FLOWOFF * CpAir * (MAT(ZN1) - MAT(ZN2))) * ReportingFraction; @@ -8612,7 +8612,7 @@ namespace AirflowNetworkBalanceManager { (AirflowNetworkLinkReport1(i).FLOWOFF * (ZoneAirHumRat(ZN2) - ZoneAirHumRat(ZN1))) * ReportingConstant * ReportingFraction; } - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN2)); if (MAT(ZN2) > MAT(ZN1)) { AirflowNetworkReportData(ZN1).MultiZoneMixSenGainW += (AirflowNetworkLinkReport1(i).FLOW2OFF * CpAir * (MAT(ZN2) - MAT(ZN1))) * ReportingFraction; @@ -8647,7 +8647,7 @@ namespace AirflowNetworkBalanceManager { for (i = 1; i <= NumOfZones; ++i) { // Start of zone loads report variable update loop ... Tamb = Zone(i).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRatAvg(i)); + CpAir = PsyCpAirFnW(ZoneAirHumRatAvg(i)); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(i), ZoneAirHumRatAvg(i)); AirflowNetworkZnRpt(i).InfilVolume = (AirflowNetworkExchangeData(i).SumMCp / CpAir / AirDensity) * ReportingConstant; @@ -8832,7 +8832,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 > 0 && ZN2 == 0) { // Find a linkage from outdoors to this zone Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirflowNetworkExchangeData(ZN1).SumMCp += AirflowNetworkLinkSimu(i).FLOW2 * CpAir; AirflowNetworkExchangeData(ZN1).SumMCpT += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * Tamb; AirflowNetworkExchangeData(ZN1).SumMHr += AirflowNetworkLinkSimu(i).FLOW2; @@ -8847,7 +8847,7 @@ namespace AirflowNetworkBalanceManager { if (ZN1 == 0 && ZN2 > 0) { // Find a linkage from outdoors to this zone Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirflowNetworkExchangeData(ZN2).SumMCp += AirflowNetworkLinkSimu(i).FLOW * CpAir; AirflowNetworkExchangeData(ZN2).SumMCpT += AirflowNetworkLinkSimu(i).FLOW * CpAir * Tamb; AirflowNetworkExchangeData(ZN2).SumMHr += AirflowNetworkLinkSimu(i).FLOW; @@ -8861,7 +8861,7 @@ namespace AirflowNetworkBalanceManager { } if (ZN1 > 0 && ZN2 > 0) { // Find a linkage from outdoors to this zone - CpAir = PsyCpAirFnWTdb(ANZW(ZN1)); + CpAir = PsyCpAirFnW(ANZW(ZN1)); AirflowNetworkExchangeData(ZN2).SumMMCp += AirflowNetworkLinkSimu(i).FLOW * CpAir; AirflowNetworkExchangeData(ZN2).SumMMCpT += AirflowNetworkLinkSimu(i).FLOW * CpAir * ANZT(ZN1); AirflowNetworkExchangeData(ZN2).SumMMHr += AirflowNetworkLinkSimu(i).FLOW; @@ -8872,7 +8872,7 @@ namespace AirflowNetworkBalanceManager { if (Contaminant.GenericContamSimulation) { AirflowNetworkExchangeData(ZN2).SumMMHrGC += AirflowNetworkLinkSimu(i).FLOW * ANGC(ZN1); } - CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); + CpAir = PsyCpAirFnW(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).SumMMCp += AirflowNetworkLinkSimu(i).FLOW2 * CpAir; AirflowNetworkExchangeData(ZN1).SumMMCpT += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * ANZT(ZN2); AirflowNetworkExchangeData(ZN1).SumMMHr += AirflowNetworkLinkSimu(i).FLOW2; @@ -8972,37 +8972,37 @@ namespace AirflowNetworkBalanceManager { // Find a linkage from a zone to outdoors if (ZN1 > 0 && ZN2 == 0) { Tamb = Zone(ZN1).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirflowNetworkExchangeData(ZN1).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW2 * CpAir * (Tamb - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW2 * (OutHumRat - ANZW(ZN1)); } if (ZN1 == 0 && ZN2 > 0) { Tamb = Zone(ZN2).OutDryBulbTemp; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirflowNetworkExchangeData(ZN2).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW * CpAir * (Tamb - ANZT(ZN2)); AirflowNetworkExchangeData(ZN2).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW * (OutHumRat - ANZW(ZN2)); } if (ZN1 > 0 && ZN2 > 0) { if (AirflowNetworkLinkSimu(i).FLOW > 0) { // Flow from ZN1 to ZN2 - CpAir = PsyCpAirFnWTdb(ANZW(ZN1)); + CpAir = PsyCpAirFnW(ANZW(ZN1)); AirflowNetworkExchangeData(ZN2).MultiZoneSen += AirflowNetworkLinkSimu(i).FLOW * CpAir * (ANZT(ZN1) - ANZT(ZN2)); AirflowNetworkExchangeData(ZN2).MultiZoneLat += AirflowNetworkLinkSimu(i).FLOW * (ANZW(ZN1) - ANZW(ZN2)); - CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); + CpAir = PsyCpAirFnW(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).MultiZoneSen += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir * (ANZT(ZN2) - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * (ANZW(ZN2) - ANZW(ZN1)); } else { - // CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN2), MAT(ZN2)) + // CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN2), MAT(ZN2)) // AirflowNetworkExchangeData(ZN1)%MultiZoneSen = AirflowNetworkExchangeData(ZN1)%MultiZoneSen + & // AirflowNetworkLinkSimu(i)%FLOW*CpAir*(MAT(ZN1)-MAT(ZN2)) // AirflowNetworkExchangeData(ZN1)%MultiZoneLat = AirflowNetworkExchangeData(ZN1)%MultiZoneLat + & // AirflowNetworkLinkSimu(i)%FLOW*(ZoneAirHumRat(ZN1)-ZoneAirHumRat(ZN2)) - // CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZN1), MAT(ZN1)) + // CpAir = PsyCpAirFnW(ZoneAirHumRat(ZN1), MAT(ZN1)) // AirflowNetworkExchangeData(ZN2)%MultiZoneSen = AirflowNetworkExchangeData(ZN2)%MultiZoneSen + & // ABS(AirflowNetworkLinkSimu(i)%FLOW2)*CpAir*(MAT(ZN1)-MAT(ZN2)) // AirflowNetworkExchangeData(ZN2)%MultiZoneLat = AirflowNetworkExchangeData(ZN2)%MultiZoneLat + & // ABS(AirflowNetworkLinkSimu(i)%FLOW2)*(ZoneAirHumRat(ZN1)-ZoneAirHumRat(ZN2)) - CpAir = PsyCpAirFnWTdb(ANZW(ZN2)); + CpAir = PsyCpAirFnW(ANZW(ZN2)); AirflowNetworkExchangeData(ZN1).MultiZoneSen += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * CpAir * (ANZT(ZN2) - ANZT(ZN1)); AirflowNetworkExchangeData(ZN1).MultiZoneLat += std::abs(AirflowNetworkLinkSimu(i).FLOW2) * (ANZW(ZN2) - ANZW(ZN1)); } @@ -9180,7 +9180,7 @@ namespace AirflowNetworkBalanceManager { for (i = 1; i <= AirflowNetworkNumOfLinks; ++i) { Node1 = AirflowNetworkLinkageData(i).NodeNums[0]; Node2 = AirflowNetworkLinkageData(i).NodeNums[1]; - CpAir = PsyCpAirFnWTdb((AirflowNetworkNodeSimu(Node1).WZ + AirflowNetworkNodeSimu(Node2).WZ) / 2.0); + CpAir = PsyCpAirFnW((AirflowNetworkNodeSimu(Node1).WZ + AirflowNetworkNodeSimu(Node2).WZ) / 2.0); // Calculate sensible loads from duct conduction losses and loads from duct radiation if (AirflowNetworkLinkageData(i).ZoneNum > 0 && AirflowNetworkCompData(AirflowNetworkLinkageData(i).CompNum).CompTypeNum == CompTypeNum_DWC) { @@ -11072,7 +11072,7 @@ namespace AirflowNetworkBalanceManager { Real64 RhoAir; // Zone air density [kg/m3] Real64 CpAir; // Zone air specific heat - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); InfilVolume = (AirflowNetworkExchangeData(ZoneNum).SumMCp / CpAir / RhoAir) * TimeStepSys * SecInHour; ACH = InfilVolume / (TimeStepSys * Zone(ZoneNum).Volume); diff --git a/src/EnergyPlus/BaseboardElectric.cc b/src/EnergyPlus/BaseboardElectric.cc index 6b8af3d835c..e133714ee62 100644 --- a/src/EnergyPlus/BaseboardElectric.cc +++ b/src/EnergyPlus/BaseboardElectric.cc @@ -650,7 +650,7 @@ namespace BaseboardElectric { // Using/Aliasing using DataHVACGlobals::SmallLoad; using DataLoopNode::Node; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -675,7 +675,7 @@ namespace BaseboardElectric { AirInletTemp = Baseboard(BaseboardNum).AirInletTemp; AirOutletTemp = AirInletTemp; - CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat); + CpAir = PsyCpAirFnW(Baseboard(BaseboardNum).AirInletHumRat); AirMassFlowRate = SimpConvAirFlowSpeed; CapacitanceAir = CpAir * AirMassFlowRate; // currently only the efficiency is used to calculate the electric consumption. There could be some diff --git a/src/EnergyPlus/BaseboardRadiator.cc b/src/EnergyPlus/BaseboardRadiator.cc index d5d8422b038..1f41c3fe0a1 100644 --- a/src/EnergyPlus/BaseboardRadiator.cc +++ b/src/EnergyPlus/BaseboardRadiator.cc @@ -118,7 +118,7 @@ namespace BaseboardRadiator { using namespace ScheduleManager; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Data @@ -1156,7 +1156,7 @@ namespace BaseboardRadiator { CpWater = GetSpecificHeatGlycol( PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(Baseboard(BaseboardNum).LoopNum).FluidIndex, RoutineName); - CpAir = PsyCpAirFnWTdb(Baseboard(BaseboardNum).AirInletHumRat); + CpAir = PsyCpAirFnW(Baseboard(BaseboardNum).AirInletHumRat); if (Baseboard(BaseboardNum).DesAirMassFlowRate > 0.0) { // If UA is autosized, assign design condition AirMassFlowRate = Baseboard(BaseboardNum).DesAirMassFlowRate; diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 4c7d579249b..bace4fdb340 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -2565,7 +2565,7 @@ namespace ChillerElectricEIR { EIRChillerHeatRecovery(EIRChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); if (CondMassFlowRate > 0.0) { - Cp = Psychrometrics::PsyCpAirFnWTdb(Node(CondInletNode).HumRat); + Cp = Psychrometrics::PsyCpAirFnW(Node(CondInletNode).HumRat); CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / Cp; } else { CondOutletTemp = CondInletTemp; diff --git a/src/EnergyPlus/ChillerExhaustAbsorption.cc b/src/EnergyPlus/ChillerExhaustAbsorption.cc index 603dd6d8231..3a1f38a39d1 100644 --- a/src/EnergyPlus/ChillerExhaustAbsorption.cc +++ b/src/EnergyPlus/ChillerExhaustAbsorption.cc @@ -1517,7 +1517,7 @@ namespace ChillerExhaustAbsorption { using FluidProperties::GetSpecificHeatGlycol; using MicroturbineElectricGenerator::SimMTGenerator; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1883,7 +1883,7 @@ namespace ChillerExhaustAbsorption { lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat); + CpAir = PsyCpAirFnW(lExhaustAirHumRat); lExhHeatRecPotentialCool = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); // If Microturbine Exhaust temperature and flow rate is not sufficient to run the chiller, then chiller will not run // lCoolThermalEnergyUseRate , lTowerLoad and lCoolElectricPower will be set to 0.0 @@ -2006,7 +2006,7 @@ namespace ChillerExhaustAbsorption { using FluidProperties::GetSpecificHeatGlycol; using MicroturbineElectricGenerator::SimMTGenerator; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2209,7 +2209,7 @@ namespace ChillerExhaustAbsorption { lExhaustInTemp = Node(lExhaustAirInletNodeNum).Temp; lExhaustInFlow = Node(lExhaustAirInletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(lExhaustAirHumRat); + CpAir = PsyCpAirFnW(lExhaustAirHumRat); lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp); if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) { if (ExhaustAbsorber(ChillNum).ExhTempLTAbsLeavingHeatingTempIndex == 0) { diff --git a/src/EnergyPlus/ChillerReformulatedEIR.cc b/src/EnergyPlus/ChillerReformulatedEIR.cc index 530b67089d7..879fe885bfc 100644 --- a/src/EnergyPlus/ChillerReformulatedEIR.cc +++ b/src/EnergyPlus/ChillerReformulatedEIR.cc @@ -126,7 +126,7 @@ namespace ChillerReformulatedEIR { using FluidProperties::GetSpecificHeatGlycol; using General::RoundSigDigits; using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Chiller type parameters @@ -408,7 +408,7 @@ namespace ChillerReformulatedEIR { CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 2) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_LeavingCondenserWaterTemperature; } else if (UtilityRoutines::SameString(PartLoadCurveType, "Lift") && - CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 3) { + CurveManager::PerfCurve(ElecReformEIRChiller(EIRChillerNum).ChillerEIRFPLR).NumDims == 3) { ElecReformEIRChiller(EIRChillerNum).PartLoadCurveType = PLR_Lift; } else { ShowSevereError(RoutineName + cCurrentModuleObject + "=\"" + cAlphaArgs(1) + "\""); diff --git a/src/EnergyPlus/CondenserLoopTowers.cc b/src/EnergyPlus/CondenserLoopTowers.cc index 46cb89291a1..df5530ec4f9 100644 --- a/src/EnergyPlus/CondenserLoopTowers.cc +++ b/src/EnergyPlus/CondenserLoopTowers.cc @@ -5182,7 +5182,7 @@ namespace CondenserLoopTowers { // set water and air properties Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(this->AirPress, InletAirTemp, this->AirHumRat); // Density of air [kg/m3] Real64 AirMassFlowRate = AirFlowRate * AirDensity; // Mass flow rate of air [kg/s] - Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(this->AirHumRat); // Heat capacity of air [J/kg/K] + Real64 CpAir = Psychrometrics::PsyCpAirFnW(this->AirHumRat); // Heat capacity of air [J/kg/K] Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(this->LoopNum).FluidName, this->WaterTemp, DataPlant::PlantLoop(this->LoopNum).FluidIndex, diff --git a/src/EnergyPlus/ConvectionCoefficients.cc b/src/EnergyPlus/ConvectionCoefficients.cc index 704c32bc26c..cc558c36028 100644 --- a/src/EnergyPlus/ConvectionCoefficients.cc +++ b/src/EnergyPlus/ConvectionCoefficients.cc @@ -4694,7 +4694,7 @@ namespace ConvectionCoefficients { // Using/Aliasing using DataEnvironment::OutBaroPress; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals @@ -4742,7 +4742,7 @@ namespace ConvectionCoefficients { lambda = 2.873E-3 + 7.76E-5 * TmeanFilmKelvin; // Table B.1 in ISO 15099, mu = 3.723E-6 + 4.94E-8 * TmeanFilmKelvin; // Table B.2 in ISO 15099 - Cp = PsyCpAirFnWTdb(AirHumRat); + Cp = PsyCpAirFnW(AirHumRat); // four cases depending on tilt and DeltaTemp (heat flow direction ) if (DeltaTemp > 0.0) TiltDeg = 180.0 - TiltDeg; // complement angle if cooling situation diff --git a/src/EnergyPlus/CoolTower.cc b/src/EnergyPlus/CoolTower.cc index 33efbe22868..65d947bcb78 100644 --- a/src/EnergyPlus/CoolTower.cc +++ b/src/EnergyPlus/CoolTower.cc @@ -604,7 +604,7 @@ namespace CoolTower { using DataHeatBalFanSys::MCPTC; using DataHeatBalFanSys::ZoneAirHumRat; using DataHeatBalFanSys::ZT; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyWFnTdbH; using Psychrometrics::PsyWFnTdbTwbPb; @@ -716,7 +716,7 @@ namespace CoolTower { // From the mass balance W_in*(m_air + m_water) = W_out*m_air RhoWater = RhoH2O(OutletTemp); // Assume T_water = T_outlet OutletHumRat = (InletHumRat * (AirMassFlowRate + (CoolTowerSys(CoolTowerNum).ActualWaterFlowRate * RhoWater))) / AirMassFlowRate; - AirSpecHeat = PsyCpAirFnWTdb(OutletHumRat); + AirSpecHeat = PsyCpAirFnW(OutletHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutletTemp, OutletHumRat); // Outlet air density CVF_ZoneNum = CoolTowerSys(CoolTowerNum).ActualAirVolFlowRate * GetCurrentScheduleValue(CoolTowerSys(CoolTowerNum).SchedPtr); MCPC(ZoneNum) = CVF_ZoneNum * AirDensity * AirSpecHeat; diff --git a/src/EnergyPlus/CrossVentMgr.cc b/src/EnergyPlus/CrossVentMgr.cc index d0193b93a16..35e12326564 100644 --- a/src/EnergyPlus/CrossVentMgr.cc +++ b/src/EnergyPlus/CrossVentMgr.cc @@ -863,7 +863,7 @@ namespace CrossVentMgr { using namespace DataHeatBalance; using InternalHeatGains::SumAllInternalConvectionGains; using InternalHeatGains::SumAllReturnAirConvectionGains; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleIndex; diff --git a/src/EnergyPlus/DataSurfaces.cc b/src/EnergyPlus/DataSurfaces.cc index 096c5dc21f0..0aa890b25f9 100644 --- a/src/EnergyPlus/DataSurfaces.cc +++ b/src/EnergyPlus/DataSurfaces.cc @@ -760,7 +760,7 @@ namespace DataSurfaces { for (int NodeNum = 1; NodeNum <= ZoneEquipConfig(Zone).NumInletNodes; ++NodeNum) { Real64 NodeTemp = Node(ZoneEquipConfig(Zone).InletNode(NodeNum)).Temp; Real64 MassFlowRate = Node(ZoneEquipConfig(Zone).InletNode(NodeNum)).MassFlowRate; - Real64 CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(Zone)); + Real64 CpAir = PsyCpAirFnW(ZoneAirHumRat(Zone)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/DesiccantDehumidifiers.cc b/src/EnergyPlus/DesiccantDehumidifiers.cc index 2922be780fa..518642d27dd 100644 --- a/src/EnergyPlus/DesiccantDehumidifiers.cc +++ b/src/EnergyPlus/DesiccantDehumidifiers.cc @@ -2679,7 +2679,7 @@ namespace DesiccantDehumidifiers { DataHeatBalance::HeatReclaimVS_DXCoil(DesicDehum(DesicDehumNum).DXCoilIndex).AvailCapacity = 0.0; } - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).CondenserInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(DesicDehum(DesicDehumNum).CondenserInletNode).HumRat); if (DesicDehum(DesicDehumNum).RegenFanPlacement == BlowThru) { if (DesicDehum(DesicDehumNum).regenFanType_Num != DataHVACGlobals::FanType_SystemModelObject) { @@ -2761,7 +2761,7 @@ namespace DesiccantDehumidifiers { if (RegenCoilIndex > 0) { if (NewRegenInTemp < RegenSetPointTemp) { - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); + CpAir = PsyCpAirFnW(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); } QRegen = max(0.0, (CpAir * Node(DesicDehum(DesicDehumNum).RegenAirInNode).MassFlowRate * @@ -2847,7 +2847,7 @@ namespace DesiccantDehumidifiers { } if (RegenCoilIndex > 0) { - CpAir = PsyCpAirFnWTdb(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); + CpAir = PsyCpAirFnW(Node(DesicDehum(DesicDehumNum).RegenAirInNode).HumRat); QRegen = max(0.0, (CpAir * Node(DesicDehum(DesicDehumNum).RegenAirInNode).MassFlowRate * (RegenSetPointTemp - Node(DesicDehum(DesicDehumNum).RegenAirInNode).Temp))); diff --git a/src/EnergyPlus/DisplacementVentMgr.cc b/src/EnergyPlus/DisplacementVentMgr.cc index 5f5a44c3e8d..4d394cd495d 100644 --- a/src/EnergyPlus/DisplacementVentMgr.cc +++ b/src/EnergyPlus/DisplacementVentMgr.cc @@ -586,7 +586,7 @@ namespace DisplacementVentMgr { using DataZoneEquipment::ZoneEquipConfig; using InternalHeatGains::SumInternalConvectionGainsByTypes; using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleIndex; @@ -735,7 +735,7 @@ namespace DisplacementVentMgr { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -861,13 +861,13 @@ namespace DisplacementVentMgr { AIRRATFloor(ZoneNum) = Zone(ZoneNum).Volume * min(HeightTransition(ZoneNum), HeightFloorSubzoneTop) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATFloor(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3Floor(ZoneNum) = XM3TFloor(ZoneNum); diff --git a/src/EnergyPlus/DualDuct.cc b/src/EnergyPlus/DualDuct.cc index 4ce91ace9ad..0691335e86a 100644 --- a/src/EnergyPlus/DualDuct.cc +++ b/src/EnergyPlus/DualDuct.cc @@ -1198,7 +1198,7 @@ namespace DualDuct { using namespace DataZoneEnergyDemands; // unused0909 USE DataHeatBalFanSys, ONLY: Mat using DataHVACGlobals::SmallTempDiff; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdbFnHW; // Locals @@ -1235,14 +1235,14 @@ namespace DualDuct { // If there is massflow then need to provide the correct amount of total // required zone energy if (MassFlow > SmallMassFlow) { - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); QZnReq = QTotLoad + MassFlow * CpAirZn * Node(ZoneNodeNum).Temp; // If the enthalpy is the same for the hot and cold duct then there would be a // divide by zero so for heating or cooling set the damper to one max flow // or the other. if (std::abs(DamperColdAirInlet(DamperNum).AirTemp - DamperHotAirInlet(DamperNum).AirTemp) > SmallTempDiff) { - // CpAirSysHot = PsyCpAirFnWTdb(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp) - // CpAirSysCold= PsyCpAirFnWTdb(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp) + // CpAirSysHot = PsyCpAirFnW(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp) + // CpAirSysCold= PsyCpAirFnW(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp) CpAirSysHot = CpAirZn; CpAirSysCold = CpAirZn; // Determine the Cold Air Mass Flow Rate @@ -1334,7 +1334,7 @@ namespace DualDuct { using namespace DataZoneEnergyDemands; // unused0909 USE DataHeatBalFanSys, ONLY: Mat using DataHVACGlobals::SmallTempDiff; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdbFnHW; // Locals @@ -1365,9 +1365,9 @@ namespace DualDuct { // The calculated load from the Heat Balance QTotLoad = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; // Calculate all of the required Cp's - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); - // CpAirSysHot = PsyCpAirFnWTdb(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp) - // CpAirSysCold= PsyCpAirFnWTdb(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp) + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); + // CpAirSysHot = PsyCpAirFnW(DamperHotAirInlet(DamperNum)%AirHumRat,DamperHotAirInlet(DamperNum)%AirTemp) + // CpAirSysCold= PsyCpAirFnW(DamperColdAirInlet(DamperNum)%AirHumRat,DamperColdAirInlet(DamperNum)%AirTemp) CpAirSysHot = CpAirZn; CpAirSysCold = CpAirZn; @@ -1556,7 +1556,7 @@ namespace DualDuct { // Using/Aliasing using namespace DataZoneEnergyDemands; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdbFnHW; using namespace DataGlobals; using DataHeatBalFanSys::ZoneThermostatSetPointHi; @@ -1612,9 +1612,9 @@ namespace DualDuct { QtoCoolSPRemain = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToCoolSP; // Calculate all of the required Cp's - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); - CpAirSysOA = PsyCpAirFnWTdb(Node(OAInletNodeNum).HumRat); - if (Damper(DamperNum).RecircIsUsed) CpAirSysRA = PsyCpAirFnWTdb(Node(RecircInletNodeNum).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); + CpAirSysOA = PsyCpAirFnW(Node(OAInletNodeNum).HumRat); + if (Damper(DamperNum).RecircIsUsed) CpAirSysRA = PsyCpAirFnW(Node(RecircInletNodeNum).HumRat); // Set the OA Damper to the calculated ventilation flow rate DamperOAInlet(DamperNum).AirMassFlowRate = OAMassFlow; diff --git a/src/EnergyPlus/EarthTube.cc b/src/EnergyPlus/EarthTube.cc index d1c6101ee4a..1c09af6e991 100644 --- a/src/EnergyPlus/EarthTube.cc +++ b/src/EnergyPlus/EarthTube.cc @@ -556,7 +556,7 @@ namespace EarthTube { if (std::abs(MAT(NZ) - OutDryBulbTemp) < EarthTubeSys(Loop).DelTemperature) continue; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutDryBulbTemp, OutHumRat); - AirSpecHeat = PsyCpAirFnWTdb(OutHumRat); + AirSpecHeat = PsyCpAirFnW(OutHumRat); EVF(NZ) = EarthTubeSys(Loop).DesignLevel * GetCurrentScheduleValue(EarthTubeSys(Loop).SchedPtr); MCPE(NZ) = EVF(NZ) * AirDensity * AirSpecHeat * (EarthTubeSys(Loop).ConstantTermCoef + std::abs(OutDryBulbTemp - MAT(NZ)) * EarthTubeSys(Loop).TemperatureTermCoef + @@ -717,7 +717,7 @@ namespace EarthTube { // Break the infiltration load into heat gain and loss components. AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, OutDryBulbTemp, OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); ZnRptET(ZoneLoop).EarthTubeVolume = (MCPE(ZoneLoop) / CpAir / AirDensity) * ReportingConstant; ZnRptET(ZoneLoop).EarthTubeMass = (MCPE(ZoneLoop) / CpAir) * ReportingConstant; ZnRptET(ZoneLoop).EarthTubeVolFlowRate = MCPE(ZoneLoop) / CpAir / AirDensity; diff --git a/src/EnergyPlus/ElectricBaseboardRadiator.cc b/src/EnergyPlus/ElectricBaseboardRadiator.cc index 1e4f19c123b..dac86539318 100644 --- a/src/EnergyPlus/ElectricBaseboardRadiator.cc +++ b/src/EnergyPlus/ElectricBaseboardRadiator.cc @@ -770,7 +770,7 @@ namespace ElectricBaseboardRadiator { using DataZoneEnergyDemands::CurDeadBandOrSetback; using DataZoneEnergyDemands::ZoneSysEnergyDemand; using DataZoneEquipment::ZoneEquipConfig; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using ScheduleManager::GetCurrentScheduleValue; using ScheduleManager::GetScheduleIndex; @@ -794,7 +794,7 @@ namespace ElectricBaseboardRadiator { QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; AirInletTemp = ElecBaseboard(BaseboardNum).AirInletTemp; AirOutletTemp = AirInletTemp; - CpAir = PsyCpAirFnWTdb(ElecBaseboard(BaseboardNum).AirInletHumRat); + CpAir = PsyCpAirFnW(ElecBaseboard(BaseboardNum).AirInletHumRat); AirMassFlowRate = SimpConvAirFlowSpeed; CapacitanceAir = CpAir * AirMassFlowRate; diff --git a/src/EnergyPlus/EvaporativeCoolers.cc b/src/EnergyPlus/EvaporativeCoolers.cc index f467694b9d8..995eba7616e 100644 --- a/src/EnergyPlus/EvaporativeCoolers.cc +++ b/src/EnergyPlus/EvaporativeCoolers.cc @@ -1859,7 +1859,7 @@ namespace EvaporativeCoolers { // CALCULATE THE TLDB FROM HX EQUATIONS GIVEN AN EFFICIENCY //*************************************************************************** EffHX = EvapCond(EvapCoolNum).IndirectHXEffectiveness; - CpAir = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); + CpAir = PsyCpAirFnW(EvapCond(EvapCoolNum).InletHumRat); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, EvapCond(EvapCoolNum).InletTemp, EvapCond(EvapCoolNum).InletHumRat); CFMAir = EvapCond(EvapCoolNum).VolFlowRate; // Volume Flow Rate Primary Side CFMSec = EvapCond(EvapCoolNum).IndirectVolFlowRate; // Volume Flolw Rate Secondary Side @@ -3047,10 +3047,10 @@ namespace EvaporativeCoolers { if (OutletTemp > EvapCond(EvapCoolNum).InletTemp) { OutletTemp = EvapCond(EvapCoolNum).InletTemp; } - CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); + CpAirSys = PsyCpAirFnW(EvapCond(EvapCoolNum).InletHumRat); CapFlowSys = EvapCond(EvapCoolNum).InletMassFlowRate * CpAirSys; QHXRate = CapFlowSys * (EvapCond(EvapCoolNum).InletTemp - OutletTemp); - CpAirSec = PsyCpAirFnWTdb(EHumRatSec); + CpAirSec = PsyCpAirFnW(EHumRatSec); CapFlowSec = AirMassFlowSec * CpAirSec; OutletTempSec = EDBTSec + QHXRate / CapFlowSec; if (OutletTempSec >= EvapCond(EvapCoolNum).InletTemp) { @@ -3071,7 +3071,7 @@ namespace EvaporativeCoolers { if (OutletTemp > EvapCond(EvapCoolNum).InletTemp) { OutletTemp = EvapCond(EvapCoolNum).InletTemp; } - CpAirSys = PsyCpAirFnWTdb(EvapCond(EvapCoolNum).InletHumRat); + CpAirSys = PsyCpAirFnW(EvapCond(EvapCoolNum).InletHumRat); CapFlowSys = EvapCond(EvapCoolNum).InletMassFlowRate * CpAirSys; QHXRate = CapFlowSys * (EvapCond(EvapCoolNum).InletTemp - OutletTemp); SecOutletEnthalpy = EvapCond(EvapCoolNum).SecInletEnthalpy + QHXRate / AirMassFlowSec; @@ -3120,7 +3120,7 @@ namespace EvaporativeCoolers { // Using/Aliasing using DataEnvironment::OutBaroPress; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHfgAirFnWTdb; using Psychrometrics::PsyWFnTdbH; using Psychrometrics::PsyWFnTdbTwbPb; @@ -3147,7 +3147,7 @@ namespace EvaporativeCoolers { if (AirMassFlowSec > 0.0) { if ((OperatingMode == DryModulated || OperatingMode == DryFull)) { EvapCond(EvapCoolNum).SecOutletHumRat = EHumRatSec; - CpAirSec = PsyCpAirFnWTdb(EHumRatSec); + CpAirSec = PsyCpAirFnW(EHumRatSec); EvapCond(EvapCoolNum).SecOutletTemp = EDBTSec + QHXTotal / AirMassFlowSec / CpAirSec; EvapCond(EvapCoolNum).SecOutletEnthalpy = PsyHFnTdbW(EvapCond(EvapCoolNum).SecOutletTemp, EHumRatSec); EvapCond(EvapCoolNum).SecOuletWetBulbTemp = PsyTwbFnTdbWPb(EvapCond(EvapCoolNum).SecOutletTemp, EHumRatSec, OutBaroPress); diff --git a/src/EnergyPlus/EvaporativeFluidCoolers.cc b/src/EnergyPlus/EvaporativeFluidCoolers.cc index edb39b2adf0..c2fbeec5655 100644 --- a/src/EnergyPlus/EvaporativeFluidCoolers.cc +++ b/src/EnergyPlus/EvaporativeFluidCoolers.cc @@ -119,7 +119,7 @@ namespace EvaporativeFluidCoolers { using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbRhPb; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTsatFnHPb; @@ -2760,7 +2760,7 @@ namespace EvaporativeFluidCoolers { AirDensity = PsyRhoAirFnPbTdbW( SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirPress, InletAirTemp, SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat); AirMassFlowRate = AirFlowRate * AirDensity; - CpAir = PsyCpAirFnWTdb(SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat); + CpAir = PsyCpAirFnW(SimpleEvapFluidCoolerInlet(EvapFluidCoolerNum).AirHumRat); CpWater = GetSpecificHeatGlycol(PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum).LoopNum).FluidName, InletWaterTemp, PlantLoop(SimpleEvapFluidCooler(EvapFluidCoolerNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/FanCoilUnits.cc b/src/EnergyPlus/FanCoilUnits.cc index 3359c3f6647..0f17151db19 100644 --- a/src/EnergyPlus/FanCoilUnits.cc +++ b/src/EnergyPlus/FanCoilUnits.cc @@ -1373,7 +1373,7 @@ namespace FanCoilUnits { using HVACHXAssistedCoolingCoil::GetHXCoilType; using HVACHXAssistedCoolingCoil::GetHXDXCoilName; using PlantUtilities::MyPlantSizingIndex; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using ReportSizingManager::ReportSizingOutput; using ReportSizingManager::RequestSizing; diff --git a/src/EnergyPlus/Fans.cc b/src/EnergyPlus/Fans.cc index 6717fca0227..3945145bcd7 100644 --- a/src/EnergyPlus/Fans.cc +++ b/src/EnergyPlus/Fans.cc @@ -131,7 +131,7 @@ namespace Fans { using DataHVACGlobals::TurnFansOn; // cpw22Aug2010 Added FanType_ComponentModel using DataHVACGlobals::UnbalExhMassFlow; using EMSManager::ManageEMS; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; using namespace ScheduleManager; @@ -2057,7 +2057,7 @@ namespace Fans { // This fan does not change the moisture or Mass Flow across the component Fan(FanNum).OutletAirHumRat = Fan(FanNum).InletAirHumRat; Fan(FanNum).OutletAirMassFlowRate = MassFlow; - // Fan(FanNum)%OutletAirTemp = Tin + PowerLossToAir/(MassFlow*PsyCpAirFnWTdb(Win,Tin)) + // Fan(FanNum)%OutletAirTemp = Tin + PowerLossToAir/(MassFlow*PsyCpAirFnW(Win,Tin)) Fan(FanNum).OutletAirTemp = PsyTdbFnHW(Fan(FanNum).OutletAirEnthalpy, Fan(FanNum).OutletAirHumRat); } else { // Fan is off and not operating no power consumed and mass flow rate. @@ -3117,7 +3117,7 @@ namespace Fans { MotEff = Fan(FanNum).MotEff; MotInAirFrac = Fan(FanNum).MotInAirFrac; RhoAir = StdRhoAir; - CpAir = PsyCpAirFnWTdb(constant_zero); + CpAir = PsyCpAirFnW(constant_zero); DesignDeltaT = (DeltaP / (RhoAir * CpAir * TotEff)) * (MotEff + MotInAirFrac * (1.0 - MotEff)); } else { DesignDeltaT = 0.0; diff --git a/src/EnergyPlus/FluidCoolers.cc b/src/EnergyPlus/FluidCoolers.cc index 338a27fd3fa..55f83dcbaeb 100644 --- a/src/EnergyPlus/FluidCoolers.cc +++ b/src/EnergyPlus/FluidCoolers.cc @@ -1650,7 +1650,7 @@ namespace FluidCoolers { Real64 AirDensity = Psychrometrics::PsyRhoAirFnPbTdbW(SimpleFluidCooler(FluidCoolerNum).AirPress, InletAirTemp, SimpleFluidCooler(FluidCoolerNum).AirHumRat); Real64 AirMassFlowRate = AirFlowRate * AirDensity; - Real64 CpAir = Psychrometrics::PsyCpAirFnWTdb(SimpleFluidCooler(FluidCoolerNum).AirHumRat); + Real64 CpAir = Psychrometrics::PsyCpAirFnW(SimpleFluidCooler(FluidCoolerNum).AirHumRat); Real64 CpWater = FluidProperties::GetSpecificHeatGlycol(DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidName, _InletWaterTemp, DataPlant::PlantLoop(SimpleFluidCooler(FluidCoolerNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/Furnaces.cc b/src/EnergyPlus/Furnaces.cc index 08c73e481ce..65ed9c7caa7 100644 --- a/src/EnergyPlus/Furnaces.cc +++ b/src/EnergyPlus/Furnaces.cc @@ -176,7 +176,7 @@ namespace Furnaces { using DataEnvironment::StdBaroPress; using DataEnvironment::StdRhoAir; using namespace DataZoneEquipment; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHfgAirFnWTdb; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -6408,7 +6408,7 @@ namespace Furnaces { // OnOffAirFlowRatio = 1.0 // Calculate the Cp Air - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); + cpair = PsyCpAirFnW(Node(FurnaceInletNode).HumRat); if (FirstHVACIteration) { HeatCoilLoad = ZoneLoad; @@ -6708,7 +6708,7 @@ namespace Furnaces { OpMode = Furnace(FurnaceNum).OpMode; HumControl = false; // Calculate the Cp Air for all conditions - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); + cpair = PsyCpAirFnW(Node(FurnaceInletNode).HumRat); NoHeatOutput = 0.0; SystemSensibleLoad = 0.0; ReheatCoilLoad = 0.0; @@ -7010,7 +7010,7 @@ namespace Furnaces { TempOutHeatingCoil = Node(FurnaceOutletNode).Temp; } } - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); + cpair = PsyCpAirFnW(Node(FurnaceInletNode).HumRat); // TempOutHeatingCoil = Node(FurnaceOutletNode)%Temp + HeatCoilLoad/(cpair*Furnace(FurnaceNum)%MdotFurnace) if ((TempOutHeatingCoil > Furnace(FurnaceNum).DesignMaxOutletTemp) && (HeatCoilLoad > 0.0)) { // deltaT = Furnace(FurnaceNum)%DesignMaxOutletTemp - Node(FurnaceOutletNode)%Temp @@ -7997,7 +7997,7 @@ namespace Furnaces { //*********INITIAL CALCULATIONS**************** // Calculate the Cp Air for all conditions - cpair = PsyCpAirFnWTdb(Node(FurnaceInletNode).HumRat); + cpair = PsyCpAirFnW(Node(FurnaceInletNode).HumRat); // set the fan part load fraction // Note: OnOffFanPartLoadFraction is passed to the @@ -8867,7 +8867,7 @@ namespace Furnaces { if (Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp > Furnace(FurnaceNum).DesignMaxOutletTemp) { Wout = Node(FurnaceOutletNode).HumRat; Tout = Furnace(FurnaceNum).DesignMaxOutletTemp; - ModifiedHeatCoilLoad = HeatCoilLoad - (AirMassFlow * PsyCpAirFnWTdb(Wout) * (Node(FurnaceOutletNode).Temp - Tout)); + ModifiedHeatCoilLoad = HeatCoilLoad - (AirMassFlow * PsyCpAirFnW(Wout) * (Node(FurnaceOutletNode).Temp - Tout)); Node(FurnaceOutletNode).Temp = Tout; } @@ -10102,7 +10102,7 @@ namespace Furnaces { using IntegratedHeatPump::GetMaxSpeedNumIHP; using IntegratedHeatPump::IHPOperationMode; using IntegratedHeatPump::IntegratedHeatPumps; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // SUBROUTINE PARAMETER DEFINITIONS: int const MaxIte(500); // maximum number of iterations @@ -10451,7 +10451,7 @@ namespace Furnaces { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp < Furnace(FurnaceNum).DesignMaxOutletTemp) { - CpAir = PsyCpAirFnWTdb(Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).HumRat); + CpAir = PsyCpAirFnW(Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).HumRat); SupHeaterLoad = Node(Furnace(FurnaceNum).FurnaceInletNodeNum).MassFlowRate * CpAir * (Furnace(FurnaceNum).DesignMaxOutletTemp - Node(Furnace(FurnaceNum).FurnaceOutletNodeNum).Temp); diff --git a/src/EnergyPlus/GeneralRoutines.cc b/src/EnergyPlus/GeneralRoutines.cc index 5c8ca32ec26..6cf83d317fe 100644 --- a/src/EnergyPlus/GeneralRoutines.cc +++ b/src/EnergyPlus/GeneralRoutines.cc @@ -164,7 +164,7 @@ void ControlCompOutput(std::string const &CompName, // the component N using HWBaseboardRadiator::CalcHWBaseboard; using OutdoorAirUnit::CalcOAUnitCoilComps; using PlantUtilities::SetActuatedBranchFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using SteamBaseboardRadiator::CalcSteamBaseboard; using UnitHeater::CalcUnitHeaterComponents; using UnitVentilator::CalcUnitVentilatorComponents; @@ -502,7 +502,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // simulate series piu reheat coil SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check + CpAir = PsyCpAirFnW(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check LoadMet = CpAir * Node(TempOutNode).MassFlowRate * (Node(TempOutNode).Temp - Node(TempInNode).Temp); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -512,7 +512,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // simulate series piu reheat coil SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check + CpAir = PsyCpAirFnW(Node(TempOutNode).HumRat); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check LoadMet = CpAir * Node(TempOutNode).MassFlowRate * (Node(TempOutNode).Temp - Node(TempInNode).Temp); // Autodesk:OPTIONAL TempInNode, TempOutNode used without PRESENT check ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -522,7 +522,7 @@ void ControlCompOutput(std::string const &CompName, // the component N // Simulate reheat coil for the VAV system SimulateWaterCoilComponents(CompName, FirstHVACIteration, CompNum); // Calculate the control signal (the variable we are forcing to zero) - CpAir = PsyCpAirFnWTdb(Node(TempOutNode).HumRat); + CpAir = PsyCpAirFnW(Node(TempOutNode).HumRat); if (present(AirMassFlow)) { LoadMet = AirMassFlow * CpAir * Node(TempOutNode).Temp; ZoneController.SensedValue = (LoadMet - QZnReq) / Denom; @@ -1043,7 +1043,7 @@ void CalcPassiveExteriorBaffleGap(Array1S_int const SurfPtrARR, // Array of inde using DataHeatBalSurface::TH; using DataSurfaces::Surface; using DataSurfaces::SurfaceData; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyWFnTdbTwbPb; using SolarCollectors::Collector; @@ -1128,7 +1128,7 @@ void CalcPassiveExteriorBaffleGap(Array1S_int const SurfPtrARR, // Array of inde LocalOutHumRat = PsyWFnTdbTwbPb(LocalOutDryBulbTemp, LocalWetBulbTemp, OutBaroPress, RoutineName); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, LocalOutDryBulbTemp, LocalOutHumRat, RoutineName); - CpAir = PsyCpAirFnWTdb(LocalOutHumRat); + CpAir = PsyCpAirFnW(LocalOutHumRat); if (!IsRain) { Tamb = LocalOutDryBulbTemp; } else { // when raining we use wetbulb not drybulb diff --git a/src/EnergyPlus/HVACCooledBeam.cc b/src/EnergyPlus/HVACCooledBeam.cc index 289fec756ec..9711f8fbd6c 100644 --- a/src/EnergyPlus/HVACCooledBeam.cc +++ b/src/EnergyPlus/HVACCooledBeam.cc @@ -123,7 +123,7 @@ namespace HVACCooledBeam { using DataHVACGlobals::SmallMassFlow; using DataHVACGlobals::SmallWaterVolFlow; using DataHVACGlobals::TimeStepSys; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -775,7 +775,7 @@ namespace HVACCooledBeam { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolMassFlow >= SmallAirVolFlow) { DesAirVolFlow = CoolBeam(CBNum).MaxAirVolFlow; - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); + CpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); // the design cooling coil load is the zone load minus whatever the central system does. Note that // DesCoolCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak > 0.0) { @@ -980,8 +980,8 @@ namespace HVACCooledBeam { QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; QToCoolSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToCoolSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); - CpAirSys = PsyCpAirFnWTdb(Node(InAirNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); + CpAirSys = PsyCpAirFnW(Node(InAirNode).HumRat); MaxColdWaterFlow = CoolBeam(CBNum).MaxCoolWaterMassFlow; SetComponentFlowRate(MaxColdWaterFlow, CoolBeam(CBNum).CWInNode, diff --git a/src/EnergyPlus/HVACFan.cc b/src/EnergyPlus/HVACFan.cc index 1be87b88a4c..c22cfed2e51 100644 --- a/src/EnergyPlus/HVACFan.cc +++ b/src/EnergyPlus/HVACFan.cc @@ -1088,7 +1088,7 @@ namespace HVACFan { Real64 FanSystem::getFanDesignTemperatureRise() const { if (!m_objSizingFlag) { - Real64 cpAir = Psychrometrics::PsyCpAirFnWTdb(DataPrecisionGlobals::constant_zero); + Real64 cpAir = Psychrometrics::PsyCpAirFnW(DataPrecisionGlobals::constant_zero); Real64 designDeltaT = (deltaPress / (m_rhoAirStdInit * cpAir * m_fanTotalEff)) * (m_motorEff + m_motorInAirFrac * (1.0 - m_motorEff)); return designDeltaT; } else { diff --git a/src/EnergyPlus/HVACFourPipeBeam.cc b/src/EnergyPlus/HVACFourPipeBeam.cc index a957964ccf5..b00c5b7f0fc 100644 --- a/src/EnergyPlus/HVACFourPipeBeam.cc +++ b/src/EnergyPlus/HVACFourPipeBeam.cc @@ -701,8 +701,8 @@ namespace FourPipeBeam { Node(this->airInNodeNum).MassFlowRate = this->mDotSystemAir; this->tDBZoneAirTemp = Node(this->zoneNodeIndex).Temp; this->tDBSystemAir = Node(this->airInNodeNum).Temp; - this->cpZoneAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->zoneNodeIndex).HumRat); - this->cpSystemAir = Psychrometrics::PsyCpAirFnWTdb(Node(this->airInNodeNum).HumRat); + this->cpZoneAir = Psychrometrics::PsyCpAirFnW(Node(this->zoneNodeIndex).HumRat); + this->cpSystemAir = Psychrometrics::PsyCpAirFnW(Node(this->airInNodeNum).HumRat); this->qDotBeamCooling = 0.0; this->qDotBeamHeating = 0.0; this->supAirCoolingRate = 0.0; @@ -724,7 +724,7 @@ namespace FourPipeBeam { using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::MyPlantSizingIndex; using PlantUtilities::RegisterPlantCompDesignFlow; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using ReportSizingManager::ReportSizingOutput; using namespace std::placeholders; using General::SolveRoot; @@ -821,7 +821,7 @@ namespace FourPipeBeam { // max flow is as if the air supply was sufficient to provide all the conditioning if (beamCoolingPresent) { - cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); + cpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); if ((TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak - TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU) > 2.0) { // avoid div by zero and blow up @@ -846,8 +846,8 @@ namespace FourPipeBeam { this->mDotHW = 0.0; this->tDBZoneAirTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak; this->tDBSystemAir = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInTempTU; - this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtCoolPeak); - this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); + this->cpZoneAir = PsyCpAirFnW(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtCoolPeak); + this->cpSystemAir = PsyCpAirFnW(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolCoilInHumRatTU); this->qDotZoneReq = -1.0 * TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolLoad; this->qDotZoneToCoolSetPt = -1.0 * TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolLoad; this->airAvailable = true; @@ -865,7 +865,7 @@ namespace FourPipeBeam { } if (beamHeatingPresent) { - cpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); + cpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); Real64 maxFlowHeat = 0.0; if ((TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU - TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak) > 2.0) { // avoid div by zero and blow up @@ -887,8 +887,8 @@ namespace FourPipeBeam { this->mDotCW = 0.0; this->tDBZoneAirTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; this->tDBSystemAir = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInTempTU; - this->cpZoneAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak); - this->cpSystemAir = PsyCpAirFnWTdb(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); + this->cpZoneAir = PsyCpAirFnW(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak); + this->cpSystemAir = PsyCpAirFnW(DataSizing::TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatCoilInHumRatTU); this->qDotZoneReq = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad; this->qDotZoneToHeatSetPt = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad; this->airAvailable = true; diff --git a/src/EnergyPlus/HVACManager.cc b/src/EnergyPlus/HVACManager.cc index a8a64b14a8f..c433772f21f 100644 --- a/src/EnergyPlus/HVACManager.cc +++ b/src/EnergyPlus/HVACManager.cc @@ -2364,7 +2364,7 @@ namespace HVACManager { using DataHeatBalFanSys::MDotOA; using DataHVACGlobals::CycleOn; using DataHVACGlobals::CycleOnZoneFansOnly; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHgAirFnWTdb; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -2424,7 +2424,7 @@ namespace HVACManager { // Reports zone exhaust loss by exhaust fans for (ZoneLoop = 1; ZoneLoop <= NumOfZones; ++ZoneLoop) { // Start of zone loads report variable update loop ... - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); H2OHtOfVap = PsyHgAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); ADSCorrectionFactor = 1.0; if (AirflowNetwork::SimulateAirflowNetwork == AirflowNetwork::AirflowNetworkControlSimpleADS) { @@ -2491,7 +2491,7 @@ namespace HVACManager { ZnAirRpt(ZoneLoop).InfilHeatLoss = 0.0; } // Report infiltration latent gains and losses - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); H2OHtOfVap = PsyHgAirFnWTdb(OutHumRat, Zone(ZoneLoop).OutDryBulbTemp); if (ZoneAirHumRat(ZoneLoop) > OutHumRat) { @@ -2517,7 +2517,7 @@ namespace HVACManager { } // first calculate mass flows using outside air heat capacity for consistency with input to heat balance - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); ZnAirRpt(ZoneLoop).InfilMass = (MCPI(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).InfilMdot = (MCPI(ZoneLoop) / CpAir) * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).VentilMass = (MCPV(ZoneLoop) / CpAir) * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2624,7 +2624,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(Mixing(MixNum).FromZone)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0); + CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(Mixing(MixNum).FromZone)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += Mixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += Mixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += Mixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2649,7 +2649,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).FromZone)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0); + CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).FromZone)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2669,7 +2669,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(CrossMixing(MixNum).ZonePtr)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0); + CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(CrossMixing(MixNum).ZonePtr)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += CrossMixing(MixNum).DesiredAirFlowRate * TimeStepSys * SecInHour * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixVdotCurDensity += CrossMixing(MixNum).DesiredAirFlowRate * ADSCorrectionFactor; ZnAirRpt(ZoneLoop).MixMass += CrossMixing(MixNum).DesiredAirFlowRate * AirDensity * TimeStepSys * SecInHour * ADSCorrectionFactor; @@ -2700,7 +2700,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0); + CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0); H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneB)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneB)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += @@ -2729,7 +2729,7 @@ namespace HVACManager { (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0, (ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, BlankString); - CpAir = PsyCpAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0); + CpAir = PsyCpAirFnW((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0); H2OHtOfVap = PsyHgAirFnWTdb((ZoneAirHumRat(ZoneLoop) + ZoneAirHumRat(ZoneA)) / 2.0, (MAT(ZoneLoop) + MAT(ZoneA)) / 2.0); ZnAirRpt(ZoneLoop).MixVolume += diff --git a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc index 77412c1b158..6697c1f716b 100644 --- a/src/EnergyPlus/HVACMultiSpeedHeatPump.cc +++ b/src/EnergyPlus/HVACMultiSpeedHeatPump.cc @@ -2850,7 +2850,7 @@ namespace HVACMultiSpeedHeatPump { using General::SolveRoot; using General::TrimSigDigits; using HeatingCoils::SimulateHeatingCoilComponents; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3301,7 +3301,7 @@ namespace HVACMultiSpeedHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).Temp < MSHeatPump(MSHeatPumpNum).SuppMaxAirTemp) { - CpAir = PsyCpAirFnWTdb(Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).HumRat); + CpAir = PsyCpAirFnW(Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).HumRat); SupHeaterLoad = Node(MSHeatPump(MSHeatPumpNum).AirInletNodeNum).MassFlowRate * CpAir * (MSHeatPump(MSHeatPumpNum).SuppMaxAirTemp - Node(MSHeatPump(MSHeatPumpNum).AirOutletNodeNum).Temp); diff --git a/src/EnergyPlus/HVACSingleDuctInduc.cc b/src/EnergyPlus/HVACSingleDuctInduc.cc index 0c7b5b1f01c..678f378f4b4 100644 --- a/src/EnergyPlus/HVACSingleDuctInduc.cc +++ b/src/EnergyPlus/HVACSingleDuctInduc.cc @@ -120,7 +120,7 @@ namespace HVACSingleDuctInduc { using DataHVACGlobals::SmallAirVolFlow; using DataHVACGlobals::SmallLoad; using DataHVACGlobals::SmallMassFlow; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -879,7 +879,7 @@ namespace HVACSingleDuctInduc { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatMassFlow >= SmallAirVolFlow) { DesPriVolFlow = IndUnit(IUNum).MaxTotAirVolFlow / (1.0 + IndUnit(IUNum).InducRatio); - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); + CpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); // the design heating coil load is the zone load minus whatever the central system does. Note that // DesHeatCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak > 0.0) { @@ -982,7 +982,7 @@ namespace HVACSingleDuctInduc { if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesCoolMassFlow >= SmallAirVolFlow) { DesPriVolFlow = IndUnit(IUNum).MaxTotAirVolFlow / (1.0 + IndUnit(IUNum).InducRatio); - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); + CpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).CoolDesHumRat); // the design cooling coil load is the zone load minus whatever the central system does. Note that // DesCoolCoilInTempTU is really the primary air inlet temperature for the unit. if (TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtCoolPeak > 0.0) { @@ -1393,7 +1393,7 @@ namespace HVACSingleDuctInduc { OutletNode = IndUnit(IUNum).OutAirNode; PriAirMassFlow = Node(PriNode).MassFlowRateMaxAvail; InducRat = IndUnit(IUNum).InducRatio; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNode).HumRat); SecAirMassFlow = InducRat * PriAirMassFlow; TotAirMassFlow = PriAirMassFlow + SecAirMassFlow; HotControlNode = IndUnit(IUNum).HWControlNode; diff --git a/src/EnergyPlus/HVACUnitaryBypassVAV.cc b/src/EnergyPlus/HVACUnitaryBypassVAV.cc index 9532bae3b32..1310ce9494b 100644 --- a/src/EnergyPlus/HVACUnitaryBypassVAV.cc +++ b/src/EnergyPlus/HVACUnitaryBypassVAV.cc @@ -3339,7 +3339,7 @@ namespace HVACUnitaryBypassVAV { (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingElectric) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingWater) || (SELECT_CASE_var == DataHVACGlobals::Coil_HeatingSteam)) { // not a DX heating coil if (CBVAV(CBVAVNum).HeatCoolMode == HeatingMode) { - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).HumRat); QHeater = DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).MassFlowRate * CpAir * (CBVAV(CBVAVNum).CoilTempSetPoint - DataLoopNode::Node(CBVAV(CBVAVNum).HeatingCoilInletNode).Temp); } else { @@ -3580,7 +3580,7 @@ namespace HVACUnitaryBypassVAV { QToHeatSetPt = DataZoneEnergyDemands::ZoneSysEnergyDemand(CBVAV(CBVAVNumber).ControlledZoneNum(ZoneNum)).OutputRequiredToHeatingSP; } - Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(OutAirHumRat); + Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnW(OutAirHumRat); // Find the supply air temperature that will force the box to full flow if (BoxOutletNodeNum > 0) { @@ -3797,7 +3797,7 @@ namespace HVACUnitaryBypassVAV { int MixerInletAirNode = CBVAV(CBVAVNum).MixerInletAirNode; // Inlet air node number in OA mixer Real64 SystemMassFlow = 0.0; // System mass flow rate required for all zones [kg/s] - Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(OutletNode).HumRat); // Specific heat of outlet air [J/kg-K] + Real64 CpSupplyAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(OutletNode).HumRat); // Specific heat of outlet air [J/kg-K] // Determine zone air flow for (int ZoneNum = 1; ZoneNum <= CBVAV(CBVAVNum).NumControlledZones; ++ZoneNum) { int ZoneNodeNum = CBVAV(CBVAVNum).ActualZoneNodeNum(ZoneNum); @@ -3817,7 +3817,7 @@ namespace HVACUnitaryBypassVAV { } else { ZoneLoad = DataZoneEnergyDemands::ZoneSysEnergyDemand(CBVAV(CBVAVNum).ControlledZoneNum(ZoneNum)).RemainingOutputRequired; } - Real64 CpZoneAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(ZoneNodeNum).HumRat); + Real64 CpZoneAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(ZoneNodeNum).HumRat); Real64 DeltaCpTemp = CpSupplyAir * DataLoopNode::Node(OutletNode).Temp - CpZoneAir * DataLoopNode::Node(ZoneNodeNum).Temp; // Need to check DeltaCpTemp and ensure that it is not zero diff --git a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc index 164e8189855..5ce7e0d1eb4 100644 --- a/src/EnergyPlus/HVACVariableRefrigerantFlow.cc +++ b/src/EnergyPlus/HVACVariableRefrigerantFlow.cc @@ -13820,7 +13820,7 @@ namespace HVACVariableRefrigerantFlow { Real64 HeatCoilCapacityAllowed; // heating coil maximum capacity that can be deleivered at current time [W] Real64 MDotAir = DataLoopNode::Node(HeatCoilAirInletNode).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(HeatCoilAirInletNode).HumRat); Real64 HCDeltaT = max(0.0, HeatCoilMaxSATAllowed - DataLoopNode::Node(HeatCoilAirInletNode).Temp); HeatCoilCapacityAllowed = MDotAir * CpAirIn * HCDeltaT; diff --git a/src/EnergyPlus/HWBaseboardRadiator.cc b/src/EnergyPlus/HWBaseboardRadiator.cc index 993ad6bdc87..463547fc1a1 100644 --- a/src/EnergyPlus/HWBaseboardRadiator.cc +++ b/src/EnergyPlus/HWBaseboardRadiator.cc @@ -127,7 +127,7 @@ namespace HWBaseboardRadiator { // Use statements for access to subroutines in other modules using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ReportSizingManager::ReportSizingOutput; @@ -1321,7 +1321,7 @@ namespace HWBaseboardRadiator { (WaterMassFlowRate > 0.0)) { // Calculate air mass flow rate AirMassFlowRate = HWBaseboard(BaseboardNum).AirMassFlowRateStd * (WaterMassFlowRate / HWBaseboard(BaseboardNum).WaterMassFlowRateMax); - CapacitanceAir = PsyCpAirFnWTdb(HWBaseboard(BaseboardNum).AirInletHumRat) * AirMassFlowRate; + CapacitanceAir = PsyCpAirFnW(HWBaseboard(BaseboardNum).AirInletHumRat) * AirMassFlowRate; Cp = GetSpecificHeatGlycol(PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidName, WaterInletTemp, PlantLoop(HWBaseboard(BaseboardNum).LoopNum).FluidIndex, diff --git a/src/EnergyPlus/HeatBalanceAirManager.cc b/src/EnergyPlus/HeatBalanceAirManager.cc index c04382c9adc..862a62fe7f2 100644 --- a/src/EnergyPlus/HeatBalanceAirManager.cc +++ b/src/EnergyPlus/HeatBalanceAirManager.cc @@ -114,7 +114,7 @@ namespace HeatBalanceAirManager { using namespace DataSurfaces; // Use statements for access to subroutines in other modules - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 654497cbb15..06d6c18c16f 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5252,7 +5252,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTemp, PsyWFnTdbRhPb(GroundTemp, 1.0, OutBaroPress, RoutineNameGroundTemp)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; @@ -5269,7 +5269,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTemp, PsyWFnTdbRhPb(GroundTemp, 1.0, OutBaroPress, RoutineNameGroundTemp)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5293,7 +5293,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTempFC, PsyWFnTdbRhPb(GroundTempFC, 1.0, OutBaroPress, RoutineNameGroundTempFC)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; @@ -5309,7 +5309,7 @@ namespace HeatBalanceSurfaceManager { HConvExtFD(SurfNum) / ((PsyRhoAirFnPbTdbW(OutBaroPress, GroundTempFC, PsyWFnTdbRhPb(GroundTempFC, 1.0, OutBaroPress, RoutineNameGroundTempFC)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5362,7 +5362,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOtherSideCoefNoCalcExt)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSky; HGrndFD(SurfNum) = HGround; HAirFD(SurfNum) = HAir; @@ -5412,7 +5412,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOtherSideCoefCalcExt)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5457,7 +5457,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOSCM)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = OSCM(OPtr).HRad; // CR 8046, use sky term for surface to baffle IR HGrndFD(SurfNum) = 0.0; // CR 8046, null out and use only sky term for surface to baffle IR HAirFD(SurfNum) = 0.0; // CR 8046, null out and use only sky term for surface to baffle IR @@ -5539,7 +5539,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvWetSurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5557,7 +5557,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvWetSurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5579,7 +5579,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameExtEnvDrySurf)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); // check for saturation conditions of air RhoVaporSat = PsyRhovFnTdbRh(TempOutsideAirFD(SurfNum), 1.0, HBSurfManDrySurfCondFD); if (RhoVaporAirOut(SurfNum) > RhoVaporSat) RhoVaporAirOut(SurfNum) = RhoVaporSat; @@ -5616,7 +5616,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameNoWind)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = HSkyExtSurf(SurfNum); HGrndFD(SurfNum) = HGrdExtSurf(SurfNum); HAirFD(SurfNum) = HAirExtSurf(SurfNum); @@ -5677,7 +5677,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameOther)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = 0.0; HGrndFD(SurfNum) = 0.0; HAirFD(SurfNum) = 0.0; @@ -5701,7 +5701,7 @@ namespace HeatBalanceSurfaceManager { TempOutsideAirFD(SurfNum), PsyWFnTdbRhPb(TempOutsideAirFD(SurfNum), 1.0, OutBaroPress, RoutineNameIZPart)) + RhoVaporAirOut(SurfNum)) * - PsyCpAirFnWTdb(OutHumRat)); + PsyCpAirFnW(OutHumRat)); HSkyFD(SurfNum) = 0.0; HGrndFD(SurfNum) = 0.0; HAirFD(SurfNum) = 0.0; @@ -5956,7 +5956,8 @@ namespace HeatBalanceSurfaceManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); + Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -6066,7 +6067,7 @@ namespace HeatBalanceSurfaceManager { RhoVaporAirIn(SurfNum) = min(PsyRhovFnTdbWPb_fast(MAT_zone, ZoneAirHumRat_zone, OutBaroPress), PsyRhovFnTdbRh(MAT_zone, 1.0, HBSurfManInsideSurf)); HMassConvInFD(SurfNum) = HConvIn_surf / (PsyRhoAirFnPbTdbW_fast(OutBaroPress, MAT_zone, ZoneAirHumRat_zone) * - PsyCpAirFnWTdb_fast(ZoneAirHumRat_zone)); + PsyCpAirFnW_fast(ZoneAirHumRat_zone)); } } } @@ -7193,7 +7194,7 @@ namespace HeatBalanceSurfaceManager { using DataSurfaces::ExtVentedCavity; using DataSurfaces::OSCM; using DataSurfaces::Surface; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyWFnTdbTwbPb; // unused0909 USE DataHVACGlobals , ONLY: TimeStepSys diff --git a/src/EnergyPlus/HeatRecovery.cc b/src/EnergyPlus/HeatRecovery.cc index 186b17ba0e4..2c7df647a31 100644 --- a/src/EnergyPlus/HeatRecovery.cc +++ b/src/EnergyPlus/HeatRecovery.cc @@ -1333,7 +1333,7 @@ namespace HeatRecovery { // I believe that all of these initializations should be taking place at the SCFM conditions RhoAir = StdRhoAir; // RhoAir = PsyRhoAirFnPbTdbW(101325.0,20.0,0.0) do we want standard air density at sea level for generic ERVs per ARI 1060? - CpAir = PsyCpAirFnWTdb(0.0); + CpAir = PsyCpAirFnW(0.0); ExIndex = ExchNum; // this replaces the loop that went over multiple at once @@ -1857,8 +1857,8 @@ namespace HeatRecovery { Deno = std::pow(QuotSup, 0.78) + ExchCond(ExNum).hARatio * std::pow(QuotExh, 0.78); UA = ExchCond(ExNum).UA0 * (ExchCond(ExNum).hARatio + 1.0) / Deno; // calculate the NTU - CSup = UnitSupMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); - CSec = UnitSecMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); + CSup = UnitSupMassFlow * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); + CSec = UnitSecMassFlow * PsyCpAirFnW(ExchCond(ExNum).SecInHumRat); // note: no C can be zero since otherwise we wouldn't be here if (CSup < CSec) { CMin = CSup; @@ -1917,7 +1917,7 @@ namespace HeatRecovery { ExchCond(ExNum).SecOutTemp = ExchCond(ExNum).SecInTemp; ExchCond(ExNum).SecOutMassFlow = ExchCond(ExNum).SecInMassFlow; } - CSup = ExchCond(ExNum).SupInMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSup = ExchCond(ExNum).SupInMassFlow * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); SensHeatRecRate = CSup * (ExchCond(ExNum).SupOutTemp - ExchCond(ExNum).SupInTemp); TotHeatRecRate = ExchCond(ExNum).SupOutMassFlow * (ExchCond(ExNum).SupOutEnth - ExchCond(ExNum).SupInEnth); LatHeatRecRate = TotHeatRecRate - SensHeatRecRate; @@ -2197,8 +2197,8 @@ namespace HeatRecovery { // Use the effectiveness to calculate the air conditions exiting the heat exchanger (all air flow through the HX) // Include EATR and OACF in the following calculations at some point - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); - CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); + CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnW(ExchCond(ExNum).SecInHumRat); CMin = min(CSup, CSec); ExchCond(ExNum).SupOutTemp = @@ -2259,7 +2259,7 @@ namespace HeatRecovery { HXSupAirVolFlowRate = MassFlowSupOut / RhoSup; HXAvgAirVolFlowRate = (HXSecAirVolFlowRate + HXSupAirVolFlowRate) / 2.0; HXAirVolFlowRatio = HXAvgAirVolFlowRate / ExchCond(ExNum).NomSupAirVolFlow; - CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn); + CSup = MassFlowSupOut * PsyCpAirFnW(HumRatSupIn); CMin = min(CSup, CSec); if (TempSupIn < TempSecIn) { // Use heating effectiveness values @@ -2397,7 +2397,7 @@ namespace HeatRecovery { } // ENDIF for "IF (UnitOn) THEN" // Calculate heat transfer from the unit using the final supply inlet and supply outlet air conditions - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); SensHeatRecRate = CSup * (ExchCond(ExNum).SupOutTemp - ExchCond(ExNum).SupInTemp); TotHeatRecRate = ExchCond(ExNum).SupOutMassFlow * (ExchCond(ExNum).SupOutEnth - ExchCond(ExNum).SupInEnth); LatHeatRecRate = TotHeatRecRate - SensHeatRecRate; @@ -2724,8 +2724,8 @@ namespace HeatRecovery { // the mass flow rate on the process and secondary side of HX may be imbalanced when the HX is used in the OA branch // use the average mass flow rate to avoid psych warnings, mass flow rates will converge at the end of the iteration // if the air mass flow rates do not converge, this model should not be used - CSup = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); - CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); + CSup = AverageMassFlowRate * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); + CSec = AverageMassFlowRate * PsyCpAirFnW(ExchCond(ExNum).SecInHumRat); ExchCond(ExNum).SupOutEnth = PsyHFnTdbW(ExchCond(ExNum).SupOutTemp, ExchCond(ExNum).SupOutHumRat); @@ -2759,7 +2759,7 @@ namespace HeatRecovery { } // ENDIF for "IF (UnitOn) THEN" // Report the process side heat transfer - CSec = AverageMassFlowRate * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); + CSec = AverageMassFlowRate * PsyCpAirFnW(ExchCond(ExNum).SecInHumRat); ProcessSensHeatRecRate = CSec * (ExchCond(ExNum).SecOutTemp - ExchCond(ExNum).SecInTemp); ProcessTotHeatRecRate = ExchCond(ExNum).SecOutMassFlow * (ExchCond(ExNum).SecOutEnth - ExchCond(ExNum).SecInEnth); @@ -2858,8 +2858,8 @@ namespace HeatRecovery { ExchCond(ExNum).SecBypassMassFlow = 0.0; RhoSup = PsyRhoAirFnPbTdbW(OutBaroPress, ExchCond(ExNum).SupInTemp, ExchCond(ExNum).SupInHumRat); RhoSec = PsyRhoAirFnPbTdbW(OutBaroPress, ExchCond(ExNum).SecInTemp, ExchCond(ExNum).SecInHumRat); - CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SupInHumRat); - CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnWTdb(ExchCond(ExNum).SecInHumRat); + CSup = ExchCond(ExNum).SupOutMassFlow * PsyCpAirFnW(ExchCond(ExNum).SupInHumRat); + CSec = ExchCond(ExNum).SecOutMassFlow * PsyCpAirFnW(ExchCond(ExNum).SecInHumRat); CMin = min(CSup, CSec); TempThreshold = ExchCond(ExNum).ThresholdTemperature; @@ -2927,7 +2927,7 @@ namespace HeatRecovery { HXSecAirVolFlowRate = ExchCond(ExNum).SecOutMassFlow / RhoSec; HXAvgAirVolFlowRate = (HXSecAirVolFlowRate + HXSupAirVolFlowRate) / 2.0; HXAirVolFlowRatio = HXAvgAirVolFlowRate / ExchCond(ExNum).NomSupAirVolFlow; - CSup = MassFlowSupOut * PsyCpAirFnWTdb(HumRatSupIn); + CSup = MassFlowSupOut * PsyCpAirFnW(HumRatSupIn); CMin = min(CSup, CSec); if (TempSupIn < TempSecIn) { // Use heating effectiveness values diff --git a/src/EnergyPlus/HeatingCoils.cc b/src/EnergyPlus/HeatingCoils.cc index 7163b146c31..b906770f768 100644 --- a/src/EnergyPlus/HeatingCoils.cc +++ b/src/EnergyPlus/HeatingCoils.cc @@ -125,7 +125,7 @@ namespace HeatingCoils { using DataHeatBalance::RefrigCondenserTypeWater; using DataHeatBalance::RefrigSystemTypeDetailed; using DataHeatBalance::RefrigSystemTypeRack; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using namespace ScheduleManager; @@ -1632,7 +1632,7 @@ namespace HeatingCoils { AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; } - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; // If the coil is operating there should be some heating capacitance // across the coil, so do the simulation. If not set outlet to inlet and no load. @@ -2001,7 +2001,7 @@ namespace HeatingCoils { TempSetPoint = HeatingCoil(CoilNum).DesiredOutletTemp; AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; // If there is a fault of coil SAT Sensor (zrp_Jul2016) if (HeatingCoil(CoilNum).FaultyCoilSATFlag && (!WarmupFlag) && (!DoingSizing) && (!KickOffSimulation)) { @@ -2494,7 +2494,7 @@ namespace HeatingCoils { AirMassFlow = HeatingCoil(CoilNum).InletAirMassFlowRate; TempAirIn = HeatingCoil(CoilNum).InletAirTemp; Win = HeatingCoil(CoilNum).InletAirHumRat; - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; TempSetPoint = HeatingCoil(CoilNum).DesiredOutletTemp; // If there is a fault of coil SAT Sensor (zrp_Jul2016) diff --git a/src/EnergyPlus/HybridEvapCoolingModel.cc b/src/EnergyPlus/HybridEvapCoolingModel.cc index 58c0c0851e1..11fb3e0f805 100644 --- a/src/EnergyPlus/HybridEvapCoolingModel.cc +++ b/src/EnergyPlus/HybridEvapCoolingModel.cc @@ -1564,9 +1564,9 @@ namespace HybridEvapCoolingModel { Hsa = 1.006 * Tsa * (2501 + 1.86 * Tsa); Hsa = PsyHFnTdbW(Tsa, Wsa); - Real64 SupplyAirCp = PsyCpAirFnWTdb(Wsa); // J/degreesK.kg - Real64 ReturnAirCP = PsyCpAirFnWTdb(Wra); // J/degreesK.kg - Real64 OutdoorAirCP = PsyCpAirFnWTdb(Wosa); // J/degreesK.kg + Real64 SupplyAirCp = PsyCpAirFnW(Wsa); // J/degreesK.kg + Real64 ReturnAirCP = PsyCpAirFnW(Wra); // J/degreesK.kg + Real64 OutdoorAirCP = PsyCpAirFnW(Wosa); // J/degreesK.kg // Calculations below of system cooling and heating capacity are ultimately reassessed when the resultant part runtime fraction is // assessed. However its valuable that they are calculated here to at least provide a check. @@ -2029,9 +2029,9 @@ namespace HybridEvapCoolingModel { // Calculate timestep average unit and system PrimaryMode = CurrentPrimaryMode(); PrimaryModeRuntimeFraction = CurrentPrimaryRuntimeFraction(); - Real64 Outletcp = PsyCpAirFnWTdb(OutletHumRat); // J/degreesK.kg - Real64 Returncp = PsyCpAirFnWTdb(Wra); // J/degreesK.kg - Real64 Outdoorcp = PsyCpAirFnWTdb(Wosa); // J/degreesK.kg + Real64 Outletcp = PsyCpAirFnW(OutletHumRat); // J/degreesK.kg + Real64 Returncp = PsyCpAirFnW(Wra); // J/degreesK.kg + Real64 Outdoorcp = PsyCpAirFnW(Wosa); // J/degreesK.kg // Zone Sensible Cooling{ W } = m'SA {kg/s} * 0.5*(cpRA+cpSA) {kJ/kg-C} * (T_RA - T_SA) {C} // Zone Latent Cooling{ W } = m'SAdryair {kg/s} * L {kJ/kgWater} * (HR_RA - HR_SA) {kgWater/kgDryAir} // Zone Total Cooling{ W } = m'SAdryair {kg/s} * (h_RA - h_SA) {kJ/kgDryAir} diff --git a/src/EnergyPlus/InternalHeatGains.cc b/src/EnergyPlus/InternalHeatGains.cc index b41219579dd..0322b5a403a 100644 --- a/src/EnergyPlus/InternalHeatGains.cc +++ b/src/EnergyPlus/InternalHeatGains.cc @@ -6368,7 +6368,7 @@ namespace InternalHeatGains { AirMassFlowRate = AirVolFlowRate * PsyRhoAirFnPbTdbW(StdBaroPress, TAirIn, WAirIn, RoutineName); if (AirMassFlowRate > 0.0) { - TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnWTdb(WAirIn); + TAirOut = TAirIn + (CPUPower + FanPower) / AirMassFlowRate / PsyCpAirFnW(WAirIn); } else { TAirOut = TAirIn; } diff --git a/src/EnergyPlus/MicroturbineElectricGenerator.cc b/src/EnergyPlus/MicroturbineElectricGenerator.cc index 8c21383281f..7503caf121e 100644 --- a/src/EnergyPlus/MicroturbineElectricGenerator.cc +++ b/src/EnergyPlus/MicroturbineElectricGenerator.cc @@ -1403,7 +1403,7 @@ namespace MicroturbineElectricGenerator { using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHfgAirFnWTdb; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -2016,7 +2016,7 @@ namespace MicroturbineElectricGenerator { MTGenerator(GeneratorNum).ExhaustAirTemperature = ExhaustAirTemp; // Adjust exhaust air temperature if heat recovery to water is being done if (QHeatRecToWater > 0.0) { - CpAir = PsyCpAirFnWTdb(CombustionAirInletW); + CpAir = PsyCpAirFnW(CombustionAirInletW); if (CpAir > 0.0) { MTGenerator(GeneratorNum).ExhaustAirTemperature = ExhaustAirTemp - QHeatRecToWater / (CpAir * ExhAirMassFlowRate); } diff --git a/src/EnergyPlus/MixedAir.cc b/src/EnergyPlus/MixedAir.cc index 86f51413bc9..6feadf8a231 100644 --- a/src/EnergyPlus/MixedAir.cc +++ b/src/EnergyPlus/MixedAir.cc @@ -3837,7 +3837,7 @@ namespace MixedAir { } this->RelTemp = this->RetTemp; this->RelEnth = this->RetEnth; - this->RelSensiLossRate = this->RelMassFlow * Psychrometrics::PsyCpAirFnWTdb(OutHumRat) * (this->RelTemp - OutDryBulbTemp); + this->RelSensiLossRate = this->RelMassFlow * Psychrometrics::PsyCpAirFnW(OutHumRat) * (this->RelTemp - OutDryBulbTemp); this->RelTotalLossRate = this->RelMassFlow * (this->RelEnth - OutEnthalpy); this->RelLatentLossRate = this->RelTotalLossRate - this->RelSensiLossRate; } diff --git a/src/EnergyPlus/MoistureBalanceEMPDManager.cc b/src/EnergyPlus/MoistureBalanceEMPDManager.cc index 8664b6c732e..5b73e4dd8b1 100644 --- a/src/EnergyPlus/MoistureBalanceEMPDManager.cc +++ b/src/EnergyPlus/MoistureBalanceEMPDManager.cc @@ -460,7 +460,7 @@ namespace MoistureBalanceEMPDManager { // Using/Aliasing using DataMoistureBalanceEMPD::Lam; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyPsatFnTemp; using Psychrometrics::PsyRhFnTdbRhov; using Psychrometrics::PsyRhFnTdbRhovLBnd0C; diff --git a/src/EnergyPlus/MundtSimMgr.cc b/src/EnergyPlus/MundtSimMgr.cc index 40be5bd4ddd..d6e6f5ce2ad 100644 --- a/src/EnergyPlus/MundtSimMgr.cc +++ b/src/EnergyPlus/MundtSimMgr.cc @@ -459,7 +459,7 @@ namespace MundtSimMgr { using DataZoneEquipment::ZoneEquipConfig; using InternalHeatGains::SumAllInternalConvectionGains; using InternalHeatGains::SumAllReturnAirConvectionGains; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyWFnTdpPb; @@ -520,7 +520,7 @@ namespace MundtSimMgr { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -532,7 +532,7 @@ namespace MundtSimMgr { SupplyAirTemp = SumSysMCpT / SumSysMCp; } // determine cooling load - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); QsysCoolTot = -(SumSysMCpT - ZoneMassFlowRate * CpAir * MAT(ZoneNum)); } // determine heat gains diff --git a/src/EnergyPlus/NodeInputManager.cc b/src/EnergyPlus/NodeInputManager.cc index d40e9f1c20a..bc425af7a3e 100644 --- a/src/EnergyPlus/NodeInputManager.cc +++ b/src/EnergyPlus/NodeInputManager.cc @@ -1153,7 +1153,7 @@ namespace NodeInputManager { using OutputProcessor::ReqReportVariables; using OutputProcessor::ReqRepVars; using Psychrometrics::CPCW; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhFnTdbWPb; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -1314,7 +1314,7 @@ namespace NodeInputManager { MoreNodeInfo(iNode).RelHumidity = 0.0; } if (ReportSpecificHeat) { // only call psych routine if needed. - MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat); + MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnW(Node(iNode).HumRat); } else { MoreNodeInfo(iNode).SpecificHeat = 0.0; } @@ -1368,7 +1368,7 @@ namespace NodeInputManager { MoreNodeInfo(iNode).WetBulbTemp = 0.0; } if (ReportSpecificHeat) { - MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnWTdb(Node(iNode).HumRat); + MoreNodeInfo(iNode).SpecificHeat = PsyCpAirFnW(Node(iNode).HumRat); } else { MoreNodeInfo(iNode).SpecificHeat = 0.0; } diff --git a/src/EnergyPlus/OutdoorAirUnit.cc b/src/EnergyPlus/OutdoorAirUnit.cc index 58bc0936449..2bd697b0b13 100644 --- a/src/EnergyPlus/OutdoorAirUnit.cc +++ b/src/EnergyPlus/OutdoorAirUnit.cc @@ -2196,7 +2196,7 @@ namespace OutdoorAirUnit { WHCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WHCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WHCoilInletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(WHCoilInletNode).HumRat); if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(WHCoilInletNode).Temp > CompAirOutTemp)) { QCompReq = 0.0; @@ -2260,7 +2260,7 @@ namespace OutdoorAirUnit { WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { QCompReq = 0.0; @@ -2310,7 +2310,7 @@ namespace OutdoorAirUnit { WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { @@ -2356,7 +2356,7 @@ namespace OutdoorAirUnit { } WCCoilInletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirInletNode; WCCoilOutletNode = OutAirUnit(OAUnitNum).OAEquip(EquipNum).CoilAirOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(WCCoilInletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(WCCoilInletNode).HumRat); OAMassFlow = OutAirUnit(OAUnitNum).OutAirMassFlow; if ((OpMode == NeutralMode) || (OpMode == HeatingMode) || (Node(WCCoilInletNode).Temp < CompAirOutTemp)) { QCompReq = 0.0; @@ -2497,7 +2497,7 @@ namespace OutdoorAirUnit { if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(InletNode).Temp > CoilAirOutTemp)) { QCompReq = 0.0; } else { - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } @@ -2521,7 +2521,7 @@ namespace OutdoorAirUnit { QCompReq = 0.0; } else { Node(OutletNode).MassFlowRate = Node(InletNode).MassFlowRate; - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } @@ -2543,7 +2543,7 @@ namespace OutdoorAirUnit { if ((OpMode == NeutralMode) || (OpMode == CoolingMode) || (Node(InletNode).Temp > CoilAirOutTemp)) { QCompReq = 0.0; } else { - CpAirZn = PsyCpAirFnWTdb(Node(InletNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(InletNode).HumRat); QCompReq = Node(InletNode).MassFlowRate * CpAirZn * ((CoilAirOutTemp - Node(InletNode).Temp) - FanEffect); if (std::abs(QCompReq) < SmallLoad) QCompReq = 0.0; } diff --git a/src/EnergyPlus/PackagedTerminalHeatPump.cc b/src/EnergyPlus/PackagedTerminalHeatPump.cc index b7f85b118c4..2f2dd1701e6 100644 --- a/src/EnergyPlus/PackagedTerminalHeatPump.cc +++ b/src/EnergyPlus/PackagedTerminalHeatPump.cc @@ -5447,7 +5447,7 @@ namespace PackagedTerminalHeatPump { using General::TrimSigDigits; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using SteamCoils::SimulateSteamCoilComponents; using WaterCoils::SimulateWaterCoilComponents; @@ -5709,7 +5709,7 @@ namespace PackagedTerminalHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(PTUnit(PTUnitNum).AirOutNode).Temp < PTUnit(PTUnitNum).MaxSATSupHeat) { - CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); + CpAir = PsyCpAirFnW(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); SupHeaterLoad = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate * CpAir * (PTUnit(PTUnitNum).MaxSATSupHeat - Node(PTUnit(PTUnitNum).AirOutNode).Temp); @@ -5754,7 +5754,7 @@ namespace PackagedTerminalHeatPump { using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using MixedAir::SimOAMixer; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using SingleDuct::SimATMixer; using SteamCoils::SimulateSteamCoilComponents; @@ -7278,7 +7278,7 @@ namespace PackagedTerminalHeatPump { using General::TrimSigDigits; using HeatingCoils::SimulateHeatingCoilComponents; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using SteamCoils::SimulateSteamCoilComponents; using WaterCoils::SimulateWaterCoilComponents; @@ -7650,7 +7650,7 @@ namespace PackagedTerminalHeatPump { // use the outlet conditions when the supplemental heater was off (CALL above) as the inlet conditions for the calculation // of supplemental heater load to just meet the maximum supply air temperature from the supplemental heater. if (Node(PTUnit(PTUnitNum).AirOutNode).Temp < PTUnit(PTUnitNum).MaxSATSupHeat) { - CpAir = PsyCpAirFnWTdb(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); + CpAir = PsyCpAirFnW(Node(PTUnit(PTUnitNum).AirOutNode).HumRat); SupHeaterLoad = Node(PTUnit(PTUnitNum).AirInNode).MassFlowRate * CpAir * (PTUnit(PTUnitNum).MaxSATSupHeat - Node(PTUnit(PTUnitNum).AirOutNode).Temp); @@ -7946,7 +7946,7 @@ namespace PackagedTerminalHeatPump { using HVACHXAssistedCoolingCoil::SimHXAssistedCoolingCoil; using MixedAir::SimOAMixer; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using SingleDuct::SimATMixer; using SteamCoils::SimulateSteamCoilComponents; diff --git a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc index 87b10a4a496..42a1d3c0907 100644 --- a/src/EnergyPlus/PhotovoltaicThermalCollectors.cc +++ b/src/EnergyPlus/PhotovoltaicThermalCollectors.cc @@ -1097,7 +1097,7 @@ namespace PhotovoltaicThermalCollectors { using DataHVACGlobals::TimeStepSys; using DataLoopNode::Node; using Psychrometrics::CPHW; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdpFnTdbTwbPb; using Psychrometrics::PsyTwbFnTdbWPb; using ScheduleManager::GetCurrentScheduleValue; @@ -1173,7 +1173,7 @@ namespace PhotovoltaicThermalCollectors { if (PVT(PVTnum).WorkingFluidType == AirWorkingFluid) { Winlet = Node(InletNode).HumRat; - CpInlet = PsyCpAirFnWTdb(Winlet); + CpInlet = PsyCpAirFnW(Winlet); if (mdot * CpInlet > 0.0) { PotentialOutletTemp = Tinlet + PotentialHeatGain / (mdot * CpInlet); } else { @@ -1189,7 +1189,7 @@ namespace PhotovoltaicThermalCollectors { } BypassFraction = max(0.0, BypassFraction); PotentialOutletTemp = Node(PVT(PVTnum).HVACOutletNodeNum).TempSetPoint; - PotentialHeatGain = mdot * PsyCpAirFnWTdb(Winlet) * (PotentialOutletTemp - Tinlet); + PotentialHeatGain = mdot * PsyCpAirFnW(Winlet) * (PotentialOutletTemp - Tinlet); } else { BypassFraction = 0.0; @@ -1222,7 +1222,7 @@ namespace PhotovoltaicThermalCollectors { if (PVT(PVTnum).WorkingFluidType == AirWorkingFluid) { Winlet = Node(InletNode).HumRat; - CpInlet = PsyCpAirFnWTdb(Winlet); + CpInlet = PsyCpAirFnW(Winlet); WetBulbInlet = PsyTwbFnTdbWPb(Tinlet, Winlet, OutBaroPress, RoutineName); DewPointInlet = PsyTdpFnTdbTwbPb(Tinlet, WetBulbInlet, OutBaroPress, RoutineName); } else if (PVT(PVTnum).WorkingFluidType == LiquidWorkingFluid) { diff --git a/src/EnergyPlus/PlantCentralGSHP.cc b/src/EnergyPlus/PlantCentralGSHP.cc index 30de1763598..e2591e70032 100644 --- a/src/EnergyPlus/PlantCentralGSHP.cc +++ b/src/EnergyPlus/PlantCentralGSHP.cc @@ -111,7 +111,7 @@ namespace PlantCentralGSHP { using DataPlant::PlantLoop; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Data diff --git a/src/EnergyPlus/PlantChillers.cc b/src/EnergyPlus/PlantChillers.cc index ef4ad645244..213e60b09e6 100644 --- a/src/EnergyPlus/PlantChillers.cc +++ b/src/EnergyPlus/PlantChillers.cc @@ -5633,7 +5633,7 @@ namespace PlantChillers { using General::RoundSigDigits; using PlantUtilities::PullCompInterconnectTrigger; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyWFnTdbTwbPb; // Locals @@ -6249,7 +6249,7 @@ namespace PlantChillers { if (ElectricChiller(ChillNum).HeatRecActive) CalcElectricChillerHeatRecovery(ChillNum, QCondenser, CondMassFlowRate, CondInletTemp, QHeatRecovered); if (CondMassFlowRate > 0.0) { - CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat); + CpCond = PsyCpAirFnW(Node(CondInletNode).HumRat); CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / CpCond; } else { CondOutletTemp = CondInletTemp; @@ -8513,7 +8513,7 @@ namespace PlantChillers { using DataPlant::PlantLoop; using DataPlant::SingleSetPoint; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using ScheduleManager::GetCurrentScheduleValue; // Locals @@ -8561,7 +8561,7 @@ namespace PlantChillers { PlantLoop(ElectricChiller(ChillNum).Base.CDLoopNum).FluidIndex, RoutineName); } else { - CpCond = PsyCpAirFnWTdb(Node(CondInletNode).HumRat); + CpCond = PsyCpAirFnW(Node(CondInletNode).HumRat); } // Before we modify the QCondenser, the total or original value is transferred to QTot @@ -8635,7 +8635,7 @@ namespace PlantChillers { // Using/Aliasing using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: diff --git a/src/EnergyPlus/PondGroundHeatExchanger.cc b/src/EnergyPlus/PondGroundHeatExchanger.cc index 7a11640cab2..c04adb11c72 100644 --- a/src/EnergyPlus/PondGroundHeatExchanger.cc +++ b/src/EnergyPlus/PondGroundHeatExchanger.cc @@ -652,7 +652,7 @@ namespace PondGroundHeatExchanger { using FluidProperties::GetSpecificHeatGlycol; using namespace DataGlobals; using DataHeatBalance::VeryRough; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHfgAirFnWTdb; using Psychrometrics::PsyWFnTdbTwbPb; @@ -740,7 +740,7 @@ namespace PondGroundHeatExchanger { // get air properties HumRatioAir = PsyWFnTdbTwbPb(OutDryBulb, OutWetBulb, OutBaroPress); HumRatioFilm = PsyWFnTdbTwbPb(PondBulkTemp, PondBulkTemp, OutBaroPress); - SpecHeatAir = PsyCpAirFnWTdb(HumRatioAir); + SpecHeatAir = PsyCpAirFnW(HumRatioAir); LatentHeatAir = PsyHfgAirFnWTdb(HumRatioAir, OutDryBulb); FluxEvap = pow_2(PrantlAir / SchmidtAir) / 3.0 * ConvCoef / SpecHeatAir * (HumRatioFilm - HumRatioAir) * LatentHeatAir; diff --git a/src/EnergyPlus/PoweredInductionUnits.cc b/src/EnergyPlus/PoweredInductionUnits.cc index e1ebc111d4a..35ce89627e0 100644 --- a/src/EnergyPlus/PoweredInductionUnits.cc +++ b/src/EnergyPlus/PoweredInductionUnits.cc @@ -127,7 +127,7 @@ namespace PoweredInductionUnits { using DataHVACGlobals::SmallMassFlow; using DataHVACGlobals::SmallTempDiff; using namespace ScheduleManager; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using SteamCoils::SimulateSteamCoilComponents; @@ -1315,7 +1315,7 @@ namespace PoweredInductionUnits { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; DesMassFlow = StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); rho = GetDensityGlycol(PlantLoop(PIU(PIUNum).HWLoopNum).FluidName, DataGlobals::HWInitConvTemp, @@ -1405,7 +1405,7 @@ namespace PoweredInductionUnits { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; DesMassFlow = StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); TempSteamIn = 100.00; EnthSteamInDry = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 1.0, PIU(PIUNum).HCoil_FluidIndex, RoutineName); EnthSteamOutWet = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 0.0, PIU(PIUNum).HCoil_FluidIndex, RoutineName); @@ -1574,7 +1574,7 @@ namespace PoweredInductionUnits { SecAirMassFlow = Node(SecNode).MassFlowRate; QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNode).HumRat); // On the first HVAC iteration the system values are given to the controller, but after that // the demand limits are in place and there needs to be feedback to the Zone Equipment @@ -1842,7 +1842,7 @@ namespace PoweredInductionUnits { SecAirMassFlow = Node(SecNode).MassFlowRate; QZnReq = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNode).HumRat); // Initialize local fan flags to global system flags bool PIUTurnFansOn = (DataHVACGlobals::TurnFansOn || DataHVACGlobals::TurnZoneFansOnlyOn); // If True, overrides fan schedule and cycles PIU fan on diff --git a/src/EnergyPlus/Psychrometrics.hh b/src/EnergyPlus/Psychrometrics.hh index 05513d53458..7490c3c095b 100644 --- a/src/EnergyPlus/Psychrometrics.hh +++ b/src/EnergyPlus/Psychrometrics.hh @@ -376,7 +376,8 @@ namespace Psychrometrics { return 1.00484e3 * TDB + dW * (2.50094e6 + 1.85895e3 * TDB); // enthalpy {J/kg} } - inline Real64 PsyCpAirFnWTdb(Real64 const dw // humidity ratio {kgWater/kgDryAir} + inline Real64 PsyCpAirFnWTdb(Real64 const dw, // humidity ratio {kgWater/kgDryAir} + Real64 const T // input temperature {Celsius} ) { // FUNCTION INFORMATION: @@ -395,6 +396,71 @@ namespace Psychrometrics { // see PsyHFnTdbW ref. to ASHRAE Fundamentals // USAGE: cpa = PsyCpAirFnWTdb(w,T) + // Static locals + static Real64 dwSave(-100.0); + static Real64 Tsave(-100.0); + static Real64 cpaSave(-100.0); + + // check if last call had the same input and if it did just use the saved output + if ((Tsave == T) && (dwSave == dw)) return cpaSave; + + // compute heat capacity of air + Real64 const w(max(dw, 1.0e-5)); + Real64 const cpa((PsyHFnTdbW(T + 0.1, w) - PsyHFnTdbW(T, w)) * 10.0); // result => heat capacity of air {J/kg-C} + + // save values for next call + dwSave = dw; + Tsave = T; + cpaSave = cpa; + + return cpa; + } + + inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw, // humidity ratio {kgWater/kgDryAir} + Real64 const T // input temperature {Celsius} + ) + { + // Faster version with humidity ratio already adjusted + assert(dw >= 1.0e-5); + + // Static locals + static Real64 dwSave(-100.0); + static Real64 Tsave(-100.0); + static Real64 cpaSave(-100.0); + + // check if last call had the same input and if it did just use the saved output + if ((Tsave == T) && (dwSave == dw)) return cpaSave; + + // compute heat capacity of air + Real64 const cpa((PsyHFnTdbW_fast(T + 0.1, dw) - PsyHFnTdbW_fast(T, dw)) * 10.0); // result => heat capacity of air {J/kg-C} + + // save values for next call + dwSave = dw; + Tsave = T; + cpaSave = cpa; + + return cpa; + } + + inline Real64 PsyCpAirFnW(Real64 const dw // humidity ratio {kgWater/kgDryAir} + ) + { + // FUNCTION INFORMATION: + // AUTHOR J. C. VanderZee + // DATE WRITTEN Feb. 1994 + // MODIFIED na + // RE-ENGINEERED na + + // PURPOSE OF THIS FUNCTION: + // This function provides the heat capacity of air {J/kg-C} as function of humidity ratio. + + // METHODOLOGY EMPLOYED: + // take numerical derivative of PsyHFnTdbW function + + // REFERENCES: + // see PsyHFnTdbW ref. to ASHRAE Fundamentals + // USAGE: cpa = PsyCpAirFnW(w) + // Static locals static Real64 dwSave(-100.0); static Real64 cpaSave(-100.0); @@ -413,7 +479,7 @@ namespace Psychrometrics { return cpa; } - inline Real64 PsyCpAirFnWTdb_fast(Real64 const dw // humidity ratio {kgWater/kgDryAir} + inline Real64 PsyCpAirFnW_fast(Real64 const dw // humidity ratio {kgWater/kgDryAir} ) { // Faster version with humidity ratio already adjusted diff --git a/src/EnergyPlus/PurchasedAirManager.cc b/src/EnergyPlus/PurchasedAirManager.cc index 9e9e7272856..2635d603346 100644 --- a/src/EnergyPlus/PurchasedAirManager.cc +++ b/src/EnergyPlus/PurchasedAirManager.cc @@ -128,7 +128,7 @@ namespace PurchasedAirManager { using DataHeatBalFanSys::ZoneThermostatSetPointHi; using DataHeatBalFanSys::ZoneThermostatSetPointLo; using namespace ScheduleManager; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; @@ -1387,7 +1387,7 @@ namespace PurchasedAirManager { using General::RoundSigDigits; using Psychrometrics::CPCW; using Psychrometrics::CPHW; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::RhoH2O; using ReportSizingManager::ReportSizingOutput; @@ -2082,7 +2082,7 @@ namespace PurchasedAirManager { // Calculate minimum outdoor air sensible and latent load if (PurchAir(PurchAirNum).OutdoorAir) { - CpAir = PsyCpAirFnWTdb(Node(OANodeNum).HumRat); + CpAir = PsyCpAirFnW(Node(OANodeNum).HumRat); MinOASensOutput = OAMassFlowRate * CpAir * (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); MinOALatOutput = OAMassFlowRate * (Node(OANodeNum).HumRat - Node(ZoneNodeNum).HumRat); } else { @@ -2132,7 +2132,7 @@ namespace PurchasedAirManager { (Node(OANodeNum).Enthalpy < Node(PurchAir(PurchAirNum).ZoneRecircAirNodeNum).Enthalpy))) { // Calculate supply MassFlowRate based on sensible load but limit to Max Cooling Supply Air Flow Rate if specified - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); DeltaT = (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); if (DeltaT < -SmallTempDiff) { SupplyMassFlowRate = QZnCoolSP / CpAir / DeltaT; @@ -2155,7 +2155,7 @@ namespace PurchasedAirManager { // Mass flow rate to meet sensible load, at Minimum Cooling Supply Air Temperature SupplyMassFlowRateForCool = 0.0; if (CoolOn) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); DeltaT = (PurchAir(PurchAirNum).MinCoolSuppAirTemp - Node(ZoneNodeNum).Temp); if (DeltaT < -SmallTempDiff) { SupplyMassFlowRateForCool = QZnCoolSP / CpAir / DeltaT; @@ -2212,7 +2212,7 @@ namespace PurchasedAirManager { // In general, in the cooling section, don't let SupplyTemp be set to something that results in heating if (SupplyMassFlowRate > 0.0) { // Calculate supply temp at SupplyMassFlowRate and recheck limit on Minimum Cooling Supply Air Temperature - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); SupplyTemp = QZnCoolSP / (CpAir * SupplyMassFlowRate) + Node(ZoneNodeNum).Temp; SupplyTemp = max(SupplyTemp, PurchAir(PurchAirNum).MinCoolSuppAirTemp); // This is the cooling mode, so SupplyTemp can't be more than MixedAirTemp @@ -2223,7 +2223,7 @@ namespace PurchasedAirManager { // Check sensible load vs max total cooling capacity, if specified, and adjust supply temp before applying humidity controls // Will check again later, too if ((PurchAir(PurchAirNum).CoolingLimit == LimitCapacity) || (PurchAir(PurchAirNum).CoolingLimit == LimitFlowRateAndCapacity)) { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy); if (CoolSensOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { CoolSensOutput = PurchAir(PurchAirNum).MaxCoolTotCap; @@ -2243,7 +2243,7 @@ namespace PurchasedAirManager { } else if (SELECT_CASE_var == ConstantSensibleHeatRatio) { // SHR = CoolSensOutput/CoolTotOutput // CoolTotOutput = CoolSensOutput/SHR - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolTotOutput = CoolSensOutput / PurchAir(PurchAirNum).CoolSHR; SupplyEnthalpy = MixedAirEnthalpy - CoolTotOutput / SupplyMassFlowRate; @@ -2301,7 +2301,7 @@ namespace PurchasedAirManager { // Adjust both supply temp and humidity ratio to maintain SHR // SHR = CoolSensOutput/CoolTotOutput // CoolSensOutput = SHR*CoolTotOutput - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = CoolTotOutput * PurchAir(PurchAirNum).CoolSHR; SupplyTemp = MixedAirTemp - CoolSensOutput / (CpAir * SupplyMassFlowRate); // This is the cooling mode, so SupplyTemp can't be more than MixedAirTemp @@ -2315,7 +2315,7 @@ namespace PurchasedAirManager { } else if ((SELECT_CASE_var == None) || (SELECT_CASE_var == ConstantSupplyHumidityRatio)) { // Keep humidity ratio and adjust supply temp // Check if latent output exceeds capacity - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolLatOutput = CoolTotOutput - CoolSensOutput; if (CoolLatOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { @@ -2339,7 +2339,7 @@ namespace PurchasedAirManager { SupplyTemp = min(SupplyTemp, MixedAirTemp); SupplyHumRat = PsyWFnTdbH(SupplyTemp, SupplyEnthalpy, RoutineName); SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); - // CpAir = PsyCpAirFnWTdb(MixedAirHumRat) + // CpAir = PsyCpAirFnW(MixedAirHumRat) // CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp) // CoolTotOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy) } @@ -2347,7 +2347,7 @@ namespace PurchasedAirManager { } else { // Not dehumidifying // If not dehumidifying, compare sensible cooling to the limit // This section will only increase supply temp, so no need to recheck for super-saturation - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); if (CoolSensOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { CoolSensOutput = PurchAir(PurchAirNum).MaxCoolTotCap; @@ -2404,7 +2404,7 @@ namespace PurchasedAirManager { // Mass flow rate to meet sensible load, at Minimum Cooling Supply Air Temperature SupplyMassFlowRateForHeat = 0.0; if ((HeatOn) && (OperatingMode == Heat)) { - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); DeltaT = (PurchAir(PurchAirNum).MaxHeatSuppAirTemp - Node(ZoneNodeNum).Temp); if (DeltaT > SmallTempDiff) { SupplyMassFlowRateForHeat = QZnHeatSP / CpAir / DeltaT; @@ -2463,7 +2463,7 @@ namespace PurchasedAirManager { if (SupplyMassFlowRate > 0.0) { if ((HeatOn) && (OperatingMode == Heat)) { // Calculate supply temp at SupplyMassFlowRate and check limit on Maximum Heating Supply Air Temperature - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); SupplyTemp = QZnHeatSP / (CpAir * SupplyMassFlowRate) + Node(ZoneNodeNum).Temp; SupplyTemp = min(SupplyTemp, PurchAir(PurchAirNum).MaxHeatSuppAirTemp); // This is the heating mode, so SupplyTemp can't be less than MixedAirTemp @@ -2471,7 +2471,7 @@ namespace PurchasedAirManager { // Check max heating capacity, if specified if ((PurchAir(PurchAirNum).HeatingLimit == LimitCapacity) || (PurchAir(PurchAirNum).HeatingLimit == LimitFlowRateAndCapacity)) { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); HeatSensOutput = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); if (HeatSensOutput > PurchAir(PurchAirNum).MaxHeatSensCap) { SupplyTemp = PurchAir(PurchAirNum).MaxHeatSensCap / (SupplyMassFlowRate * CpAir) + MixedAirTemp; @@ -2502,7 +2502,7 @@ namespace PurchasedAirManager { SupplyHumRat = PurchAir(PurchAirNum).MaxHeatSuppAirHumRat; SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); CoolTotOutput = SupplyMassFlowRate * (MixedAirEnthalpy - SupplyEnthalpy); - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); CoolSensOutput = SupplyMassFlowRate * CpAir * (MixedAirTemp - SupplyTemp); CoolLatOutput = CoolTotOutput - CoolSensOutput; if (CoolLatOutput >= PurchAir(PurchAirNum).MaxCoolTotCap) { @@ -2541,7 +2541,7 @@ namespace PurchasedAirManager { SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); if (SupplyHumRat < MixedAirHumRat) { // At this point, the system is heating or deadband but dehumidifying, check max cooling cap limit - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); SensOutput = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); LatOutput = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy) - SensOutput; if ((PurchAir(PurchAirNum).CoolingLimit == LimitCapacity) || @@ -2592,7 +2592,7 @@ namespace PurchasedAirManager { PurchAir(PurchAirNum).SenCoilLoad = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy); PurchAir(PurchAirNum).LatCoilLoad = 0.0; } else { - CpAir = PsyCpAirFnWTdb(MixedAirHumRat); + CpAir = PsyCpAirFnW(MixedAirHumRat); PurchAir(PurchAirNum).SenCoilLoad = SupplyMassFlowRate * CpAir * (SupplyTemp - MixedAirTemp); PurchAir(PurchAirNum).LatCoilLoad = SupplyMassFlowRate * (SupplyEnthalpy - MixedAirEnthalpy) - PurchAir(PurchAirNum).SenCoilLoad; } @@ -2635,7 +2635,7 @@ namespace PurchasedAirManager { SupplyEnthalpy = PsyHFnTdbW(SupplyTemp, SupplyHumRat); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); SysOutputProvided = SupplyMassFlowRate * CpAir * (SupplyTemp - Node(ZoneNodeNum).Temp); MoistOutputProvided = SupplyMassFlowRate * (SupplyHumRat - Node(ZoneNodeNum).HumRat); // Latent rate, kg/s @@ -2643,7 +2643,7 @@ namespace PurchasedAirManager { PurchAir(PurchAirNum).LatOutputToZone = SupplyMassFlowRate * (SupplyEnthalpy - Node(ZoneNodeNum).Enthalpy) - PurchAir(PurchAirNum).SenOutputToZone; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ActualZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ActualZoneNum)); if (PurchAir(PurchAirNum).OutdoorAir) { PurchAir(PurchAirNum).OASenOutput = OAMassFlowRate * CpAir * (Node(OANodeNum).Temp - Node(ZoneNodeNum).Temp); PurchAir(PurchAirNum).OALatOutput = @@ -2924,7 +2924,7 @@ namespace PurchasedAirManager { } // Calculate OA and heat recovery sensible and latent rates - CpAir = PsyCpAirFnWTdb(OAInletHumRat); + CpAir = PsyCpAirFnW(OAInletHumRat); PurchAir(PurchAirNum).HtRecSenOutput = OAMassFlowRate * CpAir * (OAAfterHtRecTemp - OAInletTemp); PurchAir(PurchAirNum).HtRecLatOutput = OAMassFlowRate * (OAAfterHtRecEnthalpy - OAInletEnthalpy) - PurchAir(PurchAirNum).HtRecSenOutput; diff --git a/src/EnergyPlus/RefrigeratedCase.cc b/src/EnergyPlus/RefrigeratedCase.cc index 70df324861b..3fbb208324f 100644 --- a/src/EnergyPlus/RefrigeratedCase.cc +++ b/src/EnergyPlus/RefrigeratedCase.cc @@ -15270,7 +15270,7 @@ namespace RefrigeratedCase { using CurveManager::CurveValue; using namespace DataLoopNode; using General::CreateSysTimeIntervalString; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbRhPb; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhFnTdbWPb; @@ -15440,7 +15440,7 @@ namespace RefrigeratedCase { ZoneMixedAirEnthalpy = PsyHFnTdbRhPb(ZoneMixedAirDryBulb, ZoneMixedAirRHFrac, OutBaroPress, TrackMessage); ZoneMixedAirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZoneMixedAirDryBulb, ZoneMixedAirHumRatio, TrackMessage); ZoneDryAirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZoneMixedAirDryBulb, 0.0, TrackMessage); - ZoneMixedAirCp = PsyCpAirFnWTdb(ZoneMixedAirHumRatio); + ZoneMixedAirCp = PsyCpAirFnW(ZoneMixedAirHumRatio); DryAirMassFlowRated = AirVolumeFlowRated * ZoneDryAirDensity; // calc t inlet to coil assuming at middle/mixed point in room bbb - // later need to do for hottest/coolest in room where Tin /= Tzonemixed @@ -15459,7 +15459,7 @@ namespace RefrigeratedCase { CoilInletCp = ZoneMixedAirCp; CoilInletHumRatio = ZoneMixedAirHumRatio; CoilInletDryAirDensity = ZoneDryAirDensity; - CoilInletDryAirCp = PsyCpAirFnWTdb(0.0); + CoilInletDryAirCp = PsyCpAirFnW(0.0); break; } AirVolumeFlowMax = AirVolumeFlowRated * (1.0 - DefrostDripDownSchedule) * CoilSchedule; diff --git a/src/EnergyPlus/ReportCoilSelection.cc b/src/EnergyPlus/ReportCoilSelection.cc index bdf5f3f3e26..6ce60aa3797 100644 --- a/src/EnergyPlus/ReportCoilSelection.cc +++ b/src/EnergyPlus/ReportCoilSelection.cc @@ -856,7 +856,7 @@ void ReportCoilSelection::doFinalProcessingOfCoilData() c->coilFlowPrcntPlantFlow = -999.0; } - c->cpDryAir = Psychrometrics::PsyCpAirFnWTdb(0.0); + c->cpDryAir = Psychrometrics::PsyCpAirFnW(0.0); c->rhoStandAir = DataEnvironment::StdRhoAir; // apply ADP method to find an SHR for Ideal loads peak, calculate sensible capacity for cooling coils @@ -1399,7 +1399,7 @@ void ReportCoilSelection::setCoilCoolingCapacity( } // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesEntHumRat); + c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesEntHumRat); } void ReportCoilSelection::setCoilHeatingCapacity( @@ -1714,7 +1714,7 @@ void ReportCoilSelection::setCoilHeatingCapacity( } // calc sensible capacity from inlet outlet - c->cpMoistAir = Psychrometrics::PsyCpAirFnWTdb(c->coilDesLvgHumRat); + c->cpMoistAir = Psychrometrics::PsyCpAirFnW(c->coilDesLvgHumRat); // this is not generally correct but okay for heating coils c->coilSensCapAtPeak = std::abs(c->cpMoistAir * c->coilDesMassFlow * (c->coilDesLvgTemp - c->coilDesEntTemp)); c->coilSensCapAtPeak = min(c->coilSensCapAtPeak, c->coilTotCapAtPeak); diff --git a/src/EnergyPlus/ReportSizingManager.cc b/src/EnergyPlus/ReportSizingManager.cc index e5fee8ac79c..0e5c40afb76 100644 --- a/src/EnergyPlus/ReportSizingManager.cc +++ b/src/EnergyPlus/ReportSizingManager.cc @@ -352,7 +352,7 @@ namespace ReportSizingManager { using General::RoundSigDigits; using General::SolveRoot; using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhFnTdbWPb; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -434,7 +434,7 @@ namespace ReportSizingManager { OASysFlag = false; AirLoopSysFlag = false; bCheckForZero = true; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); SupFanDT = 0.0; RetFanDT = 0.0; SupFanNum = 0; @@ -1761,7 +1761,7 @@ namespace ReportSizingManager { setHeatCoilInletTempForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { Cp = GetSpecificHeatGlycol(PlantLoop(DataWaterLoopNum).FluidName, DataGlobals::HWInitConvTemp, @@ -1839,7 +1839,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); + CpAir = PsyCpAirFnW(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); } } @@ -1863,7 +1863,7 @@ namespace ReportSizingManager { PlantLoop(DataWaterLoopNum).FluidIndex, CallingRoutine); DesCoilLoad = DataWaterFlowUsedForSizing * DataWaterCoilSizCoolDeltaT * Cp * rho; - T1Out = DataDesInletAirTemp - DesCoilLoad / (StdRhoAir * PsyCpAirFnWTdb(DataDesInletAirHumRat) * DataAirFlowUsedForSizing); + T1Out = DataDesInletAirTemp - DesCoilLoad / (StdRhoAir * PsyCpAirFnW(DataDesInletAirHumRat) * DataAirFlowUsedForSizing); T2Out = PlantSizData(DataPltSizCoolNum).ExitTemp + 2.0; AutosizeDes = max(T1Out, T2Out); } else { @@ -1874,7 +1874,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); + CpAir = PsyCpAirFnW(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2072,7 +2072,7 @@ namespace ReportSizingManager { // add fan heat to coil load FanCoolLoad += DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DesVolFlow); PeakCoilLoad += FanCoolLoad; - CpAir = PsyCpAirFnWTdb(CoilInHumRat); + CpAir = PsyCpAirFnW(CoilInHumRat); // adjust coil inlet/outlet temp with fan temperature rise if (DataDesAccountForFanHeat) { if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { @@ -2191,13 +2191,13 @@ namespace ReportSizingManager { if ((TermUnitSingDuct || TermUnitPIU) && (CurTermUnitSizingNum > 0)) { CoilOutTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesTemp; CoilOutHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat; - CpAir = PsyCpAirFnWTdb(CoilOutHumRat); + CpAir = PsyCpAirFnW(CoilOutHumRat); DesCoilLoad = CpAir * StdRhoAir * TermUnitSizing(CurTermUnitSizingNum).AirVolFlow * (CoilOutTemp - CoilInTemp); DesVolFlow = TermUnitSizing(CurTermUnitSizingNum).AirVolFlow; } else if (TermUnitIU && (CurTermUnitSizingNum > 0)) { if (TermUnitSizing(CurTermUnitSizingNum).InducRat > 0.01) { DesVolFlow = TermUnitSizing(CurTermUnitSizingNum).AirVolFlow / TermUnitSizing(CurTermUnitSizingNum).InducRat; - CpAir = PsyCpAirFnWTdb(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); + CpAir = PsyCpAirFnW(TermUnitFinalZoneSizing(CurTermUnitSizingNum).HeatDesHumRat); // the design heating coil load is the zone load minus whatever the central system does.Note that // DesHeatCoilInTempTU is really the primary air inlet temperature for the unit. DesCoilLoad = TermUnitFinalZoneSizing(CurTermUnitSizingNum).DesHeatLoad - @@ -2210,7 +2210,7 @@ namespace ReportSizingManager { } else { CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - CpAir = PsyCpAirFnWTdb(CoilOutHumRat); + CpAir = PsyCpAirFnW(CoilOutHumRat); DesCoilLoad = CpAir * FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow * (CoilOutTemp - CoilInTemp); DesVolFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow / StdRhoAir; } @@ -2278,7 +2278,7 @@ namespace ReportSizingManager { setHeatCoilInletHumRatForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - NominalCapacityDes = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + NominalCapacityDes = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); } AutosizeDes = NominalCapacityDes * DataHeatSizeRatio; if (DisplayExtraWarnings && AutosizeDes <= 0.0) { @@ -2347,7 +2347,7 @@ namespace ReportSizingManager { setHeatCoilInletHumRatForZoneEqSizing(setOAFracForZoneEqSizing(DesMassFlow, zoneEqSizing), zoneEqSizing, finalZoneSizing); CoilOutTemp = FinalZoneSizing(CurZoneEqNum).HeatDesTemp; CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; - AutosizeDes = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + AutosizeDes = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); } } else if (SizingType == HeatingWaterDesCoilWaterVolFlowUsedForUASizing) { if (TermUnitSingDuct) { @@ -2474,7 +2474,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).DesCoolCoilInTemp - (DataCapacityUsedForSizing / - (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat))); + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(FinalZoneSizing(CurZoneEqNum).DesCoolCoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2485,7 +2485,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).DesHeatCoilInTemp + (DataCapacityUsedForSizing / - (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).DesHeatCoilInHumRat))); + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(FinalZoneSizing(CurZoneEqNum).DesHeatCoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2496,7 +2496,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).ZoneTempAtCoolPeak - (DataCapacityUsedForSizing / - (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtCoolPeak))); + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtCoolPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2507,7 +2507,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0) { AutosizeDes = FinalZoneSizing(CurZoneEqNum).ZoneTempAtHeatPeak + (DataCapacityUsedForSizing / - (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtHeatPeak))); + (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtHeatPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -2893,7 +2893,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); + CpAir = PsyCpAirFnW(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2931,7 +2931,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); + CpAir = PsyCpAirFnW(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -2954,7 +2954,7 @@ namespace ReportSizingManager { // calculate fan heat to get fan air-side delta T FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, DataAirFlowUsedForSizing); if (DataDesInletAirHumRat > 0.0 && DataAirFlowUsedForSizing > 0.0) { - CpAir = PsyCpAirFnWTdb(DataDesInletAirHumRat); + CpAir = PsyCpAirFnW(DataDesInletAirHumRat); fanDeltaT = FanCoolLoad / (CpAir * StdRhoAir * DataAirFlowUsedForSizing); DataDesAccountForFanHeat = false; // used in CoolingCapacitySizing calculations to avoid double counting fan heat } @@ -3275,7 +3275,7 @@ namespace ReportSizingManager { PrimaryAirSystem(CurSysNum).FanDesCoolLoad = FanCoolLoad; PeakCoilLoad = max(0.0, (rhoair * DesVolFlow * (CoilInEnth - CoilOutEnth))); - CpAir = PsyCpAirFnWTdb(CoilInHumRat); + CpAir = PsyCpAirFnW(CoilInHumRat); // adjust coil inlet/outlet temp with fan temperature rise if (DataDesAccountForFanHeat) { PeakCoilLoad += FanCoolLoad; @@ -3536,7 +3536,7 @@ namespace ReportSizingManager { CoilInTemp = OutAirFrac * FinalSysSizing(CurSysNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).HeatRetTemp; } // coil load - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); if (CurOASysNum > 0) { if (DataDesicRegCoil) { AutosizeDes = CpAirStd * StdRhoAir * DataAirFlowUsedForSizing * (DataDesOutletAirTemp - DataDesInletAirTemp); @@ -3681,7 +3681,7 @@ namespace ReportSizingManager { (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).RetHumRatAtCoolPeak; } } - AutosizeDes = CoilInTemp - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat))); + AutosizeDes = CoilInTemp - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(CoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3710,7 +3710,7 @@ namespace ReportSizingManager { (1.0 - OutAirFrac) * FinalSysSizing(CurSysNum).HeatRetHumRat; } } - AutosizeDes = CoilInTemp + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnWTdb(CoilInHumRat))); + AutosizeDes = CoilInTemp + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * PsyCpAirFnW(CoilInHumRat))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3721,7 +3721,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0 && DataZoneUsedForSizing > 0) { AutosizeDes = FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtCoolPeak - (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtCoolPeak))); + PsyCpAirFnW(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtCoolPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + @@ -3734,7 +3734,7 @@ namespace ReportSizingManager { if (DataCapacityUsedForSizing > 0.0 && DataFlowUsedForSizing > 0.0 && DataZoneUsedForSizing > 0) { AutosizeDes = FinalZoneSizing(DataZoneUsedForSizing).ZoneTempAtHeatPeak + (DataCapacityUsedForSizing / (DataFlowUsedForSizing * StdRhoAir * - PsyCpAirFnWTdb(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtHeatPeak))); + PsyCpAirFnW(FinalZoneSizing(DataZoneUsedForSizing).ZoneHumRatAtHeatPeak))); } else { ShowSevereError(CallingRoutine + ' ' + CompType + ' ' + CompName + ", Developer Error: Component sizing incomplete."); ShowContinueError("SizingString = " + SizingString + diff --git a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc index a4e889ce5f3..a20810265d5 100644 --- a/src/EnergyPlus/RoomAirModelAirflowNetwork.cc +++ b/src/EnergyPlus/RoomAirModelAirflowNetwork.cc @@ -281,7 +281,7 @@ namespace RoomAirModelAirflowNetwork { using DataZoneEquipment::ZoneEquipList; using General::RoundSigDigits; using InternalHeatGains::SumInternalLatentGainsByTypes; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // SUBROUTINE LOCAL VARIABLE DECLARATIONS: @@ -612,7 +612,7 @@ namespace RoomAirModelAirflowNetwork { LinkInTemp = ThisRAFNNode.Link(linkNum).TempIn; LinkInHumRat = ThisRAFNNode.Link(linkNum).HumRatIn; LinkInMdot = ThisRAFNNode.Link(linkNum).MdotIn; - CpAir = PsyCpAirFnWTdb(LinkInHumRat); + CpAir = PsyCpAirFnW(LinkInHumRat); SumLinkMCp = SumLinkMCp + CpAir * LinkInMdot; SumLinkMCpT = SumLinkMCpT + CpAir * LinkInMdot * LinkInTemp; SumLinkM = SumLinkM + LinkInMdot; @@ -628,7 +628,7 @@ namespace RoomAirModelAirflowNetwork { ThisRAFNNode.RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, ThisRAFNNode.AirTemp, ThisRAFNNode.HumRat, "InitRoomAirModelAirflowNetwork"); - ThisRAFNNode.CpAir = PsyCpAirFnWTdb(ThisRAFNNode.HumRat); + ThisRAFNNode.CpAir = PsyCpAirFnW(ThisRAFNNode.HumRat); } // InitRoomAirModelAirflowNetwork @@ -875,7 +875,7 @@ namespace RoomAirModelAirflowNetwork { using InternalHeatGains::SumInternalLatentGainsByIndices; using InternalHeatGains::SumReturnAirConvectionGainsByIndices; using InternalHeatGains::SumReturnAirConvectionGainsByTypes; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ZonePlenum::NumZoneReturnPlenums; using ZonePlenum::NumZoneSupplyPlenums; @@ -990,7 +990,7 @@ namespace RoomAirModelAirflowNetwork { NodeW = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).HumRat; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate * RoomAirflowNetworkZoneInfo(ZoneNum).Node(RoomAirNodeNum).HVAC(EquipLoop).SupplyFraction; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; SumSysM += MassFlowRate; @@ -1003,7 +1003,7 @@ namespace RoomAirModelAirflowNetwork { // Get node conditions NodeTemp = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } // NodeNum @@ -1014,7 +1014,7 @@ namespace RoomAirModelAirflowNetwork { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -1022,7 +1022,7 @@ namespace RoomAirModelAirflowNetwork { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -1031,7 +1031,7 @@ namespace RoomAirModelAirflowNetwork { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/RoomAirModelUserTempPattern.cc b/src/EnergyPlus/RoomAirModelUserTempPattern.cc index 8ba686e2764..96fb1200b18 100644 --- a/src/EnergyPlus/RoomAirModelUserTempPattern.cc +++ b/src/EnergyPlus/RoomAirModelUserTempPattern.cc @@ -997,7 +997,7 @@ namespace RoomAirModelUserTempPattern { using DataSurfaces::ZoneMeanAirTemp; using InternalHeatGains::SumAllReturnAirConvectionGains; using InternalHeatGains::SumAllReturnAirLatentGains; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyHgAirFnWTdb; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -1047,7 +1047,7 @@ namespace RoomAirModelUserTempPattern { // Add sensible heat gain from refrigerated cases with under case returns SumAllReturnAirConvectionGains(ZoneNum, QRetAir, ReturnNode); - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneNode).HumRat); // Need to add the energy to the return air from lights and from airflow windows. Where the heat // is added depends on if there is system flow or not. If there is system flow the heat is added diff --git a/src/EnergyPlus/RuntimeLanguageProcessor.cc b/src/EnergyPlus/RuntimeLanguageProcessor.cc index 251bb8dc9b5..2580060213b 100644 --- a/src/EnergyPlus/RuntimeLanguageProcessor.cc +++ b/src/EnergyPlus/RuntimeLanguageProcessor.cc @@ -2346,9 +2346,9 @@ namespace RuntimeLanguageProcessor { // (Pa) | drybulb (C) | Humidity ratio (kg water // vapor/kg dry air) | called from } else if (SELECT_CASE_var == FuncCpAirFnWTdb) { - ReturnValue = SetErlValueNumber(PsyCpAirFnWTdb(Operand(1).Number)); // result => heat capacity of air - // {J/kg-C} | Humidity ratio (kg water - // vapor/kg dry air) | drybulb (C) + ReturnValue = SetErlValueNumber(PsyCpAirFnW(Operand(1).Number)); // result => heat capacity of air + // {J/kg-C} | Humidity ratio (kg water + // vapor/kg dry air) | drybulb (C) } else if (SELECT_CASE_var == FuncHfgAirFnWTdb) { // BG comment these two psych funct seems confusing (?) is this the enthalpy of water in the air? ReturnValue = SetErlValueNumber(PsyHfgAirFnWTdb(Operand(1).Number, Operand(2).Number)); // result => heat of vaporization diff --git a/src/EnergyPlus/SetPointManager.cc b/src/EnergyPlus/SetPointManager.cc index d05f9431642..6c2a3d20ab2 100644 --- a/src/EnergyPlus/SetPointManager.cc +++ b/src/EnergyPlus/SetPointManager.cc @@ -151,7 +151,7 @@ namespace SetPointManager { using namespace CurveManager; // USE STATEMENTS - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; // Data @@ -5509,7 +5509,7 @@ namespace SetPointManager { FanDeltaT = 0.0; } TSupNoHC = TMixAtMinOA + FanDeltaT; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); ExtrRateNoHC = CpAir * ZoneMassFlow * (TSupNoHC - ZoneTemp); if (ZoneMassFlow <= SmallMassFlow) { TSetPt = TSupNoHC; @@ -5602,7 +5602,7 @@ namespace SetPointManager { if (ZoneMassFlow <= SmallMassFlow) { this->SetPt = this->MinSetTemp; } else { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); this->SetPt = ZoneTemp + ZoneLoadtoHeatSP / (CpAir * ZoneMassFlow); this->SetPt = max(this->SetPt, this->MinSetTemp); this->SetPt = min(this->SetPt, this->MaxSetTemp); @@ -5644,7 +5644,7 @@ namespace SetPointManager { if (ZoneMassFlow <= SmallMassFlow) { this->SetPt = this->MaxSetTemp; } else { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); this->SetPt = ZoneTemp + ZoneLoadtoCoolSP / (CpAir * ZoneMassFlow); this->SetPt = max(this->SetPt, this->MinSetTemp); this->SetPt = min(this->SetPt, this->MaxSetTemp); @@ -6165,7 +6165,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MaxSetTemp; if (ZoneLoad < 0.0) { TotCoolLoad += std::abs(ZoneLoad); - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6248,7 +6248,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MinSetTemp; if (ZoneLoad > 0.0) { TotHeatLoad += ZoneLoad; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6268,7 +6268,7 @@ namespace SetPointManager { ZoneSetPointTemp = this->MinSetTemp; if (ZoneLoad > 0.0) { TotHeatLoad += ZoneLoad; - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { ZoneSetPointTemp = ZoneTemp + ZoneLoad / (CpAir * ZoneMassFlowMax); } @@ -6369,7 +6369,7 @@ namespace SetPointManager { ZoneFracFlow = MinFracFlow; if (ZoneLoad < 0.0) { TotCoolLoad += std::abs(ZoneLoad); - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); if (ZoneMassFlowMax > SmallMassFlow) { if (ControlStrategy == TempFirst) { // First find supply air temperature required to meet the load at minimum flow. If this is @@ -6569,11 +6569,11 @@ namespace SetPointManager { ZoneMassFlowRate = Node(ZoneInletNode).MassFlowRate; ZoneLoad = ZoneSysEnergyDemand(CtrlZoneNum).TotalOutputRequired; ZoneTemp = Node(ZoneNode).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneNode).HumRat); SumProductMdotCpTot += ZoneMassFlowRate * CpAir; SumProductMdotCpTZoneTot += ZoneMassFlowRate * CpAir * ZoneTemp; if (ZoneLoad > 0.0) { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); SumHeatLoad += ZoneLoad; SumProductMdotCp += ZoneMassFlowRate * CpAir; } @@ -6659,11 +6659,11 @@ namespace SetPointManager { ZoneMassFlowRate = Node(ZoneInletNode).MassFlowRate; ZoneLoad = ZoneSysEnergyDemand(CtrlZoneNum).TotalOutputRequired; ZoneTemp = Node(ZoneNode).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneNode).HumRat); SumProductMdotCpTot += ZoneMassFlowRate * CpAir; SumProductMdotCpTZoneTot += ZoneMassFlowRate * CpAir * ZoneTemp; if (ZoneLoad < 0.0) { - CpAir = PsyCpAirFnWTdb(Node(ZoneInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneInletNode).HumRat); SumCoolLoad += ZoneLoad; SumProductMdotCp += ZoneMassFlowRate * CpAir; } diff --git a/src/EnergyPlus/SimAirServingZones.cc b/src/EnergyPlus/SimAirServingZones.cc index 1877ba7bbd6..e2359aeef57 100644 --- a/src/EnergyPlus/SimAirServingZones.cc +++ b/src/EnergyPlus/SimAirServingZones.cc @@ -5247,7 +5247,7 @@ namespace SimAirServingZones { using DataEnvironment::StdRhoAir; using EMSManager::ManageEMS; using General::FindNumberInList; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using namespace OutputReportPredefined; @@ -5568,7 +5568,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysCoolOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, system design supply air temp, and the mass flow rate // calculate the system sensible cooling capacity - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * + SysSensCoolCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).CoolFlowSeq(TimeStepInDay) * (SysCoolMixTemp - SysSizing(CurOverallSimDay, AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); // calculate the system total cooling capacity @@ -5690,7 +5690,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -5780,7 +5780,7 @@ namespace SimAirServingZones { SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutTempSeq(TimeStepInDay) = OutDryBulbTemp; SysSizing(CurOverallSimDay, AirLoopNum).SysHeatOutHumRatSeq(TimeStepInDay) = OutHumRat; // From the mixed air temp, heating supply air temp, and mass flow rate calculate the system heating capacity - SysHeatCap = PsyCpAirFnWTdb(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * + SysHeatCap = PsyCpAirFnW(constant_zero) * SysSizing(CurOverallSimDay, AirLoopNum).HeatFlowSeq(TimeStepInDay) * (SysSizing(CurOverallSimDay, AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); // save the system heating capacity for the time step @@ -6596,7 +6596,7 @@ namespace SimAirServingZones { } SysCoolMixTemp = OutAirTemp * OutAirFrac + SysCoolRetTemp * (1.0 - OutAirFrac); SysCoolMixHumRat = OutAirHumRat * OutAirFrac + SysCoolRetHumRat * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * + SysSensCoolCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * (SysCoolMixTemp - CalcSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = CalcSysSizing(AirLoopNum).NonCoinCoolMassFlow * @@ -6657,7 +6657,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6701,7 +6701,7 @@ namespace SimAirServingZones { } SysHeatMixTemp = OutAirTemp * OutAirFrac + SysHeatRetTemp * (1.0 - OutAirFrac); SysHeatMixHumRat = OutAirHumRat * OutAirFrac + SysHeatRetHumRat * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * + SysHeatCap = PsyCpAirFnW(constant_zero) * CalcSysSizing(AirLoopNum).NonCoinHeatMassFlow * (CalcSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); } @@ -6876,7 +6876,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysCoolRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysCoolMixHumRat = FinalSysSizing(AirLoopNum).SysCoolOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysCoolRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysSensCoolCap = PsyCpAirFnWTdb(constant_zero) * FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * + SysSensCoolCap = PsyCpAirFnW(constant_zero) * FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * (SysCoolMixTemp - FinalSysSizing(AirLoopNum).CoolSupTemp); SysSensCoolCap = max(0.0, SysSensCoolCap); SysTotCoolCap = FinalSysSizing(AirLoopNum).CoolFlowSeq(TimeStepIndex) * @@ -6899,7 +6899,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).MixHumRatAtCoolPeak = FinalSysSizing(AirLoopNum).OutHumRatAtCoolPeak * OutAirFrac + FinalSysSizing(AirLoopNum).RetHumRatAtCoolPeak * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).SensCoolCap = - PsyCpAirFnWTdb(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * + PsyCpAirFnW(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesCoolVolFlow * (FinalSysSizing(AirLoopNum).MixTempAtCoolPeak - FinalSysSizing(AirLoopNum).CoolSupTemp); FinalSysSizing(AirLoopNum).SensCoolCap = max(0.0, FinalSysSizing(AirLoopNum).SensCoolCap); FinalSysSizing(AirLoopNum).TotCoolCap = @@ -6957,7 +6957,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).SysHeatRetTempSeq(TimeStepIndex) * (1.0 - OutAirFrac); SysHeatMixHumRat = FinalSysSizing(AirLoopNum).SysHeatOutHumRatSeq(TimeStepIndex) * OutAirFrac + FinalSysSizing(AirLoopNum).SysHeatRetHumRatSeq(TimeStepIndex) * (1.0 - OutAirFrac); - SysHeatCap = PsyCpAirFnWTdb(constant_zero) * FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * + SysHeatCap = PsyCpAirFnW(constant_zero) * FinalSysSizing(AirLoopNum).HeatFlowSeq(TimeStepIndex) * (FinalSysSizing(AirLoopNum).HeatSupTemp - SysHeatMixTemp); SysHeatCap = max(0.0, SysHeatCap); FinalSysSizing(AirLoopNum).HeatCapSeq(TimeStepIndex) = SysHeatCap; @@ -6974,7 +6974,7 @@ namespace SimAirServingZones { FinalSysSizing(AirLoopNum).HeatOutTemp * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetTemp * (1.0 - OutAirFrac); FinalSysSizing(AirLoopNum).HeatMixHumRat = FinalSysSizing(AirLoopNum).HeatOutHumRat * OutAirFrac + FinalSysSizing(AirLoopNum).HeatRetHumRat * (1.0 - OutAirFrac); - FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnWTdb(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * + FinalSysSizing(AirLoopNum).HeatCap = PsyCpAirFnW(constant_zero) * RhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * (FinalSysSizing(AirLoopNum).HeatSupTemp - FinalSysSizing(AirLoopNum).HeatMixTemp); FinalSysSizing(AirLoopNum).HeatCap = max(0.0, FinalSysSizing(AirLoopNum).HeatCap); } @@ -7208,7 +7208,7 @@ namespace SimAirServingZones { using DataEnvironment::StdRhoAir; using DataSizing::CalcSysSizing; using DataSizing::FinalSysSizing; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using ReportSizingManager::RequestSizing; @@ -7342,7 +7342,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnWTdb(constant_zero); + CpAirStd = PsyCpAirFnW(constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else if (FinalSysSizing(AirLoopNum).HeatingCapMethod == HeatingDesignCapacity) { @@ -7365,7 +7365,7 @@ namespace SimAirServingZones { OutAirFrac * FinalSysSizing(AirLoopNum).HeatOutTemp + (1.0 - OutAirFrac) * FinalSysSizing(AirLoopNum).HeatRetTemp; } CoilOutTemp = FinalSysSizing(AirLoopNum).HeatSupTemp; - CpAirStd = PsyCpAirFnWTdb(constant_zero); + CpAirStd = PsyCpAirFnW(constant_zero); AutosizedCapacity = StdRhoAir * FinalSysSizing(AirLoopNum).DesHeatVolFlow * CpAirStd * (CoilOutTemp - CoilInTemp); TempSize = FinalSysSizing(AirLoopNum).FlowPerHeatingCapacity * AutosizedCapacity * FractionOfAutosize; } else { diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index a1218edf1c5..33cb4ea0cb7 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -131,7 +131,7 @@ namespace SingleDuct { using DataHVACGlobals::SmallMassFlow; using DataHVACGlobals::TurnFansOn; using namespace DataSizing; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using namespace FluidProperties; using namespace ScheduleManager; @@ -2930,7 +2930,7 @@ namespace SingleDuct { ZoneDesTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; ZoneDesHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { rho = GetDensityGlycol(PlantLoop(Sys(SysNum).HWLoopNum).FluidName, @@ -3031,7 +3031,7 @@ namespace SingleDuct { ZoneDesTemp = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneTempAtHeatPeak; ZoneDesHumRat = TermUnitFinalZoneSizing(CurTermUnitSizingNum).ZoneHumRatAtHeatPeak; // the coil load is the zone design heating load plus (or minus!) the reheat load - DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + DesCoilLoad = DesZoneHeatLoad + PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { TempSteamIn = 100.00; EnthSteamInDry = GetSatEnthalpyRefrig(fluidNameSteam, TempSteamIn, 1.0, Sys(SysNum).FluidIndex, RoutineNameFull); @@ -3162,6 +3162,7 @@ namespace SingleDuct { // unused USE DataAirLoop, ONLY: AirLoopControlInfo using DataHVACGlobals::SmallLoad; using PlantUtilities::SetActuatedBranchFlowRate; + using Psychrometrics::PsyCpAirFnWTdb; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3221,7 +3222,9 @@ namespace SingleDuct { QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP * LeakLoadMult; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirAvg = PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat)); + CpAirAvg = PsyCpAirFnW(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat)); + Real64 CpAirAvg2 = + PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat), 0.5 * (Node(ZoneNodeNum).Temp + SysInlet(SysNum).AirTemp)); MinFlowFrac = Sys(SysNum).ZoneMinAirFrac; MassFlowBasedOnOA = 0.0; ZoneTemp = Node(ZoneNodeNum).Temp; @@ -3780,7 +3783,7 @@ namespace SingleDuct { QToHeatSetPt = ZoneSysEnergyDemand(ZoneNum).RemainingOutputReqToHeatSP * LeakLoadMult; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); MinFlowFrac = Sys(SysNum).ZoneMinAirFrac; MinMassAirFlow = MinFlowFrac * StdRhoAir * Sys(SysNum).MaxAirVolFlowRate; ZoneTemp = Node(ZoneNodeNum).Temp; @@ -3791,7 +3794,7 @@ namespace SingleDuct { // or the Max as specified for the VAV model. if (SysInlet(SysNum).AirMassFlowRateMaxAvail > 0.0) { // Calculate the flow required for cooling - CpAirSysIn = PsyCpAirFnWTdb(SysInlet(SysNum).AirHumRat); + CpAirSysIn = PsyCpAirFnW(SysInlet(SysNum).AirHumRat); DeltaTemp = CpAirSysIn * SysInlet(SysNum).AirTemp - CpAirZn * ZoneTemp; // Need to check DeltaTemp and ensure that it is not zero @@ -4154,7 +4157,7 @@ namespace SingleDuct { QTotLoad = ZoneSysEnergyDemand(ZoneNum).RemainingOutputRequired; SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); HCType = Sys(SysNum).ReheatComp_Num; FanType = Sys(SysNum).Fan_Num; MaxCoolMassFlow = SysInlet(SysNum).AirMassFlowRateMaxAvail; @@ -4548,7 +4551,7 @@ namespace SingleDuct { MassFlow = SysInlet(SysNum).AirMassFlowRateMaxAvail; // System massflow is set to the Available QMax2 = QToHeatSetPt; ZoneTemp = Node(ZoneNodeNum).Temp; - CpAir = PsyCpAirFnWTdb(Node(ZoneNodeNum).HumRat); // zone air specific heat + CpAir = PsyCpAirFnW(Node(ZoneNodeNum).HumRat); // zone air specific heat if (Sys(SysNum).MaxReheatTempSetByUser) { TAirMax = Sys(SysNum).MaxReheatTemp; QMax = CpAir * MassFlow * (TAirMax - ZoneTemp); @@ -4737,7 +4740,7 @@ namespace SingleDuct { MassFlow = SysInlet(SysNum).AirMassFlowRate; // system air mass flow rate if (GetCurrentScheduleValue(this->SchedPtr) > 0.0 && MassFlow > SmallMassFlow) { - Real64 CpAir = PsyCpAirFnWTdb(0.5 * (Node(this->OutletNodeNum).HumRat + Node(ZoneNodeNum).HumRat)); + Real64 CpAir = PsyCpAirFnW(0.5 * (Node(this->OutletNodeNum).HumRat + Node(ZoneNodeNum).HumRat)); SensOutputProvided = MassFlow * CpAir * (Node(this->OutletNodeNum).Temp - Node(ZoneNodeNum).Temp); } else { SensOutputProvided = 0.0; @@ -4826,7 +4829,7 @@ namespace SingleDuct { HotControlNode = Sys(SysNum).ReheatControlNode; AirMassFlow = AirFlow; Node(FanInNode).MassFlowRate = AirMassFlow; - CpAirZn = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(ZoneNode).HumRat); if (FanType == DataHVACGlobals::FanType_SimpleVAV && FanOn == 1) { Fans::SimulateFanComponents(Sys(SysNum).FanName, FirstHVACIteration, Sys(SysNum).Fan_Index); } else if (FanType == DataHVACGlobals::FanType_SystemModelObject && FanOn == 1) { diff --git a/src/EnergyPlus/SteamBaseboardRadiator.cc b/src/EnergyPlus/SteamBaseboardRadiator.cc index fcd10add9a7..bf3bf368d03 100644 --- a/src/EnergyPlus/SteamBaseboardRadiator.cc +++ b/src/EnergyPlus/SteamBaseboardRadiator.cc @@ -129,7 +129,7 @@ namespace SteamBaseboardRadiator { using DataZoneEquipment::ZoneEquipInputsFilled; // Use statements for access to subroutines in other modules - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Data @@ -567,7 +567,7 @@ namespace SteamBaseboardRadiator { } if (SteamBaseboard(BaseboardNum).ZonePtr <= 0) { ShowSevereError(RoutineName + cCMO_BBRadiator_Steam + "=\"" + SteamBaseboard(BaseboardNum).EquipID + - "\" is not on any ZoneHVAC:EquipmentList."); + "\" is not on any ZoneHVAC:EquipmentList."); ErrorsFound = true; continue; } @@ -625,7 +625,6 @@ namespace SteamBaseboardRadiator { } SteamBaseboard(BaseboardNum).FluidIndex = SteamIndex; - } if (ErrorsFound) { diff --git a/src/EnergyPlus/SteamCoils.cc b/src/EnergyPlus/SteamCoils.cc index 89fc69c044a..ec3f7cbbe7c 100644 --- a/src/EnergyPlus/SteamCoils.cc +++ b/src/EnergyPlus/SteamCoils.cc @@ -749,7 +749,7 @@ namespace SteamCoils { DesVolFlow = 0.0; CpWater = 0.0; RhoAirStd = PsyRhoAirFnPbTdbW(StdBaroPress, 20.0, 0.0); - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); bool coilWasAutosized(false); // coil report // If this is a steam coil @@ -917,7 +917,7 @@ namespace SteamCoils { CoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; DesMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow; DesVolFlow = DesMassFlow / RhoAirStd; - DesCoilLoad = PsyCpAirFnWTdb(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); + DesCoilLoad = PsyCpAirFnW(CoilOutHumRat) * DesMassFlow * (CoilOutTemp - CoilInTemp); if (DesCoilLoad >= SmallLoad) { TempSteamIn = 100.0; // RefrigIndex is set during GetInput for this module @@ -1129,7 +1129,7 @@ namespace SteamCoils { } if (AirMassFlow > 0.0) { // If the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; } else { CapacitanceAir = 0.0; } @@ -1197,7 +1197,7 @@ namespace SteamCoils { HeatingCoilLoad = QCoilCap; // Temperature of air at outlet - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnW(Win)); SteamCoil(CoilNum).OutletSteamMassFlowRate = SteamMassFlowRate; SteamCoil(CoilNum).InletSteamMassFlowRate = SteamMassFlowRate; @@ -1307,7 +1307,7 @@ namespace SteamCoils { QCoilCap = QSteamCoilMaxHT; // Temperature of air at outlet - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnW(Win)); // In practice Sensible & Superheated heat transfer is negligible compared to latent part. // This is required for outlet water temperature, otherwise it will be saturation temperature. @@ -1329,7 +1329,7 @@ namespace SteamCoils { // recalculate in case previous call changed mass flow rate QCoilCap = SteamMassFlowRate * (LatentHeatSteam + SubcoolDeltaTemp * CpWater); - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnW(Win)); // Total Heat Transfer to air HeatingCoilLoad = QCoilCap; @@ -1363,7 +1363,7 @@ namespace SteamCoils { // recalculate in case previous call changed mass flow rate QCoilCap = SteamMassFlowRate * (LatentHeatSteam + SubcoolDeltaTemp * CpWater); - TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnWTdb(Win)); + TempAirOut = TempAirIn + QCoilCap / (AirMassFlow * PsyCpAirFnW(Win)); // Total Heat Transfer to air HeatingCoilLoad = QCoilCap; diff --git a/src/EnergyPlus/ThermalChimney.cc b/src/EnergyPlus/ThermalChimney.cc index 68685e27141..1424f279361 100644 --- a/src/EnergyPlus/ThermalChimney.cc +++ b/src/EnergyPlus/ThermalChimney.cc @@ -642,7 +642,7 @@ namespace ThermalChimney { } AirDensityThermalChim = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); - AirSpecHeatThermalChim = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + AirSpecHeatThermalChim = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); AirOutletCrossAreaTC = ThermalChimneySys(Loop).AirOutletCrossArea; DischargeCoeffTC = ThermalChimneySys(Loop).DischargeCoeff; @@ -761,7 +761,7 @@ namespace ThermalChimney { for (TCZoneNum = 1; TCZoneNum <= ThermalChimneySys(Loop).TotZoneToDistrib; ++TCZoneNum) { TCZoneNumCounter = ThermalChimneySys(Loop).ZonePtr(TCZoneNum); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(TCZoneNumCounter), ZoneAirHumRat(TCZoneNumCounter)); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(TCZoneNumCounter)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(TCZoneNumCounter)); MCPThermChim(TCZoneNumCounter) = TCVolumeAirFlowRate * AirDensity * CpAir * ThermalChimneySys(Loop).RatioThermChimAirFlow(TCZoneNum); if (MCPThermChim(TCZoneNumCounter) <= 0.0) { MCPThermChim(TCZoneNumCounter) = 0.0; @@ -850,7 +850,7 @@ namespace ThermalChimney { // Break the infiltration load into heat gain and loss components. AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneLoop), ZoneAirHumRat(ZoneLoop)); - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneLoop)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneLoop)); ZnRptThermChim(ZoneLoop).ThermalChimneyVolume = (MCPThermChim(ZoneLoop) / CpAir / AirDensity) * TSMult; ZnRptThermChim(ZoneLoop).ThermalChimneyMass = (MCPThermChim(ZoneLoop) / CpAir) * TSMult; diff --git a/src/EnergyPlus/TranspiredCollector.cc b/src/EnergyPlus/TranspiredCollector.cc index ac276be55e2..f4df7595aa7 100644 --- a/src/EnergyPlus/TranspiredCollector.cc +++ b/src/EnergyPlus/TranspiredCollector.cc @@ -899,7 +899,7 @@ namespace TranspiredCollector { using DataSurfaces::Surface; using DataSurfaces::SurfaceData; using General::RoundSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using namespace DataHeatBalance; // , ONLY: QRadSWOutIncident, Construct, Material @@ -1004,7 +1004,7 @@ namespace TranspiredCollector { RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, Tamb, OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); holeArea = UTSC(UTSCNum).ActualArea * UTSC(UTSCNum).Porosity; diff --git a/src/EnergyPlus/UFADManager.cc b/src/EnergyPlus/UFADManager.cc index 5db2d72196f..fc39c2b4568 100644 --- a/src/EnergyPlus/UFADManager.cc +++ b/src/EnergyPlus/UFADManager.cc @@ -992,7 +992,7 @@ namespace UFADManager { // Using/Aliasing using DataZoneEquipment::ZoneEquipConfig; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ScheduleManager::GetCurrentScheduleValue; using namespace DataHeatBalFanSys; @@ -1157,7 +1157,7 @@ namespace UFADManager { for (InNodeIndex = 1; InNodeIndex <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(OutBaroPress, NodeTemp, ZoneAirHumRat(ZoneNum)); @@ -1231,10 +1231,10 @@ namespace UFADManager { GainsFrac = max(0.6, min(GainsFrac, 1.0)); AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); @@ -1465,7 +1465,7 @@ namespace UFADManager { // Using/Aliasing using DataZoneEquipment::ZoneEquipConfig; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using ScheduleManager::GetCurrentScheduleValue; using namespace DataHeatBalFanSys; @@ -1634,7 +1634,7 @@ namespace UFADManager { for (InNodeIndex = 1; InNodeIndex <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++InNodeIndex) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(InNodeIndex)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; TotSysFlow += MassFlowRate / PsyRhoAirFnPbTdbW(OutBaroPress, NodeTemp, ZoneAirHumRat(ZoneNum)); @@ -1743,10 +1743,10 @@ namespace UFADManager { } AIRRATOC(ZoneNum) = Zone(ZoneNum).Volume * (HeightTransition(ZoneNum) - min(HeightTransition(ZoneNum), 0.2)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATOC(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AIRRATMX(ZoneNum) = Zone(ZoneNum).Volume * (CeilingHeight - HeightTransition(ZoneNum)) / CeilingHeight * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MATMX(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); if (UseZoneTimeStepHistory) { ZTM3OC(ZoneNum) = XM3TOC(ZoneNum); diff --git a/src/EnergyPlus/UnitHeater.cc b/src/EnergyPlus/UnitHeater.cc index 49f2c5bb537..c97edf32586 100644 --- a/src/EnergyPlus/UnitHeater.cc +++ b/src/EnergyPlus/UnitHeater.cc @@ -127,7 +127,7 @@ namespace UnitHeater { using DataHVACGlobals::SmallLoad; using DataHVACGlobals::SmallMassFlow; using namespace ScheduleManager; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using namespace FluidProperties; @@ -1762,7 +1762,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } @@ -1775,7 +1775,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } @@ -1812,7 +1812,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); mdot = UnitHeat(UnitHeatNum).MaxHotWaterFlow * PartLoadFrac; @@ -1833,7 +1833,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); mdot = UnitHeat(UnitHeatNum).MaxHotSteamFlow * PartLoadFrac; @@ -1854,7 +1854,7 @@ namespace UnitHeater { QCoilReq = 0.0; } else { HCoilInAirNode = UnitHeat(UnitHeatNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitHeat(UnitHeatNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitHeat(UnitHeatNum).AirInNode).Temp); } diff --git a/src/EnergyPlus/UnitVentilator.cc b/src/EnergyPlus/UnitVentilator.cc index 5a118e959d7..8b2b4027373 100644 --- a/src/EnergyPlus/UnitVentilator.cc +++ b/src/EnergyPlus/UnitVentilator.cc @@ -3381,7 +3381,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -3396,7 +3396,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -3468,7 +3468,7 @@ namespace UnitVentilator { mdot = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); mdot = UnitVent(UnitVentNum).MaxHotWaterFlow * PartLoadRatio; @@ -3496,7 +3496,7 @@ namespace UnitVentilator { mdot = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); mdot = UnitVent(UnitVentNum).MaxHotSteamFlow * PartLoadFrac; @@ -3524,7 +3524,7 @@ namespace UnitVentilator { QCoilReq = 0.0; } else { HCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(UnitVent(UnitVentNum).AirInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(UnitVent(UnitVentNum).AirInNode).HumRat); QCoilReq = QZnReq - Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(HCoilInAirNode).Temp - Node(UnitVent(UnitVentNum).AirInNode).Temp); } @@ -4023,8 +4023,8 @@ namespace UnitVentilator { } } - ActualOAMassFlowRate = (std::abs(QZnReq) + (MassFlowRate * std::abs(EnthDiffAcrossFan))) / - (PsyCpAirFnWTdb(DataEnvironment::OutHumRat) * (Tinlet - Toutdoor)); + ActualOAMassFlowRate = + (std::abs(QZnReq) + (MassFlowRate * std::abs(EnthDiffAcrossFan))) / (PsyCpAirFnW(DataEnvironment::OutHumRat) * (Tinlet - Toutdoor)); ActualOAMassFlowRate = max(ActualOAMassFlowRate, (MinOAFrac * MassFlowRate)); ActualOAMassFlowRate = min(ActualOAMassFlowRate, (MaxOAFrac * MassFlowRate)); @@ -4051,7 +4051,7 @@ namespace UnitVentilator { int CCoilInAirNode = UnitVent(UnitVentNum).FanOutletNode; int AirInNode = UnitVent(UnitVentNum).AirInNode; Real64 const SmallLoad = -1.0; // Watts - Real64 CpAirZn = PsyCpAirFnWTdb(Node(AirInNode).HumRat); + Real64 CpAirZn = PsyCpAirFnW(Node(AirInNode).HumRat); QCoilReq = QZnReq - Node(CCoilInAirNode).MassFlowRate * CpAirZn * (Node(CCoilInAirNode).Temp - Node(AirInNode).Temp); if (QCoilReq > SmallLoad) { QCoilReq = 0.0; diff --git a/src/EnergyPlus/UnitarySystem.cc b/src/EnergyPlus/UnitarySystem.cc index f963a765734..a5cce11cdd8 100644 --- a/src/EnergyPlus/UnitarySystem.cc +++ b/src/EnergyPlus/UnitarySystem.cc @@ -8516,7 +8516,7 @@ namespace UnitarySystems { FullSensibleOutput = TempSensOutput; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->CoolCoilInletNodeNum).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->CoolCoilInletNodeNum).HumRat); CoolingOnlySensibleOutput = DataLoopNode::Node(this->CoolCoilInletNodeNum).MassFlowRate * CpAir * ((DataLoopNode::Node(this->NodeNumOfControlledZone).Temp - DataLoopNode::Node(this->CoolCoilOutletNodeNum).Temp) - (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp)); @@ -9605,8 +9605,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9630,8 +9630,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9646,8 +9646,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9669,8 +9669,8 @@ namespace UnitarySystems { this->calcUnitaryHeatingSystem(AirLoopNum, FirstHVACIteration, HeatPLR, HeatingCompOn, OnOffAirFlowRatio, HeatCoilLoad); if (DataLoopNode::Node(this->HeatCoilOutletNodeNum).Temp > this->DesignMaxOutletTemp && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->HeatCoilInletNodeNum).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilInletNodeNum).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->HeatCoilOutletNodeNum).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = this->DesignMaxOutletTemp - DataLoopNode::Node(this->HeatCoilInletNodeNum).Temp; Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; @@ -9697,8 +9697,8 @@ namespace UnitarySystems { this->calcUnitarySuppHeatingSystem(FirstHVACIteration, SuppPLR, SuppCoilLoad); if ((DataLoopNode::Node(this->m_SuppCoilAirOutletNode).Temp > this->DesignMaxOutletTemp) && SuppPLR > 0.0 && !this->m_SimASHRAEModel) { Real64 MDotAir = DataLoopNode::Node(this->m_SuppCoilAirInletNode).MassFlowRate; - Real64 CpAirIn = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirInletNode).HumRat); - Real64 CpAirOut = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(this->m_SuppCoilAirOutletNode).HumRat); + Real64 CpAirIn = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->m_SuppCoilAirInletNode).HumRat); + Real64 CpAirOut = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->m_SuppCoilAirOutletNode).HumRat); Real64 CpAir = (CpAirIn + CpAirOut) / 2; Real64 HCDeltaT = max(0.0, this->DesignMaxOutletTemp - DataLoopNode::Node(this->m_SuppCoilAirInletNode).Temp); Real64 MaxHeatCoilLoad = MDotAir * CpAir * HCDeltaT; diff --git a/src/EnergyPlus/UserDefinedComponents.cc b/src/EnergyPlus/UserDefinedComponents.cc index 5cf1ad9add5..6e43d566a91 100644 --- a/src/EnergyPlus/UserDefinedComponents.cc +++ b/src/EnergyPlus/UserDefinedComponents.cc @@ -2124,7 +2124,7 @@ namespace UserDefinedComponents { using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::InitComponentNodes; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals @@ -2210,7 +2210,7 @@ namespace UserDefinedComponents { if (UserPlantComp(CompNum).Air.InletNodeNum > 0) { UserPlantComp(CompNum).Air.InletRho = PsyRhoAirFnPbTdbW( OutBaroPress, Node(UserPlantComp(CompNum).Air.InletNodeNum).Temp, Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat, RoutineName); - UserPlantComp(CompNum).Air.InletCp = PsyCpAirFnWTdb(Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat); + UserPlantComp(CompNum).Air.InletCp = PsyCpAirFnW(Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat); UserPlantComp(CompNum).Air.InletTemp = Node(UserPlantComp(CompNum).Air.InletNodeNum).Temp; UserPlantComp(CompNum).Air.InletMassFlowRate = Node(UserPlantComp(CompNum).Air.InletNodeNum).MassFlowRate; UserPlantComp(CompNum).Air.InletHumRat = Node(UserPlantComp(CompNum).Air.InletNodeNum).HumRat; @@ -2239,7 +2239,7 @@ namespace UserDefinedComponents { using DataEnvironment::OutBaroPress; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals @@ -2302,7 +2302,7 @@ namespace UserDefinedComponents { Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat, RoutineName); - UserCoil(CompNum).Air(Loop).InletCp = PsyCpAirFnWTdb(Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat); + UserCoil(CompNum).Air(Loop).InletCp = PsyCpAirFnW(Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat); UserCoil(CompNum).Air(Loop).InletTemp = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).Temp; UserCoil(CompNum).Air(Loop).InletMassFlowRate = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).MassFlowRate; UserCoil(CompNum).Air(Loop).InletHumRat = Node(UserCoil(CompNum).Air(Loop).InletNodeNum).HumRat; @@ -2346,7 +2346,7 @@ namespace UserDefinedComponents { using DataZoneEnergyDemands::ZoneSysMoistureDemand; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals @@ -2416,7 +2416,7 @@ namespace UserDefinedComponents { Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).Temp, Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat, RoutineName); - UserZoneAirHVAC(CompNum).ZoneAir.InletCp = PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat); + UserZoneAirHVAC(CompNum).ZoneAir.InletCp = PsyCpAirFnW(Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat); UserZoneAirHVAC(CompNum).ZoneAir.InletTemp = Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).Temp; UserZoneAirHVAC(CompNum).ZoneAir.InletHumRat = Node(UserZoneAirHVAC(CompNum).ZoneAir.InletNodeNum).HumRat; @@ -2425,7 +2425,7 @@ namespace UserDefinedComponents { Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).Temp, Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat, RoutineName); - UserZoneAirHVAC(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat); + UserZoneAirHVAC(CompNum).SourceAir.InletCp = PsyCpAirFnW(Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat); UserZoneAirHVAC(CompNum).SourceAir.InletTemp = Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).Temp; UserZoneAirHVAC(CompNum).SourceAir.InletHumRat = Node(UserZoneAirHVAC(CompNum).SourceAir.InletNodeNum).HumRat; } @@ -2470,7 +2470,7 @@ namespace UserDefinedComponents { using DataZoneEnergyDemands::ZoneSysMoistureDemand; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; // Locals @@ -2540,7 +2540,7 @@ namespace UserDefinedComponents { Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).Temp, Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat, RoutineName); - UserAirTerminal(CompNum).AirLoop.InletCp = PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat); + UserAirTerminal(CompNum).AirLoop.InletCp = PsyCpAirFnW(Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat); UserAirTerminal(CompNum).AirLoop.InletTemp = Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).Temp; UserAirTerminal(CompNum).AirLoop.InletHumRat = Node(UserAirTerminal(CompNum).AirLoop.InletNodeNum).HumRat; @@ -2549,7 +2549,7 @@ namespace UserDefinedComponents { Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).Temp, Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat, RoutineName); - UserAirTerminal(CompNum).SourceAir.InletCp = PsyCpAirFnWTdb(Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat); + UserAirTerminal(CompNum).SourceAir.InletCp = PsyCpAirFnW(Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat); UserAirTerminal(CompNum).SourceAir.InletTemp = Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).Temp; UserAirTerminal(CompNum).SourceAir.InletHumRat = Node(UserAirTerminal(CompNum).SourceAir.InletNodeNum).HumRat; } diff --git a/src/EnergyPlus/VariableSpeedCoils.cc b/src/EnergyPlus/VariableSpeedCoils.cc index ec4ac99af50..bc1ea6e477f 100644 --- a/src/EnergyPlus/VariableSpeedCoils.cc +++ b/src/EnergyPlus/VariableSpeedCoils.cc @@ -4072,7 +4072,7 @@ namespace VariableSpeedCoils { // design fan heat will be added to coil load Real64 FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, VolFlowRate); // inlet/outlet temp is adjusted after enthalpy is calculcated so fan heat is not double counted - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -4142,7 +4142,7 @@ namespace VariableSpeedCoils { // design fan heat will be added to coil load Real64 FanCoolLoad = DataAirSystems::calcFanDesignHeatGain(DataFanEnumType, DataFanIndex, VolFlowRate); // inlet/outlet temp is adjusted after enthalpy is calculcated so fan heat is not double counted - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); @@ -5042,7 +5042,7 @@ namespace VariableSpeedCoils { using DataPlant::PlantLoop; using DataWater::WaterStorage; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; @@ -5135,7 +5135,7 @@ namespace VariableSpeedCoils { LoadSideInletDBTemp_Init = 26.7; LoadSideInletHumRat_Init = 0.0111; LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init); - CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init); + CpAir_Init = PsyCpAirFnW(LoadSideInletHumRat_Init); firstTime = false; } LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, OutBaroPress, RoutineName); @@ -5203,7 +5203,7 @@ namespace VariableSpeedCoils { SourceSideMassFlowRate = CondAirMassFlow; SourceSideInletTemp = CondInletTemp; SourceSideInletEnth = PsyHFnTdbW(CondInletTemp, CondInletHumRat); - CpSource = PsyCpAirFnWTdb(CondInletHumRat); + CpSource = PsyCpAirFnW(CondInletHumRat); VarSpeedCoil(DXCoilNum).CondInletTemp = CondInletTemp; // If used in a heat pump, the value of MaxOAT in the heating coil overrides that in the cooling coil (in GetInput) @@ -5267,7 +5267,7 @@ namespace VariableSpeedCoils { LoadSideInletHumRat_Unit = VarSpeedCoil(DXCoilNum).InletAirHumRat; LoadSideInletWBTemp_Unit = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit, OutBaroPress, RoutineName); LoadSideInletEnth_Unit = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); + CpAir_Unit = PsyCpAirFnW(LoadSideInletHumRat_Unit); RuntimeFrac = 1.0; OnOffFanPartLoadFraction = 1.0; @@ -6113,7 +6113,7 @@ namespace VariableSpeedCoils { // calculate coil outlet state variables LoadSideOutletEnth = LoadSideInletEnth - QLoadTotal / LoadSideMassFlowRate; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); + CpAir = PsyCpAirFnW(LoadSideInletHumRat); LoadSideOutletDBTemp = LoadSideInletDBTemp - QSensible / (LoadSideMassFlowRate * CpAir); MaxHumRat = PsyWFnTdbRhPb(LoadSideOutletDBTemp, 0.9999, VarSpeedCoil(DXCoilNum).InletAirPressure, RoutineName); @@ -6250,7 +6250,7 @@ namespace VariableSpeedCoils { using DataHVACGlobals::TimeStepSys; using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; @@ -6325,7 +6325,7 @@ namespace VariableSpeedCoils { LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp, LoadSideInletHumRat, OutBaroPress, RoutineName); LoadSideInletEnth = VarSpeedCoil(DXCoilNum).InletAirEnthalpy; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); + CpAir = PsyCpAirFnW(LoadSideInletHumRat); if (VarSpeedCoil(DXCoilNum).VSCoilTypeOfNum == Coil_HeatingAirToAirVariableSpeed) { // Get condenser outdoor node info from DX Heating Coil @@ -6343,7 +6343,7 @@ namespace VariableSpeedCoils { SourceSideMassFlowRate = 1.0; // not used and avoid divided by zero SourceSideInletTemp = OutdoorDryBulb; SourceSideInletEnth = PsyHFnTdbW(OutdoorDryBulb, OutdoorHumRat); - CpSource = PsyCpAirFnWTdb(OutHumRat); + CpSource = PsyCpAirFnW(OutHumRat); // Initialize crankcase heater, operates below OAT defined in input deck for HP DX heating coil if (OutdoorDryBulb < VarSpeedCoil(DXCoilNum).MaxOATCrankcaseHeater) { diff --git a/src/EnergyPlus/VentilatedSlab.cc b/src/EnergyPlus/VentilatedSlab.cc index 86c0ffedb14..4d419f1e7a9 100644 --- a/src/EnergyPlus/VentilatedSlab.cc +++ b/src/EnergyPlus/VentilatedSlab.cc @@ -2961,7 +2961,7 @@ namespace VentilatedSlab { VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } - CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat); + CpFan = PsyCpAirFnW(Node(FanOutletNode).HumRat); QZnReq = (Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - Node(FanOutletNode).Temp); // Setup the coil configuration @@ -3214,7 +3214,7 @@ namespace VentilatedSlab { VentSlab(Item).FanName, FirstHVACIteration, VentSlab(Item).Fan_Index, _, ZoneCompTurnFansOn, ZoneCompTurnFansOff); } - CpFan = PsyCpAirFnWTdb(Node(FanOutletNode).HumRat); + CpFan = PsyCpAirFnW(Node(FanOutletNode).HumRat); QZnReq = (Node(OutletNode).MassFlowRate) * CpFan * (RadInTemp - Node(FanOutletNode).Temp); ControlCompOutput(VentSlab(Item).Name, @@ -3362,7 +3362,7 @@ namespace VentilatedSlab { QCoilReq = 0.0; } else { HCoilInAirNode = VentSlab(Item).FanOutletNode; - CpAirZn = PsyCpAirFnWTdb(Node(HCoilInAirNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(HCoilInAirNode).HumRat); QCoilReq = Node(HCoilInAirNode).MassFlowRate * CpAirZn * (Node(VentSlab(Item).RadInNode).Temp) - (Node(HCoilInAirNode).Temp); } @@ -3377,7 +3377,7 @@ namespace VentilatedSlab { } else { HCoilInAirTemp = Node(VentSlab(Item).FanOutletNode).Temp; HCoilOutAirTemp = Node(VentSlab(Item).RadInNode).Temp; - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); QCoilReq = Node(VentSlab(Item).FanOutletNode).MassFlowRate * CpAirZn * (HCoilOutAirTemp - HCoilInAirTemp); } @@ -3679,7 +3679,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * VentSlab(Item).SurfaceFlowFrac(RadSurfNum); - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = VentSlab(Item).CoreNumbers * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); @@ -3818,7 +3818,7 @@ namespace VentilatedSlab { // Return Air temp Check if (VentSlab(Item).SysConfg == SlabOnly) { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && (std::abs(TotalVentSlabRadPower) > ZeroSystemResp)) { @@ -3935,7 +3935,7 @@ namespace VentilatedSlab { Cl = Ch + ((Ci * (Cc + Cb * Cf) + Cj * (Cf + Ce * Cc)) / (1.0 - Ce * Cb)); Mdot = AirMassFlow * FlowFrac; - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); QRadSysSource(SurfNum) = CNumDS * EpsMdotCpAirZn * (AirTempIn - Ck) / (1.0 + (EpsMdotCpAirZn * Cl / Surface(SurfNum).Area)); @@ -4082,7 +4082,7 @@ namespace VentilatedSlab { if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); Node(MSlabInletNode).Temp = MSlabAirInTemp; Node(MSlabOutletNode).Temp = Node(MSlabInletNode).Temp - (QRadSysSource(SurfNum) / (AirMassFlow * CpAirZn)); @@ -4096,7 +4096,7 @@ namespace VentilatedSlab { // Return Air temp Check if (AirMassFlow > 0.0) { - CpAirZn = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAirZn = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); Node(ReturnAirNode).Temp = Node(SlabInNode).Temp - (TotalVentSlabRadPower / (AirMassFlow * CpAirZn)); if ((std::abs(Node(ReturnAirNode).Temp - AirOutletTempCheck) > TempCheckLimit) && @@ -4314,7 +4314,7 @@ namespace VentilatedSlab { FanOutNode = VentSlab(Item).FanOutletNode; AirMassFlow = Node(AirOutletNode).MassFlowRate; ZoneInletNode = VentSlab(Item).ZoneAirInNode; - CpAppAir = PsyCpAirFnWTdb(Node(AirOutletNode).HumRat); + CpAppAir = PsyCpAirFnW(Node(AirOutletNode).HumRat); AirInletNode = VentSlab(Item).ReturnAirNode; for (RadSurfNum = 1; RadSurfNum <= TotRadSurfaces; ++RadSurfNum) { @@ -4512,7 +4512,7 @@ namespace VentilatedSlab { PRactual = Pr(Index - 1) + InterpFrac * (Pr(Index) - Pr(Index - 1)); } // arguments are glycol name, temperature, and concentration - CpAppAir = PsyCpAirFnWTdb(Node(VentSlab(Item).RadInNode).HumRat); + CpAppAir = PsyCpAirFnW(Node(VentSlab(Item).RadInNode).HumRat); SysAirMassFlow = AirMassFlow / CoreNumbers; // Calculate the Reynold's number from RE=(4*Mdot)/(Pi*Mu*Diameter) diff --git a/src/EnergyPlus/WaterCoils.cc b/src/EnergyPlus/WaterCoils.cc index eb9ead6ea5d..c6947ed4cb1 100644 --- a/src/EnergyPlus/WaterCoils.cc +++ b/src/EnergyPlus/WaterCoils.cc @@ -127,7 +127,7 @@ namespace WaterCoils { using DataPlant::TypeOf_CoilWaterSimpleHeating; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbRhPb; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -1199,7 +1199,7 @@ namespace WaterCoils { WaterInletNode = WaterCoil(CoilNum).WaterInletNodeNum; WaterOutletNode = WaterCoil(CoilNum).WaterOutletNodeNum; - DesCpAir(CoilNum) = PsyCpAirFnWTdb(0.0); + DesCpAir(CoilNum) = PsyCpAirFnW(0.0); DesUARangeCheck(CoilNum) = (-1568.6 * WaterCoil(CoilNum).DesInletAirHumRat + 20.157); if (WaterCoil(CoilNum).WaterCoilType == CoilType_Cooling) { // 'Cooling' @@ -1230,7 +1230,7 @@ namespace WaterCoils { Node(WaterInletNode).HumRat = 0.0; MyUAAndFlowCalcFlag(CoilNum) = false; // fill values for variable UA - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); WaterCoil(CoilNum).DesAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum).DesAirVolFlowRate; WaterCoil(CoilNum).LiquidSideNominalConvect = WaterCoil(CoilNum).UACoil * (WaterCoil(CoilNum).RatioAirSideToWaterSideConvect + 1) / WaterCoil(CoilNum).RatioAirSideToWaterSideConvect; @@ -1523,7 +1523,7 @@ namespace WaterCoils { LogMeanEnthDiff = 2000.0; // UA will be 1/2 the design coil load } DesUACoilExternalEnth = WaterCoil(CoilNum).DesTotWaterCoilLoad / LogMeanEnthDiff; - WaterCoil(CoilNum).UACoilExternal = DesUACoilExternalEnth * PsyCpAirFnWTdb(WaterCoil(CoilNum).DesInletAirHumRat); + WaterCoil(CoilNum).UACoilExternal = DesUACoilExternalEnth * PsyCpAirFnW(WaterCoil(CoilNum).DesInletAirHumRat); if (Ipass == 1 && (NoSatCurveIntersect || CBFTooLarge || BelowInletWaterTemp)) { // reset outlet conditions to 90% relative humidity at the same outlet enthalpy @@ -1653,7 +1653,7 @@ namespace WaterCoils { WaterCoil(CoilNum).InletAirEnthalpy = PsyHFnTdbW(WaterCoil(CoilNum).InletAirTemp, WaterCoil(CoilNum).InletAirHumRat); WaterCoil(CoilNum).InletWaterMassFlowRate = WaterCoil(CoilNum).MaxWaterMassFlowRate; WaterCoil(CoilNum).InletAirMassFlowRate = StdRhoAir * WaterCoil(CoilNum).DesAirVolFlowRate; - CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); + CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnW(WaterCoil(CoilNum).InletAirHumRat); Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterCoil(CoilNum).InletWaterTemp, @@ -2096,7 +2096,7 @@ namespace WaterCoils { DesCoilAirFlow = 0.0; DesCoilExitTemp = 0.0; LoopErrorsFound = false; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); // cooling coils if (WaterCoil(CoilNum).WaterCoilType == CoilType_Cooling && WaterCoil(CoilNum).RequestingAutoSize) { @@ -2764,7 +2764,7 @@ namespace WaterCoils { } if (WaterMassFlowRate > MassFlowTolerance) { // If the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, @@ -3044,8 +3044,8 @@ namespace WaterCoils { // known thermodynamic functions // All coil calcs are done in KJoules. Convert to KJ here and then convert // back to Joules at the end of the Subroutine. - DryAirSpecHeat = PsyCpAirFnWTdb(zero) * ConvK; - MoistAirSpecificHeat = PsyCpAirFnWTdb(InletAirHumRat) * ConvK; + DryAirSpecHeat = PsyCpAirFnW(zero) * ConvK; + MoistAirSpecificHeat = PsyCpAirFnW(InletAirHumRat) * ConvK; InletAirEnthalpy = WaterCoil(CoilNum).InletAirEnthalpy * ConvK; EnterAirDewPoint = PsyTdpFnWPb(InletAirHumRat, OutBaroPress, RoutineName); @@ -3449,7 +3449,7 @@ namespace WaterCoils { // Implementation of epsilon*NTU method TempAirOut = AirExitCoilSurfTemp + (AirWetDryInterfcTemp - AirExitCoilSurfTemp) * y; OutletAirHumRat = PsyWFnTdbH(TempAirOut, 1000.0 * OutletAirEnthalpy, RoutineName); - SenWaterCoilLoad = AirMassFlow * (PsyCpAirFnWTdb(InletAirHumRat) * TempAirIn - PsyCpAirFnWTdb(OutletAirHumRat) * TempAirOut) * ConvK; + SenWaterCoilLoad = AirMassFlow * (PsyCpAirFnW(InletAirHumRat) * TempAirIn - PsyCpAirFnW(OutletAirHumRat) * TempAirOut) * ConvK; } if (FanOpMode == CycFanCycCoil) { @@ -3794,7 +3794,7 @@ namespace WaterCoils { } // Calculate air and water capacity rates - CapacitanceAir = AirMassFlow * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); + CapacitanceAir = AirMassFlow * PsyCpAirFnW(WaterCoil(CoilNum).InletAirHumRat); // Water Capacity Rate Cp = GetSpecificHeatGlycol( PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); @@ -3935,7 +3935,7 @@ namespace WaterCoils { // Determine air and water enthalpy outlet conditions by modeling // coil as counterflow enthalpy heat exchanger - UACoilTotalEnth = 1.0 / (IntermediateCpSat * WaterSideResist + AirSideResist * PsyCpAirFnWTdb(0.0)); + UACoilTotalEnth = 1.0 / (IntermediateCpSat * WaterSideResist + AirSideResist * PsyCpAirFnW(0.0)); CapacityRateAirWet = AirMassFlow; Cp = GetSpecificHeatGlycol( PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, WaterTempIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, RoutineName); @@ -3951,7 +3951,7 @@ namespace WaterCoils { // Calculate entering and leaving external surface conditions from // air and water conditions and the ratio of resistances - ResistRatio = (WaterSideResist) / (WaterSideResist + PsyCpAirFnWTdb(0.0) / IntermediateCpSat * AirSideResist); + ResistRatio = (WaterSideResist) / (WaterSideResist + PsyCpAirFnW(0.0) / IntermediateCpSat * AirSideResist); EnthSatAirCoilSurfaceEntryTemp = EnthSatAirOutletWaterTemp + ResistRatio * (EnthAirInlet - EnthSatAirOutletWaterTemp); EnthSatAirCoilSurfaceExitTemp = EnthSatAirInletWaterTemp + ResistRatio * (EnthAirOutlet - EnthSatAirInletWaterTemp); @@ -4527,7 +4527,7 @@ namespace WaterCoils { // Determine the temperature effectiveness, assuming the temperature // of the condensate is constant (MinimumCapacityStream/MaximumCapacityStream = 0) and the specific heat // of moist air is constant - CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnWTdb(WaterCoil(CoilNum).InletAirHumRat); + CapacitanceAir = WaterCoil(CoilNum).InletAirMassFlowRate * PsyCpAirFnW(WaterCoil(CoilNum).InletAirHumRat); // Calculating NTU from UA and Capacitance. // del NTU = UACoilExternal/MAX(CapacitanceAir,SmallNo) @@ -6676,7 +6676,7 @@ namespace WaterCoils { WaterMassFlowRate = WaterCoil(CoilNum).InletWaterMassFlowRate; } if (WaterMassFlowRate > MassFlowTolerance) { // if the coil is operating - CapacitanceAir = PsyCpAirFnWTdb(Win) * AirMassFlow; + CapacitanceAir = PsyCpAirFnW(Win) * AirMassFlow; Cp = GetSpecificHeatGlycol(PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidName, TempWaterIn, PlantLoop(WaterCoil(CoilNum).WaterLoopNum).FluidIndex, diff --git a/src/EnergyPlus/WaterThermalTanks.cc b/src/EnergyPlus/WaterThermalTanks.cc index 4d6fa8f2e5c..e35207c51af 100644 --- a/src/EnergyPlus/WaterThermalTanks.cc +++ b/src/EnergyPlus/WaterThermalTanks.cc @@ -9292,7 +9292,7 @@ namespace WaterThermalTanks { using IntegratedHeatPump::IntegratedHeatPumps; using IntegratedHeatPump::SimIHP; using Psychrometrics::CPHW; // , PsyWFnTdbTwbPb - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::RhoH2O; using ScheduleManager::GetCurrentScheduleValue; @@ -10412,7 +10412,7 @@ namespace WaterThermalTanks { // calculate sensible capacity to zone for inlet air configuration equals Zone Only or Zone And Outdoor Air configurations } else { - CpAir = PsyCpAirFnWTdb(Node(HPAirInletNode).HumRat); + CpAir = PsyCpAirFnW(Node(HPAirInletNode).HumRat); // add parasitics to zone heat balance if parasitic heat load is to zone otherwise neglect parasitics if (HeatPump.ParasiticTempIndicator == AmbientTempZone) { diff --git a/src/EnergyPlus/WaterToAirHeatPump.cc b/src/EnergyPlus/WaterToAirHeatPump.cc index 9201768fe37..98026e89036 100644 --- a/src/EnergyPlus/WaterToAirHeatPump.cc +++ b/src/EnergyPlus/WaterToAirHeatPump.cc @@ -1114,7 +1114,7 @@ namespace WaterToAirHeatPump { using DataPlant::PlantLoop; using General::RoundSigDigits; using General::SolveRoot; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; // ,PsyHFnTdbRhPb,PsyWFnTdpPb using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyTsatFnHPb; @@ -1287,7 +1287,7 @@ namespace WaterToAirHeatPump { // Set indoor air conditions to the actual condition LoadSideInletDBTemp_Unit = WatertoAirHP(HPNum).InletAirDBTemp; LoadSideInletHumRat_Unit = WatertoAirHP(HPNum).InletAirHumRat; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); + CpAir = PsyCpAirFnW(LoadSideInletHumRat_Unit); LoadSideAirInletEnth_Unit = PsyHFnTdbW(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit); SourceSideInletTemp = WatertoAirHP(HPNum).InletWaterTemp; @@ -1783,7 +1783,7 @@ namespace WaterToAirHeatPump { // Using/Aliasing using namespace FluidProperties; - using Psychrometrics::PsyCpAirFnWTdb; // ,PsyHFnTdbRhPb,PsyWFnTdpPb + using Psychrometrics::PsyCpAirFnW; // ,PsyHFnTdbRhPb,PsyWFnTdpPb using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyWFnTdbH; // USE DataZoneEnergyDemands @@ -1920,7 +1920,7 @@ namespace WaterToAirHeatPump { LoadSideMassFlowRate = WatertoAirHP(HPNum).InletAirMassFlowRate; LoadSideInletDBTemp = WatertoAirHP(HPNum).InletAirDBTemp; LoadSideInletHumRat = WatertoAirHP(HPNum).InletAirHumRat; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); + CpAir = PsyCpAirFnW(LoadSideInletHumRat); SourceSideInletTemp = WatertoAirHP(HPNum).InletWaterTemp; SourceSideWaterInletEnth = WatertoAirHP(HPNum).InletWaterEnthalpy; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 60de81f30e7..314d90c4644 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -1408,7 +1408,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -1497,7 +1497,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else { @@ -1601,7 +1601,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::BlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else if (PrimaryAirSystem(CurSysNum).supFanLocation == DataAirSystems::fanPlacement::DrawThru) { @@ -1688,7 +1688,7 @@ namespace WaterToAirHeatPumpSimple { break; } } // end switch - Real64 CpAir = PsyCpAirFnWTdb(MixHumRat); + Real64 CpAir = PsyCpAirFnW(MixHumRat); if (DataSizing::DataFanPlacement == DataSizing::zoneFanPlacement::zoneBlowThru) { MixTemp += FanCoolLoad / (CpAir * rhoair * VolFlowRate); } else { @@ -2139,7 +2139,7 @@ namespace WaterToAirHeatPumpSimple { using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; @@ -2221,7 +2221,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletDBTemp_Init = 26.7; LoadSideInletHumRat_Init = 0.0111; LoadSideInletEnth_Init = PsyHFnTdbW(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init); - CpAir_Init = PsyCpAirFnWTdb(LoadSideInletHumRat_Init); + CpAir_Init = PsyCpAirFnW(LoadSideInletHumRat_Init); firstTime = false; } LoadSideInletWBTemp_Init = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Init, LoadSideInletHumRat_Init, OutBaroPress, RoutineName); @@ -2293,7 +2293,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletHumRat_Unit = SimpleWatertoAirHP(HPNum).InletAirHumRat; LoadSideInletWBTemp_Unit = PsyTwbFnTdbWPb(LoadSideInletDBTemp_Unit, LoadSideInletHumRat_Unit, OutBaroPress, RoutineName); LoadSideInletEnth_Unit = SimpleWatertoAirHP(HPNum).InletAirEnthalpy; - CpAir_Unit = PsyCpAirFnWTdb(LoadSideInletHumRat_Unit); + CpAir_Unit = PsyCpAirFnW(LoadSideInletHumRat_Unit); while (true) { ++NumIteration; @@ -2493,7 +2493,7 @@ namespace WaterToAirHeatPumpSimple { using DataPlant::PlantLoop; using FluidProperties::GetSpecificHeatGlycol; using PlantUtilities::SetComponentFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyTwbFnTdbWPb; @@ -2564,7 +2564,7 @@ namespace WaterToAirHeatPumpSimple { LoadSideInletWBTemp = PsyTwbFnTdbWPb(LoadSideInletDBTemp, LoadSideInletHumRat, OutBaroPress, RoutineName); LoadSideInletEnth = SimpleWatertoAirHP(HPNum).InletAirEnthalpy; - CpAir = PsyCpAirFnWTdb(LoadSideInletHumRat); + CpAir = PsyCpAirFnW(LoadSideInletHumRat); SourceSideMassFlowRate = SimpleWatertoAirHP(HPNum).WaterMassFlowRate; SourceSideInletTemp = SimpleWatertoAirHP(HPNum).InletWaterTemp; SourceSideInletEnth = SimpleWatertoAirHP(HPNum).InletWaterEnthalpy; diff --git a/src/EnergyPlus/WindowAC.cc b/src/EnergyPlus/WindowAC.cc index 8bc43c17b9c..931555e9f8b 100644 --- a/src/EnergyPlus/WindowAC.cc +++ b/src/EnergyPlus/WindowAC.cc @@ -140,7 +140,7 @@ namespace WindowAC { using DataHVACGlobals::SmallLoad; using DataHVACGlobals::SmallMassFlow; using namespace ScheduleManager; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -1256,7 +1256,7 @@ namespace WindowAC { InletNode = WindAC(WindACNum).AirInNode; AirMassFlow = Node(InletNode).MassFlowRate; Test = AirMassFlow; - CpAir = PsyCpAirFnWTdb(Node(InletNode).HumRat); + CpAir = PsyCpAirFnW(Node(InletNode).HumRat); OpMode = WindAC(WindACNum).OpMode; // set the on/off flags diff --git a/src/EnergyPlus/WindowComplexManager.cc b/src/EnergyPlus/WindowComplexManager.cc index 07127233667..166fbe39806 100644 --- a/src/EnergyPlus/WindowComplexManager.cc +++ b/src/EnergyPlus/WindowComplexManager.cc @@ -2957,7 +2957,7 @@ namespace WindowComplexManager { using DataZoneEquipment::ZoneEquipConfig; using General::InterpSlatAng; // Function for slat angle interpolation using General::InterpSw; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdpFnWPb; using ScheduleManager::GetCurrentScheduleValue; using TARCOGGassesParams::maxgas; @@ -3319,7 +3319,7 @@ namespace WindowComplexManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3364,7 +3364,7 @@ namespace WindowComplexManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3930,8 +3930,8 @@ namespace WindowComplexManager { InletAirHumRat = OutHumRat; } ZoneTemp = MAT(ZoneNum); // this should be Tin (account for different reference temps) - CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat); - CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAirOutlet = PsyCpAirFnW(InletAirHumRat); + CpAirZone = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); ConvHeatGainToZoneAir = TotAirflowGap * (CpAirOutlet * (TAirflowGapOutletC)-CpAirZone * ZoneTemp); if (SurfaceWindow(SurfNum).AirflowDestination == AirFlowWindow_Destination_IndoorAir) { SurfaceWindow(SurfNum).ConvHeatGainToZoneAir = ConvHeatGainToZoneAir; diff --git a/src/EnergyPlus/WindowEquivalentLayer.cc b/src/EnergyPlus/WindowEquivalentLayer.cc index a5302df38f0..b778692ad08 100644 --- a/src/EnergyPlus/WindowEquivalentLayer.cc +++ b/src/EnergyPlus/WindowEquivalentLayer.cc @@ -802,7 +802,7 @@ namespace WindowEquivalentLayer { using DataZoneEquipment::ZoneEquipConfig; using General::InterpSlatAng; using General::InterpSw; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdpFnWPb; using ScheduleManager::GetCurrentScheduleValue; using namespace DataHeatBalFanSys; @@ -903,7 +903,7 @@ namespace WindowEquivalentLayer { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -947,7 +947,7 @@ namespace WindowEquivalentLayer { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/WindowManager.cc b/src/EnergyPlus/WindowManager.cc index 23b23345c45..575316c8906 100644 --- a/src/EnergyPlus/WindowManager.cc +++ b/src/EnergyPlus/WindowManager.cc @@ -2461,7 +2461,7 @@ namespace WindowManager { using DataLoopNode::Node; using DataZoneEquipment::ZoneEquipConfig; using General::InterpSlatAng; // Function for slat angle interpolation - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyTdpFnWPb; // unused0909 USE DataEnvironment, ONLY: CurMnDyHr using ScheduleManager::GetCurrentScheduleValue; @@ -2680,7 +2680,7 @@ namespace WindowManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -2902,7 +2902,7 @@ namespace WindowManager { for (NodeNum = 1; NodeNum <= ZoneEquipConfig(ZoneEquipConfigNum).NumInletNodes; ++NodeNum) { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNumAdj)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNumAdj)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } @@ -3273,7 +3273,7 @@ namespace WindowManager { using General::InterpSw; using General::RoundSigDigits; using General::TrimSigDigits; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; @@ -3935,8 +3935,8 @@ namespace WindowManager { InletAirHumRat = OutHumRat; } ZoneTemp = MAT(ZoneNum); // this should be Tin (account for different reference temps) - CpAirOutlet = PsyCpAirFnWTdb(InletAirHumRat); - CpAirZone = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAirOutlet = PsyCpAirFnW(InletAirHumRat); + CpAirZone = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); ConvHeatGainToZoneAir = TotAirflowGap * (CpAirOutlet * (TAirflowGapOutletC)-CpAirZone * ZoneTemp); if (SurfaceWindow(SurfNum).AirflowDestination == AirFlowWindow_Destination_IndoorAir) { SurfaceWindow(SurfNum).ConvHeatGainToZoneAir = ConvHeatGainToZoneAir; diff --git a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc index 70bf59a47ad..83ee998e66b 100644 --- a/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc +++ b/src/EnergyPlus/ZoneAirLoopEquipmentManager.cc @@ -662,7 +662,7 @@ namespace ZoneAirLoopEquipmentManager { using HVACCooledBeam::SimCoolBeam; using HVACSingleDuctInduc::SimIndUnit; using PoweredInductionUnits::SimPIU; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using SingleDuct::GetATMixers; using SingleDuct::SimulateSingleDuct; using UserDefinedComponents::SimAirTerminalUserDefined; @@ -891,7 +891,7 @@ namespace ZoneAirLoopEquipmentManager { // SysOutputProvided >0 Zone is heated SpecHumOut = Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).HumRat; SpecHumIn = Node(ZoneEquipConfig(ControlledZoneNum).ZoneNode).HumRat; - Real64 CpAirAvg = PsyCpAirFnWTdb(0.5 * (SpecHumOut + SpecHumOut)); + Real64 CpAirAvg = PsyCpAirFnW(0.5 * (SpecHumOut + SpecHumOut)); SysOutputProvided = Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).MassFlowRate * CpAirAvg * (Node(AirDistUnit(AirDistUnitNum).OutletNodeNum).Temp - Node(ZoneEquipConfig(ControlledZoneNum).ZoneNode).Temp); // AirDistUnit( AirDistUnitNum ).HeatRate = max( 0.0, SysOutputProvided ); diff --git a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc index d97ab6f7d99..ca93ea53e4d 100644 --- a/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneContaminantPredictorCorrector.cc @@ -2374,7 +2374,7 @@ namespace ZoneContaminantPredictorCorrector { zone_M_CO2 = Zone(ZoneNum).ZoneMeasuredCO2Concentration; delta_CO2 = (Zone(ZoneNum).ZoneMeasuredCO2Concentration - OutdoorCO2) / 1000; - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineNameInfiltration); if (Zone(ZoneNum).ZoneMeasuredCO2Concentration == OutdoorCO2) { diff --git a/src/EnergyPlus/ZoneDehumidifier.cc b/src/EnergyPlus/ZoneDehumidifier.cc index 056c885db2e..25404dcd8c4 100644 --- a/src/EnergyPlus/ZoneDehumidifier.cc +++ b/src/EnergyPlus/ZoneDehumidifier.cc @@ -787,7 +787,7 @@ namespace ZoneDehumidifier { // Using/Aliasing using CurveManager::CurveValue; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHfgAirFnWTdb; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyRhFnTdbWPb; @@ -998,7 +998,7 @@ namespace ZoneDehumidifier { Node(AirInletNodeNum).MassFlowRate = ZoneDehumid(ZoneDehumNum).RatedAirMassFlow * PLR; AirMassFlowRate = Node(AirInletNodeNum).MassFlowRate; // Average air mass flow for this timestep - Cp = PsyCpAirFnWTdb(InletAirHumRat); // Heat capacity of air + Cp = PsyCpAirFnW(InletAirHumRat); // Heat capacity of air if (AirMassFlowRate > 0.0 && Cp > 0.0) { OutletAirTemp = InletAirTemp + (ElectricPowerOnCycle + (WaterRemovalMassRate * hfg)) / (ZoneDehumid(ZoneDehumNum).RatedAirMassFlow * Cp); diff --git a/src/EnergyPlus/ZoneEquipmentManager.cc b/src/EnergyPlus/ZoneEquipmentManager.cc index 77694e7b4b1..e1789dc1ff3 100644 --- a/src/EnergyPlus/ZoneEquipmentManager.cc +++ b/src/EnergyPlus/ZoneEquipmentManager.cc @@ -165,7 +165,7 @@ namespace ZoneEquipmentManager { using DataEnvironment::TotRunDesPersDays; using namespace DataZoneEquipment; // Use statements for access to subroutines in other modules - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyHFnTdbW; using Psychrometrics::PsyHgAirFnWTdb; using Psychrometrics::PsyRhoAirFnPbTdbW; @@ -670,7 +670,7 @@ namespace ZoneEquipmentManager { HR90L, DOASSupplyTemp, DOASSupplyHumRat); - DOASCpAir = PsyCpAirFnWTdb(DOASSupplyHumRat); + DOASCpAir = PsyCpAirFnW(DOASSupplyHumRat); DOASSysOutputProvided = DOASMassFlowRate * DOASCpAir * (DOASSupplyTemp - Node(ZoneNode).Temp); TotDOASSysOutputProvided = DOASMassFlowRate * (PsyHFnTdbW(DOASSupplyTemp, DOASSupplyHumRat) - PsyHFnTdbW(Node(ZoneNode).Temp, Node(ZoneNode).HumRat)); @@ -741,7 +741,7 @@ namespace ZoneEquipmentManager { Enthalpy = PsyHFnTdbW(Temp, HumRat); SysOutputProvided = ZoneSysEnergyDemand(ActualZoneNum).RemainingOutputRequired; - CpAir = PsyCpAirFnWTdb(HumRat); + CpAir = PsyCpAirFnW(HumRat); if (std::abs(DeltaTemp) > SmallTempDiff) { //!!PH/WFB/LKL (UCDV model) MassFlowRate = SysOutputProvided / (CpAir*DeltaTemp) MassFlowRate = max(SysOutputProvided / (CpAir * DeltaTemp), 0.0); @@ -5300,7 +5300,7 @@ namespace ZoneEquipmentManager { // cases the heat to return air is treated as a zone heat gain and dealt with in CalcZoneSums in // MODULE ZoneTempPredictorCorrector. if (!Zone(ActualZoneNum).NoHeatToReturnAir) { - CpAir = PsyCpAirFnWTdb(Node(ZoneNode).HumRat); + CpAir = PsyCpAirFnW(Node(ZoneNode).HumRat); if (MassFlowRA > 0.0) { if (WinGapFlowToRA > 0.0) { // Add heat-to-return from window gap airflow @@ -5518,7 +5518,7 @@ namespace ZoneEquipmentManager { using DataZoneEquipment::ZMAT; using DataZoneEquipment::ZoneEquipAvail; using EarthTube::ManageEarthTube; - using Psychrometrics::PsyCpAirFnWTdb; + using Psychrometrics::PsyCpAirFnW; using Psychrometrics::PsyRhoAirFnPbTdbW; using Psychrometrics::PsyTdbFnHW; using Psychrometrics::PsyWFnTdbTwbPb; @@ -5698,10 +5698,10 @@ namespace ZoneEquipmentManager { EnthalpyExt = OutEnthalpy; } AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, TempExt, HumRatExt); - CpAir = PsyCpAirFnWTdb(HumRatExt); + CpAir = PsyCpAirFnW(HumRatExt); // CR7751 should maybe use code below, indoor conditions instead of outdoor conditions // AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZMAT(NZ), ZHumRat(NZ)) - // CpAir = PsyCpAirFnWTdb(ZHumRat(NZ),ZMAT(NZ)) + // CpAir = PsyCpAirFnW(ZHumRat(NZ),ZMAT(NZ)) // Hybrid ventilation global control if (Ventilation(j).HybridControlType == HybridControlTypeGlobal && Ventilation(j).HybridControlMasterNum > 0) { I = Ventilation(j).HybridControlMasterNum; @@ -6005,9 +6005,9 @@ namespace ZoneEquipmentManager { if (TZM < TZN + TD) { // Per Jan 17, 2008 conference call, agreed to use average conditions for Rho, Cp and Hfg // RhoAirM = PsyRhoAirFnPbTdbW(OutBaroPress,tzm,ZHumRat(m)) - // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM + // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnW(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0); - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions + CpAir = PsyCpAirFnW((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6036,9 +6036,9 @@ namespace ZoneEquipmentManager { if (TD > 0.0) { if (TZM > TZN + TD) { // RhoAirM = PsyRhoAirFnPbTdbW(OutBaroPress,tzm,ZHumRat(m)) - // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM + // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnW(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0); // Use avg conditions - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions + CpAir = PsyCpAirFnW((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6065,10 +6065,10 @@ namespace ZoneEquipmentManager { } if (TD == 0.0) { // RhoAirM = PsyRhoAirFnPbTdbW(OutBaroPress,tzm,ZHumRat(m)) - // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnWTdb(ZHumRat(m),tzm) * RhoAirM + // MCP=Mixing(J)%DesiredAirFlowRate * PsyCpAirFnW(ZHumRat(m),tzm) * RhoAirM AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, (TZN + TZM) / 2.0, (ZHumRat(n) + ZHumRat(m)) / 2.0, RoutineNameMixing); // Use avg conditions - CpAir = PsyCpAirFnWTdb((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions + CpAir = PsyCpAirFnW((ZHumRat(n) + ZHumRat(m)) / 2.0); // Use average conditions Mixing(j).DesiredAirFlowRate = Mixing(j).DesiredAirFlowRateSaved; if (ZoneMassBalanceFlag(n) && AdjustZoneMassFlowFlag) { @@ -6203,7 +6203,7 @@ namespace ZoneEquipmentManager { Tavg = (TZN + TZM) / 2.0; Wavg = (ZHumRat(n) + ZHumRat(m)) / 2.0; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Tavg, Wavg, RoutineNameCrossMixing); - CpAir = PsyCpAirFnWTdb(Wavg); + CpAir = PsyCpAirFnW(Wavg); MCPxN = CrossMixing(j).DesiredAirFlowRate * CpAir * AirDensity; MCPM(n) += MCPxN; @@ -6243,9 +6243,9 @@ namespace ZoneEquipmentManager { HumRatZoneA = ZHumRat(ZoneA); HumRatZoneB = ZHumRat(ZoneB); AirDensityZoneA = PsyRhoAirFnPbTdbW(OutBaroPress, TZoneA, HumRatZoneA, RoutineNameRefrigerationDoorMixing); - CpAirZoneA = PsyCpAirFnWTdb(HumRatZoneA); + CpAirZoneA = PsyCpAirFnW(HumRatZoneA); AirDensityZoneB = PsyRhoAirFnPbTdbW(OutBaroPress, TZoneB, HumRatZoneB, RoutineNameRefrigerationDoorMixing); - CpAirZoneB = PsyCpAirFnWTdb(HumRatZoneB); + CpAirZoneB = PsyCpAirFnW(HumRatZoneB); Tavg = (TZoneA + TZoneB) / 2.0; Wavg = (HumRatZoneA + HumRatZoneB) / 2.0; AirDensityAvg = PsyRhoAirFnPbTdbW(OutBaroPress, Tavg, Wavg, RoutineNameRefrigerationDoorMixing); @@ -6330,11 +6330,11 @@ namespace ZoneEquipmentManager { } AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, TempExt, HumRatExt, RoutineNameInfiltration); - CpAir = PsyCpAirFnWTdb(HumRatExt); + CpAir = PsyCpAirFnW(HumRatExt); // CR7751 should maybe use code below, indoor conditions instead of outdoor conditions // AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, ZMAT(NZ), ZHumRat(NZ)) - // CpAir = PsyCpAirFnWTdb(ZHumRat(NZ),ZMAT(NZ)) + // CpAir = PsyCpAirFnW(ZHumRat(NZ),ZMAT(NZ)) { auto const SELECT_CASE_var(Infiltration(j).ModelType); @@ -6452,7 +6452,7 @@ namespace ZoneEquipmentManager { } NZ = ZoneAirBalance(j).ZonePtr; AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(NZ).OutDryBulbTemp, HumRatExt, RoutineNameZoneAirBalance); - CpAir = PsyCpAirFnWTdb(HumRatExt); + CpAir = PsyCpAirFnW(HumRatExt); ZoneAirBalance(j).ERVMassFlowRate *= AirDensity; MDotOA(NZ) = std::sqrt(pow_2(ZoneAirBalance(j).NatMassFlowRate) + pow_2(ZoneAirBalance(j).IntMassFlowRate) + diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index e42d9a1b73a..3eaaa9d01a4 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -3697,7 +3697,7 @@ namespace ZoneTempPredictorCorrector { } AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * - PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) * PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / + PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) * PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AirCap = AIRRAT(ZoneNum); RAFNFrac = 0.0; @@ -4981,7 +4981,7 @@ namespace ZoneTempPredictorCorrector { AIRRAT(ZoneNum) = Zone(ZoneNum).Volume * Zone(ZoneNum).ZoneVolCapMultpSens * PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum), RoutineName) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum)) / (TimeStepSys * SecInHour); AirCap = AIRRAT(ZoneNum); @@ -5085,7 +5085,7 @@ namespace ZoneTempPredictorCorrector { } // Sensible load is the enthalpy into the zone minus the enthalpy that leaves the zone. - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); ZoneEnthalpyIn = SumSysMCpT; // SNLOAD is the single zone load, without Zone Multiplier or Zone List Multiplier @@ -5860,7 +5860,7 @@ namespace ZoneTempPredictorCorrector { GetCurrentScheduleValue(HybridModelZone(ZoneNum).ZoneSupplyAirHumidityRatioSchedulePtr); // Calculate the air humidity ratio at supply air inlet. Real64 CpAirInlet(0.0); - CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); + CpAirInlet = PsyCpAirFnW(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); SumSysMCp_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet; SumSysMCpT_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet * Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature; @@ -5879,7 +5879,7 @@ namespace ZoneTempPredictorCorrector { zone_M_T = Zone(ZoneNum).ZoneMeasuredTemperature; delta_T = (Zone(ZoneNum).ZoneMeasuredTemperature - Zone(ZoneNum).OutDryBulbTemp); - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineNameInfiltration); Zone(ZoneNum).delta_T = delta_T; @@ -5934,7 +5934,7 @@ namespace ZoneTempPredictorCorrector { if (std::abs(ZT(ZoneNum) - PreviousMeasuredZT1(ZoneNum)) > 0.05) { // Filter MultpHM = AirCapHM / (Zone(ZoneNum).Volume * PsyRhoAirFnPbTdbW(OutBaroPress, ZT(ZoneNum), ZoneAirHumRat(ZoneNum)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))) * + PsyCpAirFnW(ZoneAirHumRat(ZoneNum))) * (TimeStepZone * SecInHour); // Inverse equation if ((MultpHM < 1.0) || (MultpHM > 30.0)) { // Temperature capacity multiplier greater than // 1 and less than 30 @@ -6002,7 +6002,7 @@ namespace ZoneTempPredictorCorrector { // Calculate the air humidity ratio at supply air inlet. Real64 CpAirInlet(0.0); - CpAirInlet = PsyCpAirFnWTdb(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); + CpAirInlet = PsyCpAirFnW(Zone(ZoneNum).ZoneMeasuredSupplyAirHumidityRatio); SumSysMCp_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet; SumSysMCpT_HM = Zone(ZoneNum).ZoneMeasuredSupplyAirFlowRate * CpAirInlet * Zone(ZoneNum).ZoneMeasuredSupplyAirTemperature; @@ -6115,7 +6115,7 @@ namespace ZoneTempPredictorCorrector { zone_M_HR = Zone(ZoneNum).ZoneMeasuredHumidityRatio; delta_HR = (Zone(ZoneNum).ZoneMeasuredHumidityRatio - OutHumRat); - CpAir = PsyCpAirFnWTdb(OutHumRat); + CpAir = PsyCpAirFnW(OutHumRat); AirDensity = PsyRhoAirFnPbTdbW(OutBaroPress, Zone(ZoneNum).OutDryBulbTemp, OutHumRat, RoutineName); if (std::abs(Zone(ZoneNum).ZoneMeasuredHumidityRatio - OutHumRat) < 0.0000001) { @@ -6316,7 +6316,7 @@ namespace ZoneTempPredictorCorrector { auto const &node(Node(zec.InletNode(NodeNum))); NodeTemp = node.Temp; MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; @@ -6332,7 +6332,7 @@ namespace ZoneTempPredictorCorrector { auto const &node(Node(zrpc.InletNode(NodeNum))); NodeTemp = node.Temp; MassFlowRate = node.MassFlowRate; - CpAir = PsyCpAirFnWTdb(air_hum_rat); + CpAir = PsyCpAirFnW(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; @@ -6346,7 +6346,7 @@ namespace ZoneTempPredictorCorrector { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(air_hum_rat); + CpAir = PsyCpAirFnW(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; @@ -6355,7 +6355,7 @@ namespace ZoneTempPredictorCorrector { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(air_hum_rat); + CpAir = PsyCpAirFnW(air_hum_rat); Real64 const MassFlowRate_CpAir(MassFlowRate * CpAir); SumSysMCp += MassFlowRate_CpAir; SumSysMCpT += MassFlowRate_CpAir * NodeTemp; @@ -6367,7 +6367,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; @@ -6630,7 +6630,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); @@ -6638,7 +6638,7 @@ namespace ZoneTempPredictorCorrector { if (ADUNum > 0) { NodeTemp = Node(AirDistUnit(ADUNum).OutletNodeNum).Temp; MassFlowRate = Node(AirDistUnit(ADUNum).OutletNodeNum).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); ADUHeatAddRate = MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); AirDistUnit(ADUNum).HeatRate = max(0.0, ADUHeatAddRate); AirDistUnit(ADUNum).CoolRate = std::abs(min(0.0, ADUHeatAddRate)); @@ -6650,7 +6650,7 @@ namespace ZoneTempPredictorCorrector { if (SDUNum > 0) { NodeTemp = Node(DirectAir(SDUNum).ZoneSupplyAirNode).Temp; MassFlowRate = Node(DirectAir(SDUNum).ZoneSupplyAirNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SDUHeatAddRate = MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); DirectAir(SDUNum).HeatRate = max(SDUHeatAddRate, 0.0); DirectAir(SDUNum).CoolRate = std::abs(min(SDUHeatAddRate, 0.0)); @@ -6666,7 +6666,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneRetPlenCond(ZoneRetPlenumNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); @@ -6678,14 +6678,14 @@ namespace ZoneTempPredictorCorrector { ADUInNode = AirDistUnit(ADUNum).InletNodeNum; NodeTemp = Node(ADUInNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateUpStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } if (AirDistUnit(ADUNum).DownStreamLeak) { ADUOutNode = AirDistUnit(ADUNum).OutletNodeNum; NodeTemp = Node(ADUOutNode).Temp; MassFlowRate = AirDistUnit(ADUNum).MassFlowRateDnStrLk; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } } @@ -6695,7 +6695,7 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).Temp; MassFlowRate = Node(ZoneSupPlenCond(ZoneSupPlenumNum).InletNode).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); SumMCpDTsystem += MassFlowRate * CpAir * (NodeTemp - MAT(ZoneNum)); } @@ -6728,7 +6728,8 @@ namespace ZoneTempPredictorCorrector { // Get node conditions NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); + Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; @@ -6803,7 +6804,7 @@ namespace ZoneTempPredictorCorrector { // now calculate air energy storage source term. // capacitance is volume * density * heat capacity - CpAir = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum)); + CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); RhoAir = PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)); { diff --git a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc index 0fa3e45cf15..3ca8b11d630 100644 --- a/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc +++ b/tst/EnergyPlus/unit/AirTerminalSingleDuctConstantVolumeNoReheat.unit.cc @@ -351,7 +351,7 @@ TEST_F(EnergyPlusFixture, AirTerminalSingleDuctCVNoReheat_Sim) Node(ZoneAirNodeNum).Enthalpy = Psychrometrics::PsyHFnTdbW(Node(ZoneAirNodeNum).Temp, Node(ZoneAirNodeNum).HumRat); ; // calculate the heating rate provided by TA unit - Real64 CpAir = PsyCpAirFnWTdb(0.5 * (Node(InletNode).HumRat + Node(ZoneAirNodeNum).HumRat)); + Real64 CpAir = PsyCpAirFnW(0.5 * (Node(InletNode).HumRat + Node(ZoneAirNodeNum).HumRat)); Real64 SensHeatRateProvided = MassFlowRateMaxAvail * CpAir * (Node(InletNode).Temp - Node(ZoneAirNodeNum).Temp); // set inlet mass flow rate to zero diff --git a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc index bce961808b4..783808edbf2 100644 --- a/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc +++ b/tst/EnergyPlus/unit/DesiccantDehumidifiers.unit.cc @@ -2839,7 +2839,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnOASystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatRetTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesOutAirVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnW(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { @@ -4019,7 +4019,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_OnPrimaryAirSystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatOutTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnW(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { @@ -5440,7 +5440,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_RegenAirHeaterHWCoilSizingTest) RegCoilDesOutletTemp = DesiccantDehumidifiers::DesicDehum(DesicDehumNum).RegenSetPointTemp; DataSizing::FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow = 1.07; RegCoilInletAirMassFlowRate = DataEnvironment::StdRhoAir * DataSizing::FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnW(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); // simulate to determine HW coil design capacity SimDesiccantDehumidifier(CompName, FirstHVACIteration, CompIndex); @@ -6686,7 +6686,7 @@ TEST_F(EnergyPlusFixture, DesiccantDehum_VSCoolingCoilOnPrimaryAirSystemTest) RegCoilDesInletTemp = FinalSysSizing(DataSizing::CurSysNum).HeatOutTemp; RegCoilDesOutletTemp = DesicDehum(DesicDehumNum).RegenSetPointTemp; RegCoilInletAirMassFlowRate = FinalSysSizing(DataSizing::CurSysNum).DesMainVolFlow * DataEnvironment::StdRhoAir; - RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnWTdb(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); + RegCoilCapacity = RegCoilInletAirMassFlowRate * PsyCpAirFnW(0.0) * (RegCoilDesOutletTemp - RegCoilDesInletTemp); for (loop = 1; loop <= NumHeatingCoils; ++loop) { if (HeatingCoil(loop).Name == DesicDehum(DesicDehumNum).RegenCoilName) { diff --git a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc index 44e25bb8c4f..95905e60b41 100644 --- a/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc +++ b/tst/EnergyPlus/unit/HVACHXAssistedCoolingCoil.unit.cc @@ -464,7 +464,7 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1) mySys->simulate(compName, FirstHVACIteration, AirLoopNum, CompIndex, HeatingActive, CoolingActive, OAUnitNum, OAUCoilOutTemp, zoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -496,7 +496,7 @@ TEST_F(EnergyPlusFixture, HXAssistCCUnitarySystem_VStest1) mySys->simulate(compName, FirstHVACIteration, AirLoopNum, CompIndex, HeatingActive, CoolingActive, OAUnitNum, OAUCoilOutTemp, zoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( diff --git a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc index c8ca9a53c09..9acfd4bf95b 100644 --- a/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc +++ b/tst/EnergyPlus/unit/OASystemHWPreheatCoil.unit.cc @@ -2036,7 +2036,7 @@ TEST_F(EnergyPlusFixture, OASystem_HotWaterPreheatCoilScheduledOnSim) EXPECT_NEAR(11.6, WaterCoil(1).OutletAirTemp, 0.01); // preheat hot water coil is on and is heating the OA air stream AirInletNodeNum = WaterCoil(1).AirInletNodeNum; - CpAir = PsyCpAirFnWTdb(Node(AirInletNodeNum).HumRat); + CpAir = PsyCpAirFnW(Node(AirInletNodeNum).HumRat); EXPECT_NEAR(WaterCoil(1).TotWaterHeatingCoilRate, WaterCoil(1).InletAirMassFlowRate * CpAir * (WaterCoil(1).OutletAirTemp - WaterCoil(1).InletAirTemp), 1.0); diff --git a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc index 1fa182fbee2..e2a9d9e8ccb 100644 --- a/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc +++ b/tst/EnergyPlus/unit/OutdoorAirUnit.unit.cc @@ -969,7 +969,7 @@ TEST_F(EnergyPlusFixture, OutdoorAirUnit_SteamHeatingCoilAutoSizeTest) Real64 DesCoilOutHumRat = FinalZoneSizing(CurZoneEqNum).HeatDesHumRat; Real64 DesAirMassFlow = FinalZoneSizing(CurZoneEqNum).DesHeatMassFlow; // DesVolFlow = DesMassFlow / RhoAirStd; - Real64 CpAirAvg = PsyCpAirFnWTdb(DesCoilOutHumRat); + Real64 CpAirAvg = PsyCpAirFnW(DesCoilOutHumRat); Real64 DesSteamCoilLoad = DesAirMassFlow * CpAirAvg * (DesCoilOutTemp - DesCoilInTemp); // do steam flow rate sizing calculation diff --git a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc index 94f905e3488..05c2c47df0e 100644 --- a/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc +++ b/tst/EnergyPlus/unit/RoomAirflowNetwork.unit.cc @@ -294,9 +294,9 @@ TEST_F(RoomAirflowNetworkTest, RAFNTest) RhoVaporAirIn(1) = PsyRhovFnTdbWPb(MAT(ZoneNum), ZoneAirHumRat(ZoneNum), OutBaroPress); RhoVaporAirIn(2) = PsyRhovFnTdbWPb(MAT(ZoneNum), ZoneAirHumRat(ZoneNum), OutBaroPress); HMassConvInFD(1) = HConvIn(1) / ((PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) + RhoVaporAirIn(1)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum))); HMassConvInFD(2) = HConvIn(2) / ((PsyRhoAirFnPbTdbW(OutBaroPress, MAT(ZoneNum), ZoneAirHumRat(ZoneNum)) + RhoVaporAirIn(2)) * - PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum))); + PsyCpAirFnW(ZoneAirHumRat(ZoneNum))); RoomAirNode = 1; auto &thisRAFN(RAFN(ZoneNum)); diff --git a/tst/EnergyPlus/unit/SetPointManager.unit.cc b/tst/EnergyPlus/unit/SetPointManager.unit.cc index 16942d0deeb..ac829f75011 100644 --- a/tst/EnergyPlus/unit/SetPointManager.unit.cc +++ b/tst/EnergyPlus/unit/SetPointManager.unit.cc @@ -1240,7 +1240,7 @@ TEST_F(EnergyPlusFixture, ColdestSetPointMgrInSingleDuct) Real64 CpAir(0.0); Real64 ZoneSetPointTemp(0.0); - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(2).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(2).HumRat); ZoneSetPointTemp = DataLoopNode::Node(5).Temp + DataZoneEnergyDemands::ZoneSysEnergyDemand(1).TotalOutputRequired / (CpAir * DataLoopNode::Node(2).MassFlowRateMax); // check the value of ZoneSetPointTemp matches to the value calculated by ColdestSetPtMgr diff --git a/tst/EnergyPlus/unit/SingleDuct.unit.cc b/tst/EnergyPlus/unit/SingleDuct.unit.cc index a86c3277300..14746638c89 100644 --- a/tst/EnergyPlus/unit/SingleDuct.unit.cc +++ b/tst/EnergyPlus/unit/SingleDuct.unit.cc @@ -2476,7 +2476,7 @@ TEST_F(EnergyPlusFixture, SingleDuct_VAVWaterCoilSizing) Real64 ZoneDesTemp = FinalZoneSizing(1).ZoneTempAtHeatPeak; Real64 ZoneDesHumRat = FinalZoneSizing(1).ZoneHumRatAtHeatPeak; - Real64 DesCoilLoad = DesZoneHeatLoad + Psychrometrics::PsyCpAirFnWTdb(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); + Real64 DesCoilLoad = DesZoneHeatLoad + Psychrometrics::PsyCpAirFnW(ZoneDesHumRat) * DesMassFlow * (ZoneDesTemp - CoilInTemp); EXPECT_EQ(CoilInTemp, 16.0); EXPECT_EQ(DesZoneHeatLoad, 0.0); diff --git a/tst/EnergyPlus/unit/UnitarySystem.unit.cc b/tst/EnergyPlus/unit/UnitarySystem.unit.cc index 1e5c4afd40b..0a6fff42ce8 100644 --- a/tst/EnergyPlus/unit/UnitarySystem.unit.cc +++ b/tst/EnergyPlus/unit/UnitarySystem.unit.cc @@ -4033,7 +4033,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4074,7 +4074,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_GetInput) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4900,7 +4900,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -4937,7 +4937,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -5356,7 +5356,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils_CyclingFan) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -5400,7 +5400,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_VarSpeedCoils_CyclingFan) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7202,7 +7202,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7240,7 +7240,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_WaterToAirHeatPump) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7548,7 +7548,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7607,7 +7607,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7641,7 +7641,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7671,7 +7671,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7716,7 +7716,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); // calculation at end of CalcUnitarySystemToLoad(): // SensOutput = AirMassFlow * ( PsyHFnTdbW( Node( OutletNode ).Temp, MinHumRatio ) - PsyHFnTdbW( ZoneTemp, MinHumRatio ) ) - UnitarySystem( @@ -7752,7 +7752,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7800,7 +7800,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio @@ -7830,7 +7830,7 @@ TEST_F(EnergyPlusFixture, UnitarySystemModel_ASHRAEModel_WaterCoils) thisSys->simulate(thisSys->Name, FirstHVACIteration, AirLoopNum, CompIndex, HeatActive, CoolActive, ZoneOAUnitNum, OAUCoilOutTemp, ZoneEquipment); ZoneTemp = DataLoopNode::Node(ControlZoneNum).Temp; - CpAir = Psychrometrics::PsyCpAirFnWTdb(DataLoopNode::Node(InletNode).HumRat); + CpAir = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(InletNode).HumRat); MinHumRatio = DataLoopNode::Node(ControlZoneNum).HumRat; // zone humidity ratio if (DataLoopNode::Node(OutletNode).Temp < DataLoopNode::Node(ControlZoneNum).Temp) MinHumRatio = DataLoopNode::Node(OutletNode).HumRat; // use lower of zone and outlet humidity ratio diff --git a/tst/EnergyPlus/unit/WaterCoils.unit.cc b/tst/EnergyPlus/unit/WaterCoils.unit.cc index 0c00b7081c5..285e5e13b68 100644 --- a/tst/EnergyPlus/unit/WaterCoils.unit.cc +++ b/tst/EnergyPlus/unit/WaterCoils.unit.cc @@ -476,7 +476,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -628,7 +628,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterLowAirFlowUASizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -785,7 +785,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterUASizingLowHwaterInletTemp) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -1110,7 +1110,7 @@ TEST_F(WaterCoilsTest, CoilHeatingWaterSimpleSizing) Real64 DesMassFlow = 0.0; Real64 DesCoilHeatingLoad = 0.0; - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); DesMassFlow = FinalSysSizing(1).DesMainVolFlow * StdRhoAir; DesCoilHeatingLoad = CpAirStd * DesMassFlow * (40.0 - 5.0); @@ -1211,7 +1211,7 @@ TEST_F(WaterCoilsTest, HotWaterHeatingCoilAutoSizeTempTest) Real64 DesMassFlow(0.0); Real64 DesCoilHeatingLoad(0.0); - CpAirStd = PsyCpAirFnWTdb(0.0); + CpAirStd = PsyCpAirFnW(0.0); DesMassFlow = WaterCoil(CoilNum).DesAirVolFlowRate * StdRhoAir; DesCoilHeatingLoad = DesMassFlow * CpAirStd * (40.0 - 5.0); From 3468196d8135f5b6f7b0d08cef1a9d337cf66a69 Mon Sep 17 00:00:00 2001 From: Nigusse Date: Tue, 5 Nov 2019 11:41:55 -0500 Subject: [PATCH 7/9] added unit tests --- src/EnergyPlus/HeatBalanceSurfaceManager.cc | 2 +- src/EnergyPlus/SingleDuct.cc | 7 +- src/EnergyPlus/ZoneTempPredictorCorrector.cc | 2 +- tst/EnergyPlus/unit/Psychrometrics.unit.cc | 77 +++++++++++++++++++- 4 files changed, 79 insertions(+), 9 deletions(-) diff --git a/src/EnergyPlus/HeatBalanceSurfaceManager.cc b/src/EnergyPlus/HeatBalanceSurfaceManager.cc index 06d6c18c16f..7c63444a538 100644 --- a/src/EnergyPlus/HeatBalanceSurfaceManager.cc +++ b/src/EnergyPlus/HeatBalanceSurfaceManager.cc @@ -5957,7 +5957,7 @@ namespace HeatBalanceSurfaceManager { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + // Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; } diff --git a/src/EnergyPlus/SingleDuct.cc b/src/EnergyPlus/SingleDuct.cc index 33cb4ea0cb7..751af3ffa84 100644 --- a/src/EnergyPlus/SingleDuct.cc +++ b/src/EnergyPlus/SingleDuct.cc @@ -3162,7 +3162,7 @@ namespace SingleDuct { // unused USE DataAirLoop, ONLY: AirLoopControlInfo using DataHVACGlobals::SmallLoad; using PlantUtilities::SetActuatedBranchFlowRate; - using Psychrometrics::PsyCpAirFnWTdb; + // using Psychrometrics::PsyCpAirFnWTdb; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -3223,8 +3223,9 @@ namespace SingleDuct { SysOutletNode = Sys(SysNum).ReheatAirOutletNode; SysInletNode = Sys(SysNum).InletNodeNum; CpAirAvg = PsyCpAirFnW(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat)); - Real64 CpAirAvg2 = - PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat), 0.5 * (Node(ZoneNodeNum).Temp + SysInlet(SysNum).AirTemp)); + // Real64 CpAirAvg2 = + // PsyCpAirFnWTdb(0.5 * (Node(ZoneNodeNum).HumRat + SysInlet(SysNum).AirHumRat), 0.5 * (Node(ZoneNodeNum).Temp + + // SysInlet(SysNum).AirTemp)); MinFlowFrac = Sys(SysNum).ZoneMinAirFrac; MassFlowBasedOnOA = 0.0; ZoneTemp = Node(ZoneNodeNum).Temp; diff --git a/src/EnergyPlus/ZoneTempPredictorCorrector.cc b/src/EnergyPlus/ZoneTempPredictorCorrector.cc index 3eaaa9d01a4..fb49fd5e850 100644 --- a/src/EnergyPlus/ZoneTempPredictorCorrector.cc +++ b/src/EnergyPlus/ZoneTempPredictorCorrector.cc @@ -6729,7 +6729,7 @@ namespace ZoneTempPredictorCorrector { NodeTemp = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).Temp; MassFlowRate = Node(ZoneEquipConfig(ZoneEquipConfigNum).InletNode(NodeNum)).MassFlowRate; CpAir = PsyCpAirFnW(ZoneAirHumRat(ZoneNum)); - Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); + // Real64 CpAir2 = PsyCpAirFnWTdb(ZoneAirHumRat(ZoneNum), NodeTemp); SumSysMCp += MassFlowRate * CpAir; SumSysMCpT += MassFlowRate * CpAir * NodeTemp; diff --git a/tst/EnergyPlus/unit/Psychrometrics.unit.cc b/tst/EnergyPlus/unit/Psychrometrics.unit.cc index d520daf2494..0bef8551dd2 100644 --- a/tst/EnergyPlus/unit/Psychrometrics.unit.cc +++ b/tst/EnergyPlus/unit/Psychrometrics.unit.cc @@ -144,7 +144,6 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyTsatFnHPb_Test) actual_result = 20.0; Real64 cache_hit_result = PsyTsatFnHPb(H, PB); EXPECT_NEAR(actual_result, cache_hit_result, 0.001); - } TEST_F(EnergyPlusFixture, Psychrometrics_PsyTsatFnPb_Test) @@ -185,7 +184,6 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyTsatFnPb_Test) PB = 101325.0; actual_result = 99.974; EXPECT_NEAR(actual_result, cache_result, 0.001); - } TEST_F(EnergyPlusFixture, Psychrometrics_PsyWFnTdpPb_Test) @@ -202,7 +200,8 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyWFnTdpPb_Test) EXPECT_NEAR(17.5250143, W, 0.0001); std::string const error_string = delimited_string({ - " ** Warning ** Calculated partial vapor pressure is greater than the barometric pressure, so that calculated humidity ratio is invalid (PsyWFnTdpPb).", + " ** Warning ** Calculated partial vapor pressure is greater than the barometric pressure, so that calculated humidity ratio is invalid " + "(PsyWFnTdpPb).", " ** ~~~ ** Routine=Unknown, Environment=, at Simulation time= 00:00 - 00:00", " ** ~~~ ** Dew-Point= 100.00 Barometric Pressure= 101325.00", " ** ~~~ ** Instead, calculated Humidity Ratio at 99.0 (1 degree less) = 17.5250 will be used. Simulation continues.", @@ -213,7 +212,7 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyWFnTdpPb_Test) EXPECT_NEAR(17.5250143, W, 0.0001); EXPECT_TRUE(compare_err_stream(error_string, true)); - // Denver barometric pressure + // Denver barometric pressure PB = 81000.0; std::string const error_string1 = delimited_string({ " ** Warning ** Calculated partial vapor pressure is greater than the barometric pressure, so that calculated humidity ratio is invalid " @@ -226,5 +225,75 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyWFnTdpPb_Test) W = Psychrometrics::PsyWFnTdpPb(TDP, PB); EXPECT_NEAR(20.07942181, W, 0.0001); EXPECT_TRUE(compare_err_stream(error_string1, true)); +} + +TEST_F(EnergyPlusFixture, Psychrometrics_PsyCpAirFn_Test) +{ + + InitializePsychRoutines(); + // Test 1: analytical PsyCpAirFnW is independent of temperature + Real64 W = 0.0080; + Real64 T = 24.0; + Real64 local_result = 1.00484e3 + W * 1.85895e3; // PsyCpAirFnW per cp = dh/dT + Real64 analytic_result = PsyCpAirFnW(W); // cp = dh/dT + // check analytical function result + EXPECT_DOUBLE_EQ(analytic_result, local_result); + + // Test 2: cooling design test condition analytical vs numerical + W = 0.0085; + T = 26.0; + analytic_result = PsyCpAirFnW(W); // cp = dh/dT + Real64 numerical_result = PsyCpAirFnWTdb(W, T); // cp = delta_h / delta_T + // check result + EXPECT_NEAR(analytic_result, numerical_result, 1.0E-010); + + // Test 3: heating design test condition analytical vs numerical + W = 0.007; + T = 10.0; + analytic_result = PsyCpAirFnW(W); // cp = dh/dT + numerical_result = PsyCpAirFnWTdb(W, T); // cp = delta_h / delta_T + // check result + EXPECT_NEAR(analytic_result, numerical_result, 1.0E-010); + + // Test 4: dry air test condition analytical vs numerical + W = 0.0; + T = 20.0; + analytic_result = PsyCpAirFnW(W); // cp = dh/dT + numerical_result = PsyCpAirFnWTdb(W, T); // cp = delta_h / delta_T + // check result + EXPECT_NEAR(analytic_result, numerical_result, 1.0E-010); + + // Test 5: analytical vs numerical cp values for psychomteric chart T and W range + Real64 SSE = 0.0; + Real64 Error = 0.0; + Real64 Error_sum = 0.0; + Real64 Error_min = 100.0; + Real64 Error_max = -100.0; + Real64 Tmax = 50.0; + Real64 Wmax = 0.030; + analytic_result = 0.0; + numerical_result = 0.0; + for (int TLoop = 0; TLoop <= 100; TLoop++) { + // update temperature + T = Tmax - (Tmax / 100.0) * TLoop; + for (int WLoop = 0; WLoop <= 100; WLoop++) { + // update humidity ratio + W = Wmax - (Wmax / 100.0) * WLoop; + analytic_result = PsyCpAirFnW(W); + numerical_result = PsyCpAirFnWTdb(W, T); + Error = numerical_result - analytic_result; + Error_min = std::min(Error, Error_min); + Error_max = std::max(Error, Error_max); + SSE += Error * Error; + Error_sum += Error; + } + } + Real64 StdError = std::sqrt(SSE / 100); + Real64 Error_avg = Error_sum / 101; + // check analytical vs numerical cp values stats + EXPECT_DOUBLE_EQ(Error_min, -2.8808244678657502e-10); + EXPECT_DOUBLE_EQ(Error_max, 2.5875124265439808e-10); + EXPECT_DOUBLE_EQ(Error_avg, 1.5508032789728189e-09); + EXPECT_DOUBLE_EQ(StdError, 6.7111413639467468e-10); } From a2ec6d62229ef411fb7f0767c27fc8308caaf222 Mon Sep 17 00:00:00 2001 From: nigusse Date: Wed, 13 Nov 2019 11:01:05 -0500 Subject: [PATCH 8/9] Added unit test --- tst/EnergyPlus/unit/Psychrometrics.unit.cc | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/tst/EnergyPlus/unit/Psychrometrics.unit.cc b/tst/EnergyPlus/unit/Psychrometrics.unit.cc index 0bef8551dd2..b35fa1df9e4 100644 --- a/tst/EnergyPlus/unit/Psychrometrics.unit.cc +++ b/tst/EnergyPlus/unit/Psychrometrics.unit.cc @@ -297,3 +297,48 @@ TEST_F(EnergyPlusFixture, Psychrometrics_PsyCpAirFn_Test) EXPECT_DOUBLE_EQ(Error_avg, 1.5508032789728189e-09); EXPECT_DOUBLE_EQ(StdError, 6.7111413639467468e-10); } + +TEST_F(EnergyPlusFixture, Psychrometrics_CpAirValue_Test) +{ + + InitializePsychRoutines(); + + // Test 1: dry cooling process test, delta enthalpy vs cpair times delta T + Real64 W1 = 0.0030; + Real64 T1 = 24.0; + Real64 W2 = 0.0030; + Real64 T2 = 20.0; + + // Dry Cooling Test + Real64 MassFlowRate = 5.0; // kgDryAir/s + Real64 CpAir = 1.00484e3 + W1 * 1.85895e3; // PsyCpAirFnW per cp = dh/dT + Real64 CpAir1 = PsyCpAirFnW(W1); // PsyCpAirFnW per cp = dh/dT + Real64 CpAir2 = PsyCpAirFnW(W2); // PsyCpAirFnW per cp = dh/dT + // check inputs and intermediate values + EXPECT_DOUBLE_EQ(W1, W2); + EXPECT_DOUBLE_EQ(CpAir, CpAir1); + EXPECT_DOUBLE_EQ(CpAir, CpAir2); + // check heat transfer rate calc methods + Real64 Qfrom_mdot_CpAir_DeltaT = MassFlowRate * CpAir * (T1 - T2); + + // get enthalpy at state 1 and 2 + Real64 H1 = PsyHFnTdbW(T1, W1); // enthaly ait state 1 + Real64 H2 = PsyHFnTdbW(T2, W2); // enthaly ait state 2 + Real64 Qfrom_mdot_DeltaH = MassFlowRate * (H1 - H2); + + // check heat rate + EXPECT_DOUBLE_EQ(Qfrom_mdot_CpAir_DeltaT, Qfrom_mdot_DeltaH); + + // Test 2: heating process test, delta enthalpy vs cpair times delta T + T1 = 10.0; + T2 = 20.0; + CpAir = 1.00484e3 + W1 * 1.85895e3; + Qfrom_mdot_CpAir_DeltaT = MassFlowRate * CpAir * (T2 - T1); + + H1 = PsyHFnTdbW(T1, W1); // enthaly ait state 1 + H2 = PsyHFnTdbW(T2, W2); // enthaly ait state 2 + Qfrom_mdot_DeltaH = MassFlowRate * (H2 - H1); + + // check heat transfer rate calc method for heating + EXPECT_DOUBLE_EQ(Qfrom_mdot_CpAir_DeltaT, Qfrom_mdot_DeltaH); +} From 9540691e1cdad0b53dca029222f95d5cfc4f5f79 Mon Sep 17 00:00:00 2001 From: Matt Mitchell Date: Tue, 28 Jan 2020 11:04:28 -0700 Subject: [PATCH 9/9] fix botched merge --- src/EnergyPlus/ChillerElectricEIR.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/EnergyPlus/ChillerElectricEIR.cc b/src/EnergyPlus/ChillerElectricEIR.cc index 99d31b24220..3b96bf0b4e6 100644 --- a/src/EnergyPlus/ChillerElectricEIR.cc +++ b/src/EnergyPlus/ChillerElectricEIR.cc @@ -2170,7 +2170,7 @@ namespace ChillerElectricEIR { if (this->HeatRecActive) this->calcHeatRecovery(this->QCondenser, this->CondMassFlowRate, condInletTemp, this->QHeatRecovered); if (CondMassFlowRate > 0.0) { - Cp = Psychrometrics::PsyCpAirFnWTdb(Node(CondInletNode).HumRat, CondInletTemp); + Cp = Psychrometrics::PsyCpAirFnW(DataLoopNode::Node(this->CondInletNodeNum).HumRat); CondOutletTemp = CondInletTemp + QCondenser / CondMassFlowRate / Cp; } else { this->CondOutletTemp = condInletTemp;