close all;clear; clc % <- Closes open plot windows, removes variables in the workspace and cleans up the calculations displayed in the command window % Required parameters and code for importing temperature data are % already entered in the code. The code for importing opens a "wizard" which % allows you to easily select file, column separator and more. % You must complete the calculations of the home's energy needs using % Note N9 (the calculations are shown and explained in the note). You can % double check that U-values and k-values are the same as in the note, but % energy requirement will be different since you will be using others % temperature values than in the note. % Many of the parameters are given as the data type "struct" below. For this % data type, one variable (what is in front of the period) can contain several % different values, e.g. R1.L and R1.B which give room dimensions for rooms % 1. This can make it a bit more tidy when there are many parameters. After % having run the code, you can double-click on a variable in "Workspace" to % open and see all the values it contains. %% Room dimensions R1.L = 9; % Length, compartment 1 (m) R1.B = 5.4; % Width, room 1 (m) R2.L = 6; % Length, room 2 (m) R2.B = 4.2; % Width, room 2 (m) R3.L = 3; % Length, room 3 (m) R3.B = 4.2; % Width, room 3 (m) RH = 3; % Floor height (m) %% Dimensions of doors and windows dor.B = 1; % Width, inner door/outer door (m) dor.H = 2; % Height, inner door/outer door (m) window.B = 0.15; % Width, window (m) window.H = 0.25; % Height, window (m) %% Dimensions of the wall construction x.gypsum = 0.0125; % Thickness, plasterboard (m) x.stn = 0.148; % Thickness, studs (m) x.wool = 0.148; % Thickness, mineral wool (m) x.brick = 0.1; % Thickness, brick (m) x.cc = 0.6; % Center distance, studs (m) x.B_stn = 0.036; % Width, studs (m) x.B_ull = x.cc - x.B_stn; % Width, insulation (m) %% Parameters for thermal properties R.i = 0.13; % Transition resistance, inner wall (m2*K/W) R.u = 0.04; % Transition resistance, outer wall (m2*K/W) R.ceiling = 2; % Thermal resistance, attic and roof (m2*K/W) R.floor = 3; % Thermal resistance, floor to the outside (m2*K/W) k.gypsum = 0.2; % Thermal conductivity, plasterboard (W/m/K) k.stn = 0.120; % Thermal conductivity, studs (W/m/K) k.wool = 0.034; % Thermal conductivity, mineral wool (W/m/K) k.brick = 0.8; % Thermal conductivity, brick (W/m/K) U.skirtwall = 0.15; % U-value, cold room wall (W/m2/K) U.kloedor = 0.3; % U-value, cold room door (W/m2/K) U.utedor = 0.2; % U-value, exterior door (W/m2/K) U.inner wall = 1; % U-value, inner wall (W/m2/K) U.window = 0.8; % U-value, windows (W/m2/K) %% Parameters for air T.o = 20; % Temperature, living space (C) T.k = 4; % Temperature, cold room (C) air.rho = 1.24; % Density, air (kg/m3) air.c = 1; % Heat capacity, air (kJ/kg/K) %% Import of outdoor temperature Tu = readtable('temperature data.csv','Delimiter',';','PreserveVariableNames',1); % Import all columns from CSV file Tu = Tu.Air temperature; % Retrieve only column for outdoor temperature Tu = replace(Tu,',','.'); % Replace commas with periods (MATLAB uses periods) Tu = char(Tu); % Change format to string Tu = str2num(Tu); % Change format from string to numeric value Tu = Tu(1:8760); % Retrieve only 8760 values (equivalent to 1 year) % If one downloads data that uses periods (e.g. solar radiation) and the data is correctly imported as "double", % then there is no need to change the format %% Parameters for ventilation and infiltration S1.infiltration = 0.4; % Air change, infiltration zone 1 (1/h) S2.infiltration = 0.2; % Air change, infiltration zone 2 (1/h) S1.ventilation = 0.6; % Air change, ventilation zone 1 (1/h) S2.ventilation = 0; % Air change, ventilation zone 1 (1/h) eta.vv = 0.8; % Efficiency, heat exchanger %% Parameters for heating and cooling technology eta.el = 1; % Efficiency, direct electric heating COP.hp = 4; % COP factor heat pump all year round COP.kj = 3; % COP factor chiller all year round %% CALCULATE AREA windows window.Arute = window.B*window.H; window.Arute4 = 4*window.Arute; window.Arute8 = 8*window.Arute; S1.A_window = 5*window.Arute8 + 2*window.Arute4; S2.A_window = 2*window.Arute8 + 0*window.Arute4; %% CALCULATE AREA doors dor.A = dor.H*dor.B; S1.A_dor = 1*dor.A; S2.A_dor = 0*dor.A; S1_S2.A_dor = 1*dor.A; %% CALCULATE AREA wall surfaces including doors/windows S1.A_outerwall = (R1.B + R1.L + R1.B + R2.B + R2.L)*RH; S2.A_external wall = (R3.B + R3.L)*RH; S1_S2.A_wall = (R3.B + R3.L)*RH; % Boundary layer between temperature zones excluding doors/windows S1.Atot_outer wall = S1.A_outer wall - S1.A_window - S1.A_door; S2.Atot_outer wall = S2.A_outer wall - S2.A_window - S2.A_door; S1_S2.Atot_wall = S1_S2.A_wall - S1_S2.A_dor; % Floor area and roof area S1.A_floor = R1.B*R1.L + R2.B*R2.L; S2.A_floor = R3.B*R3.L; S1.A_roof = S1.A_floor; S2.A_roof = S2.A_floor; S1.A_Br = S1.A_floor; % Usable area S2.A_Br = S2.A_floor; % Usable area % Boundary layer between temperature zones including doors/windows S1.Atot_out = S1.A_external wall + S1.A_roof + S1.A_floor; S2.Atot_out = S2.A_external wall + S2.A_roof + S2.A_floor; S1_S2.Atot_gs = S1_S2.A_wall; %% Calculate volume S1.V = S1.A_Br*RH; S2.V = S2.A_Br*RH; %% The U-value method % Calculate U-value for the insulation section % Calculate U-value for the stud section % Calculate the U-value for the outer wall in zones 1 and 2 without windows/doors %% the k-value method % Calculate alloy k-value for the inhomogeneous layer % Calculate the U-value for the outer wall in zones 1 and 2 without windows/doors %% Average of U-value method and K-value method %% Calculate U-value for the entire wall surfaces %% Calculate U-values for the entire boundary between different zones: %% Thermal energy demand % Calculate the thermal energy demand for the different rooms % Ventilation without heat exchanger