Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into fixIncSolarMultiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
yujiex committed Sep 19, 2023
2 parents 3a15486 + 944be33 commit ffcf657
Show file tree
Hide file tree
Showing 217 changed files with 10,397 additions and 28,121 deletions.
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ cmake_policy(SET CMP0048 NEW) # handling project_version_* variables
project(EnergyPlus)

# Raise an error if attempting to compile on macOS older than 10.15 - it does not work
if (APPLE AND CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.15")
message(FATAL_ERROR "The minimum required version for macOS is 10.15, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 or greater and try again.")
if (APPLE)
if(NOT CMAKE_OSX_DEPLOYMENT_TARGET)
message(FATAL_ERROR "CMAKE_OSX_DEPLOYMENT_TARGET not set. Please set CMAKE_OSX_DEPLOYMENT_TARGET to 10.15 or greater and try again.")
elseif (CMAKE_OSX_DEPLOYMENT_TARGET VERSION_LESS "10.15")
message(FATAL_ERROR "The minimum required version for macOS is 10.15, however CMAKE_OSX_DEPLOYMENT_TARGET is set to ${CMAKE_OSX_DEPLOYMENT_TARGET}.")
endif()
endif()

if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} VERSION_GREATER "3.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ \subsection{Built-In Variables}\label{built-in-variables}
\midrule
\endhead

