Skip to content

Commit

Permalink
Add support for Case defrost curve
Browse files Browse the repository at this point in the history
close #1573
  • Loading branch information
kbenne committed Jun 17, 2015
1 parent 6eefb16 commit e056f4f
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,22 +250,26 @@ boost::optional<IdfObject> ForwardTranslator::translateRefrigerationCase( Refrig
}
}

//DefrostEnergyCorrectionCurveType
s = modelObject.defrostEnergyCorrectionCurveType();
if (s) {
object.setString(Refrigeration_CaseFields::DefrostEnergyCorrectionCurveType,s.get());
//DefrostEnergyCorrectionCurveType
{
auto value = modelObject.defrostEnergyCorrectionCurveType();
object.setString(Refrigeration_CaseFields::DefrostEnergyCorrectionCurveType,value);
}

//DefrostEnergyCorrectionCurveName
boost::optional<CurveCubic> defrostEnergyCorrectionCurve = modelObject.defrostEnergyCorrectionCurve();

if( defrostEnergyCorrectionCurve )
//DefrostEnergyCorrectionCurveName
if( auto defrostEnergyCorrectionCurve = modelObject.defrostEnergyCorrectionCurve() )
{
boost::optional<IdfObject> _defrostEnergyCorrectionCurve = translateAndMapModelObject(defrostEnergyCorrectionCurve.get());

if( _defrostEnergyCorrectionCurve && _defrostEnergyCorrectionCurve->name() )
{
object.setString(Refrigeration_CaseFields::DefrostEnergyCorrectionCurveName,_defrostEnergyCorrectionCurve->name().get());
auto type = modelObject.caseDefrostType();
// Only for these types or E+ will halt.
if( istringEqual(type,"HotGasWithTemperatureTermination") ||
istringEqual(type,"ElectricWithTemperatureTermination") ||
istringEqual(type,"HotFluidWithTemperatureTermination") ) {
boost::optional<IdfObject> _defrostEnergyCorrectionCurve = translateAndMapModelObject(defrostEnergyCorrectionCurve.get());

if( _defrostEnergyCorrectionCurve && _defrostEnergyCorrectionCurve->name() )
{
object.setString(Refrigeration_CaseFields::DefrostEnergyCorrectionCurveName,_defrostEnergyCorrectionCurve->name().get());
}
}
}

Expand Down
9 changes: 9 additions & 0 deletions openstudiocore/src/model/RefrigerationCase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ namespace detail {
modelObjectClone.getImpl<RefrigerationCase_Impl>()->setCaseDefrostCycleParameters(caseDefrostCycleParameters->clone(model).cast<RefrigerationDefrostCycleParameters>());
}

if( auto curve = defrostEnergyCorrectionCurve() ) {
modelObjectClone.setDefrostEnergyCorrectionCurve(curve->clone(model).cast<CurveCubic>());
}

modelObjectClone.resetThermalZone();

return modelObjectClone;
Expand Down Expand Up @@ -159,6 +163,11 @@ namespace detail {
if (boost::optional<CurveCubic> intermediate = latentCaseCreditCurve()) {
result.push_back(*intermediate);
}

if( auto curve = defrostEnergyCorrectionCurve() ) {
result.push_back(curve.get());
}

return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3238,13 +3238,27 @@ OS:Refrigeration:Case,
{57b587d9-11b3-4700-a362-25f9ac3035d5}, !- Case Defrost Schedule Name
{57b587d9-11b3-4700-a362-25f9ac3035d5}, !- Case Defrost Drip-Down Schedule Name
None, !- Defrost Energy Correction Curve Type
, !- Defrost Energy Correction Curve Name
{dde2f531-75bc-4d59-94cd-01bf3bf4bcc7}, !- Defrost Energy Correction Curve Name
0, !- Under Case HVAC Return Air Fraction
, !- Refrigerated Case Restocking Schedule Name
, !- Case Credit Fraction Schedule Name
-5.56, !- Design Evaporator Temperature or Brine Inlet Temperature {C}
; !- Average Refrigerant Charge Inventory {kg/m}

OS:Curve:Cubic,
{dde2f531-75bc-4d59-94cd-01bf3bf4bcc7}, !- Handle
Refrigerated Case Defrost Modifier Curve, !- Name
1, !- Coefficient1 Constant
0, !- Coefficient2 x
0, !- Coefficient3 x**2
0, !- Coefficient4 x**3
0, !- Minimum Value of x {BasedOnField A2}
1, !- Maximum Value of x {BasedOnField A2}
, !- Minimum Curve Output {BasedOnField A3}
, !- Maximum Curve Output {BasedOnField A3}
, !- Input Unit Type for X
; !- Output Unit Type

OS:Curve:Cubic,
{012a63c6-2590-4f3d-a487-c600bf72ad75}, !- Handle
Refrigerated Case Latent Credit Curve, !- Name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -705,8 +705,7 @@
</POLICY>
<POLICY IddObjectType="OS_Refrigeration_Case">
<rule IddField="Latent Case Credit Curve Name" Access="LOCKED"/>
<rule IddField="Defrost Energy Correction Curve Name" Access="HIDDEN"/>
<rule IddField="Defrost Energy Correction Curve Type" Access="LOCKED"/>
<rule IddField="Defrost Energy Correction Curve Name" Access="LOCKED"/>
</POLICY>
<POLICY IddObjectType="OS_Refrigeration_WalkIn">
<rule IddField="Walkin Zone Boundary" Access="HIDDEN"/>
Expand Down

5 comments on commit e056f4f

@nrel-bot
Copy link

Choose a reason for hiding this comment

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

develop (kbenne) - x86_64-MacOS-10.9-clang: Tests Failed

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.

develop (kbenne) - x86_64-Linux-Ubuntu-14.04-clang-3.5: OK (2153 of 2213 tests passed)

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.

develop (kbenne) - i386-Windows-7-VisualStudio-12: OK (2183 of 2213 tests passed)

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.

develop (kbenne) - x86_64-Linux-Ubuntu-14.04-cppcheck-1.61: OK (0 of 0 tests passed)

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

develop (kbenne) - Win64-Windows-7-VisualStudio-12: OK (2195 of 2213 tests passed)

Build Badge Test Badge

Please sign in to comment.