Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global DataConstruction, VariableSpeedCoils, and VentilatedSlab #8334

Merged
merged 10 commits into from
Oct 13, 2020
1 change: 0 additions & 1 deletion src/EnergyPlus/ConvectionCoefficients.cc
Original file line number Diff line number Diff line change
@@ -61,7 +61,6 @@
#include <ObjexxFCL/member.functions.hh>

// EnergyPlus Headers
#include <EnergyPlus/Data/CommonIncludes.hh>
#include <EnergyPlus/Construction.hh>
#include <EnergyPlus/ConvectionCoefficients.hh>
#include <EnergyPlus/CurveManager.hh>
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
@@ -82,6 +82,8 @@
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
#include <EnergyPlus/PlantChillers.hh>
#include <EnergyPlus/VariableSpeedCoils.hh>
#include <EnergyPlus/VentilatedSlab.hh>
#include <EnergyPlus/WaterCoils.hh>
#include <EnergyPlus/WaterManager.hh>
#include <EnergyPlus/WaterThermalTanks.hh>
4 changes: 4 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
@@ -84,6 +84,8 @@ namespace EnergyPlus {
this->dataGlobal = std::unique_ptr<DataGlobal>(new DataGlobal);
this->dataPipes = std::unique_ptr<PipesData>(new PipesData);
this->dataPlantChillers = std::unique_ptr<PlantChillersData>(new PlantChillersData);
this->dataVariableSpeedCoils = std::unique_ptr<VariableSpeedCoilsData>(new VariableSpeedCoilsData);
this->dataVentilatedSlab = std::unique_ptr<VentilatedSlabData>(new VentilatedSlabData);
this->dataWaterCoils = std::unique_ptr<WaterCoilsData>(new WaterCoilsData);
this->dataWaterManager = std::unique_ptr<WaterManagerData>(new WaterManagerData);
this->dataWaterThermalTanks = std::unique_ptr<WaterThermalTanksData>(new WaterThermalTanksData);
@@ -133,6 +135,8 @@ namespace EnergyPlus {
this->dataGlobal->clear_state();
this->dataPipes->clear_state();
this->dataPlantChillers->clear_state();
this->dataVariableSpeedCoils->clear_state();
this->dataVentilatedSlab->clear_state();
this->dataWaterCoils->clear_state();
this->dataWaterManager->clear_state();
this->dataWaterThermalTanks->clear_state();
4 changes: 4 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
@@ -93,6 +93,8 @@ struct ExteriorEnergyUseData;
struct FansData;
struct PipesData;
struct PlantChillersData;
struct VariableSpeedCoilsData;
struct VentilatedSlabData;
struct WaterCoilsData;
struct WaterManagerData;
struct WaterThermalTanksData;
@@ -145,6 +147,8 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<FansData> dataFans;
std::unique_ptr<PipesData> dataPipes;
std::unique_ptr<PlantChillersData> dataPlantChillers;
std::unique_ptr<VariableSpeedCoilsData> dataVariableSpeedCoils;
std::unique_ptr<VentilatedSlabData> dataVentilatedSlab;
std::unique_ptr<WaterCoilsData> dataWaterCoils;
std::unique_ptr<WaterManagerData> dataWaterManager;
std::unique_ptr<WaterThermalTanksData> dataWaterThermalTanks;
59 changes: 28 additions & 31 deletions src/EnergyPlus/Furnaces.cc
Original file line number Diff line number Diff line change
@@ -183,7 +183,6 @@ namespace Furnaces {
using namespace ScheduleManager;
using DXCoils::SimDXCoil;
using Fans::SimulateFanComponents;
using VariableSpeedCoils::MaxSpedLevels;

// Data
// MODULE PARAMETER DEFINITIONS
@@ -6067,7 +6066,6 @@ namespace Furnaces {
using IntegratedHeatPump::IntegratedHeatPumps;
using IntegratedHeatPump::SizeIHP;
using VariableSpeedCoils::SimVariableSpeedCoils;
using VariableSpeedCoils::VarSpeedCoil;
using WaterToAirHeatPumpSimple::SimWatertoAirHPSimple;

// Locals
@@ -6135,9 +6133,9 @@ namespace Furnaces {
if (Furnace(FurnaceNum).bIsIHP) {
SizeIHP(state, Furnace(FurnaceNum).CoolingCoilIndex);
IHPCoilIndex = IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).SCCoilIndex;
Furnace(FurnaceNum).NumOfSpeedCooling = VarSpeedCoil(IHPCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate /
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(VarSpeedCoil(IHPCoilIndex).NormSpedLevel);
Furnace(FurnaceNum).NumOfSpeedCooling = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate /
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NormSpedLevel);
IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).CoolVolFlowScale = MulSpeedFlowScale;
} else {
SimVariableSpeedCoils(state,
@@ -6154,19 +6152,19 @@ namespace Furnaces {
0.0,
0.0,
0.0); // conduct the sizing operation in the VS WSHP
Furnace(FurnaceNum).NumOfSpeedCooling = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).RatedAirVolFlowRate /
VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex)
.MSRatedAirVolFlowRate(VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NormSpedLevel);
Furnace(FurnaceNum).NumOfSpeedCooling = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).RatedAirVolFlowRate /
state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex)
.MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).NormSpedLevel);
IHPCoilIndex = Furnace(FurnaceNum).CoolingCoilIndex;
}

