#11567: ZoneHVAC:HybridUnitaryHVAC - Add choice to optimize Supply Temperature#11581
Conversation
…supply-temperature
…supply-temperature
mitchute
left a comment
There was a problem hiding this comment.
A couple questions for consideration, which will help me finalize the review.
| \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} |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
| bool DidWePartlyMeetLoad = false; | ||
| Real64 OptimalSetting_RunFractionTotalFuel = IMPLAUSIBLE_POWER; | ||
| Real64 OptimalSetting_RunFractionSupplyTemperature = | ||
| CoolingRequested ? std::numeric_limits<Real64>::max() : std::numeric_limits<Real64>::min(); |
There was a problem hiding this comment.
Why not just : 0 here? Not a big deal.
There was a problem hiding this comment.
I saw this as a starting value convention for "checking and holding the final value" as:
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;
}
There was a problem hiding this comment.
0 didn't work when the supply temperatures were all negative because I'm trying to find the max supply temperature. Another option could be -273.15.
There was a problem hiding this comment.
Isn't std::numeric_limits<Real64>::min() approximately 0? Maybe you want lowest() instead?
There was a problem hiding this comment.
Ah, yes! I'll get that fixed. Thanks for pointing this out!
| \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 |
There was a problem hiding this comment.
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.
| bool DidWePartlyMeetLoad = false; | ||
| Real64 OptimalSetting_RunFractionTotalFuel = IMPLAUSIBLE_POWER; | ||
| Real64 OptimalSetting_RunFractionSupplyTemperature = | ||
| CoolingRequested ? std::numeric_limits<Real64>::max() : std::numeric_limits<Real64>::lowest(); |
There was a problem hiding this comment.
There used to be comments here. I guess that's because you submitted this from a fork? NBD. I see you fixed the issue.
| @@ -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; | |||
There was a problem hiding this comment.
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?
Pull request overview
Description of the purpose of this PR
Rename "Objective Function to Minimize" to "Objective Function to Optimize" and add a choice to optimize Supply Temperature.
If cooling is required, minimize the supply air temperature.
If heating is required, maximize the supply air temperature. (This is the reason for renaming the field)
If only ventilation is required, minimize electricity usage (i.e. fan power).
Pull Request Author
Reviewer