NREL / openstudio-load-flexibility-measures-gem

Other
1 stars 2 forks source link

add_packaged_ice_storage test passes, but E+ run fails, likely change from E+ 22.1 to 22.2 on Coil:Cooling:DX:SingleSpeed:ThermalStorage object #52

Closed DavidGoldwasser closed 9 months ago

DavidGoldwasser commented 1 year ago

This is the problem object. This is used in UO. First update test to run E+, then fix and test this. Update min version to OpenStudio 3.5 or later to avoid having to ad in logic for the code to work in older and newer versions of EnergyPlus. https://github.com/NREL/openstudio-load-flexibility-measures-gem/blob/develop/lib/measures/add_packaged_ice_storage/measure.rb#L375

DavidGoldwasser commented 1 year ago

This is content from eplustout.err in UO workflow

   ** Severe  ** GetTESCoilInput: Coil:Cooling:DX:SingleSpeed:ThermalStorage="UTSS COIL 0"
   **   ~~~   ** ...Invalid curve for Cooling Only Mode Total Evaporator Cooling Capacity Function of Flow Fraction Curve Name.
   **   ~~~   ** ...Input curve="COILCLGDXQRATIO_FTWBTOADBSI" has 2 dimensions.
   **   ~~~   ** ...Curve type must have 1 dimension.
   ** Severe  ** GetTESCoilInput: Coil:Cooling:DX:SingleSpeed:ThermalStorage="UTSS COIL 0"
   **   ~~~   ** ...Invalid curve for Cooling Only Mode Energy Input Ratio Function of Temperature Curve Name.
   **   ~~~   ** ...Input curve="COILCLGDXSNGLQRATIO_FCFMRATIO" has 1 dimension.
   **   ~~~   ** ...Curve type must have 2 dimensions.
   ** Severe  ** GetTESCoilInput: Coil:Cooling:DX:SingleSpeed:ThermalStorage="UTSS COIL 0"
   **   ~~~   ** ...Invalid curve for Cooling Only Mode Energy Input Ratio Function of Flow Fraction Curve Name.
   **   ~~~   ** ...Input curve="COILCLGDXEIRRATIO_FTWBTOADBSI" has 2 dimensions.
   **   ~~~   ** ...Curve type must have 1 dimension.
   **  Fatal  ** GetTESCoilInput: Errors found in getting Coil:Cooling:DX:SingleSpeed:ThermalStorage input. Preceding condition(s) causes termination.
DavidGoldwasser commented 1 year ago

By looking at an 22.1 IDF made with OS 3.4 (on the right of screen) against an 22.2 IDF made with OS 3.5 (on the left) I can see curve assignments are messed up. It appears that there is a lot of substitution to what is dropped in to start with by the measure. That gives me something to look at. I don't know if this is unique issue to this UO or will impact all uses of the measure Screen Shot 2022-12-07 at 3 47 53 PM (2)

DavidGoldwasser commented 1 year ago

Here are the curves from one of the objects in the measure's unit test

  PSZ-AC_Unitary_PackagecoolCapFT,        !- Cooling Only Mode Total Evaporator Cooling Capacity Function of Temperature Curve Name
  PSZ-AC_Unitary_PackagecoolFFF,          !- Cooling Only Mode Total Evaporator Cooling Capacity Function of Flow Fraction Curve Name
  PSZ-AC DX Unitary Package EIRFT,        !- Cooling Only Mode Energy Input Ratio Function of Temperature Curve Name
  PSZ-AC_Unitary_PackagecoolEIRFFF,       !- Cooling Only Mode Energy Input Ratio Function of Flow Fraction Curve Name
  PSZ-AC_Unitary_PackagecoolPLR,          !- Cooling Only Mode Part Load Fraction Correlation Curve Name
  Cool-SHR-fT,                            !- Cooling Only Mode Sensible Heat Ratio Function of Temperature Curve Name
  Cool-SHR-fFF,                           !- Cooling Only Mode Sensible Heat Ratio Function of Flow Fraction Curve Name
DavidGoldwasser commented 1 year ago

I'll setup the unit test to run and see if I can replicate, this, if not I can try to make new test based on UO example.

DavidGoldwasser commented 1 year ago

This code uses inputs from single or two speed dx objects for new thermal storage objects. If fields in single or two speed changed between 22.1 and 22.2 then this would break.

