-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path_1_Run_EP22_VCWG2.py
41 lines (35 loc) · 2.62 KB
/
_1_Run_EP22_VCWG2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import os, numpy as np, pandas as pd
from threading import Thread
from multiprocessing import Process
import _0_vcwg_ep_coordination as coordination
import _1_ep_time_step_handler as time_step_handlers
def run_ep_api(sensitivity_file_name):
coordination.ini_all(sensitivity_file_name)
state = coordination.ep_api.state_manager.new_state()
coordination.psychrometric=coordination.ep_api.functional.psychrometrics(state)
coordination.ep_api.runtime.callback_begin_zone_timestep_before_set_current_weather(state,
time_step_handlers.overwrite_ep_weather)
if 'MediumOffice' in coordination.bld_type:
coordination.ep_api.runtime.callback_end_system_timestep_after_hvac_reporting(state,
time_step_handlers.MediumOffice_get_ep_results)
elif 'SmallOffice' in coordination.bld_type:
coordination.ep_api.runtime.callback_end_system_timestep_after_hvac_reporting(state,
time_step_handlers.SmallOffice_get_ep_results)
elif 'LargeOffice' in coordination.bld_type:
coordination.ep_api.runtime.callback_end_system_timestep_after_hvac_reporting(state,
time_step_handlers.LargeOffice_get_ep_results)
else:
coordination.ep_api.runtime.callback_end_system_timestep_after_hvac_reporting(state,
time_step_handlers.general_get_ep_results)
coordination.ep_api.exchange.request_variable(state, "HVAC System Total Heat Rejection Energy", "SIMHVAC")
coordination.ep_api.exchange.request_variable(state, "Site Wind Speed", "ENVIRONMENT")
coordination.ep_api.exchange.request_variable(state, "Site Wind Direction", "ENVIRONMENT")
coordination.ep_api.exchange.request_variable(state, "Site Outdoor Air Drybulb Temperature", "ENVIRONMENT")
coordination.ep_api.exchange.request_variable(state, "Site Outdoor Air Humidity Ratio", "ENVIRONMENT")
idfFileName = coordination.config['Bypass']['idfFileName']
epwFileName = coordination.config['Bypass']['epwFileName']
output_path = coordination.ep_trivial_path
weather_file_path = os.path.join('.\\resources\\epw', epwFileName)
idfFilePath = os.path.join(f'.\\resources\\idf', idfFileName)
sys_args = '-d', output_path, '-w', weather_file_path, idfFilePath
coordination.ep_api.runtime.run_energyplus(state, sys_args)