Skip to content
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

Null Value for field !- Basin Heater Setpoint Temperature {C} Causes Error #5297

Closed
Ski90Moo opened this issue Nov 9, 2024 · 9 comments
Closed
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed

Comments

@Ski90Moo
Copy link

Ski90Moo commented Nov 9, 2024

Issue overview

Field 30 (!- Basin Heater Setpoint Temperature {C}) of the object OS:AirConditioner:VariableRefrigerantFlow causes the following error when left as the default (null) value:

"eplusout_err" : "Program Version,EnergyPlus, Version 24.1.0-9d7789a3ac, YMD=2024.11.09 15:31,\n ** Severe ** [AirConditioner:VariableRefrigerantFlow][Mitsubishi P72TNU_YNU NONDUCTED-VRF-OU][basin_heater_setpoint_temperature] - "0.000000" - Expected number greater than or equal to 2.000000\n ** Fatal ** Errors occurred on processing input file. Preceding condition(s) cause termination.\n ...Summary of Errors that led to program termination:\n ..... Reference severe error count=1\n ..... Last severe error=[AirConditioner:VariableRefrigerantFlow][Mitsubishi P72TNU_YNU NONDUCTED-VRF-OU][basin_heater_setpoint_temperature] - "0.000000" - Expected number greater than or equal to 2.000000\nof

From the InputOutput reference: "The basin heater capacity must be greater than or equal to zero, with a default value of zero if this field is left blank."

The default (null) value should not cause an error. Recommend the default value be changed to the expected.

Current Behavior

Expected Behavior

Steps to Reproduce

Possible Solution

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): Windows 11
  • Version of OpenStudio (if using an intermediate build, include SHA):
    image

Context

@Ski90Moo Ski90Moo added the Triage Issue needs to be assessed and labeled, further information on reported might be needed label Nov 9, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Nov 12, 2024

OS SDK sets it to 2.0 here:

setBasinHeaterSetpointTemperature(2.0);

There is no reset method.

The minimum of 2.0 is enforced at model namespace too.

The hvac_library.osm from the OS App also has it as 2.0: https://github.com/openstudiocoalition/OpenStudioApplication/blob/d279ff272cfc21743179fdf154121ca3de373c6b/src/openstudio_app/Resources/default/hvac_library.osm#L5274C1-L5274C83

So it seems like an error on your end.

[7] idf(main)> a = AirConditionerVariableRefrigerantFlow.new(m)
=> #<OpenStudio::Model::AirConditionerVariableRefrigerantFlow:0x00007570075a4230 @__swigtype__="_p_openstudio__model__AirConditionerVariableRefrigerantFlow">
[8] idf(main)> a.basinHeaterSetpointTemperature
=> 2.0
[9] idf(main)> a.setBasinHeaterSetpointTemperature(1.0)
=> false

@jmarrec jmarrec closed this as completed Nov 12, 2024
@Ski90Moo
Copy link
Author

@jmarrec Indeed I was mistaken. The basin heater capacity defaults to 0, but the setpoint temperature should default to 2°C, but it doesn't:

From the Input/Output reference:
"This set point temperature must be greater than or equal to 2◦C, and the default value is 2◦C if this
field is left blank."

This must be an EnergyPlus issue then. Please see this example
OS Example10-VRF_004-Def_HVAC_VRF.zip
. This has the field as null value, and it produces the error.

OSM File:
, !- Basin Heater Setpoint Temperature {C}

gets translated to IDF:

0, !- Basin Heater Setpoint Temperature {C}

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 15, 2024

@Ski90Moo your file has a blank for the field

  ,                                       !- Basin Heater Setpoint Temperature {C}

Which should never actually happen to begin with.

When you instantiate the object, it is filled

m = Model.new
a = AirConditionerVariableRefrigerantFlow.new(m)
puts a

OS:AirConditioner:VariableRefrigerantFlow,
  {87faf668-0f51-46d8-a6fe-4baef8a72375}, !- Handle
  Air Conditioner Variable Refrigerant Flow 1, !- Name
  [...]
  2,                                      !- Basin Heater Setpoint Temperature {C}