Year & 1900--2100 \tabularnewline
Year & 1900--2100 (Read from EPW) \tabularnewline
CalendarYear & 1900--2100 (Assigned from RunPeriod - only valid for Weather File Run Periods) \tabularnewline
Month & 1--12 \tabularnewline
DayOfMonth & 1--31 \tabularnewline
DayOfWeek & 1--7 (1 = Sun, 2 = Mon, \ldots) \tabularnewline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3341,7 +3341,7 @@ \subsubsection{Surface Inside Face Conduction Heat Loss Rate {[}W{]}}\label{surf

These ``inside face conduction'' output variables describe heat flow by conduction right at the inside face of an opaque heat transfer surface. A positive value means that the conduction is from just inside the inside face toward the inside face. A negative value means that the conduction is from the inside face into the core of the heat transfer surface.

Note that Inside Face Conduction, when positive, does \textbf{not} indicate the heat flow from the surface to the zone air, which is governed by the inside face convection coefficient and the difference in temperature between the inside face and the zone air.
Note that Inside Face Conduction, when positive, does \textbf{not} necessarily indicate the heat flow from the surface to the zone air, which is governed by the inside face convection coefficient, the difference in temperature between the inside face and the zone air, and various radiation terms due to solar, internal gains, and radiant exchange with other surfaces in the zone.

Different versions of the reports are available. The basic heat gain rate (W) and a per unit area flux (W/m\(^{2}\)) can have positive or negative values with the sign convention that positive indicates heat flowing toward the face itself. There are also directed ``gain'' and ``loss'' versions that have only positive values or zero when the heat flow direction opposes.

Expand All @@ -3359,7 +3359,9 @@ \subsubsection{Surface Outside Face Conduction Heat Loss Rate {[}W{]}}\label{sur

These ``outside face conduction'' output variables describe heat flow by conduction right at the outside face of an opaque heat transfer surface. A positive value means that the conduction is from just inside the outside face toward the outside face. A negative value means that the conduction is from the outside face into the core of the heat transfer surface.

Note that outside face conduction, when positive, does \textbf{not} indicate the heat flow from the surface to the surrounding air, which is governed by the outside face convection coefficient and the difference in temperature between the inside face and the surrounding air.
Note that outside face conduction, when positive, does \textbf{not} necessarily indicate the heat flow from the surface to the surrounding air, due to the fact that there could be various terms such as convection and/or radiation terms based on whatever is the ''outside'' environment for this surface.

When the surface in question is a partition, the output for this variable is set to zero because there is no outside face because the surface is fully exposed to the zone. When the surface is an interzone partition, the value will be non-zero because there will potentially be conduction into or out of the zone on the other side at this surface.

Different versions of the reports are available. The basic heat transfer rate (W) and a per unit area flux (W/m\(^{2}\)) can have positive or negative values with the sign convention that positive indicates heat flowing toward the face itself. There are also directed ``gain'' and ``loss'' versions that have only positive values or zero when the heat flow direction opposes.

Expand Down
3 changes: 2 additions & 1 deletion doc/readthedocs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sphinx-rtd-theme
sphinx>3
urllib3==1.26.15
Jinja2<3.1 # cannot import name 'environmentfilter' from 'jinja2'
urllib3==1.26.15
2 changes: 1 addition & 1 deletion doc/readthedocs/sphinx/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
# # OK, now we need to make sure the epJSON schema is generated so we can process it
# Since this will primarily just be run by readthedocs, I'm just going to re-run the schema generator
try:
check_call(['python3', 'scripts/dev/generate_epJSON_schema/generate_epJSON_schema.py', 'idd'], cwd=repo_root)
check_call(['python3', 'idd/schema/generate_epJSON_schema.py', 'idd'], cwd=repo_root)
except CalledProcessError as e:
raise Exception(f"Schema Generation failed! Exception string: {str(e)}") from None
except FileNotFoundError as e:
Expand Down
8 changes: 6 additions & 2 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -100940,7 +100940,9 @@ LifeCycleCost:UsePriceEscalation,
\key ElectricitySurplusSold
\key ElectricityNet
\key NaturalGas
\key Steam
\key DistrictCooling
\key DistrictHeatingWater
\key DistrictHeatingSteam
\key Gasoline
\key Diesel
\key Coal
Expand Down Expand Up @@ -101028,7 +101030,9 @@ LifeCycleCost:UseAdjustment,
\key ElectricitySurplusSold
\key ElectricityNet
\key NaturalGas
\key Steam
\key DistrictCooling
\key DistrictHeatingWater
\key DistrictHeatingSteam
\key Gasoline
\key Diesel
\key Coal
Expand Down
112 changes: 45 additions & 67 deletions src/EnergyPlus/ChillerExhaustAbsorption.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1874,86 +1874,64 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo
// all variables that are local copies of data structure
// variables are prefaced with an "l" for local.
// Local copies of ExhaustAbsorberReportVars Type
Real64 lHotWaterReturnTemp(0.0);
Real64 lHeatingLoad(0.0); // heating load on the chiller
Real64 lHeatThermalEnergyUseRate(0.0); // instantaneous use of thermal energy for period for heating
Real64 lHeatElectricPower(0.0); // parasitic electric power used for heating
Real64 lHotWaterSupplyTemp(0.0); // reporting: hot water supply (outlet) temperature
Real64 lHotWaterMassFlowRate(0.0); // reporting: hot water mass flow rate
Real64 lHeatPartLoadRatio(0.0); // operating part load ratio (load/capacity for heating)
Real64 lAvailableHeatingCapacity(0.0); // current heating capacity
Real64 lFractionOfPeriodRunning(0.0);
Real64 lExhaustInTemp(0.0); // Exhaust inlet temperature
Real64 lExhaustInFlow(0.0); // Exhaust inlet flow rate
Real64 lExhHeatRecPotentialHeat(0.0); // Exhaust heat recovery potential
Real64 lExhaustAirHumRat(0.0);
// other local variables
Real64 HeatSupplySetPointTemp(0.0);

// set node values to data structure values for nodes

int lHeatReturnNodeNum = this->HeatReturnNodeNum;
int lHeatSupplyNodeNum = this->HeatSupplyNodeNum;
int lExhaustAirInletNodeNum = this->ExhaustAirInletNodeNum;

// set local copies of data from rest of input structure

Real64 lNomCoolingCap = this->NomCoolingCap; // W - design nominal capacity of Absorber
Real64 lNomHeatCoolRatio = this->NomHeatCoolRatio; // ratio of heating to cooling capacity
Real64 lThermalEnergyHeatRatio = this->ThermalEnergyHeatRatio; // ratio of ThermalEnergy input to heating output
Real64 lElecHeatRatio = this->ElecHeatRatio; // ratio of electricity input to heating output
Real64 lMinPartLoadRat = this->MinPartLoadRat; // min allowed operating frac full load
Real64 lMaxPartLoadRat = this->MaxPartLoadRat; // max allowed operating frac full load
int lHeatCapFCoolCurve = this->HeatCapFCoolCurve; // Heating Capacity Function of Cooling Capacity Curve
int lThermalEnergyHeatFHPLRCurve = this->ThermalEnergyHeatFHPLRCurve; // ThermalEnergy Input to heat output ratio during heating only function
int LoopNum = this->HWPlantLoc.loopNum;
DataPlant::LoopSideLocation LoopSideNum = this->HWPlantLoc.loopSideNum;

Real64 Cp_HW = FluidProperties::GetSpecificHeatGlycol(
state, state.dataPlnt->PlantLoop(LoopNum).FluidName, lHotWaterReturnTemp, state.dataPlnt->PlantLoop(LoopNum).FluidIndex, RoutineName);

Real64 lCoolElectricPower = this->CoolElectricPower; // parasitic electric power used for cooling
Real64 lCoolThermalEnergyUseRate = this->CoolThermalEnergyUseRate; // instantaneous use of thermal energy for period for cooling
Real64 lCoolPartLoadRatio = this->CoolPartLoadRatio;

// initialize entering conditions
lHotWaterReturnTemp = state.dataLoopNodes->Node(lHeatReturnNodeNum).Temp;
lHotWaterMassFlowRate = state.dataLoopNodes->Node(lHeatReturnNodeNum).MassFlowRate;
switch (state.dataPlnt->PlantLoop(LoopNum).LoopDemandCalcScheme) {
case DataPlant::LoopDemandCalcScheme::SingleSetPoint: {
HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPoint;
} break;
case DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand: {
HeatSupplySetPointTemp = state.dataLoopNodes->Node(lHeatSupplyNodeNum).TempSetPointLo;
} break;
default: {
assert(false);
} break;
}
Real64 HeatDeltaTemp = std::abs(lHotWaterReturnTemp - HeatSupplySetPointTemp);
auto &hwPlantLoop = state.dataPlnt->PlantLoop(this->HWPlantLoc.loopNum);
const Real64 HeatSupplySetPointTemp = [this, &hwPlantLoop, &state]() {
switch (hwPlantLoop.LoopDemandCalcScheme) {
case DataPlant::LoopDemandCalcScheme::SingleSetPoint: {
return state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPoint;
}
case DataPlant::LoopDemandCalcScheme::DualSetPointDeadBand: {
return state.dataLoopNodes->Node(this->HeatSupplyNodeNum).TempSetPointLo;
}
default: {
assert(false);
return 0.0;
}
}
}();

auto const &heatReturnNode = state.dataLoopNodes->Node(this->HeatReturnNodeNum);
Real64 const HeatDeltaTemp = std::abs(heatReturnNode.Temp - HeatSupplySetPointTemp);
// reporting: hot water mass flow rate
Real64 lHotWaterMassFlowRate = heatReturnNode.MassFlowRate;

// If no loop demand or Absorber OFF, return
// will need to modify when absorber can act as a boiler
if (MyLoad <= 0 || !RunFlag) {
// set node temperatures
lHotWaterSupplyTemp = lHotWaterReturnTemp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
lHotWaterSupplyTemp = heatReturnNode.Temp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, this->CoolPartLoadRatio) / this->MinPartLoadRat);
} else {

Real64 const Cp_HW =
FluidProperties::GetSpecificHeatGlycol(state, hwPlantLoop.FluidName, heatReturnNode.Temp, hwPlantLoop.FluidIndex, RoutineName);

// Determine available heating capacity using the current cooling load
lAvailableHeatingCapacity =
this->NomHeatCoolRatio * this->NomCoolingCap * Curve::CurveValue(state, lHeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap));
lAvailableHeatingCapacity = this->NomHeatCoolRatio * this->NomCoolingCap *
Curve::CurveValue(state, this->HeatCapFCoolCurve, (this->CoolingLoad / this->NomCoolingCap));

