Skip to content

Commit cf8c397

Browse files
author
vikrants
committed
New Workflow
1 parent 13e1023 commit cf8c397

File tree

162 files changed

+9570
-3054
lines changed

Some content is hidden

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

162 files changed

+9570
-3054
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,24 @@ on:
3838
jobs:
3939

4040
job-check-project:
41-
runs-on: ubuntu-latest
41+
runs-on: ubuntu-22.04
4242
steps:
4343

4444
- name: Check out repository
45-
uses: actions/checkout@v3
45+
uses: actions/checkout@v4
4646

4747
- name: Setup MATLAB
48-
uses: matlab-actions/setup-matlab@v1
48+
uses: matlab-actions/setup-matlab@v2
4949
with:
5050
release: R2024a
51+
cache: true
52+
products: |
53+
Simscape_Fluids
54+
Simulink
55+
Simscape
56+
MATLAB_Test
5157
5258
- name: Run tests
53-
uses: matlab-actions/run-command@v1
59+
uses: matlab-actions/run-command@v2
5460
with:
5561
command: openProject(pwd); BuildingEnergyManagementTestRunner;

Components/Ambient/EnvModel.png

-5.54 KB
Loading
-2.82 KB
Loading
-630 Bytes
Binary file not shown.

Components/OperationalData/BuildingHVACOperation.ssc

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ component (Propagation = blocks) BuildingHVACOperation
2323
end
2424

2525
parameters
26+
roomModelOption = roomPhysicsOptions.basicroom; % Select room modelling option
2627
heatPerOccupant = {5, 'W'}; % Heat per occupant
2728
opsParamBldg = zeros(400,7);% Building operational parameter matrix
2829
% Row size 400 represents:
@@ -49,14 +50,14 @@ component (Propagation = blocks) BuildingHVACOperation
4950
Qr = {zeros(nApts,nRooms), 'W'}; % S
5051
end
5152

52-
for i = 1:nApts
53-
for j = 1:nRooms
54-
connections
55-
connect(HPA,BldgA(i,j));
56-
connect(HPB,BldgB(i,j));
57-
end
58-
end
59-
end
53+
% for i = 1:nApts
54+
% for j = 1:nRooms
55+
% connections
56+
% connect(HPA,BldgA(i,j));
57+
% connect(HPB,BldgB(i,j));
58+
% end
59+
% end
60+
% end
6061

