Skip to content

Commit

Permalink
Merge pull request #8267 from NREL/global_water_to_air
Browse files Browse the repository at this point in the history
Global WaterToAir
  • Loading branch information
Myoldmopar authored Sep 29, 2020
2 parents 998c4b7 + 70c7f85 commit 4af87a0
Show file tree
Hide file tree
Showing 230 changed files with 11,558 additions and 12,196 deletions.
52 changes: 25 additions & 27 deletions src/EnergyPlus/AirLoopHVACDOAS.cc
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ namespace AirLoopHVACDOAS {
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag);
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state,
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag);
thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("COIL:COOLING:WATER", CompName, errorsFound);
thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, "COIL:COOLING:WATER", CompName, errorsFound);
if (errorsFound) {
ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " +
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum));
Expand All @@ -494,7 +494,7 @@ namespace AirLoopHVACDOAS {
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag);
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state,
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag);
thisDOAS.HWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("Coil:Heating:Water", CompName, errorsFound);
thisDOAS.HWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, "Coil:Heating:Water", CompName, errorsFound);
if (errorsFound) {
ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " +
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum));
Expand Down Expand Up @@ -526,7 +526,7 @@ namespace AirLoopHVACDOAS {
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), InletNodeErrFlag);
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).OutletNodeNum(CompNum) = WaterCoils::GetCoilOutletNode(state,
SELECT_CASE_var, state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum), OutletNodeErrFlag);
thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode("Coil:Cooling:Water:DetailedGeometry", CompName, errorsFound);
thisDOAS.CWCtrlNodeNum = WaterCoils::GetCoilWaterInletNode(state, "Coil:Cooling:Water:DetailedGeometry", CompName, errorsFound);
if (errorsFound) {
ShowContinueError("The control node number is not found in " + CurrentModuleObject + " = " +
state.dataAirLoop->OutsideAirSys(thisDOAS.m_OASystemNum).ComponentName(CompNum));
Expand Down Expand Up @@ -810,7 +810,7 @@ namespace AirLoopHVACDOAS {

if (UtilityRoutines::SameString(CompType, "COIL:HEATING:WATER")) {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_HeatCoilNum);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate("Coil:Heating:Water", CompName, ErrorsFound);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Heating:Water", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->HWLoopNum).FluidName,
DataGlobals::HWInitConvTemp,
DataPlant::PlantLoop(this->HWLoopNum).FluidIndex,
Expand All @@ -826,7 +826,7 @@ namespace AirLoopHVACDOAS {
}
if (UtilityRoutines::SameString(CompType, "COIL:COOLING:WATER")) {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate("Coil:Cooling:Water", CompName, ErrorsFound);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CWLoopNum).FluidIndex,
Expand All @@ -842,7 +842,7 @@ namespace AirLoopHVACDOAS {
}
if (UtilityRoutines::SameString(CompType, "COIL:COOLING:WATER:DETAILEDGEOMETRY")) {
WaterCoils::SimulateWaterCoilComponents(state, CompName, FirstHVACIteration, this->m_CoolCoilNum);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate("Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound);
Real64 CoilMaxVolFlowRate = WaterCoils::GetCoilMaxWaterFlowRate(state, "Coil:Cooling:Water:DetailedGeometry", CompName, ErrorsFound);
rho = FluidProperties::GetDensityGlycol(DataPlant::PlantLoop(this->CWLoopNum).FluidName,
DataGlobals::CWInitConvTemp,
DataPlant::PlantLoop(this->CWLoopNum).FluidIndex,
Expand Down Expand Up @@ -923,7 +923,7 @@ namespace AirLoopHVACDOAS {
}
}
this->SizingMassFlow = sizingMassFlow;
this->GetDesignDayConditions();
this->GetDesignDayConditions(state);

if (this->m_FanIndex > -1 && this->m_FanTypeNum == SimAirServingZones::Fan_System_Object) {
HVACFan::fanObjs[this->m_FanIndex]->designAirVolFlowRate = sizingMassFlow / DataEnvironment::StdRhoAir;
Expand Down Expand Up @@ -954,40 +954,38 @@ namespace AirLoopHVACDOAS {
}
}

void AirLoopDOAS::GetDesignDayConditions()
void AirLoopDOAS::GetDesignDayConditions(EnergyPlusData &state)
{
// Using/Aliasing
using WeatherManager::DesDayInput;

int const summerDesignDayTypeIndex(9);
int const winterDesignDayTypeIndex(10);
bool static SummerDesignDayFlag = true;
bool static WinterDesignDayFlag = true;

for (size_t i = 1; i <= DesDayInput.size(); i++) {
for (size_t i = 1; i <= state.dataWeatherManager->DesDayInput.size(); i++) {
// Summer design day
if (DesDayInput(i).DayType == summerDesignDayTypeIndex && SummerDesignDayFlag) {
this->SizingCoolOATemp = DesDayInput(i).MaxDryBulb;
if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::WetBulb) { // wet bulb temperature
if (state.dataWeatherManager->DesDayInput(i).DayType == summerDesignDayTypeIndex && SummerDesignDayFlag) {
this->SizingCoolOATemp = state.dataWeatherManager->DesDayInput(i).MaxDryBulb;
if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::WetBulb) { // wet bulb temperature
this->SizingCoolOAHumRat =
Psychrometrics::PsyWFnTdbTwbPb(this->SizingCoolOATemp, DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::DewPoint) { // dewpoint
this->SizingCoolOAHumRat = Psychrometrics::PsyWFnTdpPb(DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::HumRatio) {
this->SizingCoolOAHumRat = DesDayInput(i).HumIndValue;
Psychrometrics::PsyWFnTdbTwbPb(this->SizingCoolOATemp, state.dataWeatherManager->DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::DewPoint) { // dewpoint
this->SizingCoolOAHumRat = Psychrometrics::PsyWFnTdpPb(state.dataWeatherManager->DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::HumRatio) {
this->SizingCoolOAHumRat = state.dataWeatherManager->DesDayInput(i).HumIndValue;
} // else { // What about other cases?
SummerDesignDayFlag = false;
}
// Winter design day
if (DesDayInput(i).DayType == winterDesignDayTypeIndex && WinterDesignDayFlag) {
this->HeatOutTemp = DesDayInput(i).MaxDryBulb;
if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::WetBulb) { // wet bulb temperature
if (state.dataWeatherManager->DesDayInput(i).DayType == winterDesignDayTypeIndex && WinterDesignDayFlag) {
this->HeatOutTemp = state.dataWeatherManager->DesDayInput(i).MaxDryBulb;
if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::WetBulb) { // wet bulb temperature
this->HeatOutHumRat =
Psychrometrics::PsyWFnTdbTwbPb(this->HeatOutTemp, DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::DewPoint) { // dewpoint
this->HeatOutHumRat = Psychrometrics::PsyWFnTdpPb(DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::HumRatio) {
this->HeatOutHumRat = DesDayInput(i).HumIndValue;
Psychrometrics::PsyWFnTdbTwbPb(this->HeatOutTemp, state.dataWeatherManager->DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::DewPoint) { // dewpoint
this->HeatOutHumRat = Psychrometrics::PsyWFnTdpPb(state.dataWeatherManager->DesDayInput(i).HumIndValue, DataEnvironment::StdPressureSeaLevel);
} else if (state.dataWeatherManager->DesDayInput(i).HumIndType == WeatherManager::DDHumIndType::HumRatio) {
this->HeatOutHumRat = state.dataWeatherManager->DesDayInput(i).HumIndValue;
} // else { // What about other cases?
WinterDesignDayFlag = false;
}
Expand Down
6 changes: 3 additions & 3 deletions src/EnergyPlus/AirLoopHVACDOAS.hh
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@

namespace EnergyPlus {

// forward declarations
struct EnergyPlusData;
// forward declarations
struct EnergyPlusData;

namespace AirLoopHVACDOAS {

Expand Down Expand Up @@ -195,7 +195,7 @@ namespace AirLoopHVACDOAS {

void SizingAirLoopDOAS(EnergyPlusData &state);

void GetDesignDayConditions();
void GetDesignDayConditions(EnergyPlusData &state);
};

int getAirLoopMixerIndex(EnergyPlusData &state, std::string const &objectName);
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/AirflowNetworkBalanceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9567,7 +9567,7 @@ namespace AirflowNetworkBalanceManager {
for (i = 1; i <= NumOfNodes; ++i) {
if (NodeFound(i)) continue;
// Skip the inlet and outlet nodes of zone dehumidifiers
if (GetZoneDehumidifierNodeNumber(state, state.dataZoneDehumidifier, i)) NodeFound(i) = true;
if (GetZoneDehumidifierNodeNumber(state, *state.dataZoneDehumidifier, i)) NodeFound(i) = true;

for (j = 1; j <= NumOfZones; ++j) {
if (!ZoneEquipConfig(j).IsControlled) continue;
Expand Down
2 changes: 1 addition & 1 deletion src/EnergyPlus/Autosizing/BaseSizerWithScalableInputs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

//#include <EnergyPlus/Autosizing/Base.hh>
#include <EnergyPlus/Autosizing/BaseSizerWithFanHeatInputs.hh>
#include <EnergyPlus/Autosizing/BaseSizerWithScalableInputs.hh>
#include <EnergyPlus/Data/EnergyPlusData.hh>
#include <EnergyPlus/DataHeatBalance.hh>
#include <EnergyPlus/HVACFan.hh>
#include <string>

Expand Down
Loading

5 comments on commit 4af87a0

@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 (Myoldmopar) - x86_64-MacOS-10.15-clang-11.0.0: OK (2267 of 2267 tests passed, 0 test warnings)

Build Badge Test Badge

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

develop (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5: OK (2287 of 2287 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 (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-UnitTestsCoverage-Debug: OK (1548 of 1548 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 (Myoldmopar) - Win64-Windows-10-VisualStudio-16: OK (2240 of 2240 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 (Myoldmopar) - x86_64-Linux-Ubuntu-18.04-gcc-7.5-IntegrationCoverage-Debug: OK (722 of 722 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.