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

Change building location measure in PAT

asked 2016-03-06 04:45:11 -0500

PBrain gravatar image

updated 2017-08-20 15:02:04 -0500

The Change Building Location measure is doing as advertised just fine in my installation of OpenStudio 1.10

I am hoping to use it in the Parametric Analysis Tool, but so far I am having no joy;

The EnergyPlus warnings from the PAT output reveal that the Location Object and Weather File Location are in conflict. Looks as though the conflict is resolved by falling back to the Baseline Weather File.

image description

I've tried a few different weather files and host folders. Any suggestions or solutions would be most appreciated

edit retag flag offensive close merge delete


help me out here folks ! I don't want to earn my tumbleweed badge

PBrain gravatar image PBrain  ( 2016-03-07 21:55:54 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2016-03-09 14:07:36 -0500

The change building location measure should set the site as well as the weather file. Below is a block of code from the measure.

# Check if the weather file is a ZIP, if so, then unzip and read the EPW file.
weather_file = File.join(@weather_directory, weather_file_name)

# Parse the EPW manually because OpenStudio can't handle multiyear weather files (or DATA PERIODS with YEARS)
epw_file = OpenStudio::Weather::Epw.load(weather_file)

weather_file = model.getWeatherFile
weather_file.setString(10, "file:///#{epw_file.filename}")

weather_name = "#{}_#{epw_file.state}_#{}"
weather_lat =
weather_lon = epw_file.lon
weather_time = epw_file.gmt
weather_elev = epw_file.elevation

# Add or update site data
site = model.getSite

In your case it seems like the weather file is for Perth and the Site object (becomes Site:Location in EnergyPlus) is for San Francisco. Not sure why that is happening, but the warning file says that EnergyPlus is trusting what is in the EPW file, so if you are trying to run in Perth the results should be valid. It does this if the distance between the location and the EPW is too great.

edit flag offensive delete link more


What is on BCL is a little outdated, I still think the warning can be ignored, but you should be able to download an update from the BCL for the Change Building Location measure. The updated version has a new argument for climate zone. that doesn't directly affect the simulation, it is only used by other measures that use the climate zone to apply climate zone specific recommendations or standards.

The old measure used the line below in place of the 'weather_file' section.

OpenStudio::Model::WeatherFile.setWeatherFile(model, epw_file).get
David Goldwasser gravatar image David Goldwasser  ( 2016-03-09 14:19:14 -0500 )edit

Still no joy. Perhaps I am doing something silly with the set up of the PAT project. I can't ignore the warning because it says the weather file location will be used and the weather file location is the same as the baseline; i.e it hasn't changed the weather file which is what I am trying to achieve. How does PAT differ from OS? Why would it work in OS but not PAT? I'm not using a relative directory but an absolute one. But i dont think thats the problem because the measure seems to run ok in PAT, the intitial condition and final condition output are what I expect.

PBrain gravatar image PBrain  ( 2016-03-10 02:32:47 -0500 )edit

@PBrain, thanks for the update. I think it relates to this open issue. I'll look into and get back to you later today if I can get an updated measure working.

This is PAT specific, measure would run fine in OS app.

David Goldwasser gravatar image David Goldwasser  ( 2016-03-10 08:26:01 -0500 )edit

@PBrain just to get more information, are you trying to do a parametric sweep across many locations, or are you using this as an always run measure to put the same weather file in all design alternatives?

David Goldwasser gravatar image David Goldwasser  ( 2016-03-10 08:41:07 -0500 )edit

Update: If your goal is just to have an always run measure that sets a single location for all design alternatives, that should work. If you want to sweep across climate zones, with different design alternatives using different locations within a single PAT project, I think you will have to wait until PAT 2.0, in September, or use the analysis spreadsheet that can already handle this.

David Goldwasser gravatar image David Goldwasser  ( 2016-03-10 11:38:08 -0500 )edit

Your Answer

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

Add Answer


Question Tools

1 follower


Asked: 2016-03-06 04:45:11 -0500

Seen: 409 times

Last updated: Mar 09 '16