6162
annotations
6263
HPA : Side=Left;
@@ -65,7 +66,7 @@ component (Propagation = blocks) BuildingHVACOperation
6566
Qr : Side=Top;
6667
BldgA : Side=Right;
6768
BldgB : Side=Right;
68-
UILayout = [UIGroup("Operational Data",opsParamBldg) ...
69+
UILayout = [UIGroup("Operational Data",roomModelOption,opsParamBldg) ...
6970
UIGroup("Other Variables",heatPerOccupant)];
7071
end
7172

@@ -92,4 +93,35 @@ component (Propagation = blocks) BuildingHVACOperation
9293
end
9394
end
9495

96+
if roomModelOption == roomPhysicsOptions.basicroom || roomModelOption == roomPhysicsOptions.requirements
97+
for i = 1:nApts
98+
for j = 1:nRooms
99+
% Closing TL domain nodes as they are not needed; put dummy param. values
100+
equations
101+
BldgA(i,j).T == {300, 'K'};
102+
BldgA(i,j).p == {0.1, 'MPa'};
103+
BldgB(i,j).T == {300, 'K'};
104+
BldgB(i,j).p == {0.1, 'MPa'};
105+
end
106+
end
107+
end
108+
equations
109+
HPA.T == {300, 'K'};
110+
HPA.p == {0.1, 'MPa'};
111+
HPB.T == {300, 'K'};
112+
HPB.p == {0.1, 'MPa'};
113+
end
114+
annotations
115+
[HPA,HPB,BldgA,BldgB]: ExternalAccess=none;
116+
end
117+
else
118+
for i = 1:nApts
119+
for j = 1:nRooms
120+
connections
121+
connect(HPA,BldgA(i,j));
122+
connect(HPB,BldgB(i,j));
123+
end
124+
end
125+
end
126+
end
95127
end
82 KB
Binary file not shown.
28.6 KB
Binary file not shown.
7.41 KB
Binary file not shown.

Overview/BuildingEnergyManagementSimscape.m

Lines changed: 59 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% for building energy managmement systems, BEMS.
66
%
77

8-
% Copyright 2024 The MathWorks, Inc.
8+
% Copyright 2024 - 2025 The MathWorks, Inc.
99

1010
%%
1111
% Building energy management is an important step when addressing energy
@@ -21,50 +21,53 @@
2121
% based workflows are used to parameterize Simscape Custom components for
2222
% building energy simulations.
2323
%
24-
%% Create Building Model with Solar Loads
24+
%% Create Building Models Quickly and Analyze Solar Loading
2525
%
26-
% * To learn how to create buildings quickly and define solar loading on
26+
% To learn how to create buildings quickly and define solar loading on
2727
% them, see <matlab:open('CreateBuildingModelWithSolarLoad.mlx') Create
28-
% Building Model with Solar Loads>.
28+
% Building Model with Solar Loads>. In this workflow, you will learn how to
29+
% define rooms, create apartments, and construct a 3D building. At the end
30+
% of the workflow, you will be able to save your building definition in a
31+
% XML part and use it later or share with others.
2932
%
30-
% In this workflow, you will learn how to define rooms, create apartments,
31-
% and construct a 3D building. At the end of the workflow, you will be able
32-
% to save your building definition in a XML part and use it later or share
33-
% with others.
33+
%
34+
% <<../Images/createBuildingREADME.gif>>
35+
%
36+
%
37+
%% Analyze Building HVAC Requirements Across Different Seasons, Geography
3438
%
35-
%% Run Building Model for HVAC Requirement Analysis
39+
% There are two workflows in this section that leverage the same model
40+
% SLX file, |BuildingModelWithSolarLoad|. This model uses two different
41+
% custom Simscape blocks - the *Building* and the *Ambient* block to
42+
% simulate energy requirements or building heat load.
3643
%
37-
% * To learn how to evaluate HVAC requirements for a building, see
38-
% <matlab:open('BuildingManagementSystemRequirementAnalysis.mlx') Simulate
39-
% Building Model for HVAC Requirement Analysis> to open and run the live
40-
% script.
44+
% * In the first workflow, <matlab:open('BuildingManagementSystemRequirementAnalysis.mlx')
45+
% Simulate Building Model for HVAC Requirement Analysis>, you will learn how to
46+
% evaluate the building system for HVAC requirements over a period of one
47+
% week.
48+
% * In the second workflow, <matlab:open('BuildingHeatLoadEstimation.mlx')
49+
% Building Heat Load Estimation>, you will learn how to compare a house
50+
% heat loading and HVAC requriements in several different cities, over a
51+
% period of one year.
4152
%
42-
% The live script opens the Simscape Model which you can run and analyze
43-
% the results. To enable the post-processing functions to work in the live
44-
% script, you must run the model programatically, as shown in code example.
45-
% This model uses two different custom Simscape blocks - the *Building* and
46-
% the *Ambient* block. To learn more about each custom block, open the block
47-
% mask and see the documentation link.
4853
%
49-
%% Setup Building Model for BEMS Design
54+
% <<../Images/houseHeatLoadREADME.gif>>
5055
%
51-
% * To learn how to evaluate actual energy consumption and design
56+
%
57+
%% Model Heat Pump, Detailed HVAC, and Building Energy Management System
58+
%
59+
% To learn how to evaluate actual energy consumption and design
5260
% controllers, see <matlab:open('SimulateBuildingEnergyManagement.mlx')
5361
% Simulate Building Model for BEMS Design>. This will open a live script
54-
% which sets up the model, parameterizes it, and opens the model to run.
55-
%
62+
% which sets up the model, parameterizes it, and opens the model to run.
5663
% This is a detailed model that uses four different custom Simscape blocks -
5764
% the *Building* , the *Heat Pump* , the *Ambient* , and the *Operational
5865
% Data* blocks. To learn more about each custom block, open the block mask and
59-
% see the documentation link.
60-
%
61-
% In this example, you will also learn how to use a air-water heat pump
62-
% (AWHP) to maintain a desired set-point temperature within the building
63-
% rooms. You will be able to specify different conditions for different
64-
% rooms by using a physics table data. You will learn how to specify
65-
% different heating or cooling options within a room: radiator, under-floor
66-
% piping, or both.
67-
66+
% see the documentation link. You will also learn how to specify and
67+
% evaluate different heating and/or cooling options for a building room:
68+
% radiator, under-floor piping, or both.
69+
%
70+
%
6871
%% Appendix A: Custom Component Documentation
6972
% To learn more about the different custom components used in the simulation:
7073
%
@@ -80,6 +83,30 @@
8083
% Operational Data Documentation> to learn more about the block.
8184
%
8285
%% Appendix B: Overall Workflow Pictorial
86+
% There are 2 SLX models that are used in different analysis. Both these models
87+
% use one or more of the above specified custom components. The two SLX
88+
% models are:
89+
%
90+
% * |BuildingModelWithSolarLoad.slx| - used for HVAC requirement analysis.
91+
% * |BuildingModelWithSolarLoadAndHVAC.slx| - used for BEMS analysis.
92+
%
93+
% The picture below shows the composition of these two models. The first
94+
% SLX model, |BuildingModelWithSolarLoad|, makes use of two custom
95+
% component - |Building| and |Ambient|. The second SLX model,
96+
% |BuildingModelWithSolarLoadAndHVAC|, makes use of all four custom
97+
% components - |Building|, |Ambient|, |Operational Data|, and |Heat Pump|.
98+
% The room model options vary between the rooms defined in |Building| block
99+
% for |BuildingModelWithSolarLoad.slx| and
100+
% |BuildingModelWithSolarLoadAndHVAC.slx|. In the
101+
% |BuildingModelWithSolarLoad| SLX model, the |Building| has rooms defined
102+
% as thermal mass and connected to the |Wall| (wall, roof, floor) custom
103+
% components. In the |BuildingModelWithSolarLoadAndHVAC| SLX model, the
104+
% |Building| has rooms defined as thermal mass and connected to |Wall|
105+
% (wall, roof, floor) and HVAC components like |Radiator| and
106+
% |Underfloor Piping|. The room fidelity is controlled through a drop-down
107+
% list within the |Building| block mask.
108+
%
109+
% <<../Images/overallProjectSummary.png>>
83110
%
84111
% <<../Images/overallSummaryBuildingSim.png>>
85112
%

Overview/DocumentationBuildingOperation.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,15 @@
2020
%
2121
%% Operational Data
2222
%
23+
% * *Select room modelling option*, |roomModelOption|, is a drop down list
24+
% that enables you to switch between different room modelling and analysis
25+
% options. You can chose from 5 different options: |Thermal Load|, |Thermal
26+
% Requirements|, |HVAC: Room Radiator Only|, |HVAC: Room Underfloor
27+
% Heating/Cooling Only|, and |HVAC: Room Radiator with Underfloor
28+
% Heating/Cooling|. This must be of same value as set in the Building custom
29+
% component. To learn more about the room modelling options, see
30+
% <matlab:open('DocumentationRoomModellingOptions.html') Room Modelling
31+
% Options in Building Custom Component>.
2332
% * *Building Operational Parameter Matrix*, |opsParamBldg|, specified as
2433
% a matrix, defines the different operational parameter states in the
2534
% building. The matix has 7 columns and rows equal to total number of hours

0 commit comments

Comments
 (0)