From 97a1447c6938a6636dad1c522dc28cbc27156a7a Mon Sep 17 00:00:00 2001 From: Yueyue Zhou Date: Tue, 19 Jan 2021 13:16:18 -0700 Subject: [PATCH] Add quint linear curve, change water-to-air equationfit coils to reference curves --- idd/Energy+.idd.in | 221 ++++++++++++------ src/EnergyPlus/CurveManager.cc | 129 ++++++---- src/EnergyPlus/CurveManager.hh | 1 + src/EnergyPlus/WaterToAirHeatPumpSimple.cc | 117 ++-------- src/EnergyPlus/WaterToAirHeatPumpSimple.hh | 43 +--- tst/EnergyPlus/unit/CurveManager.unit.cc | 42 ++++ .../unit/WaterToAirHeatPumpSimple.unit.cc | 185 ++++++++++++--- 7 files changed, 459 insertions(+), 279 deletions(-) diff --git a/idd/Energy+.idd.in b/idd/Energy+.idd.in index 776c0694780..4fba6103919 100644 --- a/idd/Energy+.idd.in +++ b/idd/Energy+.idd.in @@ -54373,55 +54373,19 @@ Coil:Cooling:WaterToAirHeatPump:EquationFit, \type real \units W/W \minimum> 0.0 - N6, \field Total Cooling Capacity Coefficient 1 + A6, \field Total Cooling Capacity Curve Name \required-field - \type real - N7, \field Total Cooling Capacity Coefficient 2 - \required-field - \type real - N8, \field Total Cooling Capacity Coefficient 3 - \required-field - \type real - N9, \field Total Cooling Capacity Coefficient 4 - \required-field - \type real - N10, \field Total Cooling Capacity Coefficient 5 - \required-field - \type real - N11, \field Sensible Cooling Capacity Coefficient 1 - \required-field - \type real - N12, \field Sensible Cooling Capacity Coefficient 2 - \required-field - \type real - N13, \field Sensible Cooling Capacity Coefficient 3 - \required-field - \type real - N14, \field Sensible Cooling Capacity Coefficient 4 - \required-field - \type real - N15, \field Sensible Cooling Capacity Coefficient 5 - \required-field - \type real - N16, \field Sensible Cooling Capacity Coefficient 6 - \required-field - \type real - N17, \field Cooling Power Consumption Coefficient 1 - \required-field - \type real - N18, \field Cooling Power Consumption Coefficient 2 - \required-field - \type real - N19, \field Cooling Power Consumption Coefficient 3 - \required-field - \type real - N20, \field Cooling Power Consumption Coefficient 4 + \type object-list + \object-list QuadvariateFunctions + A7, \field Sensible Cooling Capacity Curve Name \required-field - \type real - N21, \field Cooling Power Consumption Coefficient 5 + \type object-list + \object-list QuintvariateFunctions + A8, \field Cooling Power Consumption Curve Name \required-field - \type real - N22, \field Nominal Time for Condensate Removal to Begin + \type object-list + \object-list QuadvariateFunctions + N6, \field Nominal Time for Condensate Removal to Begin \type real \units s \minimum 0.0 @@ -54432,7 +54396,7 @@ Coil:Cooling:WaterToAirHeatPump:EquationFit, \note Nominal time is equal to the ratio of the energy of the coil's maximum \note condensate holding capacity (J) to the coil's steady state latent capacity (W). \note Suggested value is 1000; zero value means latent degradation model is disabled. - N23; \field Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity + N7; \field Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity \type real \units dimensionless \minimum 0.0 @@ -55327,36 +55291,14 @@ Coil:Heating:WaterToAirHeatPump:EquationFit, \type real \units W/W \minimum> 0.0 - N5, \field Heating Capacity Coefficient 1 - \required-field - \type real - N6, \field Heating Capacity Coefficient 2 - \required-field - \type real - N7, \field Heating Capacity Coefficient 3 - \required-field - \type real - N8, \field Heating Capacity Coefficient 4 - \required-field - \type real - N9, \field Heating Capacity Coefficient 5 - \required-field - \type real - N10, \field Heating Power Consumption Coefficient 1 - \required-field - \type real - N11, \field Heating Power Consumption Coefficient 2 - \required-field - \type real - N12, \field Heating Power Consumption Coefficient 3 - \required-field - \type real - N13, \field Heating Power Consumption Coefficient 4 + A6, \field Heating Capacity Curve Name \required-field - \type real - N14; \field Heating Power Consumption Coefficient 5 + \type object-list + \object-list QuadvariateFunctions + A7; \field Heating Power Consumption Curve Name \required-field - \type real + \type object-list + \object-list QuadvariateFunctions Coil:Heating:WaterToAirHeatPump:VariableSpeedEquationFit, \memo Direct expansion (DX) heating coil for water-to-air heat pump (includes electric @@ -80766,6 +80708,7 @@ EnergyManagementSystem:CurveOrTableIndexVariable, \object-list BivariateFunctions \object-list TrivariateFunctions \object-list QuadvariateFunctions + \object-list QuintvariateFunctions \object-list MultivariateFunctions \required-field @@ -91354,6 +91297,133 @@ Curve:QuadLinear, \key VolumetricFlowPerPower \default Dimensionless +Curve:QuintLinear, + \memo Linear curve with five independent variables. + \memo Input for the linear curve consists of a curve name, the two coefficients, and the + \memo maximum and minimum valid independent variable values. Optional inputs for curve + \memo minimum and maximum may be used to limit the output of the performance curve. + \memo curve = C1 + C2*v + C3*w + C4*x + C5*y + C6*z + A1 , \field Name + \required-field + \type alpha + \reference QuintvariateFunctions + N1 , \field Coefficient1 Constant + \required-field + \type real + N2 , \field Coefficient2 v + \required-field + \type real + N3 , \field Coefficient3 w + \required-field + \type real + N4 , \field Coefficient4 x + \required-field + \type real + N5 , \field Coefficient5 y + \required-field + \type real + N6 , \field Coefficient6 z + \required-field + \type real + N7 , \field Minimum Value of v + \required-field + \type real + \unitsBasedOnField A2 + N8 , \field Maximum Value of v + \required-field + \type real + \unitsBasedOnField A2 + N9 , \field Minimum Value of w + \required-field + \type real + \unitsBasedOnField A2 + N10 , \field Maximum Value of w + \required-field + \type real + \unitsBasedOnField A2 + N11 , \field Minimum Value of x + \required-field + \type real + \unitsBasedOnField A3 + N12 ,\field Maximum Value of x + \required-field + \type real + \unitsBasedOnField A3 + N13 , \field Minimum Value of y + \required-field + \type real + \unitsBasedOnField A4 + N14, \field Maximum Value of y + \required-field + \type real + \unitsBasedOnField A4 + N15, \field Minimum Value of z + \required-field + \type real + \unitsBasedOnField A5 + N16, \field Maximum Value of z + \required-field + \type real + \unitsBasedOnField A5 + N17, \field Minimum Curve Output + \type real + \note Specify the minimum value calculated by this curve object + \unitsBasedOnField A4 + N18, \field Maximum Curve Output + \type real + \note Specify the maximum value calculated by this curve object + \unitsBasedOnField A4 + A2 , \field Input Unit Type for v + \type choice + \key Dimensionless + \key Temperature + \key VolumetricFlow + \key MassFlow + \key Power + \key Distance + \key VolumetricFlowPerPower + \default Dimensionless + A3 , \field Input Unit Type for w + \type choice + \key Dimensionless + \key Temperature + \key VolumetricFlow + \key MassFlow + \key Power + \key Distance + \key VolumetricFlowPerPower + \default Dimensionless + A4 , \field Input Unit Type for x + \type choice + \key Dimensionless + \key Temperature + \key VolumetricFlow + \key MassFlow + \key Power + \key Distance + \key VolumetricFlowPerPower + \default Dimensionless + A5 , \field Input Unit Type for y + \type choice + \key Dimensionless + \key Temperature + \key VolumetricFlow + \key MassFlow + \key Power + \key Distance + \key VolumetricFlowPerPower + \default Dimensionless + A6; \field Input Unit Type for z + \type choice + \key Dimensionless + \key Temperature + \key VolumetricFlow + \key MassFlow + \key Power + \key Distance + \key VolumetricFlowPerPower + \default Dimensionless + Curve:Quadratic, \memo Quadratic curve with one independent variable. \memo Input for a quadratic curve consists of the curve name, the three coefficients, and @@ -92581,6 +92651,7 @@ Table:Lookup, \reference BivariateFunctions \reference TrivariateFunctions \reference QuadvariateFunctions + \reference QuintvariateFunctions \reference MultivariateFunctions \type alpha A2, \field Independent Variable List Name diff --git a/src/EnergyPlus/CurveManager.cc b/src/EnergyPlus/CurveManager.cc index 1fcc3b4b5f0..5da4f9b8a55 100644 --- a/src/EnergyPlus/CurveManager.cc +++ b/src/EnergyPlus/CurveManager.cc @@ -97,6 +97,7 @@ namespace CurveManager { // FanPressureRise, ExponentialSkewNormal, Sigmoid, RectangularHyperbola1, // RectangularHyperbola2, ExponentialDecay // March 2012, Atefe Makhmalbaf and Heejin Cho, added a new curve type (QuadLinear) + // Jan 2021 Yueyue, added a new curve type (QuintLinear) // Aug. 2014, Rongpeng Zhang, added a new curve type (ChillerPartLoadWithLift) // RE-ENGINEERED na @@ -269,6 +270,7 @@ namespace CurveManager { int NumQuadLinear; // Number of quadratic linear curve objects in the input data file int NumCubicLinear; // Number of cubic linear curve objects in the input file int NumQLinear; // Number of quad linear curve objects in the input data file + int NumQuintLinear; // Number of quint linear curve objects in the input data file int NumLinear; // Number of linear curve objects in the input data file int NumBicubic; // Number of bicubic curve objects in the input data file int NumTriQuad; // Number of triquadratic curve objects in the input file @@ -303,6 +305,7 @@ namespace CurveManager { NumQuartic = inputProcessor->getNumObjectsFound(state, "Curve:Quartic"); NumQuad = inputProcessor->getNumObjectsFound(state, "Curve:Quadratic"); NumQLinear = inputProcessor->getNumObjectsFound(state, "Curve:QuadLinear"); + NumQuintLinear = inputProcessor->getNumObjectsFound(state, "Curve:QuintLinear"); NumQuadLinear = inputProcessor->getNumObjectsFound(state, "Curve:QuadraticLinear"); NumCubicLinear = inputProcessor->getNumObjectsFound(state, "Curve:CubicLinear"); NumLinear = inputProcessor->getNumObjectsFound(state, "Curve:Linear"); @@ -323,7 +326,7 @@ namespace CurveManager { state.dataCurveManager->NumCurves = NumBiQuad + NumCubic + NumQuad + NumQuadLinear + NumCubicLinear + NumLinear + NumBicubic + NumTriQuad + NumExponent + NumQuartic + NumTableLookup + NumFanPressRise + NumExpSkewNorm + NumSigmoid + NumRectHyper1 + NumRectHyper2 + - NumExpDecay + NumDoubleExpDecay + NumQLinear + NumChillerPartLoadWithLift + NumWPCValTab; + NumExpDecay + NumDoubleExpDecay + NumQLinear + NumQuintLinear + NumChillerPartLoadWithLift + NumWPCValTab; // allocate the data structure state.dataCurveManager->PerfCurve.allocate(state.dataCurveManager->NumCurves); @@ -1006,7 +1009,7 @@ namespace CurveManager { } } } - + // Loop over quad linear curves and load data CurrentModuleObject = "Curve:QuadLinear"; for (CurveIndex = 1; CurveIndex <= NumQLinear; ++CurveIndex) { @@ -1052,55 +1055,101 @@ namespace CurveManager { state.dataCurveManager->PerfCurve(CurveNum).CurveMaxPresent = true; } - if (Numbers(6) > Numbers(7)) { // error - ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(6), Numbers(6), cNumericFieldNames(7), Numbers(7))); - ErrorsFound = true; - } - if (Numbers(8) > Numbers(9)) { // error - ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(8), Numbers(8), cNumericFieldNames(9), Numbers(9))); - ErrorsFound = true; - } - if (Numbers(10) > Numbers(11)) { // error - ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, - format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(10), Numbers(10), cNumericFieldNames(11), Numbers(11))); - ErrorsFound = true; + const int NumVar = 4; + std::string VarNames[NumVar] = {"w", "x", "y", "z"}; + for (int i = 1; i <= NumVar; ++i) { + int MinIndex = 2*i + 4; + int MaxIndex = MinIndex + 1; + if (Numbers(MinIndex) > Numbers(MaxIndex)) { // error + ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(MinIndex), Numbers(MinIndex), cNumericFieldNames(MaxIndex), Numbers(MaxIndex))); + ErrorsFound = true; + } + int InputTypeIndex = i + 1; + if (NumAlphas >= InputTypeIndex) { + if (!IsCurveInputTypeValid(Alphas(InputTypeIndex))) { + ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for " + VarNames[i] + " is invalid."); + } + } } - if (Numbers(12) > Numbers(13)) { // error - ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); - ShowContinueError(state, - format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(12), Numbers(12), cNumericFieldNames(13), Numbers(13))); - ErrorsFound = true; + if (NumAlphas >= 6) { + if (!IsCurveOutputTypeValid(Alphas(6))) { + ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Output Unit Type is invalid."); + } } + } - if (NumAlphas >= 2) { - if (!IsCurveInputTypeValid(Alphas(2))) { - ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for W is invalid."); - } + // Loop over quint linear curves and load data + CurrentModuleObject = "Curve:QuintLinear"; + for (CurveIndex = 1; CurveIndex <= NumQuintLinear; ++CurveIndex) { + inputProcessor->getObjectItem(state, + CurrentModuleObject, + CurveIndex, + Alphas, + NumAlphas, + Numbers, + NumNumbers, + IOStatus, + lNumericFieldBlanks, + _, + cAlphaFieldNames, + cNumericFieldNames); + GlobalNames::VerifyUniqueInterObjectName(state, state.dataCurveManager->UniqueCurveNames, Alphas(1), CurrentModuleObject, cAlphaFieldNames(1), ErrorsFound); + ++CurveNum; + state.dataCurveManager->PerfCurve(CurveNum).Name = Alphas(1); + state.dataCurveManager->PerfCurve(CurveNum).CurveType = CurveTypeEnum::QuintLinear; + state.dataCurveManager->PerfCurve(CurveNum).ObjectType = CurrentModuleObject; + state.dataCurveManager->PerfCurve(CurveNum).NumDims = 5; + state.dataCurveManager->PerfCurve(CurveNum).InterpolationType = InterpTypeEnum::EvaluateCurveToLimits; + state.dataCurveManager->PerfCurve(CurveNum).Coeff1 = Numbers(1); + state.dataCurveManager->PerfCurve(CurveNum).Coeff2 = Numbers(2); + state.dataCurveManager->PerfCurve(CurveNum).Coeff3 = Numbers(3); + state.dataCurveManager->PerfCurve(CurveNum).Coeff4 = Numbers(4); + state.dataCurveManager->PerfCurve(CurveNum).Coeff5 = Numbers(5); + state.dataCurveManager->PerfCurve(CurveNum).Coeff6 = Numbers(6); + state.dataCurveManager->PerfCurve(CurveNum).Var1Min = Numbers(7); + state.dataCurveManager->PerfCurve(CurveNum).Var1Max = Numbers(8); + state.dataCurveManager->PerfCurve(CurveNum).Var2Min = Numbers(9); + state.dataCurveManager->PerfCurve(CurveNum).Var2Max = Numbers(10); + state.dataCurveManager->PerfCurve(CurveNum).Var3Min = Numbers(11); + state.dataCurveManager->PerfCurve(CurveNum).Var3Max = Numbers(12); + state.dataCurveManager->PerfCurve(CurveNum).Var4Min = Numbers(13); + state.dataCurveManager->PerfCurve(CurveNum).Var4Max = Numbers(14); + state.dataCurveManager->PerfCurve(CurveNum).Var5Min = Numbers(15); + state.dataCurveManager->PerfCurve(CurveNum).Var5Max = Numbers(16); + if (NumNumbers > 16 && !lNumericFieldBlanks(17)) { + state.dataCurveManager->PerfCurve(CurveNum).CurveMin = Numbers(17); + state.dataCurveManager->PerfCurve(CurveNum).CurveMinPresent = true; } - if (NumAlphas >= 3) { - if (!IsCurveInputTypeValid(Alphas(3))) { - ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for X is invalid."); - } + if (NumNumbers > 17 && !lNumericFieldBlanks(18)) { + state.dataCurveManager->PerfCurve(CurveNum).CurveMax = Numbers(18); + state.dataCurveManager->PerfCurve(CurveNum).CurveMaxPresent = true; } - if (NumAlphas >= 4) { - if (!IsCurveInputTypeValid(Alphas(4))) { - ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for Y is invalid."); + + const int NumVar = 5; + std::string VarNames[NumVar] = {"v", "w", "x", "y", "z"}; + for (int i = 1; i <= NumVar; ++i) { + int MinIndex = 2*i + 5; + int MaxIndex = MinIndex + 1; + if (Numbers(MinIndex) > Numbers(MaxIndex)) { // error + ShowSevereError(state, "GetCurveInput: For " + CurrentModuleObject + ": " + Alphas(1)); + ShowContinueError(state, format("{} [{:.R2}] > {} [{.R2}]", cNumericFieldNames(MinIndex), Numbers(MinIndex), cNumericFieldNames(MaxIndex), Numbers(MaxIndex))); + ErrorsFound = true; } - } - if (NumAlphas >= 5) { - if (!IsCurveInputTypeValid(Alphas(5))) { - ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for Z is invalid."); + int InputTypeIndex = i + 1; + if (NumAlphas >= InputTypeIndex) { + if (!IsCurveInputTypeValid(Alphas(InputTypeIndex))) { + ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Input Unit Type for " + VarNames[i] + " is invalid."); + } } } - if (NumAlphas >= 6) { - if (!IsCurveOutputTypeValid(Alphas(6))) { + if (NumAlphas >= 7) { + if (!IsCurveOutputTypeValid(Alphas(7))) { ShowWarningError(state, "In " + CurrentModuleObject + " named " + Alphas(1) + " the Output Unit Type is invalid."); } } } + // Loop over Exponent curves and load data CurrentModuleObject = "Curve:Exponent"; for (CurveIndex = 1; CurveIndex <= NumExponent; ++CurveIndex) { @@ -2297,6 +2346,8 @@ namespace CurveManager { CurveValue = Curve.Coeff1 + V1 * (Curve.Coeff2 + V1 * Curve.Coeff3); } else if (SELECT_CASE_var == CurveTypeEnum::QuadLinear) { CurveValue = Curve.Coeff1 + V1 * Curve.Coeff2 + V2 * Curve.Coeff3 + V3 * Curve.Coeff4 + V4 * Curve.Coeff5; + } else if (SELECT_CASE_var == CurveTypeEnum::QuintLinear) { + CurveValue = Curve.Coeff1 + V1 * Curve.Coeff2 + V2 * Curve.Coeff3 + V3 * Curve.Coeff4 + V4 * Curve.Coeff5 + V5 * Curve.Coeff6; } else if (SELECT_CASE_var == CurveTypeEnum::Cubic) { CurveValue = Curve.Coeff1 + V1 * (Curve.Coeff2 + V1 * (Curve.Coeff3 + V1 * Curve.Coeff4)); } else if (SELECT_CASE_var == CurveTypeEnum::Quartic) { diff --git a/src/EnergyPlus/CurveManager.hh b/src/EnergyPlus/CurveManager.hh index 067410a408e..d3f5d3019ad 100644 --- a/src/EnergyPlus/CurveManager.hh +++ b/src/EnergyPlus/CurveManager.hh @@ -101,6 +101,7 @@ namespace CurveManager { ExponentialDecay, DoubleExponentialDecay, QuadLinear, + QuintLinear, CubicLinear, ChillerPartLoadWithLift }; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc index 9c37d741355..a06f6a34276 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.cc +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.cc @@ -80,6 +80,7 @@ #include #include #include +#include namespace EnergyPlus { @@ -280,6 +281,7 @@ namespace WaterToAirHeatPumpSimple { using BranchNodeConnections::TestCompSet; using GlobalNames::VerifyUniqueCoilName; using namespace OutputReportPredefined; + using CurveManager::GetCurveIndex; // SUBROUTINE PARAMETER DEFINITIONS: static std::string const RoutineName("GetSimpleWatertoAirHPInput: "); // include trailing blank space @@ -363,24 +365,11 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolTotal = NumArray(3); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapCoolSens = NumArray(4); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCOPCool = NumArray(5); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap1 = NumArray(6); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap2 = NumArray(7); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap3 = NumArray(8); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap4 = NumArray(9); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap5 = NumArray(10); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap1 = NumArray(11); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap2 = NumArray(12); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap3 = NumArray(13); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap4 = NumArray(14); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap5 = NumArray(15); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap6 = NumArray(16); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower1 = NumArray(17); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower2 = NumArray(18); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower3 = NumArray(19); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower4 = NumArray(20); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower5 = NumArray(21); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Twet_Rated = NumArray(22); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Gamma_Rated = NumArray(23); + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurveIndex = GetCurveIndex(state, AlphArray(6)); // convert curve name to number + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurveIndex = GetCurveIndex(state, AlphArray(7)); // convert curve name to number + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPowCurveIndex = GetCurveIndex(state, AlphArray(8)); // convert curve name to number + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Twet_Rated = NumArray(6); + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Gamma_Rated = NumArray(7); DataHeatBalance::HeatReclaimSimple_WAHPCoil(WatertoAirHPNum).Name = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Name; DataHeatBalance::HeatReclaimSimple_WAHPCoil(WatertoAirHPNum).SourceType = CurrentModuleObject; @@ -488,16 +477,8 @@ namespace WaterToAirHeatPumpSimple { state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate = NumArray(2); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCapHeat = NumArray(3); state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCOPHeat = NumArray(4); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap1 = NumArray(5); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap2 = NumArray(6); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap3 = NumArray(7); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap4 = NumArray(8); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap5 = NumArray(9); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower1 = NumArray(10); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower2 = NumArray(11); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower3 = NumArray(12); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower4 = NumArray(13); - state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower5 = NumArray(14); + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCapCurveIndex = GetCurveIndex(state, AlphArray(6)); // convert curve name to number + state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPowCurveIndex = GetCurveIndex(state, AlphArray(7)); // convert curve name to number state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).WaterInletNodeNum = GetOnlySingleNode(state, AlphArray(2), ErrorsFound, CurrentModuleObject, AlphArray(1), NodeType_Water, NodeConnectionType_Inlet, 2, ObjectIsNotParent); @@ -1105,6 +1086,7 @@ namespace WaterToAirHeatPumpSimple { using namespace OutputReportPredefined; using FluidProperties::GetDensityGlycol; using FluidProperties::GetSpecificHeatGlycol; + using CurveManager::CurveValue; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -1329,11 +1311,6 @@ namespace WaterToAirHeatPumpSimple { rhoair = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, MixTemp, MixHumRat, RoutineName); MixEnth = PsyHFnTdbW(MixTemp, MixHumRat); SupEnth = PsyHFnTdbW(SupTemp, SupHumRat); - TotalCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap1; - TotalCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap2; - TotalCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap3; - TotalCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap4; - TotalCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap5; Real64 FanCoolLoad = 0.0; if (DataFanEnumType > -1 && DataFanIndex > -1) { // add fan heat to coil load switch (DataFanEnumType) { @@ -1363,8 +1340,8 @@ namespace WaterToAirHeatPumpSimple { ratioTWB = (MixWetBulb + 273.15) / 283.15; // rated condenser water inlet temperature of 85F ratioTS = (((85.0 - 32.0) / 1.8) + 273.15) / 283.15; - TotCapTempModFac = TotalCapCoeff1 + (ratioTWB * TotalCapCoeff2) + (ratioTS * TotalCapCoeff3) + (1.0 * TotalCapCoeff4) + - (1.0 * TotalCapCoeff5); + TotCapTempModFac = CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurveIndex, ratioTWB, ratioTS, 1.0, 1.0); + if (TotCapTempModFac > 0.0) { RatedCapCoolTotalDes = CoolCapAtPeak / TotCapTempModFac; } else { @@ -1419,11 +1396,6 @@ namespace WaterToAirHeatPumpSimple { rhoair = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, MixTemp, MixHumRat, RoutineName); MixEnth = PsyHFnTdbW(MixTemp, MixHumRat); SupEnth = PsyHFnTdbW(SupTemp, SupHumRat); - TotalCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap1; - TotalCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap2; - TotalCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap3; - TotalCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap4; - TotalCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap5; if (DataFanEnumType > -1 && DataFanIndex > -1) { // add fan heat to coil load switch (DataFanEnumType) { case DataAirSystems::structArrayLegacyFanModels: { @@ -1452,8 +1424,7 @@ namespace WaterToAirHeatPumpSimple { ratioTWB = (MixWetBulb + 273.15) / 283.15; // rated condenser water inlet temperature of 85F ratioTS = (((85.0 - 32.0) / 1.8) + 273.15) / 283.15; - TotCapTempModFac = TotalCapCoeff1 + (ratioTWB * TotalCapCoeff2) + (ratioTS * TotalCapCoeff3) + (1.0 * TotalCapCoeff4) + - (1.0 * TotalCapCoeff5); + TotCapTempModFac = CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurveIndex, ratioTWB, ratioTS, 1.0, 1.0); if (TotCapTempModFac > 0.0) { RatedCapCoolTotalDes = CoolCapAtPeak / TotCapTempModFac; } else { @@ -1521,12 +1492,6 @@ namespace WaterToAirHeatPumpSimple { rhoair = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, MixTemp, MixHumRat, RoutineName); MixEnth = PsyHFnTdbW(MixTemp, MixHumRat); SupEnth = PsyHFnTdbW(SupTemp, MixHumRat); - SensCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap1; - SensCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap2; - SensCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap3; - SensCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap4; - SensCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap5; - SensCapCoeff6 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap6; Real64 FanCoolLoad = 0.0; if (DataFanEnumType > -1 && DataFanIndex > -1) { // add fan heat to coil load switch (DataFanEnumType) { @@ -1560,8 +1525,8 @@ namespace WaterToAirHeatPumpSimple { ratioTWB = (MixWetBulb + 273.15) / 283.15; // rated condenser water inlet temperature of 85F ratioTS = (((85.0 - 32.0) / 1.8) + 273.15) / 283.15; - SensCapTempModFac = SensCapCoeff1 + (ratioTDB * SensCapCoeff2) + (ratioTWB * SensCapCoeff3) + (ratioTS * SensCapCoeff4) + - (1.0 * SensCapCoeff5) + (1.0 * SensCapCoeff6); + + SensCapTempModFac = CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurveIndex,ratioTDB, ratioTWB, ratioTS, 1.0, 1.0); RatedCapCoolSensDes = SensCapAtPeak / SensCapTempModFac; } else { RatedCapCoolSensDes = 0.0; @@ -1608,12 +1573,6 @@ namespace WaterToAirHeatPumpSimple { rhoair = PsyRhoAirFnPbTdbW(state, state.dataEnvrn->StdBaroPress, MixTemp, MixHumRat, RoutineName); MixEnth = PsyHFnTdbW(MixTemp, MixHumRat); SupEnth = PsyHFnTdbW(SupTemp, MixHumRat); - SensCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap1; - SensCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap2; - SensCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap3; - SensCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap4; - SensCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap5; - SensCapCoeff6 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap6; Real64 FanCoolLoad = 0.0; if (DataFanEnumType > -1 && DataFanIndex > -1) { // add fan heat to coil load switch (DataFanEnumType) { @@ -1647,8 +1606,7 @@ namespace WaterToAirHeatPumpSimple { ratioTWB = (MixWetBulb + 273.15) / 283.15; // rated condenser water inlet temperature of 85F ratioTS = (((85.0 - 32.0) / 1.8) + 273.15) / 283.15; - SensCapTempModFac = SensCapCoeff1 + (ratioTDB * SensCapCoeff2) + (ratioTWB * SensCapCoeff3) + (ratioTS * SensCapCoeff4) + - (1.0 * SensCapCoeff5) + (1.0 * SensCapCoeff6); + SensCapTempModFac = CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurveIndex,ratioTDB, ratioTWB, ratioTS, 1.0, 1.0);; if (SensCapTempModFac > 0.0) { RatedCapCoolSensDes = SensCapAtPeak / SensCapTempModFac; } else { @@ -2102,6 +2060,7 @@ namespace WaterToAirHeatPumpSimple { using Psychrometrics::PsyTwbFnTdbWPb; using Psychrometrics::PsyWFnTdbH; using Psychrometrics::PsyWFnTdbTwbPb; + using CurveManager::CurveValue; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2188,22 +2147,6 @@ namespace WaterToAirHeatPumpSimple { AirVolFlowRateRated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedAirVolFlowRate; WaterVolFlowRateRated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate; - TotalCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap1; - TotalCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap2; - TotalCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap3; - TotalCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap4; - TotalCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap5; - SensCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap1; - SensCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap2; - SensCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap3; - SensCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap4; - SensCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap5; - SensCapCoeff6 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap6; - CoolPowerCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower1; - CoolPowerCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower2; - CoolPowerCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower3; - CoolPowerCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower4; - CoolPowerCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPower5; Twet_Rated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Twet_Rated; Gamma_Rated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).Gamma_Rated; @@ -2279,12 +2222,9 @@ namespace WaterToAirHeatPumpSimple { ratioVS = 0.0; } - state.dataWaterToAirHeatPumpSimple->QLoadTotal = TotalCapRated * (TotalCapCoeff1 + (ratioTWB * TotalCapCoeff2) + (ratioTS * TotalCapCoeff3) + (ratioVL * TotalCapCoeff4) + - (ratioVS * TotalCapCoeff5)); - state.dataWaterToAirHeatPumpSimple->QSensible = SensCapRated * (SensCapCoeff1 + (ratioTDB * SensCapCoeff2) + (ratioTWB * SensCapCoeff3) + (ratioTS * SensCapCoeff4) + - (ratioVL * SensCapCoeff5) + (ratioVS * SensCapCoeff6)); - state.dataWaterToAirHeatPumpSimple->Winput = CoolPowerRated * (CoolPowerCoeff1 + (ratioTWB * CoolPowerCoeff2) + (ratioTS * CoolPowerCoeff3) + (ratioVL * CoolPowerCoeff4) + - (ratioVS * CoolPowerCoeff5)); + state.dataWaterToAirHeatPumpSimple->QLoadTotal = TotalCapRated * CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurveIndex, ratioTWB, ratioTS, ratioVL, ratioVS); + state.dataWaterToAirHeatPumpSimple->QSensible = SensCapRated * CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurveIndex,ratioTDB, ratioTWB, ratioTS, ratioVL, ratioVS); + state.dataWaterToAirHeatPumpSimple->Winput = CoolPowerRated * CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).CoolPowCurveIndex, ratioTWB, ratioTS, ratioVL, ratioVS); // Check if the Sensible Load is greater than the Total Cooling Load if (state.dataWaterToAirHeatPumpSimple->QSensible > state.dataWaterToAirHeatPumpSimple->QLoadTotal) { @@ -2453,6 +2393,7 @@ namespace WaterToAirHeatPumpSimple { using Psychrometrics::PsyTwbFnTdbWPb; using Psychrometrics::PsyWFnTdbH; using Psychrometrics::PsyWFnTdbTwbPb; + using CurveManager::CurveValue; // Locals // SUBROUTINE ARGUMENT DEFINITIONS: @@ -2500,16 +2441,6 @@ namespace WaterToAirHeatPumpSimple { HeatPowerRated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedPowerHeat; AirVolFlowRateRated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedAirVolFlowRate; WaterVolFlowRateRated = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedWaterVolFlowRate; - HeatCapCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap1; - HeatCapCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap2; - HeatCapCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap3; - HeatCapCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap4; - HeatCapCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCap5; - HeatPowerCoeff1 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower1; - HeatPowerCoeff2 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower2; - HeatPowerCoeff3 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower3; - HeatPowerCoeff4 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower4; - HeatPowerCoeff5 = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPower5; state.dataWaterToAirHeatPumpSimple->LoadSideMassFlowRate = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).AirMassFlowRate; state.dataWaterToAirHeatPumpSimple->LoadSideInletDBTemp = state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).InletAirDBTemp; @@ -2549,11 +2480,9 @@ namespace WaterToAirHeatPumpSimple { ratioVS = 0.0; } - state.dataWaterToAirHeatPumpSimple->QLoadTotal = HeatCapRated * - (HeatCapCoeff1 + (ratioTDB * HeatCapCoeff2) + (ratioTS * HeatCapCoeff3) + (ratioVL * HeatCapCoeff4) + (ratioVS * HeatCapCoeff5)); + state.dataWaterToAirHeatPumpSimple->QLoadTotal = HeatCapRated * CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatCapCurveIndex, ratioTDB, ratioTS, ratioVL, ratioVS); state.dataWaterToAirHeatPumpSimple->QSensible = state.dataWaterToAirHeatPumpSimple->QLoadTotal; - state.dataWaterToAirHeatPumpSimple->Winput = HeatPowerRated * (HeatPowerCoeff1 + (ratioTDB * HeatPowerCoeff2) + (ratioTS * HeatPowerCoeff3) + (ratioVL * HeatPowerCoeff4) + - (ratioVS * HeatPowerCoeff5)); + state.dataWaterToAirHeatPumpSimple->Winput = HeatPowerRated * CurveValue(state, state.dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).HeatPowCurveIndex, ratioTDB, ratioTS, ratioVL, ratioVS); // calculate coil outlet state variables state.dataWaterToAirHeatPumpSimple->LoadSideOutletEnth = state.dataWaterToAirHeatPumpSimple->LoadSideInletEnth + state.dataWaterToAirHeatPumpSimple->QLoadTotal / state.dataWaterToAirHeatPumpSimple->LoadSideMassFlowRate; diff --git a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh index 7d2865f7495..7f880f6c2f4 100644 --- a/src/EnergyPlus/WaterToAirHeatPumpSimple.hh +++ b/src/EnergyPlus/WaterToAirHeatPumpSimple.hh @@ -112,32 +112,11 @@ namespace WaterToAirHeatPumpSimple { Real64 RatedCapCoolSens; // Rated/Ref Sensible Cooling Capacity [W] Real64 RatedPowerCool; // Rated/Ref Cooling Power Consumption[W] Real64 RatedCOPCool; // Rated/Ref Cooling COP [W/W] - Real64 HeatCap1; // 1st coefficient of the Heating capacity performance curve - Real64 HeatCap2; // 2nd coefficient of the Heating capacity performance curve - Real64 HeatCap3; // 3rd coefficient of the Heating capacity performance curve - Real64 HeatCap4; // 4th coefficient of the Heating capacity performance curve - Real64 HeatCap5; // 5th coefficient of the Heating capacity performance curve - Real64 HeatPower1; // 1st coefficient of the Heating power consumption curve - Real64 HeatPower2; // 2nd coefficient of the Heating power consumption curve - Real64 HeatPower3; // 3rd coefficient of the Heating power consumption curve - Real64 HeatPower4; // 4th coefficient of the Heating power consumption curve - Real64 HeatPower5; // 5th coefficient of the Heating power consumption curve - Real64 TotalCoolCap1; // 1st coefficient of the Total Cooling capacity performance curve - Real64 TotalCoolCap2; // 2nd coefficient of the Total Cooling capacity performance curve - Real64 TotalCoolCap3; // 3rd coefficient of the Total Cooling capacity performance curve - Real64 TotalCoolCap4; // 4th coefficient of the Total Cooling capacity performance curve - Real64 TotalCoolCap5; // 5th coefficient of the Total Cooling capacity performance curve - Real64 SensCoolCap1; // 1st coefficient of the Sensible Cooling capacity performance curve - Real64 SensCoolCap2; // 2nd coefficient of the Sensible Cooling capacity performance curve - Real64 SensCoolCap3; // 3rd coefficient of the Sensible Cooling capacity performance curve - Real64 SensCoolCap4; // 4th coefficient of the Sensible Cooling capacity performance curve - Real64 SensCoolCap5; // 5th coefficient of the Sensible Cooling capacity performance curve - Real64 SensCoolCap6; // 6th coefficient of the Sensible Cooling capacity performance curve - Real64 CoolPower1; // 1st coefficient of the Cooling power consumption curve - Real64 CoolPower2; // 2nd coefficient of the Cooling power consumption curve - Real64 CoolPower3; // 3rd coefficient of the Cooling power consumption curve - Real64 CoolPower4; // 4th coefficient of the Cooling power consumption curve - Real64 CoolPower5; // 5th coefficient of the Cooling power consumption curve + Real64 HeatCapCurveIndex; // Index of the heating capacity performance curve + Real64 HeatPowCurveIndex; // Index of the heating power consumption curve + Real64 TotalCoolCapCurveIndex; // Index of the Total Cooling capacity performance curve + Real64 SensCoolCapCurveIndex; // Index of the Sensible Cooling capacity performance curve + Real64 CoolPowCurveIndex; // Index of the Cooling power consumption curve int AirInletNodeNum; // Node Number of the Air Inlet int AirOutletNodeNum; // Node Number of the Air Outlet int WaterInletNodeNum; // Node Number of the Water Onlet @@ -173,13 +152,11 @@ namespace WaterToAirHeatPumpSimple { OutletWaterEnthalpy(0.0), Power(0.0), QLoadTotal(0.0), QSensible(0.0), QLatent(0.0), QSource(0.0), Energy(0.0), EnergyLoadTotal(0.0), EnergySensible(0.0), EnergyLatent(0.0), EnergySource(0.0), COP(0.0), RunFrac(0.0), PartLoadRatio(0.0), RatedWaterVolFlowRate(0.0), RatedAirVolFlowRate(0.0), RatedCapHeat(0.0), RatedPowerHeat(0.0), RatedCOPHeat(0.0), RatedCapCoolTotal(0.0), RatedCapCoolSens(0.0), - RatedPowerCool(0.0), RatedCOPCool(0.0), HeatCap1(0.0), HeatCap2(0.0), HeatCap3(0.0), HeatCap4(0.0), HeatCap5(0.0), HeatPower1(0.0), - HeatPower2(0.0), HeatPower3(0.0), HeatPower4(0.0), HeatPower5(0.0), TotalCoolCap1(0.0), TotalCoolCap2(0.0), TotalCoolCap3(0.0), - TotalCoolCap4(0.0), TotalCoolCap5(0.0), SensCoolCap1(0.0), SensCoolCap2(0.0), SensCoolCap3(0.0), SensCoolCap4(0.0), SensCoolCap5(0.0), - SensCoolCap6(0.0), CoolPower1(0.0), CoolPower2(0.0), CoolPower3(0.0), CoolPower4(0.0), CoolPower5(0.0), AirInletNodeNum(0), - AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), - WaterCyclingMode(0), LastOperatingMode(WaterCycling), WaterFlowMode(false), CompanionCoolingCoilNum(0), CompanionHeatingCoilNum(0), - Twet_Rated(0.0), Gamma_Rated(0.0), MaxONOFFCyclesperHour(0.0), HPTimeConstant(0.0), FanDelayTime(0.0), reportCoilFinalSizes(true) + RatedPowerCool(0.0), RatedCOPCool(0.0), HeatCapCurveIndex(0.0), HeatPowCurveIndex(0.0), TotalCoolCapCurveIndex(0.0), + SensCoolCapCurveIndex(0.0),CoolPowCurveIndex(0.0), AirInletNodeNum(0), AirOutletNodeNum(0), WaterInletNodeNum(0), WaterOutletNodeNum(0), + LoopNum(0), LoopSide(0), BranchNum(0), CompNum(0), WaterCyclingMode(0), LastOperatingMode(WaterCycling), WaterFlowMode(false), + CompanionCoolingCoilNum(0), CompanionHeatingCoilNum(0), Twet_Rated(0.0), Gamma_Rated(0.0), MaxONOFFCyclesperHour(0.0), + HPTimeConstant(0.0), FanDelayTime(0.0), reportCoilFinalSizes(true) { } }; diff --git a/tst/EnergyPlus/unit/CurveManager.unit.cc b/tst/EnergyPlus/unit/CurveManager.unit.cc index 65f44d16603..f796742c8dc 100644 --- a/tst/EnergyPlus/unit/CurveManager.unit.cc +++ b/tst/EnergyPlus/unit/CurveManager.unit.cc @@ -126,6 +126,48 @@ TEST_F(EnergyPlusFixture, QuadraticCurve) EXPECT_EQ(expected_value, CurveManager::CurveValue(*state, 1, var1, var2, var3, var4)); } +TEST_F(EnergyPlusFixture, QuintLinearCurve) +{ + std::string const idf_objects = delimited_string({ + "Curve:QuintLinear,", + " MinDsnWBCurveName, ! Curve Name", + " -3.3333, ! CoefficientC1", + " 0.1, ! CoefficientC2", + " 38.9, ! CoefficientC3", + " 0.1, ! CoefficientC4", + " 0.5, ! CoefficientC5", + " 1.5, ! CoefficientC6", + " 0., ! Minimum Value of v", + " 10., ! Maximum Value of v", + " -30., ! Minimum Value of w", + " 40., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 1., ! Maximum Value of x", + " 5., ! Minimum Value of y", + " 38., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 20, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", + }); + + ASSERT_TRUE(process_idf(idf_objects)); + EXPECT_EQ(0, state->dataCurveManager->NumCurves); + CurveManager::GetCurveInput(*state); + state->dataCurveManager->GetCurvesInputFlag = false; + ASSERT_EQ(1, state->dataCurveManager->NumCurves); + + EXPECT_EQ(38.0, state->dataCurveManager->PerfCurve(1).CurveMax); + EXPECT_TRUE(state->dataCurveManager->PerfCurve(1).CurveMaxPresent); + + EXPECT_EQ(0., state->dataCurveManager->PerfCurve(1).CurveMin); + EXPECT_TRUE(state->dataCurveManager->PerfCurve(1).CurveMinPresent); + + double var1 = 1, var2 = 0.1, var3 = 0.5, var4 = 10, var5 = 15; + double expected_value = -3.3333 + (0.1*1) + (38.9*0.1) + (0.1*0.5) + (0.5 * 10) + (1.5 * 15); + EXPECT_EQ(expected_value, CurveManager::CurveValue(*state, 1, var1, var2, var3, var4, var5)); +} + TEST_F(EnergyPlusFixture, TableLookup) { std::string const idf_objects = delimited_string({ diff --git a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc index 5334014e345..fe2dfd0e66b 100644 --- a/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc +++ b/tst/EnergyPlus/unit/WaterToAirHeatPumpSimple.unit.cc @@ -62,6 +62,7 @@ #include #include #include +#include using namespace EnergyPlus; using namespace ObjexxFCL; @@ -72,6 +73,7 @@ using namespace EnergyPlus::DataPlant; using namespace EnergyPlus::DataSizing; using namespace EnergyPlus::Psychrometrics; using namespace EnergyPlus::WaterToAirHeatPumpSimple; +using namespace EnergyPlus::CurveManager; TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) { @@ -81,6 +83,7 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) // This test was added to test bug issue #4893 fix, a defect that resulted in SHR greater than 1.0. int HPNum(1); + int CurveNum; SysSizingRunDone = true; ZoneSizingRunDone = true; @@ -110,21 +113,54 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimpleTest_SizeHVACWaterToAir) FinalZoneSizing(CurZoneEqNum).ZoneRetTempAtCoolPeak = 25.5; FinalZoneSizing(CurZoneEqNum).ZoneHumRatAtCoolPeak = 0.0045; ZoneEqSizing(CurZoneEqNum).OAVolFlow = 0.0; + + state->dataCurveManager->NumCurves = 2; + state->dataCurveManager->PerfCurve.allocate(state->dataCurveManager->NumCurves); + + CurveNum = 1; + state->dataCurveManager->PerfCurve(CurveNum).CurveType = CurveTypeEnum::QuadLinear; + state->dataCurveManager->PerfCurve(CurveNum).ObjectType = "Curve:QuadLinear"; + state->dataCurveManager->PerfCurve(CurveNum).InterpolationType = InterpTypeEnum::EvaluateCurveToLimits; + state->dataCurveManager->PerfCurve(CurveNum).Coeff1 = -9.149069561; + state->dataCurveManager->PerfCurve(CurveNum).Coeff2 = 10.878140260; + state->dataCurveManager->PerfCurve(CurveNum).Coeff3 = -1.718780157; + state->dataCurveManager->PerfCurve(CurveNum).Coeff4 = 0.746414818; + state->dataCurveManager->PerfCurve(CurveNum).Coeff5 = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var1Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var1Max = 80.0; + state->dataCurveManager->PerfCurve(CurveNum).Var2Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var2Max = 100.0; + state->dataCurveManager->PerfCurve(CurveNum).Var3Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var3Max = 2.0; + state->dataCurveManager->PerfCurve(CurveNum).Var4Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var4Max = 2.0; + + CurveNum = 2; + state->dataCurveManager->PerfCurve(CurveNum).CurveType = CurveTypeEnum::QuintLinear; + state->dataCurveManager->PerfCurve(CurveNum).ObjectType = "Curve:QuintLinear"; + state->dataCurveManager->PerfCurve(CurveNum).InterpolationType = InterpTypeEnum::EvaluateCurveToLimits; + state->dataCurveManager->PerfCurve(CurveNum).Coeff1 = -5.462690012; + state->dataCurveManager->PerfCurve(CurveNum).Coeff2 = 17.95968138; + state->dataCurveManager->PerfCurve(CurveNum).Coeff3 = -11.87818402; + state->dataCurveManager->PerfCurve(CurveNum).Coeff4 = -0.980163419; + state->dataCurveManager->PerfCurve(CurveNum).Coeff5 = 0.767285761; + state->dataCurveManager->PerfCurve(CurveNum).Coeff6 = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var1Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var1Max = 100.0; + state->dataCurveManager->PerfCurve(CurveNum).Var2Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var2Max = 100.0; + state->dataCurveManager->PerfCurve(CurveNum).Var3Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var3Max = 100.0; + state->dataCurveManager->PerfCurve(CurveNum).Var4Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var4Max = 1.0; + state->dataCurveManager->PerfCurve(CurveNum).Var5Min = 0.0; + state->dataCurveManager->PerfCurve(CurveNum).Var5Max = 1.0; // performance curve coefficients - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap1 = -9.149069561; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap2 = 10.878140260; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap3 = -1.718780157; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap4 = 0.746414818; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCap5 = 0.0; + state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).TotalCoolCapCurveIndex = 1; + state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCapCurveIndex = 2; state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).RatedCOPCool = 5.12; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap1 = -5.462690012; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap2 = 17.95968138; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap3 = -11.87818402; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap4 = -0.980163419; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap5 = 0.767285761; - state->dataWaterToAirHeatPumpSimple->SimpleWatertoAirHP(HPNum).SensCoolCap6 = 0.0; DesDayWeath(1).Temp(15) = 32.0; state->dataEnvrn->StdBaroPress = 101325.0; @@ -162,22 +198,9 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) " 23125.59, !- Gross Rated Total Cooling Capacity {W}", " 16267, !- Gross Rated Sensible Cooling Capacity {W}", " 7.007757577, !- Gross Rated Cooling COP", - " -0.68126221, !- Total Cooling Capacity Coefficient 1", - " 1.99529297, !- Total Cooling Capacity Coefficient 2", - " -0.93611888, !- Total Cooling Capacity Coefficient 3", - " 0.02081177, !- Total Cooling Capacity Coefficient 4", - " 0.008438868, !- Total Cooling Capacity Coefficient 5", - " 2.24209455, !- Sensible Cooling Capacity Coefficient 1", - " 7.28913391, !- Sensible Cooling Capacity Coefficient 2", - " -9.06079896, !- Sensible Cooling Capacity Coefficient 3", - " -0.36729404, !- Sensible Cooling Capacity Coefficient 4", - " 0.218826161, !- Sensible Cooling Capacity Coefficient 5", - " 0.00901534, !- Sensible Cooling Capacity Coefficient 6", - " -3.20456384, !- Cooling Power Consumption Coefficient 1", - " 0.47656454, !- Cooling Power Consumption Coefficient 2", - " 3.16734236, !- Cooling Power Consumption Coefficient 3", - " 0.10244637, !- Cooling Power Consumption Coefficient 4", - " -0.038132556, !- Cooling Power Consumption Coefficient 5", + " TotCoolCapCurve, !- Total Cooling Capacity Curve Name", + " SensCoolCapCurve, !- Sensible Cooling Capacity Curve Name", + " CoolPowCurve, !- Cooling Power Consumption Curve Name", " 0, !- Nominal Time for Condensate Removal to Begin {s}", " 0; !- Ratio of Initial Moisture Evaporation Rate and Steady State Latent Capacity {dimensionless}", @@ -191,21 +214,107 @@ TEST_F(EnergyPlusFixture, WaterToAirHeatPumpSimple_TestWaterFlowControl) " 0.0033, !- Rated Water Flow Rate {m3/s}", " 19156.73, !- Gross Rated Heating Capacity {W}", " 3.167053691, !- Gross Rated Heating COP", - " -5.50102734, !- Heating Capacity Coefficient 1", - " -0.96688754, !- Heating Capacity Coefficient 2", - " 7.70755007, !- Heating Capacity Coefficient 3", - " 0.031928881, !- Heating Capacity Coefficient 4", - " 0.028112522, !- Heating Capacity Coefficient 5", - " -7.47517858, !- Heating Power Consumption Coefficient 1", - " 6.40876653, !- Heating Power Consumption Coefficient 2", - " 1.99711665, !- Heating Power Consumption Coefficient 3", - " -0.050682973, !- Heating Power Consumption Coefficient 4", - " 0.011385145; !- Heating Power Consumption Coefficient 5", + " HeatCapCurve, !- Heating Capacity Curve Name", + " HeatPowCurve; !- Heating Power Curve Name", + + "Curve:QuintLinear,", + " SensCoolCapCurve, ! Curve Name", + " 2.24209455, ! CoefficientC1", + " 7.28913391, ! CoefficientC2", + " -9.06079896, ! CoefficientC3", + " -0.36729404, ! CoefficientC4", + " 0.218826161, ! CoefficientC5", + " 0.00901534, ! CoefficientC6", + " 0., ! Minimum Value of v", + " 100., ! Maximum Value of v", + " 0., ! Minimum Value of w", + " 100., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 100., ! Maximum Value of x", + " 0., ! Minimum Value of y", + " 100., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 100, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", + + "Curve:QuadLinear,", + " TotCoolCapCurve, ! Curve Name", + " -0.68126221, ! CoefficientC1", + " 1.99529297, ! CoefficientC2", + " -0.93611888, ! CoefficientC3", + " 0.02081177, ! CoefficientC4", + " 0.008438868, ! CoefficientC5", + " 0., ! Minimum Value of w", + " 100., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 100., ! Maximum Value of x", + " 0., ! Minimum Value of y", + " 100., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 100, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", + + "Curve:QuadLinear,", + " CoolPowCurve, ! Curve Name", + " -3.20456384, ! CoefficientC1", + " 0.47656454, ! CoefficientC2", + " 3.16734236, ! CoefficientC3", + " 0.10244637, ! CoefficientC4", + " -0.038132556, ! CoefficientC5", + " 0., ! Minimum Value of w", + " 100., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 100., ! Maximum Value of x", + " 0., ! Minimum Value of y", + " 100., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 100, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", + + "Curve:QuadLinear,", + " HeatCapCurve, ! Curve Name", + " -5.50102734, ! CoefficientC1", + " -0.96688754, ! CoefficientC2", + " 7.70755007, ! CoefficientC3", + " 0.031928881, ! CoefficientC4", + " 0.028112522, ! CoefficientC5", + " 0., ! Minimum Value of w", + " 100., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 100., ! Maximum Value of x", + " 0., ! Minimum Value of y", + " 100., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 100, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", + + "Curve:QuadLinear,", + " HeatPowCurve, ! Curve Name", + " -7.47517858, ! CoefficientC1", + " 6.40876653, ! CoefficientC2", + " 1.99711665, ! CoefficientC3", + " -0.050682973, ! CoefficientC4", + " 0.011385145, ! CoefficientC5", + " 0., ! Minimum Value of w", + " 100., ! Maximum Value of w", + " 0., ! Minimum Value of x", + " 100., ! Maximum Value of x", + " 0., ! Minimum Value of y", + " 100., ! Maximum Value of y", + " 0, ! Minimum Value of z", + " 100, ! Maximum Value of z", + " 0., ! Minimum Curve Output", + " 38.; ! Maximum Curve Output", }); ASSERT_TRUE(process_idf(idf_objects)); - + + GetCurveInput(*state); GetSimpleWatertoAirHPInput(*state); int HPNum(1);