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

Set Custom Boiler Curves

asked 2019-04-18 11:55:23 -0500

ParticleSwarm's avatar

updated 2019-04-19 14:49:27 -0500

Hello Unment!

I am currently writing a measure to replace the existing hot water boiler curves with custom bi cubic and bi quadratic curve coefficients. I have run into an issue with the curve replacement. I run through the current curves for the boilers and delete them, and then try to plunk in the new curve objects.

I've been met with this error within the hot water boiler object field:

"Undefined method setNormalizedBoilerEfficiencyCurveName for #.

I convert the hot water boiler to the correct class but I am not sure why I am unable to access this field? I am able to modify the other fields of the Boiler object besides the ones with hashed values. Bellow is code for reference.

# define the new Biquadratic curve object
condensingBoilerEfficiency = OpenStudio::Model::CurveBiquadratic.new(model)
condensingBoilerEfficiency.setName("CondensingBoilerEff")
condensingBoilerEfficiency.setCoefficient1Constant(1.124970374)
condensingBoilerEfficiency.setCoefficient2x(0.014963852)
condensingBoilerEfficiency.setCoefficient3xPOW2(-0.02599835)
condensingBoilerEfficiency.setCoefficient4y(0)
condensingBoilerEfficiency.setCoefficient5yPOW2(-0.00000140464)
condensingBoilerEfficiency.setCoefficient6xTIMESY(-0.00153624)
condensingBoilerEfficiency.setMinimumValueofx(0.1)
condensingBoilerEfficiency.setMaximumValueofx(1.0)
condensingBoilerEfficiency.setMinimumValueofy(30)
condensingBoilerEfficiency.setMaximumValueofy(85)



    model.getCurves.each do |curve|
      if curve.name.to_s == "Boiler with No Minimum Turndown"
        handle = curve.handle
        model.removeObject(curve.handle)

      end

    end
    water_unit = boiler_water.to_BoilerHotWater.get
    water_unit.setName("CondensingBoilerEff")
    water_unit.setNormalizedBoilerEfficiencyCurveName("CondensingBoilerEff")
    water_unit.setNominalThermalEfficiency(1)

  end

here is a reference to the class that I am using. Any help would be greatly appreciated!

Particle Swarm

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-18 12:33:52 -0500

updated 2019-04-18 12:34:53 -0500

You're looking at the wrong OpenStudio class, you want to be looking at objects in the OpenStudio:model namespace for modifying OpenStudio model objects. For example, here is the BoilerHotWater class and here is the method to set the curve. As you'll see, the method takes in a curve object, not a curve name. (This is better programming practice because it allows you to, e.g, subsequently change the name of the curve without breaking the relationship between the boiler and the curve.)

So you want to do:

water_unit.setNormalizedBoilerEfficiencyCurve(condensingBoilerEfficiency)

edit flag offensive delete link more

Comments

This worked great, thank you for the help!

ParticleSwarm's avatar ParticleSwarm  ( 2019-04-18 13:24:44 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2019-04-18 11:55:23 -0500

Seen: 201 times

Last updated: Apr 18 '19