And there is no resetter to clear it. So the question is more about how you ended up in this situation. Did you modify the OSM in text mode, or call setString(index, "") or something? Is this an older OSM that was upgraded to 3.8.0?

@Ski90Moo
Copy link
Author

@jmarrec I modified the OSM file. I am working on custom curves for a specific type of equipment. The equipment does not have a basin heater, so I left it as the null value, assuming EnergyPlus would just input the default value, which it did. But it seems the EP default value causes an EP fatal error. Should I lodge this as an issue on EnergPlus then?

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 16, 2024

Up to you.
Anyways as far as the OpenStudio Sdk is concerned, it works as expected

@Ski90Moo
Copy link
Author

I believe this is a forward translator issue. EP correctly inputs a value of "2" if left blank. OS forward translator inputs a value of "0" if left blank.

NREL/EnergyPlus#10824 (comment)

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 19, 2024

Like I said above, as far as the OpenStudio SDK is concerned, it works as expected.

It's just a user issue. We prevent you from inputting a blank (there is no reset), or anything < 2.0.

a = AirConditionerVariableRefrigerantFlow.new(m)
[18] OpenStudio(main)> a.setBasinHeaterSetpointTemperature(0)
=> false
[19] OpenStudio(main)> a.resetBasinHeaterSetpointTemperature
NoMethodError: undefined method `resetBasinHeaterSetpointTemperature' for #<OpenStudio::Model::AirConditionerVariableRefrigerantFlow:0x0000756ba2a36b40 @__swigtype__="_p_openstudio__model__AirConditionerVariableRefrigerantFlow">

If you do that manually and purposefully, it's on you.

This is essentially what you're doing here:

include OpenStudio::Model
m = Model.new
a = AirConditionerVariableRefrigerantFlow.new(m)
vrf_tu = ZoneHVACTerminalUnitVariableRefrigerantFlow.new(m)
a.addTerminal(vrf_tu)
# Set the Basin Heater Setpoint Temperature to blank
# This is impossible in model SDK, without manually changing the OSM or calling setString (which you should NOT do)
a.setString(65, "")

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
w = ft.translateModel(m)
puts w.getObjectsByType("AirConditioner:VariableRefrigerantFlow")

Here is the output, the BOOST_ASSERT Fatal error should be an indication...

[openstudio.energyplus.ForwardTranslator] <-1> Object of type 'OS:AirConditioner:VariableRefrigerantFlow' and named 'Air Conditioner Variable Refrigerant Flow 1' is not connected to a PlantLoop, defaulting condenserType to 'AirCooled'.
[BOOST_ASSERT] <2> Assertion value failed on line 500 of double openstudio::model::detail::AirConditionerVariableRefrigerantFlow_Impl::basinHeaterSetpointTemperature() const in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/Openstudio/src/model/AirConditionerVariableRefrigerantFlow.cpp.
[BOOST_ASSERT] <2> Assertion value failed on line 500 of double openstudio::model::detail::AirConditionerVariableRefrigerantFlow_Impl::basinHeaterSetpointTemperature() const in file /srv/jenkins/openstudio/git/nightly/ubuntu_2004/Openstudio/src/model/AirConditionerVariableRefrigerantFlow.cpp.
AirConditioner:VariableRefrigerantFlow,
  Air Conditioner Variable Refrigerant Flow 1, !- Name
[...]
  0,                                      !- Basin Heater Setpoint Temperature {C}
[...]

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 19, 2024

The main difference between Model (the model namespace) and Workspace (the idf namespace), is that the Model has specific setters, and resetters, that enforce the model logic. While the workspace only has setString, setInt, setDouble, etc.

Using the low-level (setString) setters in model namespace, albeit possible, is definitely not supported and very strongly not recommended, because you can shoot yourself in the foot and break the rules of the model namespace resulting in a broken model. Just like it would be a terrible idea to grab an OS:Connection object manually and remove it.

@Ski90Moo
Copy link
Author

Ok, thank you for the elightenment! @jmarrec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triage Issue needs to be assessed and labeled, further information on reported might be needed
Projects
None yet
Development

No branches or pull requests

2 participants