for (Iter = 1; Iter <= Furnace(FurnaceNum).NumOfSpeedCooling; ++Iter) {
Furnace(FurnaceNum).CoolVolumeFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).CoolMassFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).CoolVolumeFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).CoolMassFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).MSCoolingSpeedRatio(Iter) =
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) /
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedCooling);
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) /
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedCooling);
}

if (Furnace(FurnaceNum).HeatingCoilType_Num == Coil_HeatingWaterToAirHPVSEquationFit ||
@@ -6175,9 +6173,9 @@ namespace Furnaces {
if (Furnace(FurnaceNum).bIsIHP) {
SizeIHP(state, Furnace(FurnaceNum).CoolingCoilIndex);
IHPCoilIndex = IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).SHCoilIndex;
Furnace(FurnaceNum).NumOfSpeedHeating = VarSpeedCoil(IHPCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate /
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(VarSpeedCoil(IHPCoilIndex).NormSpedLevel);
Furnace(FurnaceNum).NumOfSpeedHeating = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).RatedAirVolFlowRate /
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).NormSpedLevel);
IntegratedHeatPumps(Furnace(FurnaceNum).CoolingCoilIndex).HeatVolFlowScale = MulSpeedFlowScale;
} else {
SimVariableSpeedCoils(state,
@@ -6194,19 +6192,19 @@ namespace Furnaces {
0.0,
0.0,
0.0); // conduct the sizing operation in the VS WSHP
Furnace(FurnaceNum).NumOfSpeedHeating = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).RatedAirVolFlowRate /
VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex)
.MSRatedAirVolFlowRate(VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NormSpedLevel);
Furnace(FurnaceNum).NumOfSpeedHeating = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NumOfSpeeds;
MulSpeedFlowScale = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).RatedAirVolFlowRate /
state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex)
.MSRatedAirVolFlowRate(state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).NormSpedLevel);
IHPCoilIndex = Furnace(FurnaceNum).HeatingCoilIndex;
}

for (Iter = 1; Iter <= Furnace(FurnaceNum).NumOfSpeedHeating; ++Iter) {
Furnace(FurnaceNum).HeatVolumeFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).HeatMassFlowRate(Iter) = VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).HeatVolumeFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).HeatMassFlowRate(Iter) = state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirMassFlowRate(Iter) * MulSpeedFlowScale;
Furnace(FurnaceNum).MSHeatingSpeedRatio(Iter) =
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) /
VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedHeating);
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Iter) /
state.dataVariableSpeedCoils->VarSpeedCoil(IHPCoilIndex).MSRatedAirVolFlowRate(Furnace(FurnaceNum).NumOfSpeedHeating);
}
}

@@ -10690,7 +10688,6 @@ namespace Furnaces {
using Fans::SimulateFanComponents;
using IntegratedHeatPump::SimIHP;
using VariableSpeedCoils::SimVariableSpeedCoils;
using VariableSpeedCoils::VarSpeedCoil;

// Locals
// SUBROUTINE ARGUMENT DEFINITIONS:
@@ -10793,7 +10790,7 @@ namespace Furnaces {
SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;

SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
} else {
if (Furnace(FurnaceNum).bIsIHP) {
SimIHP(state,
@@ -10869,7 +10866,7 @@ namespace Furnaces {
SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;

SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
} else {
if (Furnace(FurnaceNum).bIsIHP) {
SimIHP(state,
@@ -10960,7 +10957,7 @@ namespace Furnaces {

SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
} else {

if (Furnace(FurnaceNum).bIsIHP) {
@@ -11036,7 +11033,7 @@ namespace Furnaces {

SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
} else {
if (Furnace(FurnaceNum).bIsIHP) {
SimIHP(state,
@@ -11133,7 +11130,7 @@ namespace Furnaces {
SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;

SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).CoolingCoilIndex).PartLoadRatio;
} else {
if (Furnace(FurnaceNum).bIsIHP) {
SimIHP(state,
@@ -11209,7 +11206,7 @@ namespace Furnaces {

SavePartloadRatio = PartLoadFrac;
SaveSpeedRatio = SpeedRatio;
SaveCompressorPLR = VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
SaveCompressorPLR = state.dataVariableSpeedCoils->VarSpeedCoil(Furnace(FurnaceNum).HeatingCoilIndex).PartLoadRatio;
} else {
if (Furnace(FurnaceNum).bIsIHP) {
SimIHP(state,
4 changes: 2 additions & 2 deletions src/EnergyPlus/Furnaces.hh
Original file line number Diff line number Diff line change
@@ -65,7 +65,6 @@ struct EnergyPlusData;
namespace Furnaces {

// Using/Aliasing
using VariableSpeedCoils::MaxSpedLevels;

// Data
// MODULE PARAMETER DEFINITIONS
@@ -131,7 +130,8 @@ namespace Furnaces {
// Types

struct FurnaceEquipConditions
{
{
int MaxSpedLevels = 10;
// Members
std::string Name; // Name of the Furnace
int FurnaceType_Num; // Numeric Equivalent for Furnace Type
15 changes: 6 additions & 9 deletions src/EnergyPlus/HVACDXHeatPumpSystem.cc
Original file line number Diff line number Diff line change
@@ -600,7 +600,6 @@ namespace HVACDXHeatPumpSystem {
using Psychrometrics::PsyHFnTdbW;
using Psychrometrics::PsyTdpFnWPb;
using VariableSpeedCoils::SimVariableSpeedCoils;
using VariableSpeedCoils::VarSpeedCoil;

// SUBROUTINE PARAMETER DEFINITIONS:
int const MaxIte(500); // Maximum number of iterations for solver
@@ -815,7 +814,7 @@ namespace HVACDXHeatPumpSystem {
OnOffAirFlowRatio);

VSCoilIndex = DXHeatPumpSystem(DXSystemNum).HeatPumpCoilIndex;
NumOfSpeeds = VarSpeedCoil(VSCoilIndex).NumOfSpeeds;
NumOfSpeeds = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).NumOfSpeeds;

NoOutput = Node(InletNode).MassFlowRate * (PsyHFnTdbW(Node(OutletNode).Temp, Node(OutletNode).HumRat) -
PsyHFnTdbW(Node(InletNode).Temp, Node(OutletNode).HumRat));
@@ -861,7 +860,7 @@ namespace HVACDXHeatPumpSystem {
// OutletTempDXCoil is the full capacity outlet temperature at PartLoadFrac = 1 from the CALL above. If this
// temp is greater than the desired outlet temp, then run the compressor at PartLoadFrac = 1, otherwise find the
// operating PLR.
OutletTempDXCoil = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;
OutletTempDXCoil = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;
if (OutletTempDXCoil < DesOutTemp) {
PartLoadFrac = 1.0;
SpeedNum = NumOfSpeeds;
@@ -885,7 +884,7 @@ namespace HVACDXHeatPumpSystem {
QLatReq,
OnOffAirFlowRatio);

TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;
TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;

if ((TempSpeedOut - DesOutTemp) < Acc) {
// Check to see which speed to meet the load
@@ -908,7 +907,7 @@ namespace HVACDXHeatPumpSystem {
QLatReq,
OnOffAirFlowRatio);

TempSpeedOut = VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;
TempSpeedOut = state.dataVariableSpeedCoils->VarSpeedCoil(VSCoilIndex).OutletAirDBTemp;

if ((TempSpeedOut - DesOutTemp) > Acc) {
SpeedNum = I;
@@ -1156,7 +1155,6 @@ namespace HVACDXHeatPumpSystem {
// na
// Using/Aliasing
using VariableSpeedCoils::SimVariableSpeedCoils;
using VariableSpeedCoils::VarSpeedCoil;

// Return value
Real64 Residuum; // residual to be minimized to zero
@@ -1207,7 +1205,7 @@ namespace HVACDXHeatPumpSystem {
QLatReq,
OnOffAirFlowRatio);

OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp;
OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp;
Residuum = Par(2) - OutletAirTemp;

return Residuum;
@@ -1235,7 +1233,6 @@ namespace HVACDXHeatPumpSystem {
// na
// Using/Aliasing
using VariableSpeedCoils::SimVariableSpeedCoils;
using VariableSpeedCoils::VarSpeedCoil;

// Return value
Real64 Residuum; // residual to be minimized to zero
@@ -1287,7 +1284,7 @@ namespace HVACDXHeatPumpSystem {
QLatReq,
OnOffAirFlowRatio);

OutletAirTemp = VarSpeedCoil(CoilIndex).OutletAirDBTemp;
OutletAirTemp = state.dataVariableSpeedCoils->VarSpeedCoil(CoilIndex).OutletAirDBTemp;
Residuum = Par(2) - OutletAirTemp;

return Residuum;
Loading