Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page

# Bug in OS SDK 2.9.0 for OS:ElectricLoadCenter:Storage:Converter?

I am trying to model a PV system with battery, where the battery can also be charged from the grid when the PV system is down. So I have an OpenStudio measure that creates, among many others, the following objects.

OS:ElectricLoadCenter:Storage:Converter,
{6f4c1fc9-72d9-4366-a914-b7d95575a797}, !- Handle
PV Charger,                             !- Name
{4e3c2f1a-8bc8-4717-ba4e-74c8240df8c0}, !- Availability Schedule Name
FunctionOfPower,                        !- Power Conversion Efficiency Method
,                                       !- Simple Fixed Efficiency
8000,                                   !- Design Maximum Continuous Input Power {W}
{12e72227-f689-4cef-8e33-a646d0d9d28b}, !- Efficiency Function of Power Curve Name
40,                                     !- Ancillary Power Consumed In Standby {W}
,                                       !- Zone Name

OS:Curve:Linear,
{12e72227-f689-4cef-8e33-a646d0d9d28b}, !- Handle
PV Charger Efficiency,                  !- Name
1,                                      !- Coefficient1 Constant
0,                                      !- Coefficient2 x
0,                                      !- Minimum Value of x
1,                                      !- Maximum Value of x
0,                                      !- Minimum Curve Output
1,                                      !- Maximum Curve Output
Dimensionless,                          !- Input Unit Type for X
Dimensionless;                          !- Output Unit Type


When this is run in OpenStudio, the following error appears in eplusout.err:

Program Version,EnergyPlus, Version 9.2.0-921312fa1d, YMD=2020.12.26 19:58,
** Severe  ** <root>[ElectricLoadCenter:Storage:Converter][PV Charger][simple_fixed_efficiency] - "8000" - Expected number less than or equal to 1.000000
**  Fatal  ** Errors occurred on processing input file. Preceding condition(s) cause termination.
...Summary of Errors that led to program termination:
..... Reference severe error count=1
..... Last severe error=<root>[ElectricLoadCenter:Storage:Converter][PV Charger][simple_fixed_efficiency] - "8000" -
Expected number less than or equal to 1.000000
************* Warning:  Node connection errors not checked - most system input has not been read (see previous warning).
************* Fatal error -- final processing.  Program exited before simulations began.  See previous error messages.
************* EnergyPlus Warmup Error Summary. During Warmup: 0 Warning; 0 Severe Errors.
************* EnergyPlus Sizing Error Summary. During Sizing: 0 Warning; 0 Severe Errors.
************* EnergyPlus Terminated--Fatal Error Detected. 0 Warning; 1 Severe Errors; Elapsed Time=00hr 00min  0.27sec


I do not understand why EnergyPlus looking for simple_fixed_efficiency when the OS:ElectricLoadCenter:Storage:Converter object is calling for FunctionOfPower? Plus, why is Design Maximum Continuous Input Power {W} taken for Simple Fixed Efficiency in the first place?

Sorry to be bothering y'all with an old version of SDK, but paying a subscription for SketchUp just to be able to move past 2.9.0 is a tall order for an energy modeler.

Thank you

edit retag close merge delete

What does the ElectricLoadCenter:Storage:Converter object look like after it's translated to EnergyPlus for simulation? That's a good way to determine whether the issue is with OpenStudio or EnergyPlus.

( 2020-12-28 10:25:45 -0500 )edit

Matthew you were correct, as usual. The IDF object has the efficiency and power entries switched! Here is a clip:

FunctionOfPower,           !- Power Conversion Efficiency Method
8000,                               !- Simple Fixed Efficiency
,                                       !- Design Maximum Continuous Input Power {W}
PV Charger Efficiency,    !- Efficiency Function of Power Curve Name


Thanks.

( 2020-12-29 11:11:02 -0500 )edit

( 2020-12-29 11:12:28 -0500 )edit

Sort by » oldest newest most voted

### Cause

Looks like a bug due to a copy/paste typo (see below) where the code to ForwardTranslate the Design Maximum Continuous Input Power field is actually setting the Simple Fixed Efficiency field and using the same variable optD.

https://github.com/NREL/OpenStudio/bl...

// SimpleFixedEfficiency, optD
optD = modelObject.simpleFixedEfficiency();
if (optD) {
}

// designMaximumContinuousInputPower, optD
optD = modelObject.designMaximumContinuousInputPower();
if (optD) {
}


I opened an issue in the OpenStudio SDK repo here.

https://github.com/NREL/OpenStudio/is...

### Solution

As a workaround you could write a simple EnergyPlus measure to fix the IDF after it's been translated by OpenStudio, which would look something like this.

# get all objects
# OR
# get one object, e.g. if there's only one in the model

# set Simple Fixed Efficiency field to 0 rather than what's entered in the Design Maximum Continuous Input Power field

more

1

Thanks Matthew, that sounds like a brilliant workaround. I'll see if I can play with that a little. I am curious, though, as I am not familiar with the IDF methods so much:

In your last line, why is the design_maximum_continuous_input_power on the left of an equal sign? It seems to me this might be more appropriate for a getDouble rather than a setDouble?

( 2020-12-29 11:18:51 -0500 )edit

And if so, might I actually need the following?

... so that I correct both efficiency and power?

( 2020-12-29 11:20:42 -0500 )edit

@mattkoch I updated the solution code per your comment. I was originally going to create a variable for it for clarity. Your two lines of code would work too if you need the Simple Fixed Efficiency to be non-zero.

( 2020-12-29 11:22:05 -0500 )edit

@mattkoch I opened an issue for this (see link above) and mentioned you there, not sure if your GitHub username is also mattkoch.

( 2020-12-29 13:14:50 -0500 )edit

Thanks Matthew, makes me think now that adding the entire PV system (arrays, inverter, load center) plus battery and charger may be better done directly in the IDF file, rather than the OSM file, using EnergyPlus measures rather than OpenStudio measures, especially since adding life cycle cost via OSM also seems to be impossible?

( 2020-12-29 21:59:28 -0500 )edit

Following the advice from MatthewSteen, the following snippet in a simple EnergyPlus measure at least makes the model run to completion now. I have not had a chance to check the plausibility of the results. That's an entirely different effort.

pv_chargers = workspace.getObjectsByType('ElectricLoadCenter:Storage:Converter'.to_IddObjectType)
runner.registerFinalCondition("The model started with #{pv_chargers.size} PV Chargers.")

pv_charger = pv_chargers.first

runner.registerInfo("Initial PV Charger #{pv_charger}")

simple_fixed_efficiency = 1.0
design_maximum_continuous_input_power = pv_charger.getDouble(3)

pv_charger.setDouble(3, simple_fixed_efficiency)
pv_charger.setDouble(4, design_maximum_continuous_input_power.to_f)

runner.registerInfo("Final PV Charger #{pv_charger}")

runner.registerFinalCondition("The model finished with #{pv_chargers.size} PV Chargers.")


Note, EnergyPlus does not like zero efficiencies.

more