-
Notifications
You must be signed in to change notification settings - Fork 209
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
#4963 - AirLoopHVACUnitarySystem Default Supply Air Flow Rate Method When No Cooling or Heating is Required to None #4971
#4963 - AirLoopHVACUnitarySystem Default Supply Air Flow Rate Method When No Cooling or Heating is Required to None #4971
Conversation
@joseph-robertson can you remind me why we didn't apply the same treatment to "WhenNoHeatingOrCoolingIsRequired" as we did for DuringCooling / DuringHeating in #4873 ? |
I don't recall a specific reason, but certainly seems like an oversight. |
Taking an example model This is what OS 3.6.1 generates
This is what the OS 3.7.0-alpha build on this PR generates:
The performance results appear to be the same. But I'm confused as to the default behavior in the OS 3.6.1 instance. It appears the Heating/Cooling modes defaulted to |
The "good" news is that one or our regression test has differences (see #4977) so we have something to test with. I might reach out to get one or two OSMs from you. I linked to the bit of E+ code that explains the difference (and in the commit messages), but that wasn't very clear. If I put autosize for the flow rate field, and leave the method field empty, it treats it as being like method=None and it takes precedence, so I get 0 |
c855d5a
to
ccb000d
Compare
@@ -11902,7 +11902,7 @@ OS:AirLoopHVAC:UnitarySystem, | |||
\key FlowPerFloorArea | |||
\key FractionOfAutosizedCoolingValue | |||
\key FlowPerCoolingCapacity | |||
\default None | |||
\required-field |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make all Supply Air Flow Method fields required.
@@ -142,7 +142,7 @@ namespace model { | |||
boost::optional<double> designSupplyAirFlowRatePerUnitofCapacityDuringHeatingOperation() const; | |||
|
|||
/** In EnergyPlus 8.3.0 and above this property maps to the EnergyPlus field "No Load Supply Air Flow Rate Method" **/ | |||
boost::optional<std::string> supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; | |||
std::string supplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired() const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API break
/** Sets the Heating Coil. If the "Supply Air Flow Rate Method During Heating Operation" was "None", switch to "SupplyAirFlowRate" | ||
* and autosize the "Supply Air Flow Rate During Heating Operation" field */ | ||
bool setHeatingCoil(const HVACComponent& heatingCoil); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Docstring everywhere
/** Sets the field and switches "Supply Air Flow Rate Method During Cooling Operation" (coolingSAFMethod) to "SupplyAirFlowRate" */ | ||
bool setSupplyAirFlowRateDuringCoolingOperation(double supplyAirFlowRateDuringCoolingOperation); | ||
OS_DEPRECATED(3, 7, 0) void resetSupplyAirFlowRateDuringCoolingOperation(); | ||
/** Sets the field and switches the coolingSAFMethod to "SupplyAirFlowRate" */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- @kbenne should we return false if the unitary doesn't have a cooling coil set already?
} else if (iddname == "OS:AirLoopHVAC:UnitarySystem") { | ||
|
||
// NOTE: With 23.2.0-IOFreeze, we always have a change anyways cause some fields were removed | ||
|
||
auto iddObject = idd_3_7_0.getObject(iddname); | ||
IdfObject newObject(iddObject.get()); | ||
|
||
for (size_t i = 0; i < object.numFields(); ++i) { | ||
if ((value = object.getString(i))) { | ||
newObject.setString(i, value.get()); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VT is complicated.... I'm going to break it down.
First, copy everything.
} else if (!noCoolHeatSAFMethod) { | ||
|
||
// Blank is equivalent to None here, no question | ||
newObject.setString(noCoolHeatSAFMethodIndex, "None"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there isn't a method, E+ treats it the same as None, so just use that.
} else { | ||
std::string noCoolHeatSAFMethodUC = ascii_to_upper_copy(*noCoolHeatSAFMethod); | ||
if (noCoolHeatSAFMethodUC != "NONE") { | ||
auto it = std::find_if(noCoolHeatSAFMethodChoicesUC.cbegin(), noCoolHeatSAFMethodChoicesUC.cend(), | ||
[&noCoolHeatSAFMethodUC](auto& s) { return s == noCoolHeatSAFMethodUC; }); | ||
if (it == noCoolHeatSAFMethodChoicesUC.cend()) { | ||
LOG(Error, "For AirLoopHVACUnitarySystem '" | ||
<< object.nameString() | ||
<< "', Unrecognized Supply Air Flow Rate Method When No Cooling or Heating is Required=" << *noCoolHeatSAFMethod); | ||
} else { | ||
auto dist = std::distance(noCoolHeatSAFMethodChoicesUC.cbegin(), it); | ||
const size_t index = noCoolHeatSAFMethodIndex + 1 + dist; | ||
if ((value = object.getString(index))) { | ||
newObject.setString(index, *value); | ||
} else { | ||
LOG(Error, "For AirLoopHVACUnitarySystem '" << object.nameString() | ||
<< "', Supply Air Flow Rate Method When No Cooling or Heating is Required is '" | ||
<< *noCoolHeatSAFMethod << "' but associated field is empty"); | ||
} | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is a method, do the same as the cooling and heating coil: try to get corresponding numeric field and use that, or use zero if not found.
TEST_F(ModelFixture, AirLoopHVACUnitarySystem_SupplyAirFlowRateMethodDuringOperation_NoCoolHeat) { | ||
// Test for #4695 - AirLoopHVACUnitarySystem: Supply Air Flow Rate Method During <XXX> Operation should be set via related setters/autosize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lotsa model testing to make sure we enforce a "Method/FlowField" combo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I used a python script to create the VT test models this time (I've been using ruby until now). Just because it was easier for me and because I could)
@@ -2548,3 +2549,200 @@ TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_GroundHeatExchangerVertical) { | |||
EXPECT_EQ(3.2, uka.getDouble(6).get()); // Average Amplitude of Surface Temperature | |||
EXPECT_EQ(8.0, uka.getDouble(7).get()); // Phase Shift of Minimum Surface Temperature | |||
} | |||
|
|||
TEST_F(OSVersionFixture, update_3_6_1_to_3_7_0_UnitarySystem_SAFMethods_default) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lotsa VT testing, not going to comment line by line unless someone asks me to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the two main changes in this PR are to (1) setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None")
in the ctor, and (2) apply the same treatment to "WhenNoHeatingOrCoolingIsRequired"?
@@ -1391,7 +1402,7 @@ namespace model { | |||
OS_ASSERT(ok); | |||
getImpl<detail::AirLoopHVACUnitarySystem_Impl>()->setSupplyAirFlowRateMethodDuringCoolingOperation("None"); | |||
getImpl<detail::AirLoopHVACUnitarySystem_Impl>()->setSupplyAirFlowRateMethodDuringHeatingOperation("None"); | |||
autosizeSupplyAirFlowRateWhenNoCoolingorHeatingisRequired(); | |||
getImpl<detail::AirLoopHVACUnitarySystem_Impl>()->setSupplyAirFlowRateMethodWhenNoCoolingorHeatingisRequired("None"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now consistent with "XXXMethodDuringCooling / Heating".
Yes. |
…r if the flow rate is Autosized, it takes precendence cf https://github.com/NREL/EnergyPlus/blob/4502b0c6561281693f837217eb99339372b86abd/src/EnergyPlus/UnitarySystem.cc#L6080-L6081
…lds required-field in the OpenStudio.idd
…h the IOFreeze branch)
``` ZERO Which is: 0 unitary.getDouble(OS_AirLoopHVAC_UnitarySystemFields::FractionofAutosizedDesignCoolingSupplyAirFlowRate).get() Which is: 1.03613e-317 /Users/jenkins/git/OpenStudioIncr ```
d29d060
to
ce0d9c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont understand why mac fails, will try to get CI to spit it out for me
CI Results for ff08894:
|
Pfff, I merged this one by mistake, I'm sorry. I'm going to have to fix the ctest on develop / another PR. |
Done in 50fe58a |
Pull request overview
cf https://github.com/NREL/EnergyPlus/blob/4502b0c6561281693f837217eb99339372b86abd/src/EnergyPlus/UnitarySystem.cc#L6080-L6081
Marking Developer Issue as this only affects develop (not released yet)
Follow up to
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.