@kapils16 it is great to see cross simulation data being used in this way. Prior to OpenStudio 2.7.0 you would have to write this as an EnergyPlus measure to use it with OpenStudio, but scheduleFile
is now part of the OpenStudio SDK. Your code would look something like this
Note: Code updated to correctly use externalFile object instead of string with scheduleFile. externalFile copies the referenced file into the models "files" directory making the file easier to find at run time and more transportable. If the CSV is not found this will fail. This function works in OpenStudio 2.7.0, but there were fixes in 2.7.1 related to its use in Apply Measures Now in the OpenStudio application. If you are using it in that way, please update to 2.7.1.
ext_file = OpenStudio::Model::ExternalFile::getExternalFile(model,"/Users/myusername/Documents/temp.csv")
if ext_file.is_initialized
ext_file = ext_file.get
else
puts "Warning, could not find file"
runner.registerError("File could not be found and can not be assigned to ScheduleFile objects")
return false
end
model.getSpaces.each do |space|
space.people.each do |people|
# arguments are file, column, rows to skip
schedule_file_new = OpenStudio::Model::ScheduleFile.new(ext_file,25,1)
people.setNumberofPeopleSchedule(schedule_file_new)
end
end
The code above assumes you have a fractional schedule associated with the design level of people for each space in the OpenStudio model. If your CSV file contains actual number of people, then you are still fine, you just need to add more code before you loop through people. Use standard ruby methods to create a new copy of the ped_sim_raw.csv
file. Set the first row to the maximum number of people found in the column. Next convert all raw entries to a fractional value based on the maximum value. You could create a unique people object for each space, but a cleaner approach would be to create a people definition that represents a single person. If your pedestrian simulation supports it you can have different people types with different activity levels. When you loop through the people objects in each space you can set the multiplier based on the maximum value from for that column from the raw data, or saved in the top of fractional csv. Code to change multiplier would look like this.
people.setMultiplier(max_num_people_for_room_from_ped_sim)
Here is a link to the OpenStudio API documentation for scheduleFile. The fields should be similar to what is in the EnergyPlus ScheudleFile object.
@kapils16 Just out of interest. I typically think of pedestrian simulations for emergency egress analysis vs. 8760 simulation, but I guess for transportation hubs, stadiums, theaters, or anywhere where queue management is important you may run simulation full time series for at least specific event days. Is historical data (or future flight growth projections) being used for the changes in flow patterns for different days of the week and times of year? Just wondering about the source of the data, and outside of EnergyAnalysis/SystemSizing, what the full year occupancy simulation is used for.
Since I am considering the Airport terminal which characterized by fluctuating occupancy. I am simulating the pedestrian movement across various zone such as Check in Halls, Hold-rooms, security checks etc. according to the service time. This would give me occupancy variation throughout the day. For this I am using AnyLogic Software.