Skip to content

Commit 2080e26

Browse files
authored
Merge pull request #1435 from kldjonge/hfloorcheck
Issue1338_Issue1417_Vertical height check and internal floor thicknesses in TwoPort
2 parents f1a263d + 658b16e commit 2080e26

29 files changed

+699
-374
lines changed

IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo

Lines changed: 252 additions & 200 deletions
Large diffs are not rendered by default.

IDEAS/Airflow/Multizone/Validation/LargeHorizontalOpening.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ model LargeHorizontalOpening
77
Orifice Opening_Orifice(
88
redeclare package Medium = Medium,
99
useDefaultProperties=false,
10-
dp_turbulent=Opening_CrackOrOperableDoor.dp_turbulent_ope,
10+
dp_turbulent=Opening_CrackOrOperableDoor.dp_turbulent,
1111
A=2,
1212
CD=0.78) annotation (Placement(transformation(
1313
extent={{10,-10},{-10,10}},
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
within IDEAS.Buildings.Components.Examples;
2+
model CavityInternalCeiling
3+
"Illustration of an internal ceiling with a cavity"
4+
extends IDEAS.Buildings.Examples.ZoneExample(
5+
sim(interZonalAirFlowType= IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts),internalWall(
6+
redeclare parameter IDEAS.Buildings.Validation.Data.Constructions.LightWall constructionType,
7+
incOpt=3,
8+
hasCavity = true),
9+
zone1(hFloor=zone.hFloor + zone.hZone + 0.195));
10+
11+
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
12+
coordinateSystem(preserveAspectRatio=false)),
13+
experiment(
14+
StopTime=108000,
15+
Interval=720,
16+
Tolerance=0.001,
17+
__Dymola_Algorithm="Dassl"),
18+
__Dymola_Commands(file="Resources/Scripts/Dymola/Buildings/Components/Examples/CavityInternalCeiling.mos"
19+
"Simulate and plot"),
20+
Documentation(info="<html>
21+
<p>
22+
This example contains an example use of an opening in an internal ceiling.
23+
Note that it requires TwoPorts interzonal air flow (<code>interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts</code>).
24+
</p>
25+
</html>", revisions="<html>
26+
<ul>
27+
<li>
28+
August 13, 2025, by Klaas De Jonge:<br/>
29+
Updated construction type of Internal floor to <a href=modelica://IDEAS.Buildings.Validation.Data.Constructions.LightWall>
30+
IDEAS.Buildings.Validation.Data.Constructions.LightWall</a>
31+
</li>
32+
<li>
33+
February 05 2025, Klaas De Jonge<br>
34+
First implementation.
35+
</li>
36+
</ul>
37+
</html>"),
38+
__Dymola_experimentSetupOutput,
39+
__Dymola_experimentFlags(
40+
Advanced(
41+
EvaluateAlsoTop=false,
42+
GenerateAnalyticJacobian=true,
43+
OutputModelicaCode=false),
44+
Evaluate=true,
45+
OutputCPUtime=true,
46+
OutputFlatModelica=false));
47+
end CavityInternalCeiling;

IDEAS/Buildings/Components/Examples/CavityInternalWall.mo

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
within IDEAS.Buildings.Components.Examples;
22
model CavityInternalWall
33
"Illustration of an internal wall with an operable cavity"
4-
extends IDEAS.Buildings.Examples.ZoneExample(sim.interZonalAirFlowType = IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, internalWall(hasCavity = true, use_y_doo = true));
4+
extends IDEAS.Buildings.Examples.ZoneExample(sim(
5+
interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts),
6+
internalWall(hasCavity = true, use_y_doo = true));
57
Modelica.Blocks.Sources.Sine sine(amplitude = 0.5, f = 1 / 7200, offset = 0.5) annotation(
6-
Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));equation
8+
Placement(visible = true, transformation(origin = {-90, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
9+
equation
710
connect(internalWall.y_doo, sine.y) annotation(
8-
Line(points = {{-16, 6}, {-16, 10}, {-78, 10}}, color = {0, 0, 127}));
9-
11+
Line(points={{-16.8,6.4},{-16.8,10},{-79,10}}, color = {0, 0, 127}));
1012
annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
1113
coordinateSystem(preserveAspectRatio=false)),
1214
experiment(

IDEAS/Buildings/Components/Examples/TwoStoreyBoxes.mo

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ model TwoStoreyBoxes "Model with two zones on different floors, one zone above t
55
inner BoundaryConditions.SimInfoManager sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts,n50=1) annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
66

77
IDEAS.Buildings.Components.RectangularZoneTemplate Level(
8-
hFloor=5,
8+
Medium(extraPropertiesNames={"CO2"},C_nominal={1e-6}),
9+
hFloor=5.25,
910
T_start=291.15,
1011
bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
1112
bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
@@ -25,6 +26,7 @@ model TwoStoreyBoxes "Model with two zones on different floors, one zone above t
2526
annotation (Placement(transformation(extent={{-40,20},{-20,40}})));
2627

2728
IDEAS.Buildings.Components.RectangularZoneTemplate Groundfloor(
29+
Medium(extraPropertiesNames={"CO2"},C_nominal={1e-6}),
2830
T_start=291.15,
2931
bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
3032
bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall,
@@ -54,6 +56,9 @@ initial equation
5456
Groundfloor.gainCon.T=Tfix.port.T;
5557

5658
equation
59+
assert(Modelica.Math.isEqual(Groundfloor.ppm,sim.ppmCO2,eps=1),"CO2 should be at constant background level but isn't");
60+
assert(Modelica.Math.isEqual(Level.ppm,sim.ppmCO2,eps=1),"CO2 should be at constant background level but isn't");
61+
5762
connect(Groundfloor.proBusCei, Level.proBusFlo) annotation (Line(
5863
points={{-30.2,-24},{-30,-22},{-30,24}},
5964
color={255,204,51},
@@ -74,21 +79,22 @@ equation
7479
coordinateSystem(preserveAspectRatio=false)),
7580
experiment(
7681
StopTime=1209600,
77-
Interval=3600.00288,
78-
Tolerance=1e-12,
82+
Interval=3600,
83+
Tolerance=0.0001,
7984
__Dymola_fixedstepsize=15,
8085
__Dymola_Algorithm="Dassl"),
8186
Documentation(revisions="<html>
8287
<ul>
83-
<li>
84-
October 30, 2024, by Klaas De Jonge:<br/>
88+
<li>August 18, 2025, by Klaas De Jonge:<br>
89+
Added assert statements for CO2 background check,added C_nominal to medium declaration,changed tolerance in related .mos file,corrected Level.hFloor for <a href=\"https://github.com/open-ideas/IDEAS/issues/1338\">#1338</a></li>
90+
<li>October 30, 2024, by Klaas De Jonge:<br>
8591
First implementation
8692
</li>
8793
</ul>
8894
</html>", info="<html>
8995
<p>Model with two zones on different floors, one zone above the other, with a large opening between these zones and stack-effect airflow enabled.</p>
9096
</html>"),
9197
__Dymola_Commands(file=
92-
"Resources/Scripts/Dymola/Buildings/Examples/TwoStoreyBoxes.mos"
98+
"Resources/Scripts/Dymola/Buildings/Components/Examples/TwoStoreyBoxes.mos"
9399
"Simulate and Plot"));
94100
end TwoStoreyBoxes;

IDEAS/Buildings/Components/Examples/package.order

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
AirflowBoxModel
22
BeamRadiationOnFloor
33
BuildingShadeExample
4+
CavityInternalCeiling
45
CavityInternalWall
56
CavityWalls
67
FacadeShadeExample

IDEAS/Buildings/Components/Interfaces/PartialSurface.mo

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,16 @@ partial model PartialSurface "Partial model for building envelope component"
4343
parameter Boolean use_custom_q50=false
4444
"check to disable the default q50 computation and to assign a custom q50 value"
4545
annotation (choices(checkBox=true),Dialog(tab="Airflow", group="Airtightness"), Evaluate=true);
46-
parameter Real custom_q50(unit="m3/(h.m2)") = 2
46+
parameter Real custom_q50(unit="m3/(h.m2)")=2
4747
"Surface air tightness"
4848
annotation (Dialog(enable=use_custom_q50,tab="Airflow", group="Airtightness"));
4949
final parameter Real q50_internal(unit="m3/(h.m2)",fixed=false)
5050
"Surface air tightness";
5151

5252
final parameter Modelica.Units.SI.Length hzone_a( fixed=false);//connected with propsbus in inital equation
5353
final parameter Modelica.Units.SI.Length hAbs_floor_a( fixed=false);
54-
parameter Modelica.Units.SI.Length hVertical=if IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Floor) or IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Ceiling) then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true);
55-
parameter Modelica.Units.SI.Length hRelSurfBot_a= if IDEAS.Utilities.Math.Functions.isAngle(inc,IDEAS.Types.Tilt.Ceiling) then hzone_a else 0 "Height between the lowest point of the surface (bottom) and the floor level of the zone connected at propsBus_a"
56-
annotation(Evaluate=true);
54+
parameter Modelica.Units.SI.Length hVertical=if IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Floor) or IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Ceiling) then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical (e.g. 0 for floors and ceilings)" annotation(Evaluate=true,Dialog(group="Vertical position (important if interZonalAirFlowType is TwoPorts)"));
55+
parameter Modelica.Units.SI.Length hRelSurfBot_a= if IDEAS.Utilities.Math.Functions.isAngle(incInt,IDEAS.Types.Tilt.Ceiling) then hzone_a else 0 "Height between the lowest point of the surface (bottom) and the floor level of the zone connected at propsBus_a (e.g. 0 for walls at floor level and floors.)" annotation(Evaluate=true,Dialog(group="Vertical position (important if interZonalAirFlowType is TwoPorts)"));
5756
final parameter Modelica.Units.SI.Length Habs_surf=hAbs_floor_a+hRelSurfBot_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation";
5857

