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

Method to import DDY file

asked 2019-10-02 10:18:58 -0600

I want to change the DesignDay objects in a model through an OpenStudio measure. Changing it will allow me to change the design day in the PAT.

I found the action performed when you click the Import DDY button, it seems like there is some well-worked logic to importing it and I think that using this method would be the best approach. Is there any way in the current SDK to access it?

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2019-10-04 02:52:34 -0600

Here's how you would load DDY file, and try to limit yourself to the two most common design days:

  if !OpenStudio::exists(ddy_path)
     raise "Path doesn't exist: #{ddy_path}"
  end
  ddy_idf = OpenStudio::IdfFile::load(ddy_path, "EnergyPlus".to_IddFileType).get
  ddy_workspace = OpenStudio::Workspace.new(ddy_idf)
  reverse_translator = OpenStudio::EnergyPlus::ReverseTranslator.new()
  ddy_model = reverse_translator.translateWorkspace(ddy_workspace)

  # Try to limit to the two main design days
  ddy_objects = ddy_model.getDesignDays().select { |d| d.name.get.include?('.4% Condns DB') || d.name.get.include?('99.6% Condns DB') }
  # Otherwise, get all .4% and 99.6%
  if ddy_objects.size < 2
    ddy_objects = ddy_model.getDesignDays().select { |d| d.name.get.include?('.4%') || d.name.get.include?('99.6%') }
  end
  #add the objects in the ddy file to the model
  model.addObjects(ddy_objects)

This is loosely adapted from what we do in OpenStudio-resources, where we look at the workflow.osw to find the EPW name and load the matching DDY file next to it. See code here

edit flag offensive delete link more
2

answered 2019-10-02 10:58:58 -0600

Change Building Location measure would be a good place to start. It not only sets up EPW and ASHRAE climate zone, but imports design days. You can also directly edit existing design day objects in a model or make new design day objects from scratch instead of importing from ddy files. Here is a link to the documentation for DesignDay object.

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

Training Workshops

Careers

Question Tools

2 followers

Stats

Asked: 2019-10-02 10:18:58 -0600

Seen: 1,131 times

Last updated: Oct 04 '19