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

ZoneHVACUnitHeater components missing air inlet/outlet node names if created by API #3426

Closed
MatthewSteen opened this issue Feb 21, 2019 · 15 comments · Fixed by #4459
Closed

Comments

@MatthewSteen
Copy link
Member

MatthewSteen commented Feb 21, 2019

I used the API to add unit heaters to a model, but EP failed because the fan and heating coil inlet and outlet node names were missing. After removing the unit heaters with the API and then adding new unit heaters with the app the model ran.

require 'openstudio'
include OpenStudio::Model

m = Model.new

fan = FanConstantVolume.new(m)
hc = CoilHeatingElectric.new(m)
uh = ZoneHVACUnitHeater.new(m, m.alwaysOnDiscreteSchedule, fan, hc)

puts m

OS:Version,
  {2a392599-84aa-46fa-80cf-4f80b4fe26b2}, !- Handle
  2.7.0;                                  !- Version Identifier

OS:Fan:ConstantVolume,
  {1702df54-ff2a-4027-a998-cca714f92891}, !- Handle
  Fan Constant Volume 1,                  !- Name
  {21a7f155-0735-4045-9d97-6bcc50dd08a4}, !- Availability Schedule Name
  ,                                       !- Fan Total Efficiency
  ,                                       !- Pressure Rise {Pa}
  AutoSize,                               !- Maximum Flow Rate {m3/s}
  ,                                       !- Motor Efficiency
  ,                                       !- Motor In Airstream Fraction
  ***,                                       !- Air Inlet Node Name
  ***,                                       !- Air Outlet Node Name
  ;                                       !- End-Use Subcategory

OS:Schedule:Constant,
  {21a7f155-0735-4045-9d97-6bcc50dd08a4}, !- Handle
  Always On Discrete,                     !- Name
  {e3a45e43-d49c-4451-bf42-018b6c0f15cc}, !- Schedule Type Limits Name
  1;                                      !- Value

OS:ScheduleTypeLimits,
  {e3a45e43-d49c-4451-bf42-018b6c0f15cc}, !- Handle
  OnOff,                                  !- Name
  0,                                      !- Lower Limit Value
  1,                                      !- Upper Limit Value
  Discrete,                               !- Numeric Type
  Availability;                           !- Unit Type

OS:Coil:Heating:Electric,
  {7ed9a00f-1a6f-4964-99c2-90f387bc20d4}, !- Handle
  Coil Heating Electric 1,                !- Name
  {21a7f155-0735-4045-9d97-6bcc50dd08a4}, !- Availability Schedule Name
  ,                                       !- Efficiency
  ,                                       !- Nominal Capacity {W}
  ***,                                       !- Air Inlet Node Name
  ***;                                       !- Air Outlet Node Name

OS:ZoneHVAC:UnitHeater,
  {2f705943-975f-41d4-923d-6cc2865fd77b}, !- Handle
  Zone HVAC Unit Heater 1,                !- Name
  {21a7f155-0735-4045-9d97-6bcc50dd08a4}, !- Availability Schedule Name
  ,                                       !- Air Inlet Node Name
  ,                                       !- Air Outlet Node Name
  {1702df54-ff2a-4027-a998-cca714f92891}, !- Supply Air Fan Name
  autosize,                               !- Maximum Supply Air Flow Rate {m3/s}
  OnOff,                                  !- Fan Control Type
  {7ed9a00f-1a6f-4964-99c2-90f387bc20d4}, !- Heating Coil Name
  ,                                       !- Maximum Hot Water Flow Rate {m3/s}
  0,                                      !- Minimum Hot Water Flow Rate {m3/s}
  0.001,                                  !- Heating Convergence Tolerance
  ;                                       !- Availability Manager List Name
@jmarrec
Copy link
Collaborator

jmarrec commented Feb 26, 2019

@MatthewSteen I think you may have forgotten to do uh.addToThermalZone(z), haven't you?

require 'openstudio'
include OpenStudio::Model

m = Model.new

fan = FanConstantVolume.new(m)
hc = CoilHeatingElectric.new(m)
uh = ZoneHVACUnitHeater.new(m, m.alwaysOnDiscreteSchedule, fan, hc)

z = ThermalZone.new(m)
uh.addToThermalZone(z)

ft = OpenStudio::EnergyPlus::ForwardTranslator.new
w = ft.translateModel(m)

