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

Revision history [back]

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.