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

LSurf's profile - activity

2024-01-25 07:28:13 -0500 received badge  Popular Question (source)
2021-06-13 01:54:31 -0500 received badge  Popular Question (source)
2016-06-22 10:20:07 -0500 received badge  Taxonomist
2016-04-12 18:09:18 -0500 marked best answer Measure writing: import dependent Objects

Since I was unable to produce the HVAC system in OpenStudio, I'm writing a measure to import my system from an .idf file.

Problem is, when loading an object, or adding it to a workspace, all fields checked if referencing objects exist. References to objects that have not been inserted yet, are therefore deleted. Before I tried fixing this by adjusting the order of my .idf file. However, this does not work when two objects reference each other. Every broken connection would have to be fixed manually in Ruby by finding the offending object and resetting its reference. In my case this would be 100s lines of code.

I've tried looking into the workspace.insertObjects function to see if that would not have this issue, but couldn't get it to work.

Is there another way of disabling this error checking, or inserting multiple objects at the same time into a workspace?

2016-04-12 18:02:06 -0500 marked best answer Unable to start ResultsViewer

While typing this topic, I managed to find the issue. Just putting this out there in case anyone is hitting the same issue.

ResultsViewer stopped working for me. When trying to start the program, nothing happens, no error is produced.

To fix the issue:

  • Just try opening the ResultsViewer a few dozen times. Randomly, the program will occasionally start.
  • When open, clear all available settings under 'Preferences'

Other steps I've tried, which may have contributed to the solution:

  • logging on/off & rebooting
  • reinstalling openstudio (actually upgrading from 1.5.0 to 1.6.0)

Last time it working normally, I was working on an .sql file produced by a custom .idf file, not one produced by Openstudio.

2015-03-04 02:09:31 -0500 commented answer Heating curve (weather compensation) in OpenStudio / EnergyPlus?

Perfect, exactly what I was looking for. In the documentation I indeed skipped the managers about Air, but didn't know they were applicable for PlantLoops as well.

2015-03-03 09:34:39 -0500 asked a question Heating curve (weather compensation) in OpenStudio / EnergyPlus?

Is it possible to create a heating setpoint in Energyplus that is dependent on outside temperature?

I would like to model a baseboard heater system with an inlet temperature that is dependent on outside conditions. For higher outside temperatures, less heating capacity is needed. This means lower supply temperatures can be sufficient to meet heating demand.

Typically a curve would look like this. (inlet temperature vs. outdoor air) Heating curve

I have found SetpointManager:FollowOutdoorAirTemperature object, but that only follow the outdoor temperature. I would need a negative feedback.

Any thoughts on how one would implement such a system?

2015-02-26 02:23:52 -0500 commented question Can't get Boiler:HotWater to heat water

Awesome Jamie, that did the trick! I guess I'll have to learn more about the Operation scheme's. Can you convert your comment to an answer?

2015-02-25 10:46:35 -0500 commented question Can't get Boiler:HotWater to heat water

@Archmerage I think I have those correctly set up, but I'm not sure. I have these in my idf-file

2015-02-25 07:51:03 -0500 asked a question Can't get Boiler:HotWater to heat water

I have a working model built from some EnergyPlus example files.

In my PlantLoop for heating I have a Storage Tank for preheating, and a WaterHeater:Mixed to provide additional heat. I want to compare this scenario with my baseline scenario, in which I have a Boiler:HotWater for heating.

For this purpose I'm trying to replace the WaterHeater by a Boiler. However, I can't get this to work. I suspect some issue with setpoints, since there is flow through the Boiler, it just doesn't heat. Also, the WaterHeater has a field called Setpoint Temperature Schedule Name, whereas the Boiler doesn't.

I tried fiddling around with the setpoints. Also I've moved the Boiler to the same branch as the Storage Tank, without result.

How can I get my Boiler to heat to 50 °C?

Working with WaterHeater:Mixed

Not working with Boiler:HotWater

Full folder

The problem is with the the second loop in this HVAC system diagram.

HVAC system

2015-02-25 07:30:48 -0500 commented answer Openstudio not responding / too long filename

Instead of posting these issues here, should I instead file these on github?

2015-02-23 08:57:27 -0500 commented answer Openstudio not responding / too long filename