puts w.getObjectsByType("Coil:Heating:Electric".to_IddObjectType)

Result:

Coil:Heating:Electric,
  Coil Heating Electric 1,                !- Name
  Always On Discrete,                     !- Availability Schedule Name
  1,                                      !- Efficiency
  Autosize,                               !- Nominal Capacity {W}
  Zone HVAC Unit Heater 1 Fan Outlet Node, !- Air Inlet Node Name
  Node 3;                                 !- Air Outlet Node Name

@jmarrec jmarrec self-assigned this Feb 26, 2019
@MatthewSteen
Copy link
Member Author

@jmarrec no, i tried that too.

require 'openstudio'
include OpenStudio::Model

m = Model.new

fan = FanConstantVolume.new(m)
hc = CoilHeatingElectric.new(m)
uh = ZoneHVACUnitHeater.new(m, m.alwaysOnDiscreteSchedule, fan, hc)

z = ThermalZone.new(m)
uh.addToThermalZone(z)

puts m.getObjectsByType('OS:Coil:Heating:Electric'.to_IddObjectType)[0]
OS:Coil:Heating:Electric,
  {0725f3ce-dcce-4cd6-9061-2794dfb34037}, !- Handle
  Coil Heating Electric 1,                !- Name
  {7e6635d5-dd33-43c0-bfc0-7633924e380e}, !- Availability Schedule Name
  ,                                       !- Efficiency
  ,                                       !- Nominal Capacity {W}
  ,                                       !- Air Inlet Node Name
  ;                                       !- Air Outlet Node Name

@jmarrec
Copy link
Collaborator

jmarrec commented Feb 26, 2019

the Forwardtranslator is the one that sets the nodes, not the model API

@MatthewSteen
Copy link
Member Author

Ok, well that's strange then. Perhaps it was some more EP instability that I've been experiencing lately.

@MatthewSteen
Copy link
Member Author

MatthewSteen commented Mar 6, 2019

FYI @jmarrec I'm experiencing this issue again with CoilCoolingWater and CoilHeatingWater, which appears to be an EnergyPlus issue.

I created a model with the API with the code and topology below. All of the hydronic coils are connected to plant loops.

Workaround is to delete the coils and re-add them using the app.

Code

        class_names.each do |class_name|
          
          # puts node.name, class_name if class_name
          if class_name
            component = Object.const_get("OpenStudio::Model::#{class_name}").new(model)
            component.addToNode(node)
          end
          
        end

Topology
image

Error

Program Version,EnergyPlus, Version 9.0.1-bb7ca4f0da, YMD=2019.03.06 10:44,
** Severe ** [Coil:Cooling:Water][AHU-205 SA Clg Coil] - Missing required property 'water_inlet_node_name'.
** Severe ** [Coil:Cooling:Water][AHU-205 SA Clg Coil] - Missing required property 'water_outlet_node_name'.
** Severe ** [Coil:Heating:Water][AHU-205 SA Htg Coil] - Missing required property 'water_inlet_node_name'.
** Severe ** [Coil:Heating:Water][AHU-205 SA Htg Coil] - Missing required property 'water_outlet_node_name'.
** Fatal ** Errors occurred on processing input file. Preceding condition(s) cause termination.
...Summary of Errors that led to program termination:
..... Reference severe error count=4
..... Last severe error=[Coil:Heating:Water][AHU-205 SA Htg Coil] - Missing required property 'water_outlet_node_name'.
************* 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; 4 Severe Errors; Elapsed Time=00hr 00min 0.37sec

OpenStudio Object

OS:Coil:Cooling:Water,
  {886ef029-9a00-4fd6-b2db-94a4b5177c8a}, !- Handle
  AHU-202 SA Clg Coil,                    !- Name
  {bfc2e832-190b-466b-9997-edc7eca1eaee}, !- Availability Schedule Name
  ,                                       !- Design Water Flow Rate {m3/s}
  ,                                       !- Design Air Flow Rate {m3/s}
  ,                                       !- Design Inlet Water Temperature {C}
  ,                                       !- Design Inlet Air Temperature {C}
  ,                                       !- Design Outlet Air Temperature {C}
  ,                                       !- Design Inlet Air Humidity Ratio {kg-H2O/kg-air}
  ,                                       !- Design Outlet Air Humidity Ratio {kg-H2O/kg-air}
  {6a6dc325-b05e-4f91-84cc-5234547fe2bb}, !- Water Inlet Node Name
  {ee9fec55-e433-490e-b927-be9e69400e94}, !- Water Outlet Node Name
  {60c9d81b-3350-4fde-80fd-9fe9c3002301}, !- Air Inlet Node Name
  {eba73b99-8d30-4b1a-9eff-ddb08e89952a}, !- Air Outlet Node Name
  ,                                       !- Type of Analysis
  ;                                       !- Heat Exchanger Configuration

