From bd329b1c71c31a0f84aa28f5bec573b7c50cd910 Mon Sep 17 00:00:00 2001 From: s_ranjbar Date: Wed, 10 Apr 2024 10:27:10 -0400 Subject: [PATCH] Costing initiated The classes and scripts of costs library are copied in scripts folder fix: updating the energy system catalogue parameter importer fix: units are fixed in the sizing and simulation modules fix: adding costing workflow feat: new function created to store current and new system analysis results fix: updating the code to implement all the changes feat: new attributes added to energy system catalogue fix: samll bug in calculating capital cost of TES is solved feat: a new method for calculating peak dhw demand is created in building class fix: small bug in generation system class of CDM is fixed fix: small issues in current system simulation and sizing modules are resolved feat: new class called EnergySystemsSimulationFactory is created to handle all the system simulation models fix: the operational cost class is modified and completed fix: slight changes before merge fix: The simulation model for 1st archetype is modified. fix: small changes to building code that affect cost and total operational cost code feat: new attribute added to store fuel consumption values found from simulation fix: cleaning --- .../generation_system.cpython-39.pyc | Bin 3601 -> 3601 bytes .../non_pv_generation_system.cpython-39.pyc | Bin 11617 -> 11617 bytes .../pv_generation_system.cpython-39.pyc | Bin 5569 -> 5569 bytes .../thermal_storage_system.cpython-39.pyc | Bin 4148 -> 4148 bytes .../montreal_custom_catalog.cpython-39.pyc | Bin 7643 -> 7643 bytes ...eal_future_system_catalogue.cpython-39.pyc | Bin 14875 -> 14875 bytes hub/city_model_structure/building.py | 69 +-------- .../generation_system.cpython-39.pyc | Bin 4877 -> 4877 bytes .../non_pv_generation_system.cpython-39.pyc | Bin 14199 -> 14674 bytes .../thermal_storage_system.cpython-39.pyc | Bin 3320 -> 3320 bytes .../non_pv_generation_system.py | 17 +++ .../montreal_future_systems.xml | 6 +- hub/helpers/constants.py | 3 +- ...om_energy_system_parameters.cpython-39.pyc | Bin 5405 -> 5405 bytes ...e_energy_systems_parameters.cpython-39.pyc | Bin 6888 -> 6888 bytes main.py | 14 +- scripts/costs/cost.py | 6 +- scripts/costs/total_operational_costs.py | 6 +- scripts/energy_system_sizing.py | 2 +- ...gy_system_sizing_and_simulation_factory.py | 14 +- scripts/system_simulation.py | 6 +- .../system_simulation_models/archetype1.py | 137 ++++++++++++++++++ 22 files changed, 186 insertions(+), 94 deletions(-) create mode 100644 scripts/system_simulation_models/archetype1.py diff --git a/hub/catalog_factories/data_models/energy_systems/__pycache__/generation_system.cpython-39.pyc b/hub/catalog_factories/data_models/energy_systems/__pycache__/generation_system.cpython-39.pyc index 8166640084e47fcb5a739f513df9502ca9a0347f..59b6f604a36141333abc8b334e368026557dbd76 100644 GIT binary patch delta 20 acmbOzGf{>+k(ZZ?0SIPHGup__#s>f`Wds`l delta 20 acmbOzGf{>+k(ZZ?0SHnKt8L_F;{yOJ%LE7j diff --git a/hub/catalog_factories/data_models/energy_systems/__pycache__/non_pv_generation_system.cpython-39.pyc b/hub/catalog_factories/data_models/energy_systems/__pycache__/non_pv_generation_system.cpython-39.pyc index d66f0daac5d5808ec9f1f100d30cae19a70ab9ae..82f4374c0dff7425919e0501c23193f781263d8c 100644 GIT binary patch delta 1355 zcmZ{kNlX(_7{?jFT4_rw?EoEV%S>rxC_8mw2UkP|)I<@~X;}_UT1ciP!4SoR2ZM>x z{0Vv>(JMEx;b2^%i3g1fVxoynIB@d9!Lugn_ez3gSq-e%TtpnU8=<+lUO%-Qa?<~JH%>Yde5fmWuqFrw=TK+Hk}!qA+_Y|LaSZD zGuwTxqK*`Or10ZT{+!6mQIAIZDmS))V#E09@Z+UuLce308y~{D16;BXv%8;jGw-L& zlZZPN+%9MioS`>W&LaJq1rOIlG^^ja!4YP1d3;y2!NM!228D>#b%2-~gjxaTC@2`UPZ*cIR_-S` zia#DrK2O2)!}l8HIEL%qsC;2VRc@p@4zurxPc_0_1k3{FMH#<*NvXm}cLKLchva_3 z)Kbt$)eVchBv$e;zRGWXRXoCcC&`ox7<0<0RV5+_J!mhJl(b75i6)YIbZ8`KOdjgg zVoQh(*=p8X5DF>?2VIy^tBSgr%f`$_W>~vwu3n9IYO7;gu|X78{6($mMnkaE!d8`@ z%}fragOv@LM4LJEK_Y3JrVYm;iNx?|ET(B&rgw_P_2P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aM-6XdDoi|OaadZ;! dC}*Z4MhaJCAZ^zhC#SXQ4&j-OyK0u4raxNFf<6EM diff --git a/hub/catalog_factories/data_models/energy_systems/__pycache__/thermal_storage_system.cpython-39.pyc b/hub/catalog_factories/data_models/energy_systems/__pycache__/thermal_storage_system.cpython-39.pyc index 31ec81fcad14bf60fe0beec89c478ce31511fc7d..b80728fe082c40da52c1abcb1574519113e0d530 100644 GIT binary patch delta 59 zcmdm@utkA8k(ZZ?0SIPHGup_#kC*Y*=2N^mjEp*y&G`eEZkbHB;a8fxnqQphmN}Hk JJNYxeBLMyZ5&r-H delta 59 zcmdm@utkA8k(ZZ?0SJU=t8L`o$IBSC`4n#sBct|YbN&FPD3i%H{7REo^NTY@nM0Yp JlRxu20sy{E5Apy2 diff --git a/hub/catalog_factories/energy_systems/__pycache__/montreal_custom_catalog.cpython-39.pyc b/hub/catalog_factories/energy_systems/__pycache__/montreal_custom_catalog.cpython-39.pyc index 18eeb41cc750b0ab726285f1edc51ca05ec6d261..3e998cac2db2ebd839c47c98461dbca28d113be1 100644 GIT binary patch delta 1442 zcma)+&rcIU6vw;$MO)}^Cb%)XOC?4QpFG}s^L_8lo9)re(M+r2_xo)8@BO>U zgVwxLVkU7ak~C@_y1v*WtZl8J8~O{qXeeq{cHtEL;8|Nw@dNlW;1UP(ZdOn+V^qtC z1q(7=qRzJ0JI6!f6>#3-V69@tqD}}REQCrbA@xE;Zoxf}ItMrl`3_Yx zm|e|b54f&z$N@Y8_I1EKKonm9YY`yIF57G#TdgjQ_!ov*G^Y{+tIsO`n5^G?=}$;f zlI{f(vkl{LS=LcjutHS0{;aN%N~sJ&_y&}`$ss!$wn~2l`ZM)WypSZC_x?}w>rgM) zbUDpi=rgy2i_*B*Ld&1EhM>~f1Z914ey9R#AgXy?GO0T9i!gC*YleQu@O>DzG9eHY9ae>yRG814x*y|01Y z$S*0m8%-<=8BmbjRvSXR-hn9YgLv&;hq#R&0>S`McZ24mL(Me?&An*KJ|zmAhtwsG zboBVn(esL0E+Nez_z{E~5~&o6?+k-eL_`l(A@B(?@dQDUxr+K0!p!$TDOS)D#yaMs z!24yMEdPM>I<7KzMpO8Q&AbZE77+XtSXU?B^~t+oE|L1x+>eb&tIeHpS*|Wxdknpt z7PnhldIIqVZ8O;QO1f8{N(>}K>XX-}@~vn&v~7*!ums@%bMXtq)ka1GYm>7yKKi<=&Y2vwPp(u-w|2Pw|Q0 DF_TF2 delta 1442 zcma)+&rcIU6vw;$MO)}^DB4n?A|;DOi{ei}5d;M^f*MW6L$kI+*`(dAGh3lv@TLb( z%u%?S7~{dLSI_QYTzm*=Rq)Z*eeP`(K6OBQ4Cer_M?dmVge&zrA#^SQS#=vZS}Hc zPj8gOz<&mC7LaG|u2-7}O_H17oZ~>9qQ{C(DW)ibt16{-A}V)~B!pf8oZzrrs%BVD zwM2a2n&6N_Bn$Q=U1k-x<>2O8VHdYNIA_=#zV7KCjAW^*ke~Mq=;V9fT zoc2>ln;YR-DJM>$u9?+Q!c|2pQ4$CL6#E{@Zo&eJ9XVu*y8kjDD*IYa zqz_c)0k;4H0O*RiIpnTpYbU|62oS||g9SOs5(nyLZ=$2#+h8X6)k(13Xe!cnzcO2~ zUs7%>o|zXipdfpjWe9P*0+Ae^Ab$tqQk>#8xdVs-MBYVKjt{lx7&N!zW6p7rU=%{9 zIZ*sy=J;7%tyQsRP;wWRTLPJsNN)~-Q>=&@nu)+C#KaYx=6@|uMPJ9n3OrIObv#Fi zPIxO&s^u&42VB-k!}1n1g+FZMS4eRU!>6D*I&rTL&&KkI&@bjrVpv*guZ+ubby33}6uO0Pqm-7+@DAtP%DuIok7tuUIaHKVT=s^m3pytMw(!pUE9(%i-?t I`H;^420OJs_5c6? diff --git a/hub/catalog_factories/energy_systems/__pycache__/montreal_future_system_catalogue.cpython-39.pyc b/hub/catalog_factories/energy_systems/__pycache__/montreal_future_system_catalogue.cpython-39.pyc index 0ab98f97e534a9cdbae0028606d048b9a70b24cb..1f9f0180cf9cccc46404c485cbd157d0cabdc386 100644 GIT binary patch delta 660 zcmbPTGP{I3k(ZZ?0SIPHGup`gOp)={I-Zf!oTq|C%PZ}NMUWX3t0gH?|( zs;mHt7p(*lt3bqZ5U~zKtOXHkK*Z|F*6IpCV`9`5C%3E1af4;RYL;zYrY^?_H1Mc~ zBHKog+GU&HXc#djfz8qf34jemSh5;!D%=!JuA*v?C|Ef{CBlBNRbX?##)6GlKe<6m zO_OMAHlNpGWE9^7vSu@o&}1p<0FC2}B$P5ywEp$;l38k&I_I&oXOd1^_l0 BtDFD; delta 657 zcma)(JxD@P9L2kuB85vKHH4^{&kr(8a;c$))+nMOYq5}qOyMF(1z~Ft4L1f|EzuMNjYZTw_ra64-tgnR|2zM4F85`V*<^LZY_6&hPwY`CRlnLv zn0?qE42xnC=C_VU9m%nG=O|g?{Y_WInHO_f05*ViU>n#1Hi05*S8O6?Sg{-B_dJ_a z9Au5>6)O>G*KWIU7sfUI=58e;GN=Uu)eR*Zicm6AhNH$)MW->9_VQWE Polyhedron: @@ -844,38 +842,6 @@ class Building(CityObject): self._onsite_electrical_production[_key] = _results return self._onsite_electrical_production - @property - def heating_consumption_disaggregated(self) -> dict: - """ - Get energy consumed for heating from different fuels in J - return: dict - """ - return self._heating_consumption_disaggregated - - @heating_consumption_disaggregated.setter - def heating_consumption_disaggregated(self, value): - """ - Get energy consumed for heating from different fuels in J - return: dict - """ - self._heating_consumption_disaggregated = value - - @property - def domestic_how_water_consumption_disaggregated(self) -> dict: - """ - Get energy consumed for heating from different fuels in J - return: dict - """ - return self._domestic_how_water_consumption_disaggregated - - @domestic_how_water_consumption_disaggregated.setter - def domestic_how_water_consumption_disaggregated(self, value): - """ - Get energy consumed for heating from different fuels in J - return: dict - """ - self._domestic_how_water_consumption_disaggregated = value - @property def lower_corner(self): """ @@ -891,45 +857,12 @@ class Building(CityObject): return [self._max_x, self._max_y, self._max_z] @property - def fuel_consumption_breakdown(self) -> dict: + def energy_consumption_breakdown(self) -> dict: """ Get energy consumption of different sectors return: dict """ fuel_breakdown = {cte.ELECTRICITY: {cte.LIGHTING: self.lighting_electrical_demand[cte.YEAR][0], cte.APPLIANCES: self.appliances_electrical_demand[cte.YEAR][0]}} - energy_systems = self.energy_systems - for energy_system in energy_systems: - demand_types = energy_system.demand_types - generation_systems = energy_system.generation_systems - for demand_type in demand_types: - if demand_type == cte.COOLING: - fuel_breakdown[cte.ELECTRICITY][cte.COOLING] = self.cooling_consumption[cte.YEAR][0] / 3600 - elif demand_type == cte.HEATING: - heating_fuels = [generation_system.fuel_type for generation_system in generation_systems] - if len(heating_fuels) > 1: - for fuel in heating_fuels: - if fuel == cte.ELECTRICITY: - fuel_breakdown[cte.ELECTRICITY][cte.HEATING] = self._heating_consumption_disaggregated[cte.ELECTRICITY][cte.YEAR][0] - elif fuel not in fuel_breakdown.keys(): - fuel_breakdown[fuel] = {cte.HEATING: self._heating_consumption_disaggregated[fuel][cte.YEAR][0]} - else: - fuel_breakdown[fuel][cte.HEATING] = self._heating_consumption_disaggregated[fuel][cte.YEAR][0] - else: - fuel = heating_fuels[0] - if fuel == cte.ELECTRICITY: - fuel_breakdown[cte.ELECTRICITY][cte.HEATING] = self.heating_consumption[cte.YEAR][0] - elif fuel not in fuel_breakdown.keys(): - fuel_breakdown[fuel] = {cte.HEATING: self.heating_consumption[cte.YEAR][0]} - else: - fuel_breakdown[fuel][cte.HEATING] = self.heating_consumption[cte.YEAR][0] - elif demand_type == cte.DOMESTIC_HOT_WATER: - for generation_system in generation_systems: - if generation_system.fuel_type == cte.ELECTRICITY: - fuel_breakdown[cte.ELECTRICITY][cte.DOMESTIC_HOT_WATER] = self.domestic_hot_water_consumption[cte.YEAR][0] - elif generation_system.fuel_type not in fuel_breakdown.keys(): - fuel_breakdown[generation_system.fuel_type] = {cte.DOMESTIC_HOT_WATER: self.domestic_hot_water_consumption[cte.YEAR][0]} - else: - fuel_breakdown[generation_system.fuel_type][cte.DOMESTIC_HOT_WATER] = self.domestic_hot_water_consumption[cte.YEAR][0] self._fuel_consumption_breakdown = fuel_breakdown return self._fuel_consumption_breakdown diff --git a/hub/city_model_structure/energy_systems/__pycache__/generation_system.cpython-39.pyc b/hub/city_model_structure/energy_systems/__pycache__/generation_system.cpython-39.pyc index 4d2de077ea9344ec2f963e480c00bba2c6a3687b..6bbaea4e9d89f424276c63a98762ebf5359d6f5b 100644 GIT binary patch delta 20 acmeBG>s8}U9Qj5cyJ2?GEwG6X09 delta 20 acmeBG>s8}Uc7#nY;eS-)6F>hZ7 z!x=CTOmrrM!yiTo(PaJ@0)i0#0TM6w?{#3sGD z?|tw6oO9nj_uTVm{3~V)6%^!~@Hc5~9sYUAMcXxwJ9g<77s?7q*;0LE=_xKU7}5fPtE^z@R+V(M?`HTj0p4!D=^fbQ&0?qit9zG9b6<0esvm{8=peXdKJ za_*R&=?Za=6jJ2)ZgDszMa6I;o=n9?6gd%x<~i@?E+aR%e7G~G4T|&M^VQ=coBy!! zV=rACPsHSSD5{dgL`oS+DXn0))k0@=9@yrdXb9l2DKqoZ=zcMOZPOlVf1I2_QkQaT+T;Y1=zfu=>sNst{{gmjg>CQzK|8d#3P zDKgMh)r{RKjup_*Ohd52;p8R}8S=D{zJeOPFj$GgS(Ue>6}!l@(a=mDzDt*4RI9=E zxZ{`6iW{sRJG|jo;Ax}TPg0|2Z50Yvwa=4Nw!A^l%Did%qkZ@UVr8!jtBs&*P`IT* zd&^hpMsg_(m6vkgsGs<5`C;KHBi33JzSme6DmE8pItWFTW!znKrxwm*0QXcL5!M-@ z)}!#7hN^L{sn0~Anl79^7@=fR9F8XT--ik3Y2j%jb-Q80VF#yY9h|T2;Wv|2Jz@_E9S?}R zX47uCz1(V~-Qs(V2z@AY!PlNiZ|15{NEfLoLOZcyIK@V#J~&->o!@GN+lImbI@APb z>JL=tA)SPT+y1hG2=^%81Rv&`gWd~#zY%^13Q-k5+Q8cM@Q#e6rg^Q*Fy((}s@*rq z?=&(cqA*UT+Ss$$#Y|C6L-lNyOrPPIAL=NC=HKK)M)+M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&*g4b08XL%u8$tOFe3Ru(SahZ@~|29V{ro9NU zZ9>vvucO;?faZ&*!TXLv&V`h%gm9Uc`zay&5KxB54p=W3*txPkryDb4d7%qdE$Lv= zn;}%#2=jIw{O#=FU!>WUsQoCkAQco3i4%GYom?kk@9+oJ5CbUmfVJpDcl`2Dh-GZc zr-B$|)6xK}6@A7Js^MNnVHiECgg=T;DSBmt5xtEQ;iCHo{)if82!#n5bF+l)+^!Z+ zE*FMD&u#vw8es&5GeqcQhp>qkKcBiPEi!BCf^O7}jdjj(8cjF>hiJ5?OR?@*!C0Y( zyQS~)$B3g84KE7kY06@D7@IgHPhFL!T|m zSF88u$^(?#&xH@1x!gTW7fv~J2Wl2vN*ghO;QMjlhFU?nvNCB}VqxELpWhdm`3*j) zJzOzP9{bhY4xsQLjxN@P6mNzV3hJ%gKk#4OSEZ9`z#s|10uqvOfwOfd>Nqi8YOSw=N cMa-DKH4q$)`lWV^f+nm-lcYB!7&t@X|MycykpKVy diff --git a/hub/city_model_structure/energy_systems/__pycache__/thermal_storage_system.cpython-39.pyc b/hub/city_model_structure/energy_systems/__pycache__/thermal_storage_system.cpython-39.pyc index cb1c354330149703128170f0de36ce1d8e622d75..073c98fa6f24da4e703a928804021f0ed62d97ea 100644 GIT binary patch delta 20 acmew%`9qRBk(ZZ?0SIPHGup`gmInYn4+Y2o delta 20 acmew%`9qRBk(ZZ?0SE- dict: + """ + Get fuel consumption in W, m3, or kg + :return: dict{[float]} + """ + return self._heating_fuel_consumption + + @heating_fuel_consumption.setter + def heating_fuel_consumption(self, value): + """ + Set fuel consumption in W, m3, or kg + :param value: dict{[float]} + """ + self._heating_fuel_consumption = value + diff --git a/hub/data/energy_systems/montreal_future_systems.xml b/hub/data/energy_systems/montreal_future_systems.xml index 4437fe62..6ebf8b51 100644 --- a/hub/data/energy_systems/montreal_future_systems.xml +++ b/hub/data/energy_systems/montreal_future_systems.xml @@ -1311,7 +1311,6 @@ heating cooling - domestic_hot_water 21 @@ -1408,8 +1407,8 @@ cooling - 21 - 18 + 23 + 16 @@ -1444,6 +1443,7 @@ 7 1 + 10 diff --git a/hub/helpers/constants.py b/hub/helpers/constants.py index a48718bd..af22e94d 100644 --- a/hub/helpers/constants.py +++ b/hub/helpers/constants.py @@ -10,11 +10,10 @@ Project Coder Pilar Monsalvete Alvarez de Uribarri pilar.monsalvete@concordia.ca KELVIN = 273.15 WATER_DENSITY = 1000 # kg/m3 WATER_HEAT_CAPACITY = 4182 # J/kgK - +NATURAL_GAS_LHV = 36.6e6 # J/m3 AIR_DENSITY = 1.293 # kg/m3 AIR_HEAT_CAPACITY = 1005.2 # J/kgK - # converters HOUR_TO_MINUTES = 60 MINUTES_TO_SECONDS = 60 diff --git a/hub/imports/energy_systems/__pycache__/montreal_custom_energy_system_parameters.cpython-39.pyc b/hub/imports/energy_systems/__pycache__/montreal_custom_energy_system_parameters.cpython-39.pyc index 4e8f384abb74ddbaf9b4e6e2542fab88b98c2098..df20da86ee48efe398eecf952354f96f8224dccc 100644 GIT binary patch delta 37 scmbQMHCKx}k(ZZ?0SIPHGup`gM40i`y`Gc@KQtY$f!TLQ>2bV3#dqwt;lFHzvx6pgUJg;--(KX^ofB8 zH4q^JBD5wi5z}T=n0!I3mr-_docKHqWuWjap5l_klFa1X)RK(+lp=AEN*NHL3nC0a XgzRJ$30LkW5K|IFRBSGhC}9EscCI`= delta 260 zcmaE1`ofeuk(ZZ?0SNZqQs2mJ$I5tXvlr_OCUF^{P?02%&}1nR0kOdXs*``Rt20V$ zR^$j{WR#g)!P&~D43bos%*>U>D7!g}E0$S8A1HE*ySTErBsDj_q_QBjhz)GO=KH*6 zER5Qd#f0P-jVGH59c9$p{9CA(kL5ZCL}*W5BBsr#IQfEDFQeS#IPrNJDnQ{|JjEr6C7H>&sU;ctDMb<>m9ij04@4M( X2)W5B60Y3MAf^ 0 and t_return < 25): T_ret[i + 1] = max(25, T[i + 1]) else: @@ -89,7 +89,7 @@ class SystemSimulation: tes_output = m_dis[i + 1] * cte.WATER_HEAT_CAPACITY * (T[i + 1] - T_ret[i + 1]) if tes_output < (self.heating_demand[i + 1] / 3600): q_aux[i + 1] = (self.heating_demand[i + 1] / 3600) - tes_output - aux_fuel[i + 1] = (q_aux[i + 1] * dt) / 50e6 + aux_fuel[i + 1] = (q_aux[i + 1] * dt) / 35.8e6 boiler_consumption[i + 1] = q_aux[i + 1] / boiler_efficiency heating_consumption[i + 1] = boiler_consumption[i + 1] + hp_electricity[i + 1] data = list(zip(T, T_sup, T_ret, m_ch, m_dis, q_hp, hp_electricity, aux_fuel, q_aux, self.heating_demand)) @@ -129,7 +129,7 @@ class SystemSimulation: disaggregated_consumption[generation_system.fuel_type][cte.HOUR]) disaggregated_consumption[generation_system.fuel_type][cte.YEAR] = [ sum(disaggregated_consumption[generation_system.fuel_type][cte.MONTH])] - self.building.heating_consumption_disaggregated = disaggregated_consumption + self.building.heating_fuel_consumption_disaggregated = disaggregated_consumption return self.building diff --git a/scripts/system_simulation_models/archetype1.py b/scripts/system_simulation_models/archetype1.py new file mode 100644 index 00000000..e24a5084 --- /dev/null +++ b/scripts/system_simulation_models/archetype1.py @@ -0,0 +1,137 @@ +import math +import csv +import hub.helpers.constants as cte +from hub.helpers.monthly_values import MonthlyValues + + +class Archetype1: + def __init__(self, building, output_path): + self._building = building + self._name = building.name + self._pv_system = building.energy_systems[1] + self._hvac_system = building.energy_systems[0] + self._dhw_system = building.energy_systems[-1] + self._heating_peak_load = building.heating_peak_load[cte.YEAR][0] + self._cooling_peak_load = building.cooling_peak_load[cte.YEAR][0] + self._domestic_hot_water_peak_load = building.domestic_hot_water_peak_load[cte.YEAR][0] + self._hourly_heating_demand = [0] + [demand / 3600 for demand in building.heating_demand[cte.HOUR]] + self._hourly_cooling_demand = [demand / 3600 for demand in building.cooling_demand[cte.HOUR]] + self._hourly_dhw_demand = building.domestic_hot_water_heat_demand[cte.HOUR] + self._output_path = output_path + self._t_out = building.external_temperature[cte.HOUR] + + def hvac_sizing(self): + storage_factor = 3 + heat_pump = self._hvac_system.generation_systems[0] + boiler = self._hvac_system.generation_systems[1] + thermal_storage = heat_pump.energy_storage_systems[0] + heat_pump.nominal_heat_output = round(0.5 * self._heating_peak_load / 3600) + heat_pump.nominal_cooling_output = round(self._cooling_peak_load / 3600) + boiler.nominal_heat_output = round(0.5 * self._heating_peak_load / 3600) + thermal_storage.volume = round( + (self._heating_peak_load * storage_factor) / (cte.WATER_HEAT_CAPACITY * cte.WATER_DENSITY * 30)) + return heat_pump, boiler, thermal_storage + + def hvac_simulation(self): + hp, boiler, tes = self.hvac_sizing() + demand = self._hourly_heating_demand + if hp.source_medium == cte.AIR: + hp.source_temperature = self._t_out + # Heating System Simulation + variable_names = ["t_sup_hp", "t_tank", "t_ret", "m_ch", "m_dis", "q_hp", "q_boiler", "hp_cop", + "hp_electricity", "boiler_gas", "boiler_consumption", "t_sup_boiler", "heating_consumption"] + num_hours = len(demand) + variables = {name: [0] * num_hours for name in variable_names} + (t_sup_hp, t_tank, t_ret, m_ch, m_dis, q_hp, q_boiler, hp_cop, + hp_electricity, boiler_gas, boiler_consumption, t_sup_boiler, heating_consumption) = [variables[name] for name in + variable_names] + + t_tank[0] = 30 + dt = 3600 + hp_heating_cap = hp.nominal_heat_output + hp_efficiency = float(hp.heat_efficiency) + boiler_efficiency = float(boiler.heat_efficiency) + v, h = float(tes.volume), float(tes.height) + r_tot = sum(float(layer.thickness) / float(layer.material.conductivity) for layer in + tes.layers) + u_tot = 1 / r_tot + d = math.sqrt((4 * v) / (math.pi * h)) + a_side = math.pi * d * h + a_top = math.pi * d ** 2 / 4 + ua = u_tot * (2 * a_top + a_side) + for i in range(len(demand) - 1): + t_tank[i + 1] = (t_tank[i] + + ((m_ch[i] * (t_sup_hp[i] - t_tank[i])) + + (ua * (self._t_out[i] - t_tank[i] + 5)) / cte.WATER_HEAT_CAPACITY - + m_dis[i] * (t_tank[i] - t_ret[i])) * (dt / (cte.WATER_DENSITY * v))) + if t_tank[i + 1] < 40: + q_hp[i + 1] = hp_heating_cap + m_ch[i + 1] = q_hp[i + 1] / (cte.WATER_HEAT_CAPACITY * 7) + t_sup_hp[i + 1] = (q_hp[i + 1] / (m_ch[i + 1] * cte.WATER_HEAT_CAPACITY)) + t_tank[i + 1] + elif 40 <= t_tank[i + 1] < 55 and q_hp[i] == 0: + q_hp[i + 1] = 0 + m_ch[i + 1] = 0 + t_sup_hp[i + 1] = t_tank[i + 1] + elif 40 <= t_tank[i + 1] < 55 and q_hp[i] > 0: + q_hp[i + 1] = hp_heating_cap + m_ch[i + 1] = q_hp[i + 1] / (cte.WATER_HEAT_CAPACITY * 3) + t_sup_hp[i + 1] = (q_hp[i + 1] / (m_ch[i + 1] * cte.WATER_HEAT_CAPACITY)) + t_tank[i + 1] + else: + q_hp[i + 1], m_ch[i + 1], t_sup_hp[i + 1] = 0, 0, t_tank[i + 1] + + hp_electricity[i + 1] = q_hp[i + 1] / hp_efficiency + if demand[i + 1] == 0: + m_dis[i + 1], t_return, t_ret[i + 1] = 0, t_tank[i + 1], t_tank[i + 1] + else: + if demand[i + 1] > 0.5 * self._heating_peak_load: + factor = 8 + else: + factor = 4 + m_dis[i + 1] = self._heating_peak_load / (cte.WATER_HEAT_CAPACITY * factor * dt) + t_return = t_tank[i + 1] - demand[i + 1] / (m_dis[i + 1] * cte.WATER_HEAT_CAPACITY * dt) + if m_dis[i + 1] == 0 or (m_dis[i + 1] > 0 and t_return < 25): + t_ret[i + 1] = max(25, t_tank[i + 1]) + else: + t_ret[i + 1] = t_tank[i + 1] - demand[i + 1] / (m_dis[i + 1] * cte.WATER_HEAT_CAPACITY * dt) + tes_output = m_dis[i + 1] * cte.WATER_HEAT_CAPACITY * (t_tank[i + 1] - t_ret[i + 1]) + if tes_output < (demand[i + 1] / dt): + q_boiler[i + 1] = (demand[i + 1] / dt) - tes_output + boiler_gas[i + 1] = (q_boiler[i + 1] * dt) / cte.NATURAL_GAS_LHV + if q_boiler[i + 1] > 0: + t_sup_boiler[i + 1] = q_boiler[i + 1] / (m_dis[i + 1] * cte.WATER_HEAT_CAPACITY) + t_tank[i + 1] + else: + t_sup_boiler[i + 1] = t_tank[i + 1] + boiler_consumption[i + 1] = q_boiler[i + 1] / boiler_efficiency + heating_consumption[i + 1] = boiler_consumption[i + 1] + hp_electricity[i + 1] + data = list(zip(q_hp, hp_electricity, hp_cop, m_ch, t_sup_hp, t_tank, m_dis, q_boiler, + boiler_gas, t_sup_boiler, t_ret, demand)) + file_name = f'simulation_results_{self._name}.csv' + with open(self._output_path / file_name, 'w', newline='') as csvfile: + output_file = csv.writer(csvfile) + # Write header + output_file.writerow(['HP_heat_output(W)', 'HP_electricity_consumption(W)', 'HP_COP', + 'TES_charge_flow_rate(kg/s)', 'TES_supply_temperature(C)', 'TES_temperature(C)', + 'TES_discharge_flow_rate(kg/s)', 'Boiler_heat_output(W)', 'Boiler_gas_consumption(m3)', + 'Boiler_supply_temperature(C)', 'Return_temperature(C)', 'heating_demand']) + # Write data + output_file.writerows(data) + return heating_consumption, hp_electricity, boiler_gas, t_sup_hp, t_sup_boiler + + def enrich_buildings(self): + (self._building.heating_consumption[cte.HOUR], hp_electricity, + boiler_gas, t_sup_hp, t_sup_boiler) = self.hvac_simulation() + self._building.heating_consumption[cte.MONTH] = MonthlyValues.get_total_month( + self._building.heating_consumption[cte.HOUR]) + self._building.heating_consumption[cte.YEAR] = [sum(self._building.heating_consumption[cte.MONTH])] + self._hvac_system.generation_systems[0].heating_fuel_consumption[cte.HOUR] = hp_electricity + self._hvac_system.generation_systems[0].heating_fuel_consumption[cte.MONTH] = MonthlyValues.get_total_month( + self._hvac_system.generation_systems[0].heating_fuel_consumption[cte.HOUR]) + self._hvac_system.generation_systems[0].heating_fuel_consumption[cte.YEAR] = \ + [sum(self._hvac_system.generation_systems[0].heating_fuel_consumption[cte.MONTH])] + self._hvac_system.generation_systems[1].heating_fuel_consumption[cte.HOUR] = boiler_gas + self._hvac_system.generation_systems[1].heating_fuel_consumption[cte.MONTH] = MonthlyValues.get_total_month( + self._hvac_system.generation_systems[1].heating_fuel_consumption[cte.HOUR]) + self._hvac_system.generation_systems[1].heating_fuel_consumption[cte.YEAR] = \ + [sum(self._hvac_system.generation_systems[1].heating_fuel_consumption[cte.MONTH])] + self._hvac_system.generation_systems[0].heat_supply_temperature = t_sup_hp + self._hvac_system.generation_systems[1].heat_supply_temperature = t_sup_boiler -- 2.39.2