Skip to content

Commit 6def0d1

Browse files
author
vikrants
committed
R2025a
1 parent b23c3b9 commit 6def0d1

File tree

1,251 files changed

+16429
-1399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,251 files changed

+16429
-1399
lines changed
-13.8 KB
Binary file not shown.
-249 KB
Binary file not shown.

Components/Building/Room/generateCustomRoomComponents.m

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
component (Propagation = blocks) WallExternal
2+
% Wall External:2.5
3+
% This block is used to specify a solid external wall with solar Load.
4+
% This block combines Wall Selector block and the Solar Radiation on
5+
% Surface block to model external walls with solar radiation.
6+
% <br/>
7+
% <br/>
8+
% <a href="matlab:open DocumentationExternalWall.html">Documentation for External Wall</a>
9+
% <br/>
10+
11+
% Copyright 2025 The MathWorks, Inc.
12+
13+
annotations
14+
A : Side=Left;
15+
B : Side=Right;
16+
R : Side=Left;
17+
UILayout = [UIGroup("Wall", extWallModel, wallLength, wallHeight, wallThickness, ...
18+
wallMaterialDen, wallMaterialCp, wallAbsorptivity, wallThermalK)
19+
UIGroup("Window", winLength, winHeight, winThickness, ...
20+
winMaterialDen, winMaterialCp, winAbsorptivity, ...
21+
winThermalK, winTransmissivity)
22+
UIGroup("Vent", ventLength, ventHeight)
23+
UIGroup("Heat Transfer", extToWallHTC, intToRoomHTC, iniT)
24+
UIGroup("Location", latitude, longitude, localTime, dayLightS)
25+
UIGroup("Surface Orientation", surfAngle, surfUnitV)
26+
UIGroup("Solar Data Parameterization", startYear, startMonth, startDay, startHr, numHrsData, interp_method,extrap_method)];
27+
end
28+
29+
inputs
30+
R = {0, 'W/m^2'}; % Rad
31+
end
32+
33+
nodes
34+
A = foundation.thermal.thermal; % A
35+
B = foundation.thermal.thermal; % B
36+
end
37+
38+
parameters
39+
extWallModel = wallExternalModelOption.wallSolarWinVent; % Select wall type
40+
% Wall properties
41+
wallLength = {5, "m"}; % Wall length
42+
wallHeight = {3, "m"}; % Wall height
43+
wallThickness = {0.3, "m"}; % Wall thickness
44+
wallMaterialDen = {4000, "kg/m^3"}; % Wall material density
45+
wallMaterialCp = {1870, "J/(K*kg)"}; % Wall material heat capacity
46+
wallAbsorptivity = 0.5; % Wall absorptivity
47+
wallThermalK = {2, "W/(K*m)"}; % Wall thermal conductivity
48+
% Vent properties
49+
ventLength = {0.1, "m"}; % Vent length
50+
ventHeight = {0.1, "m"}; % Vent height
51+
% Window properties
52+
winLength = {1, "m"}; % Window length
53+
winHeight = {0.5, "m"}; % Window height
54+
winThickness = {0.007, "m"}; % Window glass thickness
55+
winMaterialDen = {2500, "kg/m^3"}; % Window glass material density
56+
winMaterialCp = {787, "J/(K*kg)"}; % Window glass material heat capacity
57+
winAbsorptivity = 0.35; % Window glass Absorptivity
58+
winThermalK = {1, "W/(K*m)"}; % Window glass thermal conductivity
59+
winTransmissivity = 0.45; % Window glass transmissivity
60+
extToWallHTC = {5, "W/(K*m^2)"}; % Effective heat transfer coefficient from ambient to wall surface
61+
intToRoomHTC = {5, "W/(K*m^2)"}; % Effective heat transfer coefficient from internal surface to the room
62+
iniT = {300, "K"}; % Initial temperature
63+
% Solar Model
64+
startYear = {2025, "1"}; % Year for start time
65+
startMonth = {1, "1"}; % Month for start time
66+
startDay = {1, "1"}; % Day for start time
67+
startHr = {1,"1"}; % Hour of the day for start time
68+
numHrsData = {24, "1"}; % Number of hours of solar data
69+
latitude = {5, "1"}; % Latitude of the location
70+
longitude = {5, "1"}; % Longitude of the location
71+
localTime = {5, "1"}; % Longitude reference for local time calculations
72+
surfAngle = {90, "deg"}; % Surface angle wrt ground
73+
surfUnitV = {[0,-1], "1"}; % Unit outward normal direction vector
74+
dayLightS = {0, "1"}; % Daylight hour savings
75+
interp_method = simscape.enum.interpolation.linear; % Interpolation method
76+
extrap_method = simscape.enum.extrapolation.nearest; % Extrapolation method
77+
end
78+
79+
components(ExternalAccess = observe)
80+
WallOrientation = SolarRadiationOnSurface.solarRadiationOnSurface(...
81+
dayLightS = dayLightS, ...
82+
extrap_method = extrap_method, ...
83+
interp_method = interp_method, ...
84+
latitude = latitude, ...
85+
localTime = localTime, ...
86+
longitude = longitude, ...
87+
numHrsData = numHrsData, ...
88+
startDay = startDay, ...
89+
startHr = startHr, ...
90+
startMonth = startMonth, ...
91+
startYear = startYear, ...
92+
surfAngle = surfAngle, ...
93+
surfUnitV = surfUnitV);
94+
end
95+
96+
connections
97+
connect(WallOrientation.Sf,WallModel.S);
98+
connect(R,WallOrientation.S);
99+
connect(B,WallModel.B);
100+
connect(A,WallModel.A);
101+
end
102+
103+
if extWallModel == wallExternalModelOption.wallSolar
104+
annotations
105+
Icon = "extWallSolar.png";
106+
[winLength,winHeight,ventLength,ventHeight,winMaterialDen,winMaterialCp,winAbsorptivity,...
107+
winThermalK,winThickness,winTransmissivity] : ExternalAccess=none;
108+
end
109+
components(ExternalAccess=observe)
110+
WallModel = WallSelector.wallSelector(...
111+
extToWallHTC = extToWallHTC, ...
112+
iniT = iniT, ...
113+
intToRoomHTC = intToRoomHTC, ...
114+
optWall = int32(3), ...
115+
wallAbsorptivity = wallAbsorptivity, ...
116+
wallHeight = wallHeight, ...
117+
wallLength = wallLength, ...
118+
wallMaterialCp = wallMaterialCp, ...
119+
wallMaterialDen = wallMaterialDen, ...
120+
wallThermalK = wallThermalK, ...
121+
wallThickness = wallThickness);
122+
end
123+
elseif extWallModel == wallExternalModelOption.wallSolarWin
124+
annotations
125+
Icon = "extWallSolarWin.png";
126+
[ventLength,ventHeight] : ExternalAccess=none;
127+
end
128+
components(ExternalAccess=observe)
129+
WallModel = WallSelector.wallSelector(...
130+
extToWallHTC = extToWallHTC, ...
131+
iniT = iniT, ...
132+
intToRoomHTC = intToRoomHTC, ...
133+
optWall = int32(4), ...
134+
wallAbsorptivity = wallAbsorptivity, ...
135+
wallHeight = wallHeight, ...
136+
wallLength = wallLength, ...
137+
wallMaterialCp = wallMaterialCp, ...
138+
wallMaterialDen = wallMaterialDen, ...
139+
wallThermalK = wallThermalK, ...
140+
wallThickness = wallThickness, ...
141+
winLength = winLength, ...
142+
winHeight = winHeight, ...
143+
winThickness = winThickness, ...
144+
winMaterialDen = winMaterialDen, ...
145+
winMaterialCp = winMaterialCp, ...
146+
winAbsorptivity = winAbsorptivity, ...
147+
winThermalK = winThermalK, ...
148+
winTransmissivity = winTransmissivity);
149+
end
150+
elseif extWallModel == wallExternalModelOption.wallSolarVent
151+
annotations
152+
Icon = "extWallSolarVent.png";
153+
[winLength,winHeight,winMaterialDen,winMaterialCp,winAbsorptivity,winThermalK,...
154+
winThickness,winTransmissivity] : ExternalAccess=none;
155+
end
156+
components(ExternalAccess=observe)
157+
WallModel = WallSelector.wallSelector(...
158+
extToWallHTC = extToWallHTC, ...
159+
iniT = iniT, ...
160+
intToRoomHTC = intToRoomHTC, ...
161+
optWall = int32(6), ...
162+
wallAbsorptivity = wallAbsorptivity, ...
163+
wallHeight = wallHeight, ...
164+
wallLength = wallLength, ...
165+
wallMaterialCp = wallMaterialCp, ...
166+
wallMaterialDen = wallMaterialDen, ...
167+
wallThermalK = wallThermalK, ...
168+
wallThickness = wallThickness, ...
169+
ventLength = ventLength, ...
170+
ventHeight = ventHeight);
171+
end
172+
else % extWallModel == wallExternalModelOption.wallSolarWinVent
173+
annotations
174+
Icon = "extWallSolarWinVent.png";
175+
end
176+
components(ExternalAccess=observe)
177+
WallModel = WallSelector.wallSelector(...
178+
extToWallHTC = extToWallHTC, ...
179+
iniT = iniT, ...
180+
intToRoomHTC = intToRoomHTC, ...
181+
optWall = int32(5), ...
182+
wallAbsorptivity = wallAbsorptivity, ...
183+
wallHeight = wallHeight, ...
184+
wallLength = wallLength, ...
185+
wallMaterialCp = wallMaterialCp, ...
186+
wallMaterialDen = wallMaterialDen, ...
187+
wallThermalK = wallThermalK, ...
188+
wallThickness = wallThickness, ...
189+
ventLength = ventLength, ...
190+
ventHeight = ventHeight, ...
191+
winLength = winLength, ...
192+
winHeight = winHeight, ...
193+
winThickness = winThickness, ...
194+
winMaterialDen = winMaterialDen, ...
195+
winMaterialCp = winMaterialCp, ...
196+
winAbsorptivity = winAbsorptivity, ...
197+
winThermalK = winThermalK, ...
198+
winTransmissivity = winTransmissivity);
199+
end
200+
end
201+
end
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
component(Propagation=Blocks) roomWallRadiator
2+
% Room Wall Radiator : 2.5
3+
% This block is used to specify a radiator inside a room. The block has
4+
% two Thermal-Liquid (TL) nodes, A and B, to model the cooling or
5+
% heating fluid. The Thermal node R connects to the room thermal mass.
6+
% The input port V is used to control the flow into the radiator. When
7+
% set to 0, the whole cooling fluid passes through the radiator pipes.
8+
% When it is set to 1, the whole cooling liquid passes through a by-pass
9+
% circuit and the radiator is non-functional.
10+
% <br/>
11+
% <br/>
12+
% <a href="matlab:open DocumentationRoomRadiator.html">Documentation for Room Radiator</a>
13+
% <br/>
14+
15+
% Copyright 2025 The MathWorks, Inc.
16+
17+
annotations
18+
Icon = "roomWallRadiator.png";
19+
UILayout = [UIGroup("Piping", pipeHydrDia,pipeLength,pipeArea,pipeRoughness)
20+
UIGroup("Heat Transfer",htc,iniTemperature)];
21+
22+
M : Side=Right;
23+
TL_A : Side=Left;
24+
TL_B : Side=Right;
25+
TL_V : Side=Left;
26+
end
27+
28+
inputs
29+
TL_V = 0; % V
30+
end
31+
32+
nodes
33+
TL_A = foundation.thermal_liquid.thermal_liquid; % A
34+
M = foundation.thermal.thermal; % R
35+
TL_B = foundation.thermal_liquid.thermal_liquid; % B
36+
end
37+
38+
parameters
39+
pipeHydrDia = {1.5e-2, "m"}; % Pipe hydraulic diameter
40+
pipeLength = {1, "m"}; % Pipe length
41+
pipeArea = {1.75e-4, "m^2"}; % Pipe cross-sectional area
42+
pipeRoughness = {1e-6, "m"}; % Pipe roughness
43+
iniTemperature = {300, "K"}; % Initial temperature
44+
htc = {10, "W/(K*m^2)"}; % Heat transfer coefficient
45+
end
46+
47+
components(ExternalAccess=observe)
48+
Radiator = RoomRadiatorPiping(radiatorConvArea=pi*pipeHydrDia*pipeLength,...
49+
radiatorConvHTC=htc,gateValveOrificeDia=pipeHydrDia,...
50+
maxGateValveOrificeDia=pipeHydrDia,radiatorPipeHydrDia=pipeHydrDia,...
51+
radiatorPipeT=iniTemperature,radiatorPipeArea=pipeArea,radiatorPipeLen=pipeLength,...
52+
radiatorPipeRoughness=pipeRoughness,gateValveBypassOrificeDia=pipeHydrDia,...
53+
maxGateValveBypassOrificeDia=pipeHydrDia,radiatorBypassPipeHydrDia=pipeHydrDia,...
54+
radiatorBypassPipeT=iniTemperature,radiatorBypassPipeArea=pipeArea,...
55+
radiatorBypassPipeLen=pipeLength,radiatorBypassPipeRoughness=pipeRoughness);
56+
end
57+
58+
connections
59+
connect(Radiator.TL_A,TL_A);
60+
connect(Radiator.TL_B,TL_B);
61+
connect(Radiator.M,M);
62+
end
63+
64+
equations
65+
Radiator.TL_V == TL_V;
66+
end
67+
end
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
component(Propagation=Blocks) roomUnderFloorPiping
2+
% Room Underfloor Piping : 2.5
3+
% This block is used to specify underfloor heating or cooling inside a
4+
% room. The block has two Thermal-Liquid (TL) nodes, A and B, to model
5+
% the fluid. The Thermal node R connects to the room thermal mass.
6+
% The input port V is used to control the flow into the radiator. When
7+
% set to 0, the whole cooling fluid passes through the radiator pipes.
8+
% When it is set to 1, the whole cooling liquid passes through a by-pass
9+
% circuit and the radiator is non-functional.
10+
% <br/>
11+
% <br/>
12+
% <a href="matlab:open DocumentationRoomUnderFloorPiping.html">Documentation for Room Under-floor Piping</a>
13+
% <br/>
14+
15+
% Copyright 2025 The MathWorks, Inc.
16+
17+
annotations
18+
Icon = "roomUnderFloorPiping.png";
19+
UILayout = [UIGroup("Piping", pipeHydrDia,pipeLength,pipeArea,pipeRoughness)
20+
UIGroup("Heat Transfer",htc,iniTemperature)];
21+
22+
M : Side=Right;
23+
TL_A : Side=Left;
24+
TL_B : Side=Right;
25+
TL_V : Side=Left;
26+
end
27+
28+
inputs
29+
TL_V = 0; % V
30+
end
31+
32+
nodes
33+
TL_A = foundation.thermal_liquid.thermal_liquid; % A
34+
M = foundation.thermal.thermal; % R
35+
TL_B = foundation.thermal_liquid.thermal_liquid; % B
36+
end
37+
38+
parameters
39+
pipeHydrDia = {1.5e-2, "m"}; % Pipe hydraulic diameter
40+
pipeLength = {1, "m"}; % Pipe length
41+
pipeArea = {1.75e-4, "m^2"}; % Pipe cross-sectional area
42+
pipeRoughness = {1e-6, "m"}; % Pipe roughness
43+
iniTemperature = {300, "K"}; % Initial temperature
44+
htc = {10, "W/(K*m^2)"}; % Heat transfer coefficient
45+
end
46+
47+
components(ExternalAccess=observe)
48+
RoomUnderFloor = RoomUnderFloorPiping(UFPipeHTArea =pi*pipeHydrDia*pipeLength,...
49+
UFPipeHTC=htc,gateValveOrificeDia=pipeHydrDia,gateValveBypassOrificeDia=pipeHydrDia,...
50+
maxGateValveOrificeDia=pipeHydrDia,maxGateValveBypassOrificeDia=pipeHydrDia,...
51+
UFPipeHydrDia=pipeHydrDia,UFBypassPipeHydrDia=pipeHydrDia,UFPipeT=iniTemperature,...
52+
UFBypassPipeT=iniTemperature,UFPipeArea=pipeArea,UFBypassPipeArea=pipeArea,...
53+
UFPipeLen=pipeLength,UFBypassPipeLen=pipeLength,UFPipeRoughness=pipeRoughness,...
54+
UFBypassPipeRoughness=pipeRoughness);
55+
end
56+
57+
connections
58+
connect(RoomUnderFloor.TL_A,TL_A);
59+
connect(RoomUnderFloor.TL_B,TL_B);
60+
connect(RoomUnderFloor.M,M);
61+
end
62+
63+
equations
64+
RoomUnderFloor.TL_V == TL_V;
65+
end
66+
end

0 commit comments

Comments
 (0)