EnergyPlus Object

Coil:Cooling:Water,
  AHU-202 SA Clg Coil,                    !- Name
  Always On Discrete,                     !- Availability Schedule Name
  Autosize,                               !- Design Water Flow Rate {m3/s}
  Autosize,                               !- Design Air Flow Rate {m3/s}
  Autosize,                               !- Design Inlet Water Temperature {C}
  Autosize,                               !- Design Inlet Air Temperature {C}
  Autosize,                               !- Design Outlet Air Temperature {C}
  Autosize,                               !- Design Inlet Air Humidity Ratio {kgWater/kgDryAir}
  Autosize,                               !- Design Outlet Air Humidity Ratio {kgWater/kgDryAir}
  Node 64,                                !- Water Inlet Node Name
  Node 151,                               !- Water Outlet Node Name
  Node 31,                                !- Air Inlet Node Name
  Node 32,                                !- Air Outlet Node Name
  SimpleAnalysis,                         !- Type of Analysis
  CrossFlow;                              !- Heat Exchanger Configuration

@jmarrec
Copy link
Collaborator

jmarrec commented Mar 6, 2019

@MatthewSteen I don't have enough to reproduce this, could you share more? If this is proprietary and you cannot create a MCVE you can send it to me privately via Slack or email. Thanks!

@MatthewSteen
Copy link
Member Author

@jmarrec experiencing this again, so here's a model in the early stages of development (i.e. only hit run once)...

20146-Proposed.osm.txt

ERR

Program Version,EnergyPlus, Version 9.2.0-921312fa1d, YMD=2020.11.02 20:23,
  ** Severe  ** <root>[Fan:OnOff][100.Vestibule.TZ - UH Fan] - Missing required property 'air_inlet_node_name'.
  ** Severe  ** <root>[Fan:OnOff][100.Vestibule.TZ - UH Fan] - Missing required property 'air_outlet_node_name'.
  ** Severe  ** <root>[ZoneHVAC:UnitHeater][100.Vestibule.TZ - UH] - Missing required property 'supply_air_fan_name'.
  **  Fatal  ** Errors occurred on processing input file. Preceding condition(s) cause termination.
  ...Summary of Errors that led to program termination:
  ..... Reference severe error count=3
  ..... Last severe error=<root>[ZoneHVAC:UnitHeater][100.Vestibule.TZ - UH] - Missing required property 'supply_air_fan_name'.
  ************* 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; 3 Severe Errors; Elapsed Time=00hr 00min  0.60sec

OSM

OS:ZoneHVAC:UnitHeater,
  {2b7890b4-50fd-4eab-a36a-6a633cdef305}, !- Handle
  100.Vestibule.TZ - UH,                  !- Name
  {ea50017b-6e4c-4357-b3af-34f45ae0341e}, !- Availability Schedule Name
  {c13e91e9-9bea-413e-8b5f-eee509ff4f0c}, !- Air Inlet Node Name
  {9577b161-4568-4cd5-a38d-46e5780e3532}, !- Air Outlet Node Name
  {ad0c2ba0-fdc6-48f1-ad86-62bce2d92f79}, !- Supply Air Fan Name
  autosize,                               !- Maximum Supply Air Flow Rate {m3/s}
  OnOff,                                  !- Fan Control Type
  {aec1801e-a699-43f8-bf1a-a65334be5c1c}, !- Heating Coil Name
  ,                                       !- Maximum Hot Water Flow Rate {m3/s}
  0,                                      !- Minimum Hot Water Flow Rate {m3/s}
  0.001,                                  !- Heating Convergence Tolerance
  ;                                       !- Availability Manager List Name

IDF

