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 DataWater #8360

Merged
merged 8 commits into from
Nov 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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