Thanks for the followup. Perhaps I wasn't very thorough in describing. Also since this fixed the issue for me I didn't investigate further.

Yes, I meant running an .osm file from the my measures directory, and running it from Openstudio (not PAT) I was using this as a test file in debugging my measures, so it made sense to me to place my .osm in the my measures directory. I'm guessing that when the file is run, it makes a copy of the measure to its working directory, which is in the measure directory, therefore creating the loop.

2015-02-23 05:57:34 -0500 answered a question Openstudio not responding / too long filename

It seemed that running an .osm file from the measures folder created this error. Some loop is created that creates an infinite depth of directories.

So: Never run an .osm-file from the OpenStudio\Measures directory!!

Some loop occurs, recursively creating more and more directories. You'll be unable to delete the directories, since filenames are too long.

To remove these files, you need to use subst from command prompt and assign a drive letter (quite ugly solution, but works). Proceed as follows:

  • Open a command prompt, and cd into the offending directory until you cannot go further, then go a few directories back up
  • use subst to assign a drive letter to the offending directory. e.g. subst z: <dirname>
  • go to z:, and remove all files using del /s /q <dirname>, then rd /s /q <dirname>
  • In case you still get errors, go deeper in the tree, and assign a new driveletter to an offending directory (i could typically get 20 dirs deep), repeat until you can get to the lowest directory and remove everything. I had to use about 6 driveletter to get to the deepest level.
  • You may have several branches of offending directories, dig into each until you can remove all.
2015-02-23 05:48:53 -0500 asked a question Openstudio not responding / too long filename

I was experiencing errors where Openstudio would never finish running, even though EnergyPlus results would be fine.

Symptoms:

  • log file of several MB's
  • error deleting run files, because of too long filenames
2015-02-19 10:44:49 -0500 received badge  Self-Learner (source)
2015-02-19 02:38:35 -0500 commented answer Disable zone/plant/system sizing

Aah, there's my answer. I had accidentally added it as an OpenStudio measure. Thanks!

2015-02-18 05:48:50 -0500 commented answer Disable zone/plant/system sizing

Thanks a lot for sharing. For now, your measure doesn't run on my machine. (Ruby complains about not finding an in.idf)

If the other route fails I'll dig deeper in your measure. I'll certainly keep it in my liblary!

2015-02-18 05:46:54 -0500 commented answer Disable zone/plant/system sizing

Thanks a bunch. Deleting the design days seems to do the trick. Openstudio now fails on the next issue, so I'll get to fixing that.

For deleting the designdays, there's no option in OpenStudio. I tried creating an empty ddy-file, which didn't work. What did work was to directly delete the design days from the .osm-file.

2015-02-17 11:02:04 -0500 asked a question Disable zone/plant/system sizing

Under the simulation setting / simulation control, Openstudio provides the option of disabling sizing calculations. I need sizing calculations disabled, since they interfere with other components of my system.

Despite the OpenStudio settings, in the resulting idf-file sizing is enabled.

I figured this would be because some components required autosizing. I went through the process of editing the .idf-file to disable sizing, running it, filling in the missing data in OpenStudio. Now the model runs fine in E+ without the sizing, however OpenStudio still enables it.

The only workaround I can think about is disabling the sizing in the .idf-file by using an energyplus-measure.

Are there any other parameters I should check, or is there some other way of permanently disabling sizing in OpenStudio?

OpenStudio Settings

Resulting .idf

2015-02-17 08:00:34 -0500 answered a question Autohotkey open Resultsviewer and E+ error file

When the script below is active, some functionality is added when an OpenStudio window has focus.

The following shortcuts are available, and work on the most recently run .osm-file (based on modified date):

  • Ctrl+R: Opens Resultsviewer (and goes to tree view + collapses the tree)
  • Ctrl+E: Opens the .err in Notepad++
  • Ctrl+D: Opens the folder in explorer
  • Ctrl+Q: Closes Resultsviewer (so that no file conflict occurs when running simulation)

I didn't do any thorough testing, so it may need modifications on your system. Feel free to use/modify.

SetTitleMatchMode, 2