ZoneHVAC:UnitHeater,
  100.Vestibule.TZ - UH,                  !- Name
  Always On Discrete,                     !- Availability Schedule Name
  Node 671,                               !- Air Inlet Node Name
  Node 672,                               !- Air Outlet Node Name
  Fan:OnOff,                              !- Supply Air Fan Object Type
  ,                                       !- Supply Air Fan Name
  Autosize,                               !- Maximum Supply Air Flow Rate {m3/s}
  Coil:Heating:Water,                     !- Heating Coil Object Type
  100.Vestibule.TZ - UH Htg Coil,         !- Heating Coil Name
  ,                                       !- Supply Air Fan Operating Mode Schedule Name
  No,                                     !- Supply Air Fan Operation During No Heating
  ,                                       !- Maximum Hot Water or Steam Flow Rate {m3/s}
  0,                                      !- Minimum Hot Water or Steam Flow Rate {m3/s}
  0.001;                                  !- Heating Convergence Tolerance

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 3, 2020

I'm about to look at your model, but I have a hunch this could be because you ordered the Ctor arguments wrong. Or the FT is doing something fishy. We'll see!

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 3, 2020

Created this file ft.rb:

require 'openstudio'

include OpenStudio::Model

# Helper to load a model in one line
# It will raise if the path (or the model) isn't valid
#
# @param path [String] The path to the osm
# @return [OpenStudio::Model::Model] the resulting model.
def osload(path)
  translator = OpenStudio::OSVersion::VersionTranslator.new
  ospath = OpenStudio::Path.new(path)
  model = translator.loadModel(ospath)
  if model.empty?
      raise "Path '#{path}' is not a valid path to an OpenStudio Model"
  else
      model = model.get
  end
  return model
end

m = osload('20146-Proposed.osm')

ft = OpenStudio::EnergyPlus::ForwardTranslator.new

w = ft.translateModel(m)

puts w.getObjectsByName("100.Vestibule.TZ - UH")
# Change to 291
w.save('310.idf')

So it works in 310, not in 291:

image

@jmarrec
Copy link
Collaborator

jmarrec commented Nov 3, 2020

@MatthewSteen My (strong) guess is that it's this commit that fixed it: f304968#diff-6e5de9c83c5afa147df589cdacadf05ddb5d361b3766b1e99e83dda333ff5e20 while I was implementing FanSystemModel in #3856

