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

What is the solution for the openstudio error for cogeneration measure fail

asked 2023-05-29 09:06:18 -0500

Alosius Thomas's avatar

updated 2023-05-29 16:12:52 -0500

New openstudio measure is added and the following error is shown after running the measure

Applying CogenerationMeasure
Result: Fail
Error: Expected argument 1 of type openstudio::model::HVACComponent, but got OpenStudio::Model::GeneratorMicroTurbine #<OpenStudio::Model::Generator...
in SWIG method 'addSupplyBranchForComponent'

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-29 14:12:16 -0500

updated 2023-05-29 14:27:56 -0500

Somewhere in that measure, there's a request to addSupplyBranchForComponent to a PlantLoop; a method which takes a single argument, an object of type HVACComponent. There are 40-odd OpenStudio components that are derived from the general class HVACComponent (e.g. coils, heat pumps), yet Generators (e.g. GeneratorMicroTurbines) are not one of them.

EDIT: Ah! One can instantiate a GeneratorMicroTurbineHeatRecovery by linking it to a previously generated GeneratorMicroTurbine. This (optional) heat recovery component is a type of HVACComponent. So an excerpt of that measure.rb code should look something like:

turbine = OpenStudio::Model::GeneratorMicroTurbine.new(model)
recovery = OpenStudio::Model::GeneratorMicroTurbineHeatRecovery.new(model, turbine)
loop.addSupplyBranchForComponent(recovery)

... or something along those lines.

edit flag offensive delete link more

Your Answer

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

Add Answer

Careers

Question Tools

1 follower

Stats

Asked: 2023-05-29 09:06:18 -0500

Seen: 40 times

Last updated: May 29 '23