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

Change building location measure in PAT

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

PBrain's avatar

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

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

Comments

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

PBrain's avatar PBrain  ( 2016-03-07 21:55:54 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

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

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.setCity(epw_file.city)
weather_file.setStateProvinceRegion(epw_file.state)
weather_file.setCountry(epw_file.country)
weather_file.setDataSource(epw_file.data_type)
weather_file.setWMONumber(epw_file.wmo.to_s)
weather_file.setLatitude(epw_file.lat)
weather_file.setLongitude(epw_file.lon)
weather_file.setTimeZone(epw_file.gmt)
weather_file.setElevation(epw_file.elevation)
weather_file.setString(10, "file:///#{epw_file.filename}")

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

# Add or update site data
site = model.getSite
site.setName(weather_name)
site.setLatitude(weather_lat)
site.setLongitude(weather_lon)
site.setTimeZone(weather_time)
site.setElevation(weather_elev)

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

Comments

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's avatar David Goldwasser  ( 2016-03-09 14:19:14 -0600 )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's avatar PBrain  ( 2016-03-10 02:32:47 -0600 )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's avatar David Goldwasser  ( 2016-03-10 08:26:01 -0600 )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's avatar David Goldwasser  ( 2016-03-10 08:41:07 -0600 )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's avatar David Goldwasser  ( 2016-03-10 11:38:08 -0600 )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

1 follower

Stats

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

Seen: 510 times

Last updated: Mar 09 '16