diff --git a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationCase.cpp b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationCase.cpp index 34f286caf7f..0cedfbfbe10 100644 --- a/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationCase.cpp +++ b/openstudiocore/src/energyplus/ForwardTranslator/ForwardTranslateRefrigerationCase.cpp @@ -250,22 +250,26 @@ boost::optional 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 defrostEnergyCorrectionCurve = modelObject.defrostEnergyCorrectionCurve(); - - if( defrostEnergyCorrectionCurve ) + //DefrostEnergyCorrectionCurveName + if( auto defrostEnergyCorrectionCurve = modelObject.defrostEnergyCorrectionCurve() ) { - boost::optional _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 _defrostEnergyCorrectionCurve = translateAndMapModelObject(defrostEnergyCorrectionCurve.get()); + + if( _defrostEnergyCorrectionCurve && _defrostEnergyCorrectionCurve->name() ) + { + object.setString(Refrigeration_CaseFields::DefrostEnergyCorrectionCurveName,_defrostEnergyCorrectionCurve->name().get()); + } } } diff --git a/openstudiocore/src/model/RefrigerationCase.cpp b/openstudiocore/src/model/RefrigerationCase.cpp index 55580885707..de1bcdff84a 100644 --- a/openstudiocore/src/model/RefrigerationCase.cpp +++ b/openstudiocore/src/model/RefrigerationCase.cpp @@ -126,6 +126,10 @@ namespace detail { modelObjectClone.getImpl()->setCaseDefrostCycleParameters(caseDefrostCycleParameters->clone(model).cast()); } + if( auto curve = defrostEnergyCorrectionCurve() ) { + modelObjectClone.setDefrostEnergyCorrectionCurve(curve->clone(model).cast()); + } + modelObjectClone.resetThermalZone(); return modelObjectClone; @@ -159,6 +163,11 @@ namespace detail { if (boost::optional intermediate = latentCaseCreditCurve()) { result.push_back(*intermediate); } + + if( auto curve = defrostEnergyCorrectionCurve() ) { + result.push_back(curve.get()); + } + return result; } diff --git a/openstudiocore/src/openstudio_app/Resources/hvaclibrary/hvac_library.osm b/openstudiocore/src/openstudio_app/Resources/hvaclibrary/hvac_library.osm index b51ea36805c..87ef906d480 100644 --- a/openstudiocore/src/openstudio_app/Resources/hvaclibrary/hvac_library.osm +++ b/openstudiocore/src/openstudio_app/Resources/hvaclibrary/hvac_library.osm @@ -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 diff --git a/openstudiocore/src/openstudio_lib/library/OpenStudioPolicy.xml b/openstudiocore/src/openstudio_lib/library/OpenStudioPolicy.xml index 0d4cc534a97..92577c8073c 100644 --- a/openstudiocore/src/openstudio_lib/library/OpenStudioPolicy.xml +++ b/openstudiocore/src/openstudio_lib/library/OpenStudioPolicy.xml @@ -705,8 +705,7 @@ - - +