https://github.com/NREL/openstudio-load-flexibility-measures-gem/blob/develop/lib/measures/add_packaged_ice_storage/measure.rb#L563-L581


      # copy old coil information over to TES object (use low-speed info for 2spd coils)
      case sel_coil.iddObject.name
      when 'Coil:Cooling:DX:SingleSpeed'
        utss.setString(16, sel_coil.getString(2).get)
        utss.setString(18, sel_coil.getString(4).get)
        utss.setString(19, sel_coil.getString(9).get)
        utss.setString(20, sel_coil.getString(10).get)
        utss.setString(21, sel_coil.getString(11).get)
        utss.setString(22, sel_coil.getString(12).get)
        utss.setString(23, sel_coil.getString(13).get)
      when 'Coil:Cooling:DX:TwoSpeed'
        utss.setString(16, sel_coil.getString(14).get)
        utss.setString(18, sel_coil.getString(16).get)
        utss.setString(19, sel_coil.getString(18).get)
        utss.setString(20, sel_coil.getString(10).get)
        utss.setString(21, sel_coil.getString(19).get)
        utss.setString(22, sel_coil.getString(12).get)
        utss.setString(23, sel_coil.getString(13).get)
      end
DavidGoldwasser commented 1 year ago

In 22.2 for single speed (but not double speed) two new fields come in at position 6 and 7, so all strings after 5 need to be increased by 2

  N5 , \field 2017 Rated Evaporator Fan Power Per Volume Flow Rate
       \note Enter the evaporator fan power per air volume flow rate at the rated test conditions
       \note as defined in the 2017 version of ANSI/AHRI Standard 210/240. 
       \note The test conditions vary external static pressure based on total cooling capacity.
       \note This value is only used to calculate Seasonal Energy Efficiency Ratio (SEER), Energy
       \note Efficiency Ratio (EER), Integrated Energy Efficiency Ratio (IEER), and the Standard Rating
       \note (Net) Cooling Capacity which will be outputs in the EnergyPlus eio file. This value is not
       \note used for modeling the evaporator fan during simulations.
       \type real
       \units W/(m3/s)
       \minimum 0.0
       \maximum 1250.0
       \default 773.3
  N6 , \field 2023 Rated Evaporator Fan Power Per Volume Flow Rate
       \note Enter the evaporator fan power per air volume flow rate at the rated test conditions
       \note as defined in the 2023 version of ANSI/AHRI Standard 210/240.
       \note The test conditions vary external static pressure based on total cooling capacity.
       \note This value is only used to calculate Seasonal Energy Efficiency Ratio (SEER2), Energy
       \note Efficiency Ratio (EER), Integrated Energy Efficiency Ratio (IEER), and the Standard Rating
       \note (Net) Cooling Capacity which will be outputs in the EnergyPlus eio file. This value is not
       \note used for modeling the evaporator fan during simulations.
       \type real
       \units W/(m3/s)
       \minimum 0.0
       \maximum 1505.0
       \default 934.4
DavidGoldwasser commented 1 year ago

I borrowed code from Standards that runs a simulation with OSM that has been used in measure tests, to instead run IDF files. https://github.com/NREL/openstudio-standards/blob/a61ba54ead336dbbd5376a8b0c3f1fb139aaebaa/lib/openstudio-standards/utilities/simulation.rb#L9

My code uses the EnergyPlus CLI, while it works on my computer not sure if it will on CI. One issue on my local computer is that a failing E+ run doesn't fail the test. I'd like to fix that so I don't have to hand inspect the eplusout.err file.

To run workflow for this which should fix issues I might want to embed the measure for replace_idf in a method so that all E+ measure tests can use it. SO maybe for OS 3.6. https://github.com/NREL/BESTEST-GSR/blob/main/integration_testing/workflow/600EN_from_idf/workflow.osw#L15

Here is measure code, link above is example OSW https://github.com/NREL/BESTEST-GSR/blob/main/measures/replace_idf/measure.rb#L47-L84

DavidGoldwasser commented 1 year ago

This shows working 3.4 object on the right, and the fixed 3.5 object on the left. I added the UO model as a test model since the existing test model was using two speed instead of single speed. I confirmed locally the E+ file ran successfully.

Screen Shot 2022-12-08 at 2 35 13 AM
DavidGoldwasser commented 1 year ago

@tijcolem the CI doesn't find the E+ results even though it works locally. Any ideas, I can always comment out the run E+ code for now and wait until I have cleaner fix.

This is the line from console [openstudio.model.Model] <1> Results for the run couldn't be found here: /srv/jenkins/git/openstudio-load-flexibility-measures-gem/PR-53/1/lib/measures/add_packaged_ice_storage/tests/output/test_good_argument_values/Run/eplusout.sql.

Screen Shot 2022-12-08 at 8 00 11 AM
DavidGoldwasser commented 9 months ago

fixed with issue #60