; OpenStudio Shortcuts
OSDir()
{
    NewestTime = 20100101000000
    NewestName = 0
    Loop, %USERPROFILE%\AppData\Local\Temp\OpenStudio*,2
    {
        ;dt = %A_LoopFileTimeModified%
        FileGetTime, dt, %A_LoopFileFullPath%\resources
        EnvSub, dt, %NewestTime%, seconds
        if dt > 0  ; Source file is newer than destination file.
        {
            IfExist, %A_LoopFileFullPath%\resources\run ; Folder contains run data
            {
                ;NewestTime = %A_LoopFileTimeModified%
                FileGetTime, NewestTime, %A_LoopFileFullPath%\resources
                NewestName = %A_LoopFileFullPath%
            }
        }
    }
    ;Newest folder is %NewestName%
    return %NewestName%
}

#IfWinActive, osm ahk_class Qt5QWindowIcon

; Open most recent SQL database in ResultsViewer
^r::
OSD := OSDir()
Run "C:\Program Files\OpenStudio 1.6.0\bin\ResultsViewer.exe" "%OSD%\resources\run\5-EnergyPlus-0\eplusout.sql"
WinWait, ResultsViewer, 
IfWinNotActive, ResultsViewer, , WinActivate, ResultsViewer, 
WinWaitActive, ResultsViewer,
;MouseClick, left,  136,  182
ControlClick, x136 y182
Sleep, 100
;MouseClick, left,  152,  208
ControlClick, x152 y208
Sleep, 100
Send, {DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}{DOWN}{LEFT}
Return

; Open E+ Error file with Notepad++
^e::
OSD := OSDir()
Run "C:\Program Files (x86)\Notepad++\notepad++.exe" "%OSD%\resources\run\5-EnergyPlus-0\eplusout.err"
Return

; Open Directory containing files
^d::
OSD := OSDir()
Run explorer.exe "%OSD%\resources\run"
Return

; Close ResultsViewer so no file conflict occurs when running simulation in OpenStudio
^q::
WinClose ResultsViewer ahk_class Qt5QWindowIcon
Return

#IfWinActive
2015-02-17 07:54:13 -0500 commented question Autohotkey open Resultsviewer and E+ error file

Sure! I realized this wasn't a question, but wanted to share in case someone should find it helpful

2015-02-17 07:31:28 -0500 asked a question Autohotkey open Resultsviewer and E+ error file

In my workflow I open Resultsviewer a lot, and look at the EnergyPlus .err file.

