Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -4431,9 +4431,8 @@ \subsubsection{Inputs}
\paragraph{Field: Third Fuel Type}
This alpha field specifies the fuel type associated with the \hyperref[tablelookup]{Table:Lookup} object specified in field ''System Third Fuel Consumption Lookup Table``. Valid choices include: None, Electricity, NaturalGas, Propane, FuelOilNo1, FuelOilNo2, Diesel, Gasoline, Coal, OtherFuel1, OtherFuel2, Steam, \hyperref[districtheating]{DistrictHeatingWater} and \hyperref[districtcooling]{DistrictCooling}. If this field is blank, the default second fuel type is None.

\paragraph{Field: Objective Function to Minimize}
In each time step ZoneHVAC:HybridUnitaryHVAC will choose one or more combinations of the controlled independent variables, subject to constraints, so as to best satisfy sensible load, latent load, and scheduled ventilation with the least amount of resource consumption. This alpha field specifies which resource will be minimized by the optimization. Valid choices include: Electricity Use, Second Fuel Use, Third Fuel Use, and Water Use. If this field is blank, the objective function will minimize electricity use.

\paragraph{Field: Objective Function to Optimize}

@mitchute mitchute Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see you are proposing to change this from "minimize" to "optimize," which I presume is due to adding this new option which you probably don't want to "minimize" in the true sense of the word. But now, we have the ambiguity of what you mean by "optimize." Can you add some descriptions of what the expected behavior is for each of the options now?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, the new option will either minimize or maximize the supply temperature (depending on cooling or heating). Everything else will still be minimized. I'll update the .tex and .idd to clarify this.

In each time step ZoneHVAC:HybridUnitaryHVAC will choose one or more combinations of the controlled independent variables, subject to constraints, so as to best satisfy sensible load, latent load, and scheduled ventilation. Electricity Use, Second Fuel Use, Third Fuel Use, and Water Use will be minimized. Supply Temperature will be minimized when cooling is required, maximized when heating is required, and electricity use will be minimized when only ventilation is required. This alpha field specifies which resource will be optimized. Valid choices include: Electricity Use, Second Fuel Use, Third Fuel Use, Water Use, and Supply Temperature. If this field is blank, the default objective function to optimize is Electricity Use.

\paragraph{Field: Design Specification Outdoor Air Object Name}
This alpha field specifies the name of a \hyperref[designspecificationoutdoorair]{DesignSpecification:OutdoorAir} object which specifies the a schedule for the required standard density volume of outdoor air. If this field is blank, the system may still supply outdoor air, if it is capable, when doing so is the most efficient way to satisfy other constraints.
Expand Down
7 changes: 4 additions & 3 deletions idd/Energy+.idd.in
Original file line number Diff line number Diff line change
Expand Up @@ -37641,14 +37641,15 @@ ZoneHVAC:HybridUnitaryHVAC,
\note Select the fuel type associated with field: "System Third Fuel Consumption Lookup Table" in each mode.
\note If this field is blank, default third fuel type = None.
\default None
A18, \field Objective Function to Minimize
A18, \field Objective Function to Optimize

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure we don't need a transition rule on this since you're just renaming and not changing the current/default values.

