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 WaterToAir #8267

Merged
merged 26 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e0b6e32
Merge remote-tracking branch 'origin/develop' into global_weather_man…
brianlball Aug 20, 2020
589b31b
temp commit
brianlball Aug 22, 2020
459a180
energypluslib compiles but api does not
brianlball Aug 22, 2020
3df2a7a
testing
brianlball Aug 22, 2020
bd74bf3
convert to Impl
brianlball Aug 23, 2020
ddab3ff
compiles windows
brianlball Aug 23, 2020
abde03d
Merge remote-tracking branch 'origin/develop' into global_weather_man…
brianlball Aug 23, 2020
8d3da42
address warnings
brianlball Aug 24, 2020
00eaed2
use state
brianlball Aug 24, 2020
b5713cd
API
brianlball Aug 24, 2020
e53fcea
all of API
brianlball Aug 24, 2020
9d660ce
convert WaterToAirHeatPumpSimple
brianlball Aug 25, 2020
6f091fe
WaterToAirHeatPump
brianlball Aug 26, 2020
d5a7a4c
waterthermaltanks
brianlball Aug 26, 2020
1e3870f
water manager
brianlball Aug 27, 2020
97b56db
watercoils
brianlball Aug 27, 2020
be0b3cf
Merge remote-tracking branch 'origin/develop' into global_water_to_air
brianlball Aug 27, 2020
c92d64b
Merge remote-tracking branch 'origin/global_dataairloop' into global_…
brianlball Aug 28, 2020
fdb6ed9
remove unused
brianlball Aug 28, 2020
0d3adc4
Merge branch 'global_dataairloop' into global_water_to_air
mitchute Sep 8, 2020
44e81d8
Merge branch 'develop' into global_water_to_air
mitchute Sep 9, 2020
fbbb531
Merge branch 'develop' into global_water_to_air
mitchute Sep 11, 2020
6896b97
Merge branch 'develop' into global_water_to_air
mitchute Sep 21, 2020
8e3966c
Merge branch 'develop' into global_water_to_air
mitchute Sep 21, 2020
58ec6c1
Merge develop; resolve conflicts
mitchute Sep 29, 2020
70c7f85
Merge branch 'develop' into global_water_to_air
mitchute Sep 29, 2020
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
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