Skip to content

Commit

Permalink
0.7.3 - implementing arguments to modify adaptive comfort models
Browse files Browse the repository at this point in the history
  • Loading branch information
dsanchez-garcia committed Mar 14, 2024
1 parent afc09da commit 5e37dfb
Show file tree
Hide file tree
Showing 9 changed files with 66,493 additions and 12 deletions.
8,124 changes: 8,124 additions & 0 deletions ChileanModel.idf

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions EMS/ACCIS_Mixed_mode_v05-38_Occupancy.idf
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
!TODO:
!Parametrizar el vent opening factor; ahora mismo es 1 o 0, y se podria parametrizar en funcion de la velocidad maxima del viento; estudiar con cuidado porque seria una variable para zada zona aplicada a las ventanas
!Permitir la seleccion del modelo estatico aplicado cuando no se cumple aplicabilidad del adaptativo como una segunda variable
todo añadir argumentos para modificar los modelos de confort

!PENDIENTE DE ARREGLAR:
! HAY QUE MODIFICAR EL SCRIPT DE PYTHON PARA QUE AÑADA UN FORSCRIPT_SCHEDULE PARA CADA ZONA, PARA QUE PUEDA ACTIVARSE O DESACTIVARSE EL HVAC INDEPENDIENTEMENTE DE LAS OTRAS.
! ADEMÁS HABRÁ QUE HACER UN FOR LOOP PARA ASIGNAR A CADA ZONA SU DUALSETPOINTTEMPERATURE, QUE SERÁ EL FORSCRIPT DE LA ZONA CORRESPONDIENTE
! HAY QUE COMPROBAR QUE EL PROGRAMA ApplyAST_MixedMode FUNCIONA CORRECTAMENTE DESPUÉS DE ESOS CAMBIOS. QUIZÁS HAYA QUE ASIGNAR EL FORSCRIPT AL AST EN UN PROGRAMA PARALELO CON LoopZoneIDFName