5958
IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a(
@@ -88,6 +87,16 @@ partial model PartialSurface "Partial model for building envelope component"
8887
"Multilayer component for simulating walls, windows and other surfaces"
8988
annotation (Placement(transformation(extent={{10,-10},{-10,10}})));
9089

90+
output Modelica.Units.SI.MassFlowRate mBA_flow_1=crackOrOperableDoor.m1_flow
91+
if add_door and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None
92+
"Flow outwards relative to propsBus_a, part 1"
93+
annotation (Placement(visible = true, transformation(origin = {30, -52}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
94+
output Modelica.Units.SI.MassFlowRate mBA_flow_2=-crackOrOperableDoor.m2_flow
95+
if add_door and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts
96+
"Flow outwards relative to propsBus_a, part 2"
97+
annotation (Placement(visible = true, transformation(origin = {30, -52}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
98+
99+
//protected
91100
Q50_parameterToConnector q50_zone(
92101
q50_inp=q50_internal,
93102
v50_surf=q50_internal*A,
@@ -102,7 +111,7 @@ partial model PartialSurface "Partial model for building envelope component"
102111
h_b1=-0.5*hzone_a + 0.75*hVertical + hRelSurfBot_a,
103112
h_a2=-0.5*hzone_a + 0.25*hVertical + hRelSurfBot_a,
104113
interZonalAirFlowType = sim.interZonalAirFlowType,
105-
inc=inc) if add_door and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None annotation (
114+
inc=incInt) if add_door and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None annotation (
106115
Placement(visible = true, transformation(origin = {30, -52}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
107116
Modelica.Blocks.Sources.RealExpression AExp(y = A) "Area expression" annotation(
108117
Placement(transformation(origin = {0, 20}, extent = {{-10, -10}, {10, 10}})));
@@ -282,6 +291,10 @@ equation
282291
Documentation(revisions="<html>
283292
<ul>
284293
<li>
294+
August 18, 2025, by Klaas De Jonge:<br/>
295+
Changed <code>inc</code> to <code>incInt</code> where nececarry.
296+
</li>
297+
<li>
285298
January 24, 2025, by Klaas De Jonge:<br/>
286299
Addition of BooleanPassThrough and RealPassThrough block for v50 and use_custom_q50 and
287300
parameter for number of dummy connections in <code>Q50_parameterToConnector</code> to avoid translation warnings.

IDEAS/Buildings/Components/Interfaces/PartialZone.mo

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ model PartialZone "Building zone model"
1717

1818
parameter Real n50(unit="1/h",min=0.01)= sim.n50 "n50 value for this zone"
1919
annotation(Dialog(tab="Airflow", group="Airtightness"));
20-
final parameter Real n50_computed(unit="1/h",min=0.01) = if use_custom_n50 and not setq50.allSurfacesCustom then n50 else n50_int "Computed n50 value";
20+
final parameter Real n50_computed(unit="1/h",min=0.01) = n50_int "Computed n50 value";
2121
parameter Boolean allowFlowReversal=true
2222
"= true to allow flow reversal in zone, false restricts to design direction (port_a -> port_b)."
2323
annotation(Dialog(tab="Airflow", group="Air model"));
@@ -561,6 +561,10 @@ end for;
561561
</html>", revisions="<html>
562562
<ul>
563563
<li>
564+
August 18, 2025, by Klaas De Jonge:<br/>
565+
Simplified <code>n50_computed</code> to <code>n50_int</code> since the if statement was a duplicate.
566+
</li>
567+
<li>
564568
November 11, 2024 by Lucas Verleyen:<br/>
565569
Change Medium to IDEAS.Media.Air and use 'constrainedby' for Modelica.Media.Interfaces.PartialMedium.
566570
This is for <a href=https://github.com/open-ideas/IDEAS/issues/1375>#1375</a>.

0 commit comments

Comments
 (0)