\type choice
\key Electricity Use
\key Second Fuel Use
\key Third Fuel Use
\key Water Use
\note In each time step, controlled variables will be chosen to minimize the selection in this field, subject to constraints.
\note If this field is blank, the objective function will minimize electricity use.
\key Supply Temperature
\note In each time step, controlled variables will be chosen to optimize the selection in this field, subject to constraints. Electricity Use, Second Fuel Use, Third Fuel Use, and Water Use will be minimized. Supply Temperature will be minimized when cooling is required, maximized when heating is required, and electricity use will be minimized when only ventilation is required.
\note If this field is blank, the default objective function to optimize is Electricity Use.
\default Electricity Use
A19, \field Design Specification Outdoor Air Object Name
\type object-list
Expand Down
72 changes: 54 additions & 18 deletions src/EnergyPlus/HybridEvapCoolingModel.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,8 @@ namespace HybridEvapCoolingModel {
bool DidWeMeetHumidification = false;
bool DidWePartlyMeetLoad = false;
Real64 OptimalSetting_RunFractionTotalFuel = IMPLAUSIBLE_POWER;
Real64 OptimalSetting_RunFractionSupplyTemperature =
CoolingRequested ? std::numeric_limits<Real64>::max() : std::numeric_limits<Real64>::lowest();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There used to be comments here. I guess that's because you submitted this from a fork? NBD. I see you fixed the issue.

Real64 Tma;
Real64 Wma;
Real64 Hsa;
Expand Down Expand Up @@ -1454,37 +1456,60 @@ namespace HybridEvapCoolingModel {

// Calculate partload fraction required to meet all requirements
// Fraction can be above 1 meaning its not able to do it completely in a time step
Real64 PartRuntimeFraction = CalculatePartRuntimeFraction(MinOA_Msa,
thisSetting.Supply_Air_Ventilation_Volume * state.dataEnvrn->StdRhoAir,
StepIns.RequestedCoolingLoad,
StepIns.RequestedHeatingLoad,
SensibleRoomORZone,
StepIns.ZoneDehumidificationLoad,
StepIns.ZoneMoistureLoad,
latentRoomORZone);

Real64 RunFractionTotalFuel;
thisSetting.Runtime_Fraction = CalculatePartRuntimeFraction(MinOA_Msa,
thisSetting.Supply_Air_Ventilation_Volume * state.dataEnvrn->StdRhoAir,
StepIns.RequestedCoolingLoad,
StepIns.RequestedHeatingLoad,
SensibleRoomORZone,
StepIns.ZoneDehumidificationLoad,
StepIns.ZoneMoistureLoad,
latentRoomORZone);

Real64 RunFractionTotalFuel(0);
Real64 RunFractionSupplyTemperature(0);
switch (ObjectiveFunction) {
default:
case ObjectiveFunctionType::ElectricityUse:
RunFractionTotalFuel = thisSetting.ElectricalPower * PartRuntimeFraction;
RunFractionTotalFuel = thisSetting.ElectricalPower * thisSetting.Runtime_Fraction;
break;
case ObjectiveFunctionType::SecondFuelUse:
RunFractionTotalFuel = thisSetting.SecondaryFuelConsumptionRate * PartRuntimeFraction;
RunFractionTotalFuel = thisSetting.SecondaryFuelConsumptionRate * thisSetting.Runtime_Fraction;
break;
case ObjectiveFunctionType::ThirdFuelUse:
RunFractionTotalFuel = thisSetting.ThirdFuelConsumptionRate * PartRuntimeFraction;
RunFractionTotalFuel = thisSetting.ThirdFuelConsumptionRate * thisSetting.Runtime_Fraction;
break;
case ObjectiveFunctionType::WaterUse:
RunFractionTotalFuel = thisSetting.WaterConsumptionRate * PartRuntimeFraction;
RunFractionTotalFuel = thisSetting.WaterConsumptionRate * thisSetting.Runtime_Fraction;
break;
case ObjectiveFunctionType::SupplyTemperature:
RunFractionSupplyTemperature = thisSetting.SupplyAirTemperature * thisSetting.Runtime_Fraction;
Comment on lines 1198 to +1485

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to understand how the works. Is this supposed to be multiplied by the RTF here? It looks to me like the supply air temperature for thisSetting is based on the Mode <N> Supply Air Temperature Lookup Table Name from the object, and presumably you could have different combinations of SAT * RTF that don't actually minimize/maximize the supply air temp. Am I understanding this right?

break;
}
thisSetting.Runtime_Fraction = PartRuntimeFraction; //

if (Conditioning_load_met && Humidification_load_met) {
// store best performing mode
if (RunFractionTotalFuel < OptimalSetting_RunFractionTotalFuel) {
bool store_best_performing_mode = false;

if (ObjectiveFunction == ObjectiveFunctionType::SupplyTemperature) {
if (CoolingRequested && RunFractionSupplyTemperature < OptimalSetting_RunFractionSupplyTemperature) {
store_best_performing_mode = true;
OptimalSetting_RunFractionSupplyTemperature = RunFractionSupplyTemperature;
}
if (HeatingRequested && RunFractionSupplyTemperature > OptimalSetting_RunFractionSupplyTemperature) {
store_best_performing_mode = true;
OptimalSetting_RunFractionSupplyTemperature = RunFractionSupplyTemperature;
}
// fall back to ElectricityUse since ventilation-only is just fan operation
if (!CoolingRequested && !HeatingRequested && VentilationRequested &&
RunFractionTotalFuel < OptimalSetting_RunFractionTotalFuel) {
store_best_performing_mode = true;
OptimalSetting_RunFractionTotalFuel = RunFractionTotalFuel;
}
} else if (RunFractionTotalFuel < OptimalSetting_RunFractionTotalFuel) {
store_best_performing_mode = true;
OptimalSetting_RunFractionTotalFuel = RunFractionTotalFuel;
}

if (store_best_performing_mode) {
OptimalSetting = thisSetting;
DidWeMeetLoad = true;
DidWeMeetHumidification = true;
Expand Down Expand Up @@ -1515,8 +1540,19 @@ namespace HybridEvapCoolingModel {
PreviousMaxiumConditioningOutput = SensibleRoomORZone;
}
}

if (store_best_attempt) {
OptimalSetting_RunFractionTotalFuel = RunFractionTotalFuel;
if (ObjectiveFunction == ObjectiveFunctionType::SupplyTemperature) {
if (CoolingRequested || HeatingRequested) {
OptimalSetting_RunFractionSupplyTemperature = RunFractionSupplyTemperature;
}
// fall back to ElectricityUse since ventilation-only is just fan operation
if (!CoolingRequested && !HeatingRequested && VentilationRequested) {
OptimalSetting_RunFractionTotalFuel = RunFractionTotalFuel;
}
} else {
OptimalSetting_RunFractionTotalFuel = RunFractionTotalFuel;
}
OptimalSetting = thisSetting;
DidWePartlyMeetLoad = true;
}
Expand Down
5 changes: 3 additions & 2 deletions src/EnergyPlus/HybridEvapCoolingModel.hh
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ namespace HybridEvapCoolingModel {
SecondFuelUse,
ThirdFuelUse,
WaterUse,
SupplyTemperature,
Num
};

constexpr std::array<std::string_view, (int)ObjectiveFunctionType::Num> objectiveFunctionNamesUC = {
"ELECTRICITY USE", "SECOND FUEL USE", "THIRD FUEL USE", "WATER USE"};
"ELECTRICITY USE", "SECOND FUEL USE", "THIRD FUEL USE", "WATER USE", "SUPPLY TEMPERATURE"};

class CModeSolutionSpace
{
Expand Down Expand Up @@ -265,7 +266,7 @@ namespace HybridEvapCoolingModel {
Constant::eFuel firstFuel = Constant::eFuel::Invalid; // First fuel type, currently electricity is only option
Constant::eFuel secondFuel = Constant::eFuel::Invalid; // Second fuel type
Constant::eFuel thirdFuel = Constant::eFuel::Invalid; // Third fuel type
ObjectiveFunctionType ObjectiveFunction = ObjectiveFunctionType::ElectricityUse; // Objective function to minimize
ObjectiveFunctionType ObjectiveFunction = ObjectiveFunctionType::ElectricityUse; // Objective function to optimize

int UnitOn; // feels like it should be a bool but its an output and I couldn't get it to work as a bool
Real64 UnitTotalCoolingRate; // unit output to zone, total cooling rate [W]
Expand Down
2 changes: 1 addition & 1 deletion testfiles/UnitaryHybridAC_DedicatedOutsideAir.idf
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,7 @@
Electricity, !- First Fuel Type
NaturalGas, !- Second Fuel Type
DistrictCooling, !- Third Fuel Type
, !- Objective Function to Minimize
, !- Objective Function to Optimize
SZ DSOA SPACE2-1, !- Design Specification Outdoor Air Object Name
Mode0 Standby, !- Mode 0 Name
, !- Mode 0 Supply Air Temperature Lookup Table Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@
Electricity, !- First Fuel Type
NaturalGas, !- Second Fuel Type
DistrictCooling, !- Third Fuel Type
, !- Objective Function to Minimize
, !- Objective Function to Optimize
SZ DSOA SPACE2-1, !- Design Specification Outdoor Air Object Name
Mode0 Standby, !- Mode 0 Name
, !- Mode 0 Supply Air Temperature Lookup Table Name
Expand Down
Loading
Loading