(I could git bisect to make sure it is, but it's not like I have 4 hours ahead of me to satisfy my curiosity)

@MatthewSteen
Copy link
Member Author

MatthewSteen commented Nov 3, 2020

@jmarrec thanks for taking a look and tracking it down. Strange that it doesn't happen in the App.

@luisclv
Copy link

luisclv commented Oct 4, 2021

@jmarrec I am experiencing the same issue again in OS 3.2.1. I also created my ZoneHVACUnitHeaters. I can upload my model and the code I used to create the equipment if needed.

@shorowit shorowit reopened this Oct 4, 2021
@jmarrec
Copy link
Collaborator

jmarrec commented Oct 5, 2021

@luisclv yes, I would need something to reproduce the bug. please share.

@luisclv
Copy link

luisclv commented Oct 5, 2021

In my case I noticed that this happened when I wanted to create the Unit Heater with a FanOnOff, the problem is not present if I created the ZoneHVACUnitHeater with a FanConstantVolume.

The code below reproduces my issue the same as in my model (the inlet and outlet nodes in the FanOnOff are not set). If you need my actual model to reproduce I can send it privately, but I think this test shows the issue.

I am creating two models, and on each one creating a ZoneHVACUnitHeater, the only difference between the models is that one has a FanOnOff while the other one has a FanConstantVolume.

require 'openstudio'

m_constant = OpenStudio::Model::Model.new
m_on_off = OpenStudio::Model::Model.new

hc_constant = OpenStudio::Model::CoilHeatingElectric.new(m_constant)
hc_on_off  = OpenStudio::Model::CoilHeatingElectric.new(m_on_off)
f_constant = OpenStudio::Model::FanConstantVolume.new(m_constant)
f_on_off = OpenStudio::Model::FanOnOff.new(m_on_off)
z_constant = OpenStudio::Model::ThermalZone.new(m_constant) 
z_on_off = OpenStudio::Model::ThermalZone.new(m_on_off) 
cuh_constant = OpenStudio::Model::ZoneHVACUnitHeater.new(m_constant, m_constant.alwaysOnDiscreteSchedule, f_constant, hc_constant)
cuh_on_off = OpenStudio::Model::ZoneHVACUnitHeater.new(m_on_off, m_on_off.alwaysOnDiscreteSchedule, f_on_off, hc_on_off)
cuh_constant.setName('CUH')
cuh_on_off.setName('CUH')
cuh_constant.addToThermalZone(z_constant)
cuh_on_off.addToThermalZone(z_on_off)

ft = OpenStudio::EnergyPlus::ForwardTranslator.new

w_constant = ft.translateModel(m_constant)
w_onoff = ft.translateModel(m_on_off)

puts w_constant.getObjectsByName("Fan Constant Volume 1")
puts w_onoff.getObjectsByName("Fan On Off 1")

The output is below. Note the nodes are assigned correctly in FanConstanVolume but not on FanOnOff

[openstudio.energyplus.ForwardTranslator] <0> ThermalZone Thermal Zone 1 does not have any geometry or loads associated with it.
[utilities.idf.WorkspaceObject] <0> Object of type 'Schedule:Constant' and named 'Always Off Discrete', points to an object named OnOff 1 from field 1, but that object cannot be 
located.
[utilities.idf.WorkspaceObject] <0> Object of type 'Schedule:Constant' and named 'Always On Continuous', points to an object named Fractional from field 1, but that object cannot be located.
[openstudio.energyplus.ForwardTranslator] <0> ThermalZone Thermal Zone 1 does not have any geometry or loads associated with it.
[utilities.idf.WorkspaceObject] <0> Object of type 'Schedule:Constant' and named 'Always Off Discrete', points to an object named OnOff 1 from field 1, but that object cannot be 
located.
[utilities.idf.WorkspaceObject] <0> Object of type 'Schedule:Constant' and named 'Always On Continuous', points to an object named Fractional from field 1, but that object cannot be located.
Fan:ConstantVolume,
  Fan Constant Volume 1,                  !- Name
  Always On Discrete,                     !- Availability Schedule Name
  0.7,                                    !- Fan Total Efficiency
  250,                                    !- Pressure Rise {Pa}
  AutoSize,                               !- Maximum Flow Rate {m3/s}
  0.9,                                    !- Motor Efficiency
  1,                                      !- Motor In Airstream Fraction
  Node 2,                                 !- Air Inlet Node Name
  CUH Fan Outlet Node,                    !- Air Outlet Node Name
  ;                                       !- End-Use Subcategory

Fan:OnOff,
  Fan On Off 1,                           !- Name
  Always On Discrete,                     !- Availability Schedule Name
  0.6,                                    !- Fan Total Efficiency
  300,                                    !- Pressure Rise {Pa}
  Autosize,                               !- Maximum Flow Rate {m3/s}
  0.8,                                    !- Motor Efficiency
  1,                                      !- Motor In Airstream Fraction
  ,                                       !- Air Inlet Node Name
  ,                                       !- Air Outlet Node Name
  Fan On Off Power Curve,                 !- Fan Power Ratio Function of Speed Ratio Curve Name
  Fan On Off Efficiency Curve,            !- Fan Efficiency Ratio Function of Speed Ratio Curve Name
  General;                                !- End-Use Subcategory

@jmarrec
Copy link
Collaborator

jmarrec commented Oct 5, 2021

Yep, confirmed it's missing there:

if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_ConstantVolume) {
_supplyAirFan->setString(Fan_ConstantVolumeFields::AirInletNodeName, *s);
_supplyAirFan->setString(Fan_ConstantVolumeFields::AirOutletNodeName, fanOutletNodeName);
} else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_VariableVolume) {
_supplyAirFan->setString(Fan_VariableVolumeFields::AirInletNodeName, *s);
_supplyAirFan->setString(Fan_VariableVolumeFields::AirOutletNodeName, fanOutletNodeName);
} else if (_supplyAirFan->iddObject().type() == IddObjectType::Fan_SystemModel) {
_supplyAirFan->setString(Fan_SystemModelFields::AirInletNodeName, *s);
_supplyAirFan->setString(Fan_SystemModelFields::AirOutletNodeName, fanOutletNodeName);
}

jmarrec added a commit that referenced this issue Oct 6, 2021
jmarrec added a commit that referenced this issue Oct 6, 2021
…ERT inc ase new types are supported in the future)
tijcolem added a commit that referenced this issue Oct 6, 2021
Fix #3426 - ZoneHVACUnitHeater components missing air inlet/outlet node names when Fan:OnOff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants