Skip to content

Commit

Permalink
Merge pull request #8360 from NREL/global_dataWater
Browse files Browse the repository at this point in the history
Global DataWater
  • Loading branch information
mitchute authored Nov 5, 2020
2 parents cfdf320 + baa8cc0 commit 649ab48
Show file tree
Hide file tree
Showing 31 changed files with 638 additions and 1,015 deletions.
1 change: 0 additions & 1 deletion src/EnergyPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,6 @@ SET( SRC
DataVectorTypes.hh
DataViewFactorInformation.cc
DataViewFactorInformation.hh
DataWater.cc
DataWater.hh
DataWindowEquivalentLayer.cc
DataWindowEquivalentLayer.hh
Expand Down
12 changes: 6 additions & 6 deletions src/EnergyPlus/Coils/CoilCoolingDX.cc
Original file line number Diff line number Diff line change
Expand Up @@ -497,11 +497,11 @@ void CoilCoolingDX::simulate(EnergyPlus::EnergyPlusData &state, int useAlternate
Real64 outHumidityRatio = evapOutletNode.HumRat;
this->condensateVolumeFlow = max(0.0, (evapInletNode.MassFlowRate * (inHumidityRatio - outHumidityRatio) / waterDensity));
this->condensateVolumeConsumption = this->condensateVolumeFlow * reportingConstant;
DataWater::WaterStorage(this->condensateTankIndex).VdotAvailSupply(this->condensateTankSupplyARRID) = this->condensateVolumeFlow;
DataWater::WaterStorage(this->condensateTankIndex).TwaterSupply(this->condensateTankSupplyARRID) = evapOutletNode.Temp;
state.dataWaterData->WaterStorage(this->condensateTankIndex).VdotAvailSupply(this->condensateTankSupplyARRID) = this->condensateVolumeFlow;
state.dataWaterData->WaterStorage(this->condensateTankIndex).TwaterSupply(this->condensateTankSupplyARRID) = evapOutletNode.Temp;
} else {
DataWater::WaterStorage(this->condensateTankIndex).VdotAvailSupply(this->condensateTankSupplyARRID) = 0.0;
DataWater::WaterStorage(this->condensateTankIndex).TwaterSupply(this->condensateTankSupplyARRID) = evapOutletNode.Temp;
state.dataWaterData->WaterStorage(this->condensateTankIndex).VdotAvailSupply(this->condensateTankSupplyARRID) = 0.0;
state.dataWaterData->WaterStorage(this->condensateTankIndex).TwaterSupply(this->condensateTankSupplyARRID) = evapOutletNode.Temp;
}
}