Since this debugging is quite time-consuming, I was looking for a way to optimize my workflow using AutoHotKey (http://www.autohotkey.com/)

I wrote a script that can for instance open ResultsViewer, and is easily modifiable to perform other actions.

2015-02-13 07:03:33 -0500 received badge  Editor (source)
2015-02-13 07:03:17 -0500 answered a question Debugging EnergyPlus crash

I got an answer from the EnergyPlus staff, who were helpful enough to pinpoint the exact problem. Zone sizing in combination with the OtherSideConditionsModel made it crash.

Response from EP:

The problem is with the combination of zone sizing plus the OtherSideConditionsModel for the ICS model. This should be fine, but the zone sizing changes the order of input processing the collector is undefined when the surfaces are modeled during zone sizing. I have posted a new issue #4723 to get this fixed. For this particular file, you can get it running by deleting the sizing:zone object. I will post an issue to get this fixed.

2015-02-11 14:08:37 -0500 edited answer Measure writing: import dependent Objects

Credits go to macumber and David. Solution was in using the .toIdfFile and adding all objects simulataneously using the .addObjects.

I created an importer for a YAML-file, which holds data for fixing the remaining missing references. This way the connection between the original .osm-file and imported .idf-file can be fixed.

I don't belong to any group in the BCL-library, so for ppl looking for a way to import an .idf file and fixing remaining links, below the full code, including example .yml file.

# YAML style file containing params to be adjusted
---
- class: BuildingSurface:Detailed
  name: Surface Name
  field: 4
  value: OtherSideConditionsModel
- class: BuildingSurface:Detailed
  name: Surface Name
  field: 5
  value: ICS Collector 1 OSCM
- class: SurfaceProperty:ExteriorNaturalVentedCavity
  name: ICSRoofPaverExtVentCav1
  field: 11
  value: Zolder voor
- class: SolarCollector:IntegralCollectorStorage
  name: Collector 1
  field: 2
  value: Surface Name

.

class ImportIDFFile < OpenStudio::Ruleset::WorkspaceUserScript

  # human readable name
  def name
    return " Import IDF-file"
  end

  # human readable description
  def description
    return "This measure can be used to import functionality from EnergyPlus, which is not exposed (yet) to OpenStudio. E.g. HVAC-components can be imported."
  end

  # human readable description of modeling approach
  def modeler_description
    return "Imports an .idf-file from the /resources folder. Connections from .idf-file which are not satisfied internally (e.g. references to objects in the .osm-file) will be broken. Use the .yml-file to restore these references, example file provided.

Note that this measure is run after the preprocessor. This means you cannot use HVACTemplate objects, instead expand these first and copy from the .expidf-file.

"
  end

  # define the arguments that the user will input
  def arguments(workspace)
    args = OpenStudio::Ruleset::OSArgumentVector.new

    idf_file = OpenStudio::Ruleset::OSArgument::makeStringArgument('idf_file', false)
    idf_file.setDisplayName("IDF-file")
    idf_file.setDescription("The name of the IDF-file residing in the resources directory of this measure")
    idf_file.setDefaultValue('import.idf')
    args << idf_file

    yml_file = OpenStudio::Ruleset::OSArgument::makeStringArgument('yml_file', false)
    yml_file.setDisplayName("YML-file")
    yml_file.setDescription("The name of the YML-file residing in the resources directory of this measure")
    yml_file.setDefaultValue('import.yml')
    args << yml_file

    return args
  end 

  # define what happens when the measure is run
  def run(workspace, runner, user_arguments)
    super(workspace, runner, user_arguments)

    # Use the built-in error checking
    if !runner.validateUserArguments(arguments(workspace), user_arguments)
      return false
    end

    # Assign the user inputs to variables
    idf_file = runner.getStringArgumentValue("idf_file", user_arguments)
    yml_file = runner.getStringArgumentValue("yml_file", user_arguments)

    # Parameters
    idf_file = "#{File.dirname(__FILE__)}/resources/#{idf_file}"
    yml_file = "#{File.dirname(__FILE__)}/resources/#{yml_file}"

    # Process .idf file
    if !idf_file.empty?
      # Load workspace to be imported
      idf = OpenStudio::Workspace::load(idf_file)
      if idf.empty?
        runner.registerError("Cannot load #{idf_file}")
        return false
      end
      idf = idf.get.toIdfFile()
      workspace.addObjects(idf.objects)
    end

    # Process .yml file
    if !yml_file.empty?
      require 'yaml'
      fixfields = YAML::load_file(yml_file)

      fixfields.each do |f|
        o = workspace.getObjectByTypeAndName(f['class'].to_IddObjectType,f['name'])
        if o.empty?
          runner.registerError("No #{f['class']} found with name #{f['name']}")
          return false
        end
        o = o.get
        if !o.setString(f['field'],f['value'])
          runner.registerError("Unable to set #{f['value']} to field #{f['field']} in #{f['name']}")
          return false
        end
      end
    end

    return true

  end ...
(more)
2015-02-08 12:18:14 -0500 commented answer Reusing elements best practice

Ah, I see. I didn't know that it was possible to use existing .osm files as a library! That's a neat solution.

2015-02-08 12:17:36 -0500 marked best answer Reusing elements best practice

When building a new model, I want to be able to reuse built schedules/materials/etc.

I've seen there are several ways of doing this, right now I'm using the Sketchup plugin for importing construction, schedules and space loads. But i.e. materials cannot be imported this way. Right now I'm solving this by searching through the compiled .idf file for materials, pasting these in a seperate .idf file, and importing that in Sketchup.

Another way could be to open an existing .osm file in notepad, and compile templates for materials/schedules etc, which can be pasted into a new .osm file.

Which is the preferred way?

2015-02-08 11:44:48 -0500 commented answer Measure writing: import dependent Objects

That would be great, let me know if you need some sort of input file.

I'm also thinking about setting every field of every object using .setString. I couldn't get that to work because I couldn't find a method of finding the object type (needed for finding the correct original object). But that might be worth a second shot