Skip to content

Commit

Permalink
Merge branch 'develop' into 10299CheckConvexityChangeCheckForShadowCa…
Browse files Browse the repository at this point in the history
…lculations
  • Loading branch information
RKStrand committed Jul 25, 2024
2 parents ef9b816 + 8c96cbb commit 54e4025
Show file tree
Hide file tree
Showing 48 changed files with 5,875 additions and 7,214 deletions.
2 changes: 1 addition & 1 deletion src/EnergyPlus/BoilerSteam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ namespace BoilerSteam {
"Hot Steam Nodes");

if (SteamFluidIndex == 0 && BoilerNum == 1) {
SteamFluidIndex = FluidProperties::FindRefrigerant(state, fluidNameSteam);
SteamFluidIndex = FluidProperties::GetRefrigNum(state, fluidNameSteam); // Steam is a refrigerant?
if (SteamFluidIndex == 0) {
ShowSevereError(
state, format("{}{}=\"{}\",", RoutineName, state.dataIPShortCut->cCurrentModuleObject, state.dataIPShortCut->cAlphaArgs(1)));
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChillerAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void GetBLASTAbsorberInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(7),
"Hot Water Nodes");
} else {
thisChiller.SteamFluidIndex = FluidProperties::FindRefrigerant(state, fluidNameSteam);
thisChiller.SteamFluidIndex = FluidProperties::GetRefrigNum(state, fluidNameSteam);
thisChiller.GeneratorInletNodeNum = NodeInputManager::GetOnlySingleNode(state,
state.dataIPShortCut->cAlphaArgs(6),
ErrorsFound,
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/ChillerIndirectAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void GetIndirectAbsorberInput(EnergyPlusData &state)
state.dataIPShortCut->cAlphaArgs(10),
"Hot Water Nodes");
} else {
thisChiller.SteamFluidIndex = FluidProperties::FindRefrigerant(state, fluidNameSteam);
thisChiller.SteamFluidIndex = FluidProperties::GetRefrigNum(state, fluidNameSteam);
thisChiller.GeneratorInletNodeNum = NodeInputManager::GetOnlySingleNode(state,
state.dataIPShortCut->cAlphaArgs(9),
ErrorsFound,
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ EnergyPlusData::EnergyPlusData()
this->dataFans = std::make_unique<FansData>();
this->dataFaultsMgr = std::make_unique<FaultsManagerData>();
this->dataFluidCoolers = std::make_unique<FluidCoolersData>();
this->dataFluidProps = std::make_unique<FluidPropertiesData>();
this->dataFluidProps = std::make_unique<FluidData>();
this->dataFourPipeBeam = std::make_unique<FourPipeBeamData>();
this->dataFuelCellElectGen = std::make_unique<FuelCellElectricGeneratorData>();
this->dataFurnaces = std::make_unique<FurnacesData>();
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ struct FanCoilUnitsData;
struct FansData;
struct FaultsManagerData;
struct FluidCoolersData;
struct FluidPropertiesData;
struct FluidData;
struct FourPipeBeamData;
struct FuelCellElectricGeneratorData;
struct FurnacesData;
Expand Down Expand Up @@ -390,7 +390,7 @@ struct EnergyPlusData : BaseGlobalStruct
std::unique_ptr<FansData> dataFans;
std::unique_ptr<FaultsManagerData> dataFaultsMgr;
std::unique_ptr<FluidCoolersData> dataFluidCoolers;
std::unique_ptr<FluidPropertiesData> dataFluidProps;
std::unique_ptr<FluidData> dataFluidProps;
std::unique_ptr<FourPipeBeamData> dataFourPipeBeam;
std::unique_ptr<FuelCellElectricGeneratorData> dataFuelCellElectGen;
std::unique_ptr<FurnacesData> dataFurnaces;
Expand Down
10,765 changes: 4,775 additions & 5,990 deletions src/EnergyPlus/FluidProperties.cc

Large diffs are not rendered by default.

634 changes: 306 additions & 328 deletions src/EnergyPlus/FluidProperties.hh

Large diffs are not rendered by default.

604 changes: 212 additions & 392 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.cc

Large diffs are not rendered by default.

84 changes: 43 additions & 41 deletions src/EnergyPlus/HVACVariableRefrigerantFlow.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataHeatBalance.hh>
#include <EnergyPlus/EnergyPlus.hh>
#include <EnergyPlus/FluidProperties.hh>
#include <EnergyPlus/Plant/PlantLocation.hh>
#include <EnergyPlus/PlantComponent.hh>
#include <EnergyPlus/SingleDuct.hh>
Expand Down Expand Up @@ -319,47 +320,48 @@ namespace HVACVariableRefrigerantFlow {
int HeatEIRFPLRErrorIndex = 0; // warning message index
int CoolEIRFPLRErrorIndex = 0; // warning message index
// The following are for the Algorithm Type: VRF model based on physics, applicable for Fluid Temperature Control
int AlgorithmIUCtrl; // VRF indoor unit contrl algorithm, 1-High sensible, 2-Te/Tc constant
Array1D<Real64> CompressorSpeed; // compressor speed array [rps]
Real64 CondensingTemp; // VRV system outdoor unit condensing temperature [C]
Real64 CondTempFixed; // Inddor unit condensing temperature, fixed, for AlgorithmIUCtrl is 2-Te/Tc constant [C]
Real64 CoffEvapCap; // Evaporative Capacity Correction Factor
Real64 CompActSpeed; // Compressor speed [rps]
Real64 CompMaxDeltaP; // maximum compressor pressure rise [Pa]
Real64 C1Te; // VRF Outdoor Unit Coefficient 1 to calculate Te,req [--]
Real64 C2Te; // VRF Outdoor Unit Coefficient 2 to calculate Te,req [--]
Real64 C3Te; // VRF Outdoor Unit Coefficient 3 to calculate Te,req [--]
Real64 C1Tc; // VRF Outdoor Unit Coefficient 1 to calculate Tc,req [--]
Real64 C2Tc; // VRF Outdoor Unit Coefficient 2 to calculate Tc,req [--]
Real64 C3Tc; // VRF Outdoor Unit Coefficient 3 to calculate Tc,req [--]
Real64 DiffOUTeTo; // Difference between Outdoor Unit Te and OAT during Simultaneous Heating and Cooling operations
Real64 EffCompInverter; // Compressor Inverter Efficiency
Real64 EvaporatingTemp; // VRV system outdoor unit evaporating temperature [C]
Real64 EvapTempFixed; // Indoor unit evaporating temperature, fixed, for AlgorithmIUCtrl is 2-Te/Tc constant [C]
Real64 HROUHexRatio; // HR OU Heat Exchanger Capacity Ratio [--]
Real64 IUEvaporatingTemp; // VRV system indoor unit evaporating temperature, min among all indoor units [C]
Real64 IUCondensingTemp; // VRV system indoor unit condensing temperature, max among all indoor units [C]
Real64 IUEvapTempLow; // VRV system indoor unit evaporating temperature, lower bound[C]
Real64 IUEvapTempHigh; // VRV system indoor unit evaporating temperature, higher bound [C]
Real64 IUCondTempLow; // VRV system indoor unit condensing temperature, lower bound [C]
Real64 IUCondTempHigh; // VRV system indoor unit condensing temperature, higher bound [C]
Real64 IUCondHeatRate; // Indoor Unit Condensers Total Heat Release Rate, excluding piping loss [W]
Real64 IUEvapHeatRate; // Outdoor Unit Evaporators Total Heat Extract Rate, excluding piping loss [W]
Real64 Ncomp; // compressor electric power [W]
Real64 NcompCooling; // compressor electric power at cooling mode [W]
Real64 NcompHeating; // compressor electric power at heating mode [W]
Array1D_int OUCoolingCAPFT; // index to outdoor unit cooling capacity function of temperature at different compressor speed
Array1D_int OUCoolingPWRFT; // index to outdoor unit cooling power function of temperature at different compressor speed
Real64 OUEvapTempLow; // VRV system outdoor unit evaporating temperature, lower bound[C]
Real64 OUEvapTempHigh; // VRV system outdoor unit evaporating temperature, higher bound [C]
Real64 OUCondTempLow; // VRV system outdoor unit condensing temperature, lower bound [C]
Real64 OUCondTempHigh; // VRV system outdoor unit condensing temperature, higher bound [C]
Real64 OUAirFlowRate; // Max condenser air flow rate [m3/s]
Real64 OUAirFlowRatePerCapcity; // Max condenser air flow rate per Evaporative Capacity [m3/s]
Real64 OUCondHeatRate; // Outdoor Unit Condenser Heat Release Rate, excluding piping loss [W]
Real64 OUEvapHeatRate; // Outdoor Unit Evaporator Heat Extract Rate, excluding piping loss [W]
Real64 OUFanPower; // Outdoor unit fan power at real conditions[W]
std::string RefrigerantName; // Name of refrigerant, must match name in FluidName (see fluidpropertiesrefdata.idf)
int AlgorithmIUCtrl; // VRF indoor unit contrl algorithm, 1-High sensible, 2-Te/Tc constant
Array1D<Real64> CompressorSpeed; // compressor speed array [rps]
Real64 CondensingTemp; // VRV system outdoor unit condensing temperature [C]
Real64 CondTempFixed; // Inddor unit condensing temperature, fixed, for AlgorithmIUCtrl is 2-Te/Tc constant [C]
Real64 CoffEvapCap; // Evaporative Capacity Correction Factor
Real64 CompActSpeed; // Compressor speed [rps]
Real64 CompMaxDeltaP; // maximum compressor pressure rise [Pa]
Real64 C1Te; // VRF Outdoor Unit Coefficient 1 to calculate Te,req [--]
Real64 C2Te; // VRF Outdoor Unit Coefficient 2 to calculate Te,req [--]
Real64 C3Te; // VRF Outdoor Unit Coefficient 3 to calculate Te,req [--]
Real64 C1Tc; // VRF Outdoor Unit Coefficient 1 to calculate Tc,req [--]
Real64 C2Tc; // VRF Outdoor Unit Coefficient 2 to calculate Tc,req [--]
Real64 C3Tc; // VRF Outdoor Unit Coefficient 3 to calculate Tc,req [--]
Real64 DiffOUTeTo; // Difference between Outdoor Unit Te and OAT during Simultaneous Heating and Cooling operations
Real64 EffCompInverter; // Compressor Inverter Efficiency
Real64 EvaporatingTemp; // VRV system outdoor unit evaporating temperature [C]
Real64 EvapTempFixed; // Indoor unit evaporating temperature, fixed, for AlgorithmIUCtrl is 2-Te/Tc constant [C]
Real64 HROUHexRatio; // HR OU Heat Exchanger Capacity Ratio [--]
Real64 IUEvaporatingTemp; // VRV system indoor unit evaporating temperature, min among all indoor units [C]
Real64 IUCondensingTemp; // VRV system indoor unit condensing temperature, max among all indoor units [C]
Real64 IUEvapTempLow; // VRV system indoor unit evaporating temperature, lower bound[C]
Real64 IUEvapTempHigh; // VRV system indoor unit evaporating temperature, higher bound [C]
Real64 IUCondTempLow; // VRV system indoor unit condensing temperature, lower bound [C]
Real64 IUCondTempHigh; // VRV system indoor unit condensing temperature, higher bound [C]
Real64 IUCondHeatRate; // Indoor Unit Condensers Total Heat Release Rate, excluding piping loss [W]
Real64 IUEvapHeatRate; // Outdoor Unit Evaporators Total Heat Extract Rate, excluding piping loss [W]
Real64 Ncomp; // compressor electric power [W]
Real64 NcompCooling; // compressor electric power at cooling mode [W]
Real64 NcompHeating; // compressor electric power at heating mode [W]
Array1D_int OUCoolingCAPFT; // index to outdoor unit cooling capacity function of temperature at different compressor speed
Array1D_int OUCoolingPWRFT; // index to outdoor unit cooling power function of temperature at different compressor speed
Real64 OUEvapTempLow; // VRV system outdoor unit evaporating temperature, lower bound[C]
Real64 OUEvapTempHigh; // VRV system outdoor unit evaporating temperature, higher bound [C]
Real64 OUCondTempLow; // VRV system outdoor unit condensing temperature, lower bound [C]
Real64 OUCondTempHigh; // VRV system outdoor unit condensing temperature, higher bound [C]
Real64 OUAirFlowRate; // Max condenser air flow rate [m3/s]
Real64 OUAirFlowRatePerCapcity; // Max condenser air flow rate per Evaporative Capacity [m3/s]
Real64 OUCondHeatRate; // Outdoor Unit Condenser Heat Release Rate, excluding piping loss [W]
Real64 OUEvapHeatRate; // Outdoor Unit Evaporator Heat Extract Rate, excluding piping loss [W]
Real64 OUFanPower; // Outdoor unit fan power at real conditions[W]
std::string refrigName; // Name of refrigerant, must match name in FluidName (see fluidpropertiesrefdata.idf)
FluidProperties::RefrigProps *refrig;
Real64 RatedEvapCapacity; // Rated Evaporative Capacity [W]
Real64 RatedHeatCapacity; // Rated Heating Capacity [W]
Real64 RatedCompPower; // Rated Compressor Power [W]
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatPumpWaterToWaterCOOLING.cc
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void GetGshpInput(EnergyPlusData &state)
ShowFatalError(state, "Errors Found in getting Gshp input");
}

state.dataHPWaterToWaterClg->GSHPRefrigIndex = FluidProperties::FindRefrigerant(state, GSHPRefrigerant);
state.dataHPWaterToWaterClg->GSHPRefrigIndex = FluidProperties::GetRefrigNum(state, GSHPRefrigerant);
if (state.dataHPWaterToWaterClg->GSHPRefrigIndex == 0) {
ShowFatalError(state, format("Refrigerant for {} not found, should have been={}", ModuleCompName, GSHPRefrigerant));
ShowFatalError(state, format("FluidProperties:* objects for {} must be included in the idf file.", GSHPRefrigerant));
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/HeatPumpWaterToWaterHEATING.cc
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ void GetGshpInput(EnergyPlusData &state)
ShowFatalError(state, format("Errors Found in getting {} Input", ModuleCompNameUC));
}

state.dataHPWaterToWaterHtg->GSHPRefrigIndex = FluidProperties::FindRefrigerant(state, GSHPRefrigerant);
state.dataHPWaterToWaterHtg->GSHPRefrigIndex = FluidProperties::GetRefrigNum(state, GSHPRefrigerant);
if (state.dataHPWaterToWaterHtg->GSHPRefrigIndex == 0) {
ShowFatalError(state, format("Refrigerant for {} not found, should have been={}", ModuleCompName, GSHPRefrigerant));
}
Expand Down
12 changes: 4 additions & 8 deletions src/EnergyPlus/Humidifiers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,6 @@ namespace Humidifiers {

// Using/Aliasing
using DataSizing::AutoSize;
using FluidProperties::FindGlycol;
using FluidProperties::FindRefrigerant;
using FluidProperties::GetSatEnthalpyRefrig;
using FluidProperties::GetSpecificHeatGlycol;

Expand Down Expand Up @@ -880,8 +878,8 @@ namespace Humidifiers {
}

NomCap = RhoH2O(Constant::InitConvTemp) * NomCapVol;
RefrigerantIndex = FindRefrigerant(state, format(fluidNameSteam));
WaterIndex = FindGlycol(state, format(fluidNameWater));
RefrigerantIndex = FluidProperties::GetRefrigNum(state, format(fluidNameSteam));
WaterIndex = FluidProperties::GetGlycolNum(state, format(fluidNameWater));
SteamSatEnthalpy = GetSatEnthalpyRefrig(state, format(fluidNameSteam), TSteam, 1.0, RefrigerantIndex, CalledFrom);
WaterSatEnthalpy = GetSatEnthalpyRefrig(state, format(fluidNameSteam), TSteam, 0.0, RefrigerantIndex, CalledFrom);
WaterSpecHeatAvg = 0.5 * (GetSpecificHeatGlycol(state, format(fluidNameWater), TSteam, WaterIndex, CalledFrom) +
Expand Down Expand Up @@ -1164,8 +1162,6 @@ namespace Humidifiers {

// Using/Aliasing
using Curve::CurveValue;
using FluidProperties::FindGlycol;
using FluidProperties::FindRefrigerant;
using FluidProperties::GetSatEnthalpyRefrig;
using FluidProperties::GetSpecificHeatGlycol;
using Psychrometrics::PsyHFnTdbW;
Expand Down Expand Up @@ -1256,8 +1252,8 @@ namespace Humidifiers {
CurMakeupWaterTemp = state.dataEnvrn->WaterMainsTemp;
}
Tref = CurMakeupWaterTemp;
RefrigerantIndex = FindRefrigerant(state, format(fluidNameSteam));
WaterIndex = FindGlycol(state, format(fluidNameWater));
RefrigerantIndex = FluidProperties::GetRefrigNum(state, format(fluidNameSteam));
WaterIndex = FluidProperties::GetGlycolNum(state, format(fluidNameWater));
SteamSatEnthalpy = GetSatEnthalpyRefrig(state, format(fluidNameSteam), TSteam, 1.0, RefrigerantIndex, RoutineName);
WaterSatEnthalpy = GetSatEnthalpyRefrig(state, format(fluidNameSteam), TSteam, 0.0, RefrigerantIndex, RoutineName);
WaterSpecHeatAvg = 0.5 * (GetSpecificHeatGlycol(state, format(fluidNameWater), TSteam, WaterIndex, RoutineName) +
Expand Down
5 changes: 2 additions & 3 deletions src/EnergyPlus/LowTempRadiantSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ namespace LowTempRadiantSystem {
using DataSizing::FractionOfAutosizedCoolingCapacity;
using DataSizing::FractionOfAutosizedHeatingCapacity;
using DataSizing::HeatingDesignCapacity;
using FluidProperties::FindGlycol;

using NodeInputManager::GetOnlySingleNode;
using ScheduleManager::GetScheduleIndex;
Expand Down Expand Up @@ -376,7 +375,7 @@ namespace LowTempRadiantSystem {

state.dataLowTempRadSys->HydrRadSys.allocate(state.dataLowTempRadSys->NumOfHydrLowTempRadSys);
if (state.dataLowTempRadSys->NumOfHydrLowTempRadSys > 0) {
GlycolIndex = FindGlycol(state, fluidNameWater);
GlycolIndex = FluidProperties::GetGlycolNum(state, fluidNameWater);
for (auto &e : state.dataLowTempRadSys->HydrRadSys)
e.GlycolIndex = GlycolIndex;
if (GlycolIndex == 0) {
Expand All @@ -390,7 +389,7 @@ namespace LowTempRadiantSystem {

state.dataLowTempRadSys->CFloRadSys.allocate(state.dataLowTempRadSys->NumOfCFloLowTempRadSys);
if (state.dataLowTempRadSys->NumOfCFloLowTempRadSys > 0) {
GlycolIndex = FindGlycol(state, fluidNameWater);
GlycolIndex = FluidProperties::GetGlycolNum(state, fluidNameWater);
for (auto &e : state.dataLowTempRadSys->CFloRadSys)
e.GlycolIndex = GlycolIndex;
if (GlycolIndex == 0) {
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/NodeInputManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ void CalcMoreNodeInfo(EnergyPlusData &state)
} else if (state.dataLoopNodes->Node(iNode).FluidType == DataLoopNode::NodeFluidType::Water) {

if (!((state.dataLoopNodes->Node(iNode).FluidIndex > 0) &&
(state.dataLoopNodes->Node(iNode).FluidIndex <= state.dataFluidProps->NumOfGlycols))) {
(state.dataLoopNodes->Node(iNode).FluidIndex <= state.dataFluidProps->glycols.isize()))) {
rho = RhoWaterStdInit;
rhoStd = RhoWaterStdInit;
Cp = CPCW(state.dataLoopNodes->Node(iNode).Temp);
Expand Down
Loading

5 comments on commit 54e4025

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10299CheckConvexityChangeCheckForShadowCalculations (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3691 of 3691 tests passed, 791 test warnings)

Messages:\n

  • 791 tests had: EIO diffs.

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10299CheckConvexityChangeCheckForShadowCalculations (RKStrand) - Win64-Windows-10-VisualStudio-16: OK (2858 of 2858 tests passed, 0 test warnings)

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10299CheckConvexityChangeCheckForShadowCalculations (RKStrand) - x86_64-MacOS-10.18-clang-15.0.0: OK (3650 of 3650 tests passed, 787 test warnings)

Messages:\n

  • 787 tests had: EIO diffs.

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10299CheckConvexityChangeCheckForShadowCalculations (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (795 of 795 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10299CheckConvexityChangeCheckForShadowCalculations (RKStrand) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (2066 of 2066 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.