-
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
Fix #4185 - Wrap Fan:ComponentModel in OS SDK #4193
Conversation
``` $os_build/Products/openstudio GenerateClass.rb -c "FanComponentModel" -b "StraightComponent" -i "OS:Fan:ComponentModel" -s model -o /home/julien/Software/Others/OpenStudio/src/model/ -p -f -r ```
…minFlowRate per IDD mistake)
…So use specific references
… with right curves
…me names...) + typo in return value
…hted by OpenStudio-resources test)
case openstudio::IddObjectType::Curve_ExponentialDecay: { | ||
modelObject = translateCurveExponentialDecay(workspaceObject); | ||
break; | ||
} |
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.
While testing, I realized the RT existed but it wasn't actually used for Curve:ExponentialDecay
case openstudio::IddObjectType::Fan_ComponentModel: { | ||
modelObject = translateFanComponentModel(workspaceObject); | ||
break; | ||
} |
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 enabled the RT for the object...
} else { | ||
auto componentModelFans = subsetCastVector<FanComponentModel>(comps); | ||
if (!componentModelFans.empty()) { | ||
result = componentModelFans.back(); | ||
} |
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.
Register fan type for AirLoopHVAC
resources/model/OpenStudio.idd
Outdated
\type real | ||
\minimum 1.0 | ||
\required-field | ||
\note Applied to specified or autosized VFD output power | ||
A7 , \field Fan Pressure Rise Curve Name | ||
\required-field | ||
\type object-list | ||
\object-list FanPressureRiseCurves | ||
\object-list BiVariateTables | ||
\note Pressure rise depends on volumetric flow, system resistances, | ||
\note system leakage, and duct static pressure set point | ||
A8 , \field Duct Static Pressure Reset Curve Name | ||
\required-field | ||
\type object-list | ||
\object-list LinearCurves | ||
\object-list UniVariateTables | ||
\note Function of fan volumetric flow | ||
\note Minimum and maximum fan airflows correspond respectively to | ||
\note minimum and maximum duct static pressure set points | ||
A9 , \field Normalized Fan Static Efficiency Curve Name-Non-Stall Region | ||
\required-field | ||
\type object-list | ||
\object-list ExponentialSkewNormalCurves | ||
\object-list UniVariateTables | ||
\note xfan <= 0 | ||
\note Curve should have maximum of 1.0 | ||
A10, \field Normalized Fan Static Efficiency Curve Name-Stall Region | ||
\required-field | ||
\type object-list | ||
\object-list ExponentialSkewNormalCurves | ||
\object-list UniVariateTables | ||
\note xfan > 0 | ||
\note Curve should have maximum of 1.0 | ||
A11 , \field Normalized Dimensionless Airflow Curve Name-Non-Stall Region | ||
\required-field | ||
\type object-list | ||
\object-list SigmoidCurves | ||
\object-list UniVariateTables | ||
\note xspd <= 0 | ||
\note Curve should have maximum of 1.0 | ||
A12 , \field Normalized Dimensionless Airflow Curve Name-Stall Region | ||
\required-field | ||
\type object-list | ||
\object-list SigmoidCurves | ||
\object-list UniVariateTables | ||
\note xspd > 0 | ||
\note Curve should have maximum of 1.0 | ||
A13 , \field Maximum Belt Efficiency Curve Name | ||
\type object-list | ||
\object-list QuarticCurves | ||
\object-list UniVariateTables | ||
\note Determines maximum fan drive belt efficiency in log space | ||
\note as function of xbelt,max | ||
\note Curve should have minimum of -4.6 and maximum of 0.0 | ||
\note If field blank, assumes output of curve is always 1.0 | ||
A14 , \field Normalized Belt Efficiency Curve Name - Region 1 | ||
\type object-list | ||
\object-list RectangularHyperbola2Curves | ||
\object-list UniVariateTables | ||
\note Region 1 (0 <= xbelt < xbelt,trans) | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes output of curve is always 1.0 in Region 1 | ||
A15 , \field Normalized Belt Efficiency Curve Name - Region 2 | ||
\type object-list | ||
\object-list ExponentialDecayCurves | ||
\object-list UniVariateTables | ||
\note Region 2 (xbelt,trans <= xbelt <= 1) | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes output of curve is always 1.0 in Region 2 | ||
A16 , \field Normalized Belt Efficiency Curve Name - Region 3 | ||
\type object-list | ||
\object-list RectangularHyperbola2Curves | ||
\object-list UniVariateTables | ||
\note Determines normalized drive belt efficiency Region 3 (xbelt > 1) | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes output of curve is always 1.0 in Region 3 | ||
A17 , \field Maximum Motor Efficiency Curve Name | ||
\type object-list | ||
\object-list RectangularHyperbola1Curves | ||
\object-list UniVariateTables | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes output of curve is always 1.0 | ||
A18 , \field Normalized Motor Efficiency Curve Name | ||
\type object-list | ||
\object-list RectangularHyperbola2Curves | ||
\object-list UniVariateTables | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes output of curve is always 1.0 | ||
A19 , \field VFD Efficiency Curve Name | ||
\type object-list | ||
\object-list RectangularHyperbola2Curves | ||
\object-list UniVariateTables | ||
\note Determines VFD efficiency as function of motor load or speed fraction | ||
\note Curve should have minimum > 0.0 and maximum of 1.0 | ||
\note If field blank, assumes constant VFD efficiency (0.97) | ||
A20 ; \field End-Use Subcategory | ||
\note Any text may be used here to categorize the end-uses in the ABUPS End Uses by Subcategory table. | ||
\type alpha | ||
\retaincase | ||
\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.
IDD. I pretty much made everything required.
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.
Love it!
boost::optional<ZoneHVACComponent> FanComponentModel_Impl::containingZoneHVACComponent() const { | ||
|
||
// Note JM 2021-01-26: Only ZoneHVAC:EvaporativeCoolerUnit apparently, which isn't wrapped in the OS SDK currently | ||
|
||
//std::vector<ZoneHVACComponent> zoneHVACComponent = this->model().getModelObjects<ZoneHVACComponent>(); | ||
//for (const auto& elem : zoneHVACComponent) { | ||
//switch (elem.iddObject().type().value()) { | ||
|
||
//// ZoneHVAC:EvaporativeCoolerUnit: not wrapped | ||
//case openstudio::IddObjectType::OS_ZoneHVAC_EvaporativeCoolerUnit: { | ||
//ZoneHVACEnergyRecoveryVentilator component = elem.cast<ZoneHVACEvaporativeCoolerUnit>(); | ||
//if (component.supplyAirFan().handle() == this->handle()) return elem; | ||
//break; | ||
//} | ||
//default: { | ||
//break; | ||
//} | ||
//} | ||
//} | ||
return boost::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.
containingZoneHVACComponent
: apparently only ZoneHVAC:EvaporativeCoolerUnit
allows it (ref Fans
), but it's not wrapped in OS SDK.
ok = setEndUseSubcategory("General"); | ||
OS_ASSERT(ok); | ||
|
||
// Default from E+ example file: EnergyPlus/testfiles/5ZoneWarmestVFD_FCMAuto.idf, v9.4.0 |
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.
Default required fields from the E+ example, where there was no IDD default.
/** @name Constructors and Destructors */ | ||
//@{ | ||
|
||
explicit FanComponentModel(const Model& model); |
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.
Here, perhaps should change to take 5 required curves
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 say make an overload.
OSX failed test is a usual suspect: ForwardTranslatorTest_MultiThreadedLogMessages |
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.
@jmarrec let me know if you want to adjust (overload) the ctor. Other than that, I'm ready to merge.
…t** instantiate optional curves. Move the optional curves stuff in assignDefaultCurves() so that user can call it if she wants to.
…HROW instead (Curve not convertible to bool, duh)
CI Results for 5c0ac3b:
|
Pull request overview
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)src/openstudio_lib/library/OpenStudioPolicy.xml
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.