First time here? Check out the Help page!
1 | initial version |
The object you should really modify in your case is the Site:WaterMainsTemperature, where you can use either a Schedule or a Correlation.
It isn't available in the application, but it's easy to access it in the API.
# Get the Site:MainsWaterTemperature
mains = model.getSiteWaterMainsTemperature
# Case 1: Calculation Method = Schedule
# temp_sch is an OpenStudio::Model::Schedule
calculation_method = "Schedule"
mains.setCalculationMethod(calculation_method)
mains.setTemperatureSchedule(temp_sch)
mains.resetAnnualAverageOutdoorAirTemperature
mains.resetMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures
# Case 2: Calculation Method = Correlation
# avg_oa_temp, max_diff_monthly_oa_temp are doubles
calculation_method = "Correlation"
mains.setCalculationMethod(calculation_method)
mains.resetTemperatureSchedule
mains.setAnnualAverageOutdoorAirTemperature(avg_oa_temp)
mains.setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(max_diff_monthly_oa_temp)
2 | No.2 Revision |
The object you should really modify in your case is the Site:WaterMainsTemperature, where you can use either a Schedule or a Correlation.
It isn't available in the application, but it's easy to access it in the API.
# Get the Site:MainsWaterTemperature
mains = model.getSiteWaterMainsTemperature
# Case 1: Calculation Method = Schedule
# temp_sch is an OpenStudio::Model::Schedule
calculation_method = "Schedule"
mains.setCalculationMethod(calculation_method)
mains.setTemperatureSchedule(temp_sch)
mains.resetAnnualAverageOutdoorAirTemperature
mains.resetMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures
# Case 2: Calculation Method = Correlation
# avg_oa_temp, max_diff_monthly_oa_temp are doubles
calculation_method = "Correlation"
mains.setCalculationMethod(calculation_method)
mains.resetTemperatureSchedule
mains.setAnnualAverageOutdoorAirTemperature(avg_oa_temp)
mains.setMaximumDifferenceInMonthlyAverageOutdoorAirTemperatures(max_diff_monthly_oa_temp)
I uploaded a measure I wrote to do just this on the BCL: Set Site WaterMains Temeprature. There is an Excel spreadsheet in the 'resources' folder that I created to calculate the Correlation coefficients from the weather .stat file.
Note that I often find the resulting temperatures to be a bit extreme... Not sure if my fault or the original methodology. I couldn't find any mistake but it doesn't mean I didn't make one, feel free to ping me if you notice one.