!Para que funcione correctamente:
!- No debe haber otro script que contenta variables con los mismos nombres que este script; por lo tanto, no se puede duplicar y cambiar datos. La opcion mas recomendable es exportar el IDF, cambiar datos del script y guardar como un archivo de texto distinto.
!- Se debe usar Detailed HVAC system con Detailed HVAC data: el sistema debe ser un sistema VRF sin AHU
Expand Down
28 changes: 16 additions & 12 deletions accim/data/data_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,39 +184,43 @@ def __init__(

epw_df['EPW_mod_filtered'] = epw_df['EPW_names'].str.replace('-', '_').str.replace('.', '_').str.split('_')

rcpdict = {
future_scenario_dict = {
'Present': ['Presente', 'Actual', 'Present', 'Current'],
'RCP26': ['RCP2.6', 'RCP26', 'RCP2.5', 'RCP25'],
'RCP45': ['RCP4.5', 'RCP45'],
'RCP60': ['RCP6.0', 'RCP60'],
'RCP85': ['RCP8.5', 'RCP85']
'RCP85': ['RCP8.5', 'RCP85'],
'SSP126': ['ssp126'],
'SSP245': ['ssp245'],
'SSP370': ['ssp370'],
'SSP585': ['ssp585'],
}

for i in range(len(epw_df['EPW_names'])):
for j in rcpdict:
for k in rcpdict[j]:
for j in future_scenario_dict:
for k in future_scenario_dict[j]:
if k.lower() in epw_df.loc[i, 'EPW_names'].lower():
epw_df.loc[i, 'EPW_scenario'] = j
try:
epw_df.loc[i, 'EPW_mod_filtered'].remove([x for x in epw_df.loc[i, 'EPW_mod_filtered'] if x.lower() in k.lower()][0])
except IndexError:
continue

rcp_not_found_list = []
future_scenario_not_found_list = []

for i in range(len(epw_df['EPW_names'])):
try:
if type(epw_df.loc[i, 'EPW_scenario']) is float:
epw_df.loc[i, 'EPW_scenario'] = 'Present'
rcp_not_found_list.append(epw_df.loc[i, 'EPW_file_names'])
future_scenario_not_found_list.append(epw_df.loc[i, 'EPW_file_names'])
except KeyError:
epw_df.loc[i, 'EPW_scenario'] = 'Present'
rcp_not_found_list.append(epw_df.loc[i, 'EPW_file_names'])
future_scenario_not_found_list.append(epw_df.loc[i, 'EPW_file_names'])

if len(rcp_not_found_list) > 0:
print('Since no match has been found between RCP scenarios and EPW file name, '
if len(future_scenario_not_found_list) > 0:
print('Since no match has been found between RCP or SSP scenarios and EPW file name, '
'Present scenario has been assigned to the following EPW files:')
print(*rcp_not_found_list, sep='\n')
print(*future_scenario_not_found_list, sep='\n')

for i in range(len(epw_df['EPW_names'])):
for j in range(2000, 2101, 10):
Expand All @@ -226,7 +230,7 @@ def __init__(
epw_df.loc[i, 'EPW_mod_filtered'].remove(str(j))
except ValueError:
continue
# print('Year has nt ben identified.')
# print('Year has not been identified.')

for i in range(len(epw_df['EPW_names'])):
if epw_df.loc[i, 'EPW_scenario'] == 'Present':
Expand All @@ -244,7 +248,7 @@ def __init__(
epw_df.loc[i, 'EPW_year'] = 'Present'
year_not_found_list.append(epw_df.loc[i, 'EPW_file_names'])
if len(year_not_found_list) > 0:
print('Since no match has been found between RCP scenario Year and EPW file name, '
print('Since no match has been found between RCP or SSP scenario Year and EPW file name, '
'Present year has been assigned to the following EPW files:')
print(*year_not_found_list, sep='\n')

Expand Down
57 changes: 57 additions & 0 deletions accis in chile_final.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from accim.sim.accis import addAccis
from accim.utils import amend_idf_version_from_dsb
from accim.sim.chile_funcs import apply_heating_activation_time_sch



x = addAccis(
ScriptType='vrf_mm',
SupplyAirTempInputMethod='temperature difference',
Output_keep_existing=False,
Output_type='custom',
Output_freqs=['monthly'],
EnergyPlus_version='23.1',
TempCtrl='temp',
ComfStand=[21],
CAT=[80],
ComfMod=[3],
HVACmode=[2],
VentCtrl=[0],
VSToffset=[0],
MinOToffset=[50],
MaxWindSpeed=[50],
ASTtol_steps=1.9,
ASTtol_start=1.9,
ASTtol_end_input=1.9,
confirmGen=True,
VRFschedule='Heating_activation_time_chile',
eer=1,
cop=0.8,
)

# output_idf = x.output_idfs[[i for i in x.output_idfs.keys()][0]]
# output_idf.idfobjects['Output:variable']


##

from besos import eplus_funcs
from besos import eppy_funcs

# new_idf = [i for i in os.listdir() if i.endswith('.idf') and idfpath not in i][0]
# new_idf = 'TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V940_heat_act_time_added[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'caso_01.1_2_heat_act_time_added[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'caso_01.1_3[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'testmodel_chile_2_heat_act_time_added[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'TestModel_onlyGeometryForVRFsystem_2zones_CalcVent_V940[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'testmodel_chile_2_lightweight_uninsulated_heat_act_time_added[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
# new_idf = 'COMB 03_mod_no-door_lightweight_uninsulated_heat_act_time_added[CS_INT EN16798[CA_3[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'
new_idf = 'COMB 03_mod_no-door_lightweight_uninsulated_heat_act_time_added[CS_CHL Perez-Fargallo[CA_80[CM_3[HM_0[VC_X[VO_X[MT_X[MW_X[AT_0.1[NS_X.idf'

building = eppy_funcs.get_building(new_idf)

eplus_funcs.run_energyplus(
building_path=new_idf,
epw='CHL_Concepcion.856820_IWEC.epw',
out_dir='temp_sim_outputs'
)
Binary file modified dist/accim-0.7.3.tar.gz
Binary file not shown.
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ def run(self):

# Creating a dictionary with IDD paths, IDD backups paths and the first line to modify
dict_lines = {
'EnergyPlus 23.1.0': [r"C:\EnergyPlusV23-1-0\Energy+.idd", r"C:\EnergyPlusV23-1-0\Energy+_backup.idd", 83101],
'EnergyPlus 22.2.0': [r"C:\EnergyPlusV22-2-0\Energy+.idd", r"C:\EnergyPlusV22-2-0\Energy+_backup.idd", 82643],
'EnergyPlus 22.1.0': [r"C:\EnergyPlusV22-1-0\Energy+.idd", r"C:\EnergyPlusV22-1-0\Energy+_backup.idd", 81925],
'EnergyPlus 9.6.0': [r"C:\EnergyPlusV9-6-0\Energy+.idd", r"C:\EnergyPlusV9-6-0\Energy+_backup.idd", 81798],
Expand Down

0 comments on commit 5e37dfb

Please sign in to comment.