// Calculate current load for heating
MyLoad = sign(max(std::abs(MyLoad), this->HeatingCapacity * lMinPartLoadRat), MyLoad);
MyLoad = sign(min(std::abs(MyLoad), this->HeatingCapacity * lMaxPartLoadRat), MyLoad);
MyLoad = sign(max(std::abs(MyLoad), this->HeatingCapacity * this->MinPartLoadRat), MyLoad);
MyLoad = sign(min(std::abs(MyLoad), this->HeatingCapacity * this->MaxPartLoadRat), MyLoad);

// Determine the following variables depending on if the flow has been set in
// the nodes (flowlock=1 to 2) or if the amount of load is still be determined (flowlock=0)
// chilled water flow,
// cooling load taken by the chiller, and
// supply temperature
switch (state.dataPlnt->PlantLoop(LoopNum).LoopSide(LoopSideNum).FlowLock) {
switch (hwPlantLoop.LoopSide(this->HWPlantLoc.loopSideNum).FlowLock) {
case DataPlant::FlowLock::Unlocked: { // mass flow rates may be changed by loop components
lHeatingLoad = std::abs(MyLoad);
if (HeatDeltaTemp != 0) {
Expand Down Expand Up @@ -1989,25 +1967,25 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo

// Calculate ThermalEnergy consumption for heating
// ThermalEnergy used for heating availCap * HIR * HIR-FT * HIR-FPLR

lHeatThermalEnergyUseRate =
lAvailableHeatingCapacity * lThermalEnergyHeatRatio * Curve::CurveValue(state, lThermalEnergyHeatFHPLRCurve, lHeatPartLoadRatio);
lHeatThermalEnergyUseRate = lAvailableHeatingCapacity * this->ThermalEnergyHeatRatio *
Curve::CurveValue(state, this->ThermalEnergyHeatFHPLRCurve, lHeatPartLoadRatio);

// calculate the fraction of the time period that the chiller would be running
// use maximum from heating and cooling sides
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, this->CoolPartLoadRatio) / this->MinPartLoadRat);

// Calculate electric parasitics used
// for heating based on nominal capacity not available capacity
lHeatElectricPower = lNomCoolingCap * lNomHeatCoolRatio * lElecHeatRatio * lFractionOfPeriodRunning;
lHeatElectricPower = this->NomCoolingCap * this->NomHeatCoolRatio * this->ElecHeatRatio * lFractionOfPeriodRunning;
// Coodinate electric parasitics for heating and cooling to avoid double counting
// Total electric is the max of heating electric or cooling electric
// If heating electric is greater, leave cooling electric and subtract if off of heating elec
// If cooling electric is greater, set heating electric to zero

lExhaustInTemp = state.dataLoopNodes->Node(lExhaustAirInletNodeNum).Temp;
lExhaustInFlow = state.dataLoopNodes->Node(lExhaustAirInletNodeNum).MassFlowRate;
Real64 CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhaustInTemp = state.dataLoopNodes->Node(this->ExhaustAirInletNodeNum).Temp;
lExhaustInFlow = state.dataLoopNodes->Node(this->ExhaustAirInletNodeNum).MassFlowRate;
Real64 const lExhaustAirHumRat = state.dataLoopNodes->Node(this->ExhaustAirInletNodeNum).HumRat;
Real64 const CpAir = Psychrometrics::PsyCpAirFnW(lExhaustAirHumRat);
lExhHeatRecPotentialHeat = lExhaustInFlow * CpAir * (lExhaustInTemp - AbsLeavingTemp);
if (lExhHeatRecPotentialHeat < lHeatThermalEnergyUseRate) {
if (this->ExhTempLTAbsLeavingHeatingTempIndex == 0) {
Expand All @@ -2032,31 +2010,31 @@ void ExhaustAbsorberSpecs::calcHeater(EnergyPlusData &state, Real64 &MyLoad, boo
// If exhaust is not available, it means the avilable thermal energy is 0.0 and Chiller is not available
lHeatThermalEnergyUseRate = 0.0;
lHeatElectricPower = 0.0;
lHotWaterSupplyTemp = lHotWaterReturnTemp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, lCoolPartLoadRatio) / lMinPartLoadRat);
lHotWaterSupplyTemp = heatReturnNode.Temp;
lFractionOfPeriodRunning = min(1.0, max(lHeatPartLoadRatio, this->CoolPartLoadRatio) / this->MinPartLoadRat);
}

if (lHeatElectricPower <= lCoolElectricPower) {
if (lHeatElectricPower <= this->CoolElectricPower) {
lHeatElectricPower = 0.0;
} else {
lHeatElectricPower -= lCoolElectricPower;
lHeatElectricPower -= this->CoolElectricPower;
}

} // IF(MyLoad==0 .OR. .NOT. RunFlag)
// Write into the Report Variables except for nodes
this->HeatingLoad = lHeatingLoad;
this->HeatThermalEnergyUseRate = lHeatThermalEnergyUseRate;
this->HeatElectricPower = lHeatElectricPower;
this->HotWaterReturnTemp = lHotWaterReturnTemp;
this->HotWaterReturnTemp = heatReturnNode.Temp;
this->HotWaterSupplyTemp = lHotWaterSupplyTemp;
this->HotWaterFlowRate = lHotWaterMassFlowRate;
this->HeatPartLoadRatio = lHeatPartLoadRatio;
this->HeatingCapacity = lAvailableHeatingCapacity;
this->FractionOfPeriodRunning = lFractionOfPeriodRunning;

// write the combined heating and cooling ThermalEnergy used and electric used
this->ThermalEnergyUseRate = lCoolThermalEnergyUseRate + lHeatThermalEnergyUseRate;
this->ElectricPower = lCoolElectricPower + lHeatElectricPower;
this->ThermalEnergyUseRate = this->CoolThermalEnergyUseRate + lHeatThermalEnergyUseRate;
this->ElectricPower = this->CoolElectricPower + lHeatElectricPower;
this->ExhaustInTemp = lExhaustInTemp;
this->ExhaustInFlow = lExhaustInFlow;
this->ExhHeatRecPotentialHeat = lExhHeatRecPotentialHeat;
Expand Down
2 changes: 0 additions & 2 deletions src/EnergyPlus/HeatBalanceSurfaceManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5178,8 +5178,6 @@ void UpdateThermalHistories(EnergyPlusData &state)
state.dataHeatBalFanSys->CTFTuserConstPart(SurfNum);
}

if (surface.ExtBoundCond > 0) continue; // Don't need to evaluate outside for partitions

// Set current outside flux:
if (construct.SourceSinkPresent) {
state.dataHeatBalSurf->SurfOutsideFluxHist(1)(SurfNum) =
Expand Down
Loading

5 comments on commit ffcf657

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

fixIncSolarMultiplier (yujiex) - x86_64-MacOS-10.17-clang-14.0.0: OK (3523 of 3524 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 784
  • Failed: 1

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

fixIncSolarMultiplier (yujiex) - Win64-Windows-10-VisualStudio-16: OK (2738 of 2738 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.

fixIncSolarMultiplier (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4: OK (3564 of 3565 tests passed, 0 test warnings)

Messages:\n

  • 1 test had: EIO diffs.
  • 1 test had: ESO big diffs.
  • 1 test had: Table big diffs.

Failures:\n

regression Test Summary

  • Passed: 804
  • Failed: 1

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.

fixIncSolarMultiplier (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-UnitTestsCoverage-Debug: OK (1952 of 1952 tests passed, 0 test warnings)

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

fixIncSolarMultiplier (yujiex) - x86_64-Linux-Ubuntu-22.04-gcc-11.4-IntegrationCoverage-Debug: OK (789 of 789 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.