Expand All @@ -519,10 +519,10 @@ void CoilCoolingDX::simulate(EnergyPlus::EnergyPlusData &state, int useAlternate
if (useAlternateMode == DataHVACGlobals::coilNormalMode) {
this->evapCondPumpElecPower = this->performance.normalMode.getCurrentEvapCondPumpPower(speedNum);
}
DataWater::WaterStorage(this->evaporativeCondSupplyTankIndex).VdotRequestDemand(this->evaporativeCondSupplyTankARRID) =
state.dataWaterData->WaterStorage(this->evaporativeCondSupplyTankIndex).VdotRequestDemand(this->evaporativeCondSupplyTankARRID) =
this->evaporativeCondSupplyTankVolumeFlow;
} else {
DataWater::WaterStorage(this->evaporativeCondSupplyTankIndex).VdotRequestDemand(this->evaporativeCondSupplyTankARRID) = 0.0;
state.dataWaterData->WaterStorage(this->evaporativeCondSupplyTankIndex).VdotRequestDemand(this->evaporativeCondSupplyTankARRID) = 0.0;
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/CondenserLoopTowers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5844,10 +5844,10 @@ namespace CondenserLoopTowers {
if (this->SuppliedByWaterSystem) {

// set demand request
DataWater::WaterStorage(this->WaterTankID).VdotRequestDemand(this->WaterTankDemandARRID) = makeUpVdot;
state.dataWaterData->WaterStorage(this->WaterTankID).VdotRequestDemand(this->WaterTankDemandARRID) = makeUpVdot;

Real64 const AvailTankVdot =
DataWater::WaterStorage(this->WaterTankID).VdotAvailDemand(this->WaterTankDemandARRID); // check what tank can currently provide
state.dataWaterData->WaterStorage(this->WaterTankID).VdotAvailDemand(this->WaterTankDemandARRID); // check what tank can currently provide

tankSupplyVdot = makeUpVdot; // init
if (AvailTankVdot < makeUpVdot) { // calculate starved flow
Expand Down
4 changes: 2 additions & 2 deletions src/EnergyPlus/CoolTower.cc
Original file line number Diff line number Diff line change
Expand Up @@ -691,13 +691,13 @@ namespace CoolTower {

// Set the demand request for supply water from water storage tank (if needed)
if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupplyMode == WaterSupplyMode::FromTank) {
WaterStorage(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupTankID).VdotRequestDemand(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupTankID).VdotRequestDemand(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterTankDemandARRID) =
state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterConsumpRate;
}

// check if should be starved by restricted flow from tank
if (state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupplyMode == WaterSupplyMode::FromTank) {
AvailWaterRate = WaterStorage(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupTankID)
AvailWaterRate = state.dataWaterData->WaterStorage(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterSupTankID)
.VdotAvailDemand(state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterTankDemandARRID);
if (AvailWaterRate < state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterConsumpRate) {
state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterStarvMakeupRate = state.dataCoolTower->CoolTowerSys(CoolTowerNum).CoolTWaterConsumpRate - AvailWaterRate;
Expand Down
22 changes: 7 additions & 15 deletions src/EnergyPlus/DXCoils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8395,7 +8395,6 @@ namespace DXCoils {
using DataHVACGlobals::HPWHCrankcaseDBTemp;
using DataHVACGlobals::SysTimeElapsed;
using DataHVACGlobals::TimeStepSys;
using DataWater::WaterStorage;
using General::CreateSysTimeIntervalString;
using General::RoundSigDigits;
using General::TrimSigDigits;
Expand Down Expand Up @@ -9312,7 +9311,7 @@ namespace DXCoils {

// set water system demand request (if needed)
if (DXCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) {
WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
DXCoil(DXCoilNum).EvapWaterConsumpRate;
}

Expand Down Expand Up @@ -9385,7 +9384,6 @@ namespace DXCoils {
using DataHVACGlobals::HPWHCrankcaseDBTemp;
using DataHVACGlobals::SysTimeElapsed;
using DataHVACGlobals::TimeStepSys;
using DataWater::WaterStorage;
using General::CreateSysTimeIntervalString;
using General::RoundSigDigits;
using General::TrimSigDigits;
Expand Down Expand Up @@ -9971,7 +9969,7 @@ namespace DXCoils {

// set water system demand request (if needed)
if (DXCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) {
WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
DXCoil(DXCoilNum).EvapWaterConsumpRate;
}

Expand Down Expand Up @@ -10496,8 +10494,6 @@ namespace DXCoils {
using CurveManager::CurveValue;
using DataHeatBalFanSys::ZoneAirHumRat;
using DataHeatBalFanSys::ZT;
using DataWater::WaterStorage;
// USE ScheduleManager, ONLY: GetCurrentScheduleValue

// SUBROUTINE ARGUMENT DEFINITIONS:
// SpeedRatio varies between 1.0 (maximum speed) and 0.0 (minimum speed)
Expand Down Expand Up @@ -10933,7 +10929,7 @@ namespace DXCoils {
// set water system demand request (if needed)
if (DXCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) {

WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
DXCoil(DXCoilNum).EvapWaterConsumpRate;
}

Expand Down Expand Up @@ -11711,7 +11707,6 @@ namespace DXCoils {
using DataHVACGlobals::MSHPMassFlowRateHigh;
using DataHVACGlobals::MSHPMassFlowRateLow;
using DataHVACGlobals::MSHPWasteHeat;
using DataWater::WaterStorage;
using General::RoundSigDigits;
using General::TrimSigDigits;

Expand Down Expand Up @@ -12451,7 +12446,7 @@ namespace DXCoils {
DXCoil(DXCoilNum).EvapCondPumpElecPower = EvapCondPumpElecPower;
// set water system demand request (if needed)
if (DXCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) {
WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
DXCoil(DXCoilNum).EvapWaterConsumpRate;
}

Expand Down Expand Up @@ -12543,7 +12538,6 @@ namespace DXCoils {
using DataHVACGlobals::MSHPMassFlowRateHigh;
using DataHVACGlobals::MSHPMassFlowRateLow;
using DataHVACGlobals::MSHPWasteHeat;
using DataWater::WaterStorage;
using General::RoundSigDigits;
using General::TrimSigDigits;

Expand Down Expand Up @@ -13287,7 +13281,6 @@ namespace DXCoils {
using DataHVACGlobals::DXElecCoolingPower;
using DataHVACGlobals::DXElecHeatingPower;
using DataHVACGlobals::TimeStepSys;
using DataWater::WaterStorage;
using Psychrometrics::RhoH2O;

// SUBROUTINE LOCAL VARIABLE DECLARATIONS:
Expand Down Expand Up @@ -13390,9 +13383,9 @@ namespace DXCoils {
DXCoil(DXCoilNum).CondensateVdot = max(0.0, (DXCoil(DXCoilNum).InletAirMassFlowRate * (SpecHumIn - SpecHumOut) / RhoWater));
DXCoil(DXCoilNum).CondensateVol = DXCoil(DXCoilNum).CondensateVdot * ReportingConstant;

WaterStorage(DXCoil(DXCoilNum).CondensateTankID).VdotAvailSupply(DXCoil(DXCoilNum).CondensateTankSupplyARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).CondensateTankID).VdotAvailSupply(DXCoil(DXCoilNum).CondensateTankSupplyARRID) =
DXCoil(DXCoilNum).CondensateVdot;
WaterStorage(DXCoil(DXCoilNum).CondensateTankID).TwaterSupply(DXCoil(DXCoilNum).CondensateTankSupplyARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).CondensateTankID).TwaterSupply(DXCoil(DXCoilNum).CondensateTankSupplyARRID) =
DXCoil(DXCoilNum).OutletAirTemp;
}

Expand Down Expand Up @@ -15680,7 +15673,6 @@ namespace DXCoils {
using DataHVACGlobals::HPWHCrankcaseDBTemp;
using DataHVACGlobals::SysTimeElapsed;
using DataHVACGlobals::TimeStepSys;
using DataWater::WaterStorage;
using General::CreateSysTimeIntervalString;
using General::RoundSigDigits;
using General::TrimSigDigits;
Expand Down Expand Up @@ -16093,7 +16085,7 @@ namespace DXCoils {

// set water system demand request (if needed)
if (DXCoil(DXCoilNum).EvapWaterSupplyMode == WaterSupplyFromTank) {
WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
state.dataWaterData->WaterStorage(DXCoil(DXCoilNum).EvapWaterSupTankID).VdotRequestDemand(DXCoil(DXCoilNum).EvapWaterTankDemandARRID) =
DXCoil(DXCoilNum).EvapWaterConsumpRate;
}

Expand Down
1 change: 1 addition & 0 deletions src/EnergyPlus/Data/CommonIncludes.hh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
#include <EnergyPlus/CurveManager.hh>
#include <EnergyPlus/DataAirLoop.hh>
#include <EnergyPlus/DataGlobals.hh>
#include <EnergyPlus/DataWater.hh>
#include <EnergyPlus/ExteriorEnergyUse.hh>
#include <EnergyPlus/Fans.hh>
#include <EnergyPlus/Pipes.hh>
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace EnergyPlus {
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->dataWaterData = std::unique_ptr<DataWaterData>(new DataWaterData);
this->dataWaterManager = std::unique_ptr<WaterManagerData>(new WaterManagerData);
this->dataWaterThermalTanks = std::unique_ptr<WaterThermalTanksData>(new WaterThermalTanksData);
this->dataWaterToAirHeatPump = std::unique_ptr<WaterToAirHeatPumpData>(new WaterToAirHeatPumpData);
Expand Down Expand Up @@ -171,6 +172,7 @@ namespace EnergyPlus {
this->dataVariableSpeedCoils->clear_state();
this->dataVentilatedSlab->clear_state();
this->dataWaterCoils->clear_state();
this->dataWaterData->clear_state();
this->dataWaterManager->clear_state();
this->dataWaterThermalTanks->clear_state();
this->dataWaterToAirHeatPump->clear_state();
Expand Down
2 changes: 2 additions & 0 deletions src/EnergyPlus/Data/EnergyPlusData.hh
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ struct CTElectricGeneratorData;
struct CurveManagerData;
struct DataAirLoopData;
struct DataGlobal;
struct DataWaterData;
struct ExteriorEnergyUseData;
struct FansData;
struct PipesData;
Expand Down Expand Up @@ -160,6 +161,7 @@ struct EnergyPlusData : BaseGlobalStruct {
std::unique_ptr<CurveManagerData> dataCurveManager;
std::unique_ptr<DataAirLoopData> dataAirLoop;
std::unique_ptr<DataGlobal> dataGlobal;
std::unique_ptr<DataWaterData> dataWaterData;
std::unique_ptr<ExteriorEnergyUseData> dataExteriorEnergyUse;
std::unique_ptr<FansData> dataFans;
std::unique_ptr<PipesData> dataPipes;
Expand Down
Loading

5 comments on commit 649ab48

@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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2292 of 2292 tests passed, 0 test warnings)

Build Badge Test 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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1553 of 1553 tests passed, 0 test warnings)

Build Badge Test Badge Coverage 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.

develop (mitchute) - Win64-Windows-10-VisualStudio-16: OK (2245 of 2245 tests passed, 0 test warnings)

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.

develop (mitchute) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (721 of 722 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 721
  • Timeout: 1

Build Badge Test Badge Coverage 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.

develop (mitchute) - x86_64-MacOS-10.15-clang-11.0.0: OK (2272 of 2272 tests passed, 0 test warnings)

Build Badge Test Badge

Please sign in to comment.