From a38555d6f356321ce9aca84a099463197e7e3f3a Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 16 Dec 2021 14:01:37 +0100 Subject: [PATCH 001/140] Provide information of zone heights and zone absolute height at the zone propsbus --- .../Components/Interfaces/PartialZone.mo | 31 ++++++++++++++++--- .../Components/Interfaces/ZoneBus.mo | 6 +++- .../Components/Interfaces/ZoneInterface.mo | 3 ++ 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo index 8f43f8f9f3..0f8bdfe70e 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo @@ -230,7 +230,9 @@ protected n50=n50_int, V=V, q50_corr=sim.q50_def, - use_custom_n50=use_custom_n50) + use_custom_n50=use_custom_n50, + hZone=hZone, + hFloor=hFloor) annotation (Placement(transformation(extent={{-60,-100},{-40,-80}}))); model Setq50 "q50 computation for zones" @@ -254,6 +256,9 @@ model Setq50 "q50 computation for zones" parameter Real v50_custom[nSurf](fixed=false) "custom assigned v50 value, else zero"; + parameter Modelica.SIunits.Length hZone "Zone height: distance between floor and ceiling"; + parameter Modelica.SIunits.Length hFloor = 0 "Absolute height of zone floor"; + Modelica.Blocks.Interfaces.RealInput v50_surf[nSurf] annotation (Placement(transformation(extent={{-126,28},{-86,68}}))); Modelica.Blocks.Interfaces.BooleanInput use_custom_q50[nSurf] @@ -267,13 +272,21 @@ model Setq50 "q50 computation for zones" annotation (Placement(transformation(extent={{-98,-38},{-118,-18}}))); Modelica.Blocks.Interfaces.RealOutput q50_zone[nSurf] "Custom q50 value for the surfaces connected to this zone" - annotation (Placement(transformation(extent={{-98,-70}, - {-118,-50}}))); + annotation (Placement(transformation(extent={{-98,-60},{-118,-40}}))); + Modelica.Blocks.Interfaces.RealOutput hzone[nSurf] + "Custom q50 value for the surfaces connected to this zone" + annotation (Placement(transformation(extent={{-96,-82},{-116,-62}}))); + Modelica.Blocks.Interfaces.RealOutput hfloor[nSurf] + "Custom q50 value for the surfaces connected to this zone" + annotation (Placement(transformation(extent={{-96,-106},{-116,-86}}))); initial equation for i in 1:nSurf loop defaultArea[i] = if use_custom_q50[i] then 0 else Area[i]; v50_custom[i] = if use_custom_q50[i] then v50_surf[i] else 0; + + hzone[i]=hZone; + hfloor[i]=hFloor; end for; allSurfacesCustom = max(Modelica.Constants.small, sum(defaultArea)) <= Modelica.Constants.small; @@ -285,6 +298,10 @@ equation else q50_zone=fill(q50_corr,nSurf); end if; + + + + annotation (Icon(graphics={Rectangle( extent={{-84,80},{82,-80}}, lineColor={28,108,200}, @@ -489,8 +506,6 @@ end for; connect(airModel.ports[interzonalAirFlow.nPorts + 1 + nSurf:interzonalAirFlow.nPorts + nSurf*2], propsBusInt[1:nSurf].port_2) annotation (Line(points={{-30, 40},{-30,39.9},{-80.1,39.9}}, color={0,127,255})); end if; - connect(setq50.q50_zone, propsBusInt.q50_zone) annotation (Line(points={{-60.8, - -96},{-60.8,-96},{-80.1,-96},{-80.1,39.9}}, color={0,0,127})); connect(setq50.Area, propsBusInt.area) annotation (Line(points={{-60.6,-88.6}, {-60.6,-89.3},{-80.1,-89.3},{-80.1,39.9}}, color={0,0,127})); connect(setq50.v50_surf, propsBusInt.v50) annotation (Line(points={{-60.6,-85.2}, @@ -501,6 +516,12 @@ end for; connect(setq50.use_custom_n50s, propsBusInt.use_custom_n50) annotation (Line(points={{-60.8, -92.8},{-60,-92.8},{-60,-92},{-80.1,-92},{-80.1,39.9}}, color={ 255,0,255})); + connect(setq50.q50_zone, propsBusInt.q50_zone) annotation (Line(points={{ + -60.8,-95},{-80.1,-95},{-80.1,39.9}}, color={0,0,127})); + connect(setq50.hzone, propsBusInt.hzone) annotation (Line(points={{-60.6, + -97.2},{-80.1,-97.2},{-80.1,39.9}}, color={0,0,127})); + connect(setq50.hfloor, propsBusInt.hfloor) annotation (Line(points={{-60.6, + -99.6},{-80.1,-99.6},{-80.1,39.9}}, color={0,0,127})); annotation (Placement(transformation(extent={{ 140,48},{100,88}})), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo b/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo index e9c3b7b703..1b6e87f8c2 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo @@ -48,7 +48,11 @@ connector ZoneBus IDEAS.Buildings.Components.Interfaces.RealConnector v50(final unit="m3/h") "v50 if the surface has a custome q50 value" annotation (); IDEAS.Buildings.Components.Interfaces.RealConnector q50_zone(final unit="m3/(h.m2)") "v50 of the surface" annotation (); IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_q50 "true if custome q50 value is assigned to surface" annotation (); - IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_n50 "true if the zone n50 is a custom value"; + IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_n50 "true if the zone n50 is a custom value" annotation (); + IDEAS.Buildings.Components.Interfaces.RealConnector hzone(final unit="m3/h") "Zone height: distance between floor and ceiling" annotation (); + IDEAS.Buildings.Components.Interfaces.RealConnector hfloor(final unit="m3/(h.m2)") "Absolute height of zone floor" annotation (); + + annotation (Documentation(info="

Connector that contains a weather bus and further diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo index 0b7df686ff..9eb3ee540d 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo @@ -16,6 +16,9 @@ partial model ZoneInterface "Partial model for thermal building zones" annotation(Dialog(group="Building physics")); parameter Modelica.SIunits.Length hZone = 2.8 "Zone height: distance between floor and ceiling" + annotation(Dialog(group="Building physics")); + parameter Modelica.SIunits.Length hFloor = 0 + "Absolute height of zone floor" annotation(Dialog(group="Building physics")); parameter Modelica.SIunits.Area A = V/hZone "Total conditioned floor area" annotation(Dialog(group="Building physics")); From 386af27b175d957184513e75161fa49a88bff4ae Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 11:58:35 +0100 Subject: [PATCH 002/140] Changes in propsbus and multiplicator --- IDEAS/Buildings/Components/Interfaces/ZoneBus.mo | 4 ++-- .../Interfaces/ZoneBusVarMultiplicator.mo | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo b/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo index 1b6e87f8c2..f3fce4b445 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneBus.mo @@ -49,8 +49,8 @@ connector ZoneBus IDEAS.Buildings.Components.Interfaces.RealConnector q50_zone(final unit="m3/(h.m2)") "v50 of the surface" annotation (); IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_q50 "true if custome q50 value is assigned to surface" annotation (); IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_n50 "true if the zone n50 is a custom value" annotation (); - IDEAS.Buildings.Components.Interfaces.RealConnector hzone(final unit="m3/h") "Zone height: distance between floor and ceiling" annotation (); - IDEAS.Buildings.Components.Interfaces.RealConnector hfloor(final unit="m3/(h.m2)") "Absolute height of zone floor" annotation (); + IDEAS.Buildings.Components.Interfaces.RealConnector hzone(final unit="m") "Zone height: distance between floor and ceiling" annotation (); + IDEAS.Buildings.Components.Interfaces.RealConnector hfloor(final unit="m") "Absolute height of zone floor" annotation (); annotation (Documentation(info=" diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneBusVarMultiplicator.mo b/IDEAS/Buildings/Components/Interfaces/ZoneBusVarMultiplicator.mo index 08d172a174..789e19823b 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneBusVarMultiplicator.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneBusVarMultiplicator.mo @@ -80,6 +80,11 @@ protected Modelica.Blocks.Routing.BooleanPassThrough use_custom_q50 "0 if the surface has a custom q50" annotation (Placement(transformation(extent={{-12,-296},{8,-276}}))); + Modelica.Blocks.Routing.RealPassThrough hzone "zone height" + annotation (Placement(transformation(extent={{8,-356},{-12,-336}}))); + Modelica.Blocks.Routing.RealPassThrough hFloor + "Absolute height of the zone floor" + annotation (Placement(transformation(extent={{8,-384},{-12,-364}}))); equation connect(QTra_desgin.u, propsBus_a.QTra_design) annotation (Line(points={{-12,188}, {-100.1,188},{-100.1,0.1}}, color={0,0,127})); @@ -162,6 +167,14 @@ equation connect(use_custom_n50.y, propsBus_a.use_custom_n50) annotation (Line(points={{-13, -314},{-100,-314},{-100,0.1},{-100.1,0.1}}, color={255,0,255})); + connect(hzone.u, propsBus_b.hzone) annotation (Line(points={{10,-346},{100, + -346},{100,-0.1},{100.1,-0.1}}, color={0,0,127})); + connect(hzone.y, propsBus_a.hzone) annotation (Line(points={{-13,-346},{-100, + -346},{-100,0.1},{-100.1,0.1}}, color={0,0,127})); + connect(hFloor.u, propsBus_b.hfloor) annotation (Line(points={{10,-374},{100, + -374},{100,-0.1},{100.1,-0.1}}, color={0,0,127})); + connect(hFloor.y, propsBus_a.hfloor) annotation (Line(points={{-13,-374},{ + -100,-374},{-100,0.1},{-100.1,0.1}}, color={0,0,127})); annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-180}, {100,200}}), graphics={ Polygon( From 754492fe15bbcbb18675e9a28a722bb9a39b27b2 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 13:00:29 +0100 Subject: [PATCH 003/140] Update PartialSurface.mo --- .../Components/Interfaces/PartialSurface.mo | 252 ++++++++++++++++-- 1 file changed, 231 insertions(+), 21 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index edbec07687..8f5bb1c6af 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -53,6 +53,13 @@ partial model PartialSurface "Partial model for building envelope component" final parameter Real q50_internal(fixed=false) "Envelope air tightness"; + final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation + parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings"; + + parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; + //TO CHECK: default should be zone height only when it is the ceiling at propsbus a + + IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( redeclare final package Medium = Medium, numIncAndAziInBus=sim.numIncAndAziInBus, outputAngles=sim.outputAngles, @@ -86,25 +93,19 @@ partial model PartialSurface "Partial model for building envelope component" "Multilayer component for simulating walls, windows and other surfaces" annotation (Placement(transformation(extent={{10,-10},{-10,10}}))); - PowerLaw_q50 res1( - redeclare package Medium = Medium, - final forceErrorControlOnFlow=false, - m=0.65, - A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - then A/2 else A, - final q50=q50_internal) if - add_cracks and - sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + PowerLaw_q50_stack res1( + redeclare package Medium = Medium, StackEff= if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then true else false, + h_b= -0.5*hzone_a + 0.25*hVertical +hRef_a) if + add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Middle or bottom crack " - annotation (Placement(transformation(extent={{20,-50},{40,-30}}))); - PowerLaw_q50 res2( - redeclare package Medium = Medium, - final forceErrorControlOnFlow=false, - m=0.65, - A=A/2, - final q50=q50_internal) if - add_cracks and - sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + annotation (Placement(transformation(extent={{20,-46},{40,-26}}))); + + + PowerLaw_q50_stack res2( + redeclare package + Medium = Medium, + h_b= -0.5*hzone_a + 0.75*hVertical +hRef_a) if + add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Top crack" annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); @@ -248,7 +249,208 @@ equation pattern=LinePattern.None, fillColor={255,255,255}, fillPattern=FillPattern.Solid)})); -end PowerLaw_q50; + end PowerLaw_q50; + + + + + + model PowerLaw_q50_stack + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation ( + __Dymola_choicesAllMatching=true); + + + parameter Modelica.SIunits.Area A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + then A/2 else A + "Surface area"; + + parameter Real m=0.65; + parameter Boolean StackEff=true "True if stack effect is used"; + + parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); + parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); + + /* + parameter Airflow.Multizone.Types.densitySelection densitySelection_port_a= + IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom + "Select how to pick density"; + parameter Airflow.Multizone.Types.densitySelection densitySelection_port_b= + IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom + "Select how to pick density"; +*/ + + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, + {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, + {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); + + + PowerLaw_q50 res1( + redeclare package Medium = Medium, + final forceErrorControlOnFlow=false, + m=m, + useDefaultProperties= if StackEff then false else true, + A=A, + final q50=q50_internal) if StackEff and + add_cracks and + sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + "Middle or bottom crack " + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + + Airflow.Multizone.MediumColumn col( + redeclare package Medium = Medium, + h=abs(h_a), + densitySelection= if h_a>0 then IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom else IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) + annotation (Placement(transformation(extent={{-70,-12},{-50,8}}))); + Airflow.Multizone.MediumColumn col1( + redeclare package Medium = Medium, + h=abs(h_b), + densitySelection= if h_b>0 then IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom else IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) + annotation (Placement(transformation(extent={{40,-10},{60,10}}))); + + + + equation + if StackEff then //Conditionally connect to density columns + + if h_a>=0 and h_b>=0 then + + connect(port_a, col.port_b) annotation (Line(points={{-100,0},{-80,0},{-80,-12}, + {-60,-12}}, color={0,127,255})); + connect(col.port_a, res1.port_a) annotation (Line(points={{-60,8},{-40,8},{-40, + 0},{-12,0}}, color={0,127,255})); + connect(port_b, col1.port_b) annotation (Line(points={{100,0},{74,0},{74,-10}, + {50,-10}}, color={0,127,255})); + connect(col1.port_a, res1.port_b) annotation (Line(points={{50,10},{30,10},{30, + 0},{8,0}}, color={0,127,255})); + + elseif h_a>=0 and h_b<0 then + + connect(port_a, col.port_b) annotation (Line(points={{-100,0},{-80,0},{-80,-12}, + {-60,-12}}, color={0,127,255})); + connect(col.port_a, res1.port_a) annotation (Line(points={{-60,8},{-40,8},{-40, + 0},{-12,0}}, color={0,127,255})); + connect(port_b, col1.port_a) annotation (Line(points={{100,0},{74,0},{74,10},{ + 50,10}}, + color={0,127,255})); + connect(col1.port_b, res1.port_b) annotation (Line(points={{50,-10},{30,-10},{ + 30,0},{8,0}}, + color={0,127,255})); + + elseif h_a<0 and h_b>=0 then + + connect(port_a, col.port_a) annotation (Line(points={{-100,0},{-80,0},{-80,8}, + {-60,8}}, + color={0,127,255})); + connect(col.port_b, res1.port_a) annotation (Line(points={{-60,-12},{-40,-12}, + {-40,0},{-12,0}}, + color={0,127,255})); + connect(port_b, col1.port_b) annotation (Line(points={{100,0},{74,0},{74,-10}, + {50,-10}}, color={0,127,255})); + connect(col1.port_a, res1.port_b) annotation (Line(points={{50,10},{30,10},{30, + 0},{8,0}}, color={0,127,255})); + + elseif h_a<0 and h_b<0 then + + connect(port_a, col.port_a) annotation (Line(points={{-100,0},{-80,0},{-80,8}, + {-60,8}}, + color={0,127,255})); + connect(col.port_b, res1.port_a) annotation (Line(points={{-60,-12},{-40,-12}, + {-40,0},{-12,0}}, + color={0,127,255})); + connect(port_b, col1.port_a) annotation (Line(points={{100,0},{74,0},{74,10},{ + 50,10}}, + color={0,127,255})); + connect(col1.port_b, res1.port_b) annotation (Line(points={{50,-10},{30,-10},{ + 30,0},{8,0}}, + color={0,127,255})); + + + end if; + + + + + else //or ignore density columns + connect(port_a,res1.port_a); + connect(port_b,res1.port_b); + end if; + + + + annotation (Icon(graphics={ + Text( + extent={{-100,100},{-40,60}}, + lineColor={28,108,200}, + fillColor={215,215,215}, + fillPattern=FillPattern.None, + textString="q50"), + Rectangle( + extent={{-20,80},{20,-80}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,0,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-60,58},{64,46}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-94,4},{-58,-8}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,127,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{54,6},{106,-8}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,127,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-64,2},{-46,-6}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,127,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-82,4},{-46,-8}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={0,127,0}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-58,36},{66,24}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-58,-54},{66,-66}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-56,-24},{68,-36}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid), + Rectangle( + extent={{-38,4},{40,-8}}, + lineColor={0,0,255}, + pattern=LinePattern.None, + fillColor={255,255,255}, + fillPattern=FillPattern.Solid)})); + end PowerLaw_q50_stack; + + + model Q50_parameterToConnector "Converts parameter values into connectors for propsBus" extends Modelica.Blocks.Icons.Block; @@ -269,6 +471,9 @@ model Q50_parameterToConnector "Converts parameter values into connectors for pr Modelica.Blocks.Interfaces.BooleanOutput using_custom_q50 = use_custom_q50 "Output indicating whether a custom q50 value should be considered by the zone" annotation (Placement(transformation(extent={{-100,-30},{-120,-10}}))); + Modelica.Blocks.Interfaces.RealInput dummy_h[2] + "Dummy connectors for hzone and hfloor" + annotation (Placement(transformation(extent={{-126,14},{-86,54}}))); annotation (Icon(graphics={Rectangle( extent={{-82,80},{78,-80}}, lineColor={28,108,200}, @@ -277,6 +482,7 @@ model Q50_parameterToConnector "Converts parameter values into connectors for pr end Q50_parameterToConnector; initial equation q50_internal=if use_custom_q50 then custom_q50 else q50_zone.q50_zone; + hzone_a=propsBusInt.hzone; equation connect(prescribedHeatFlowE.port, propsBusInt.E); @@ -328,8 +534,8 @@ equation points={{70,20.2105},{60,20.2105},{60,20},{56,20}}, color={255,204,51}, thickness=0.5)); - connect(res1.port_b, propsBusInt.port_1) annotation (Line(points={{40,-40},{50, - -40},{50,19.91},{56.09,19.91}}, color={0,127,255})); + connect(res1.port_b, propsBusInt.port_1) annotation (Line(points={{40,-36},{50, + -36},{50,19.91},{56.09,19.91}}, color={0,127,255})); connect(res2.port_b, propsBusInt.port_2) annotation (Line(points={{40,-60},{50, -60},{50,19.91},{56.09,19.91}}, color={0,127,255})); connect(setArea.areaPort, sim.areaPort); @@ -343,6 +549,10 @@ equation -91},{79.4,-90.5},{56.09,-90.5},{56.09,19.91}}, color={255,0,255})); connect(setArea.v50, propsBus_a.v50) annotation (Line(points={{79.4,-83.2},{ 79.4,-82},{56,-82},{56,0},{100.1,0},{100.1,19.9}}, color={0,0,127})); + connect(q50_zone.dummy_h[1], propsBusInt.hzone) annotation (Line(points={{79.4, + -47.6},{80,-47.6},{80,-48},{56.09,-48},{56.09,19.91}}, color={0,0,127})); + connect(q50_zone.dummy_h[2], propsBusInt.hfloor) annotation (Line(points={{79.4, + -45.6},{80,-45.6},{80,-46},{56.09,-46},{56.09,19.91}}, color={0,0,127})); annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}})), From 0a62abb805aa3d44ee7ffc88ee4cb4b994ab4a37 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 13:04:29 +0100 Subject: [PATCH 004/140] Update PartialZone.mo --- IDEAS/Buildings/Components/Interfaces/PartialZone.mo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo index 0f8bdfe70e..26ea2cc3c6 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo @@ -285,8 +285,6 @@ initial equation defaultArea[i] = if use_custom_q50[i] then 0 else Area[i]; v50_custom[i] = if use_custom_q50[i] then v50_surf[i] else 0; - hzone[i]=hZone; - hfloor[i]=hFloor; end for; allSurfacesCustom = max(Modelica.Constants.small, sum(defaultArea)) <= Modelica.Constants.small; @@ -299,6 +297,8 @@ equation q50_zone=fill(q50_corr,nSurf); end if; + hzone=fill(hZone,nSurf); + hfloor=fill(hFloor,nSurf); @@ -519,9 +519,9 @@ end for; connect(setq50.q50_zone, propsBusInt.q50_zone) annotation (Line(points={{ -60.8,-95},{-80.1,-95},{-80.1,39.9}}, color={0,0,127})); connect(setq50.hzone, propsBusInt.hzone) annotation (Line(points={{-60.6, - -97.2},{-80.1,-97.2},{-80.1,39.9}}, color={0,0,127})); + -97.2},{-60.6,-97.8},{-80.1,-97.8},{-80.1,39.9}}, color={0,0,127})); connect(setq50.hfloor, propsBusInt.hfloor) annotation (Line(points={{-60.6, - -99.6},{-80.1,-99.6},{-80.1,39.9}}, color={0,0,127})); + -99.6},{-60.6,-99.8},{-80.1,-99.8},{-80.1,39.9}}, color={0,0,127})); annotation (Placement(transformation(extent={{ 140,48},{100,88}})), Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}), From d4c71857f819202bc2cfb5ac51b5aba4eaa10731 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 13:06:32 +0100 Subject: [PATCH 005/140] Update InternalWall.mo --- IDEAS/Buildings/Components/InternalWall.mo | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index a7259deaa5..1f6b621411 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -9,7 +9,9 @@ model InternalWall "interior opaque wall between two zones" Qgai(y=(if sim.openSystemConservationOfEnergy or not sim.computeConservationOfEnergy then 0 else sum(port_emb.Q_flow))), final QTra_design=U_value*A*(TRef_a - TRef_b), - q50_zone(v50_surf=0)); + q50_zone(v50_surf=0), + res1(h_a=-0.5*hzone_b + 0.25*hVertical + hRef_b), + res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b)); //using custom q50 since this model is not an external component parameter Boolean linIntCon_b=sim.linIntCon @@ -69,6 +71,10 @@ model InternalWall "interior opaque wall between two zones" parameter Real CD=0.78 "Discharge coefficient of cavity" annotation (Dialog(tab="Airflow")); + final parameter Real hzone_b( fixed=false); + parameter Real hRef_b=if inc == 0 then hzone_b else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; + //TO CHECK: default should be zone height when it is the ceiling at propsbus + protected final parameter Real U_value=1/(1/8 + sum(constructionType.mats.R) + 1/8) "Wall U-value"; @@ -126,6 +132,8 @@ public hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); +initial equation + hzone_b = propsBus_b.hzone; equation assert(hasCavity == false or IDEAS.Utilities.Math.Functions.isAngle(incInt, IDEAS.Types.Tilt.Wall), "In " + getInstanceName() + ": Cavities are only supported for vertical walls, but inc=" + String(incInt)); @@ -179,8 +187,8 @@ equation -38,68},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); connect(resDoor.port_b, propsBusInt.port_1) annotation (Line(points={{10,68},{ 38,68},{38,19.91},{56.09,19.91}}, color={0,127,255})); - connect(res1.port_a, propsBus_b.port_1) annotation (Line(points={{20,-40},{-60, - -40},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(res1.port_a, propsBus_b.port_1) annotation (Line(points={{20,-36},{-60, + -36},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); connect(res2.port_a, propsBus_b.port_2) annotation (Line(points={{20,-60},{-60, -60},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); connect(q50_zone.v50, propsBus_b.v50) annotation (Line(points={{79,-58},{56, From 5074221a102ef43fdaa0cc6e3c849460d0bf0ef5 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 13:07:42 +0100 Subject: [PATCH 006/140] Update OuterWall.mo --- IDEAS/Buildings/Components/OuterWall.mo | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index b3226502c6..bd881b7bfd 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -4,7 +4,9 @@ model OuterWall "Opaque building envelope construction" setArea(A=A), final nWin=1, dT_nominal_a=-3, - QTra_design(fixed=false)); + QTra_design(fixed=false), + res1(h_a=Habs - (propsBusInt.hfloor + 0.25*hVertical + hRef_a)), + res2(h_a=Habs - (propsBusInt.hfloor + 0.75*hVertical + hRef_a))); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" @@ -165,8 +167,9 @@ equation connect(radSolData.hForcedConExt, extCon.hForcedConExt) annotation (Line(points={{-79.4, -8.2},{-46,-8.2},{-46,-34},{-16,-34},{-16,-27},{-22,-27}}, color={0,0,127})); - connect(res1.port_a, outsideAir.ports[1]) annotation (Line(points={{20,-40},{16, - -40},{16,-50},{-80,-50}}, color={0,127,255})); + connect(res1.port_a, outsideAir.ports[1]) annotation (Line(points={{20,-36},{ + 16,-36},{16,-50},{-80,-50}}, + color={0,127,255})); connect(res2.port_a, outsideAir.ports[2]) annotation (Line(points={{20,-60},{16, -60},{16,-50},{-80,-50}}, color={0,127,255})); annotation ( From dcf99624825b42dc68f6553de73c02dbc4b21e2a Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 13:08:16 +0100 Subject: [PATCH 007/140] Update Window.mo --- IDEAS/Buildings/Components/Window.mo | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 174af08865..9f793f4b41 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -7,6 +7,9 @@ model Window "Multipane window" "Construction details")); extends IDEAS.Buildings.Components.Interfaces.PartialSurface( + hRef_a=if inc == 0 then hzone_a else (hzone_a - hVertical)/2, + hVertical=if inc == Modelica.Constants.pi or inc == 0 then 0 else min( + hzone_a, sqrt(A)), dT_nominal_a=-3, intCon_a(final A= A*(1 - frac), @@ -27,8 +30,9 @@ model Window "Multipane window" checkCoatings=glazing.checkLowPerformanceGlazing), setArea(A=A_glass*nWin), q50_zone(v50_surf=q50_internal*A_glass), - res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass), - res2(A=A_glass/2)); + res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=Habs + - (propsBusInt.hfloor + 0.25*hVertical + hRef_a)), + res2(A=A_glass/2, h_a=Habs - (propsBusInt.hfloor + 0.75*hVertical + hRef_a))); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); @@ -323,8 +327,9 @@ equation annotation (Line(points={{-10,70},{-10,100}}, color={191,0,0})); connect(heaCapGlaExt.port, layMul.port_b) annotation (Line(points={{-10,-12},{-10,0}}, color={191,0,0})); - connect(res1.port_a,outsideAir. ports[1]) annotation (Line(points={{20,-40},{16, - -40},{16,-90},{-20,-90}}, color={0,127,255})); + connect(res1.port_a,outsideAir. ports[1]) annotation (Line(points={{20,-36},{ + 16,-36},{16,-90},{-20,-90}}, + color={0,127,255})); connect(res2.port_a,outsideAir. ports[2]) annotation (Line(points={{20,-60},{16, -60},{16,-90},{-20,-90}}, color={0,127,255})); annotation ( From 79b184bb4da61d97758927ac0d5242ef643f5978 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 15:16:15 +0100 Subject: [PATCH 008/140] PartialSurface Debugging Debugging partial surface, new implementation of stack columns because conditional connections to col models did not work as expected. --- .../Components/Interfaces/PartialSurface.mo | 179 ++++++++---------- .../TwinHouses/BuildingO5_Exp1_2Port.mo | 43 +++++ IDEAS/Examples/TwinHouses/package.order | 1 + 3 files changed, 121 insertions(+), 102 deletions(-) create mode 100644 IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 8f5bb1c6af..d788292cb7 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -54,6 +54,7 @@ partial model PartialSurface "Partial model for building envelope component" "Envelope air tightness"; final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation + final parameter Real hfloor_a( fixed=false); parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings"; parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; @@ -94,8 +95,11 @@ partial model PartialSurface "Partial model for building envelope component" annotation (Placement(transformation(extent={{10,-10},{-10,10}}))); PowerLaw_q50_stack res1( - redeclare package Medium = Medium, StackEff= if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then true else false, - h_b= -0.5*hzone_a + 0.25*hVertical +hRef_a) if + redeclare package Medium = Medium, + A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + then A/2 else A, + h_b= -0.5*hzone_a + 0.25*hVertical +hRef_a, + final q50=q50_internal) if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Middle or bottom crack " annotation (Placement(transformation(extent={{20,-46},{40,-26}}))); @@ -104,7 +108,9 @@ partial model PartialSurface "Partial model for building envelope component" PowerLaw_q50_stack res2( redeclare package Medium = Medium, - h_b= -0.5*hzone_a + 0.75*hVertical +hRef_a) if + A=A/2, + h_b= -0.5*hzone_a + 0.75*hVertical +hRef_a, + final q50=q50_internal) if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Top crack" annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); @@ -249,37 +255,28 @@ equation pattern=LinePattern.None, fillColor={255,255,255}, fillPattern=FillPattern.Solid)})); - end PowerLaw_q50; +end PowerLaw_q50; - model PowerLaw_q50_stack +model PowerLaw_q50_stack replaceable package Medium = Modelica.Media.Interfaces.PartialMedium constrainedby Modelica.Media.Interfaces.PartialMedium annotation ( __Dymola_choicesAllMatching=true); - parameter Modelica.SIunits.Area A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - then A/2 else A + parameter Modelica.SIunits.Area A "Surface area"; - parameter Real m=0.65; - parameter Boolean StackEff=true "True if stack effect is used"; - + parameter Real m=0.65; + final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used"; parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); - - /* - parameter Airflow.Multizone.Types.densitySelection densitySelection_port_a= - IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom - "Select how to pick density"; - parameter Airflow.Multizone.Types.densitySelection densitySelection_port_b= - IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom - "Select how to pick density"; -*/ + parameter Real q50 + "Leaked volume flow rate per unit A at 50Pa"; Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); @@ -291,95 +288,73 @@ equation redeclare package Medium = Medium, final forceErrorControlOnFlow=false, m=m, - useDefaultProperties= if StackEff then false else true, + useDefaultProperties= not StackEff, A=A, - final q50=q50_internal) if StackEff and - add_cracks and - sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + final q50=q50) "Middle or bottom crack " annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - Airflow.Multizone.MediumColumn col( - redeclare package Medium = Medium, - h=abs(h_a), - densitySelection= if h_a>0 then IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom else IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) - annotation (Placement(transformation(extent={{-70,-12},{-50,8}}))); - Airflow.Multizone.MediumColumn col1( - redeclare package Medium = Medium, - h=abs(h_b), - densitySelection= if h_b>0 then IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom else IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) - annotation (Placement(transformation(extent={{40,-10},{60,10}}))); - - - - equation - if StackEff then //Conditionally connect to density columns - - if h_a>=0 and h_b>=0 then - - connect(port_a, col.port_b) annotation (Line(points={{-100,0},{-80,0},{-80,-12}, - {-60,-12}}, color={0,127,255})); - connect(col.port_a, res1.port_a) annotation (Line(points={{-60,8},{-40,8},{-40, - 0},{-12,0}}, color={0,127,255})); - connect(port_b, col1.port_b) annotation (Line(points={{100,0},{74,0},{74,-10}, - {50,-10}}, color={0,127,255})); - connect(col1.port_a, res1.port_b) annotation (Line(points={{50,10},{30,10},{30, - 0},{8,0}}, color={0,127,255})); - - elseif h_a>=0 and h_b<0 then - - connect(port_a, col.port_b) annotation (Line(points={{-100,0},{-80,0},{-80,-12}, - {-60,-12}}, color={0,127,255})); - connect(col.port_a, res1.port_a) annotation (Line(points={{-60,8},{-40,8},{-40, - 0},{-12,0}}, color={0,127,255})); - connect(port_b, col1.port_a) annotation (Line(points={{100,0},{74,0},{74,10},{ - 50,10}}, - color={0,127,255})); - connect(col1.port_b, res1.port_b) annotation (Line(points={{50,-10},{30,-10},{ - 30,0},{8,0}}, - color={0,127,255})); - - elseif h_a<0 and h_b>=0 then - connect(port_a, col.port_a) annotation (Line(points={{-100,0},{-80,0},{-80,8}, - {-60,8}}, - color={0,127,255})); - connect(col.port_b, res1.port_a) annotation (Line(points={{-60,-12},{-40,-12}, - {-40,0},{-12,0}}, - color={0,127,255})); - connect(port_b, col1.port_b) annotation (Line(points={{100,0},{74,0},{74,-10}, - {50,-10}}, color={0,127,255})); - connect(col1.port_a, res1.port_b) annotation (Line(points={{50,10},{30,10},{30, - 0},{8,0}}, color={0,127,255})); - - elseif h_a<0 and h_b<0 then - - connect(port_a, col.port_a) annotation (Line(points={{-100,0},{-80,0},{-80,8}, - {-60,8}}, - color={0,127,255})); - connect(col.port_b, res1.port_a) annotation (Line(points={{-60,-12},{-40,-12}, - {-40,0},{-12,0}}, - color={0,127,255})); - connect(port_b, col1.port_a) annotation (Line(points={{100,0},{74,0},{74,10},{ - 50,10}}, - color={0,127,255})); - connect(col1.port_b, res1.port_b) annotation (Line(points={{50,-10},{30,-10},{ - 30,0},{8,0}}, - color={0,127,255})); - - - end if; - - - - - else //or ignore density columns - connect(port_a,res1.port_a); - connect(port_b,res1.port_b); - end if; + Airflow.Multizone.MediumColumn col_a_pos( + redeclare package Medium = Medium, + h=abs(h_a), + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if StackEff + annotation (Placement(transformation(extent={{-70,0},{-50,20}}))); + Airflow.Multizone.MediumColumn col_b_pos( + redeclare package Medium = Medium, + h=abs(h_b), + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if StackEff + annotation (Placement(transformation(extent={{50,0},{70,20}}))); + outer BoundaryConditions.SimInfoManager sim + annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); + Airflow.Multizone.MediumColumn col_b_neg( + redeclare package Medium = Medium, + h=abs(h_b), + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if StackEff + annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); + Airflow.Multizone.MediumColumn col_a_neg( + redeclare package Medium = Medium, + h=abs(h_a), + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if StackEff + annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); + Fluid.FixedResistances.LosslessPipe No_stack_a( + redeclare package Medium = Medium, + allowFlowReversal=false, + m_flow_nominal=0.1) + annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); + Fluid.FixedResistances.LosslessPipe No_stack_b( + redeclare package Medium = Medium, + allowFlowReversal=false, + m_flow_nominal=0.1) + annotation (Placement(transformation(extent={{40,40},{60,60}}))); +equation + connect(port_a, col_a_neg.port_a) annotation (Line(points={{-100,0},{-84,0},{-84, + -20},{-60,-20}}, color={0,127,255})); + connect(port_b, col_b_neg.port_a) annotation (Line(points={{100,0},{80,0},{80, + -20},{60,-20}}, color={0,127,255})); + connect(col_b_neg.port_b, res1.port_b) annotation (Line(points={{60,-40},{20,-40}, + {20,0},{8,0}}, color={0,127,255})); + connect(col_a_neg.port_b, res1.port_a) annotation (Line(points={{-60,-40},{-20, + -40},{-20,0},{-12,0}}, color={0,127,255})); + connect(port_a, No_stack_a.port_a) annotation (Line(points={{-100,0},{-84,0},{ + -84,50},{-60,50}}, color={0,127,255})); + connect(No_stack_a.port_b, res1.port_a) annotation (Line(points={{-40,50},{-20, + 50},{-20,0},{-12,0}}, color={0,127,255})); + connect(res1.port_b, No_stack_b.port_a) annotation (Line(points={{8,0},{20,0}, + {20,50},{40,50}}, color={0,127,255})); + connect(No_stack_b.port_b, port_b) annotation (Line(points={{60,50},{80,50},{80, + 0},{100,0}}, color={0,127,255})); + connect(port_a, col_a_pos.port_b) + annotation (Line(points={{-100,0},{-60,0}}, color={0,127,255})); + connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,20},{ + -40,20},{-40,0},{-12,0}}, color={0,127,255})); + connect(port_b, col_b_pos.port_b) + annotation (Line(points={{100,0},{60,0}}, color={0,127,255})); + connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,20},{34, + 20},{34,0},{8,0}}, color={0,127,255})); annotation (Icon(graphics={ Text( extent={{-100,100},{-40,60}}, @@ -447,7 +422,7 @@ equation pattern=LinePattern.None, fillColor={255,255,255}, fillPattern=FillPattern.Solid)})); - end PowerLaw_q50_stack; +end PowerLaw_q50_stack; @@ -483,7 +458,7 @@ end Q50_parameterToConnector; initial equation q50_internal=if use_custom_q50 then custom_q50 else q50_zone.q50_zone; hzone_a=propsBusInt.hzone; - + hfloor_a=propsBusInt.hfloor; equation connect(prescribedHeatFlowE.port, propsBusInt.E); connect(Qgai.y,prescribedHeatFlowQgai. Q_flow); diff --git a/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo b/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo new file mode 100644 index 0000000000..1a11eeaae1 --- /dev/null +++ b/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo @@ -0,0 +1,43 @@ +within IDEAS.Examples.TwinHouses; +model BuildingO5_Exp1_2Port + "Model for simulation of experiment 1 for the O5 building with 2-port pressure driven airflow" + extends BuildingN2_Exp1( + bui=2, + exp=1, + redeclare BaseClasses.Structures.TwinhouseO5 struct, + redeclare BaseClasses.Ventilation.Vent_TTH_pressureNetwork vent, + sim( + interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, + unify_n50=true, + n50=1.64, + A0=1, + a=0.15)); + + Real comparison_W40[2] = {struct.W40.resDoor.m_flow, validationDataO5Exp1_Airflow.W40_resDoor}; + Real comparison_W1[2] = {struct.W1.propsBus_a.port_1.m_flow, -validationDataO5Exp1_Airflow.W1_FlowRate}; + Real comparison_W7[2] = {struct.W7.propsBus_a.port_1.m_flow, -validationDataO5Exp1_Airflow.W7_FlowRate}; + Real comparison_W10[2] = {struct.W10.propsBus_a.port_1.m_flow, -validationDataO5Exp1_Airflow.W10_FlowRate}; + Real comparison_W37[2] = {struct.W37.propsBus_a.port_1.m_flow, validationDataO5Exp1_Airflow.W37_FlowRate}; + + IDEAS.Examples.TwinHouses.BaseClasses.Data.ValidationDataO5Exp1_Airflow validationDataO5Exp1_Airflow + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StartTime=1.5e+007, + StopTime=2.35872e+007, + Interval=900, + Tolerance=1e-006), + __Dymola_experimentSetupOutput, + __Dymola_experimentFlags( + Advanced(GenerateVariableDependencies=false, OutputModelicaCode=false), + Evaluate=true, + OutputCPUtime=true, + OutputFlatModelica=false), + __Dymola_Commands(file= + "modelica://IDEAS/Resources/Scripts/Dymola/Examples/TwinHouses/BuildingO5_Exp1_1Port.mos" + "Simulate and plot"), + Documentation(info=" +

Similar to IDEAS.Examples.TwinHouses.BuildingO5_Exp1 but using the 1-port pressure driven interzonal airflow implementation.

+")); +end BuildingO5_Exp1_2Port; diff --git a/IDEAS/Examples/TwinHouses/package.order b/IDEAS/Examples/TwinHouses/package.order index 884fec6d83..ee61594a77 100644 --- a/IDEAS/Examples/TwinHouses/package.order +++ b/IDEAS/Examples/TwinHouses/package.order @@ -3,5 +3,6 @@ BuildingN2_Exp2 BuildingN2_Exp2_Tset BuildingO5_Exp1 BuildingO5_Exp1_1Port +BuildingO5_Exp1_2Port Interfaces BaseClasses From 61af6e7265cc615c97e5d27fc36f64db74dfe5da Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 15:16:49 +0100 Subject: [PATCH 009/140] hfloor_a defined as parameter in initial equation --- IDEAS/Buildings/Components/OuterWall.mo | 4 ++-- IDEAS/Buildings/Components/Window.mo | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index bd881b7bfd..bb1b9f8e9f 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -5,8 +5,8 @@ model OuterWall "Opaque building envelope construction" final nWin=1, dT_nominal_a=-3, QTra_design(fixed=false), - res1(h_a=Habs - (propsBusInt.hfloor + 0.25*hVertical + hRef_a)), - res2(h_a=Habs - (propsBusInt.hfloor + 0.75*hVertical + hRef_a))); + res1(h_a=Habs - (hfloor_a + 0.25*hVertical + hRef_a)), + res2(h_a=Habs - (hfloor_a + 0.75*hVertical + hRef_a))); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 9f793f4b41..b506d512e0 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -31,8 +31,8 @@ model Window "Multipane window" setArea(A=A_glass*nWin), q50_zone(v50_surf=q50_internal*A_glass), res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=Habs - - (propsBusInt.hfloor + 0.25*hVertical + hRef_a)), - res2(A=A_glass/2, h_a=Habs - (propsBusInt.hfloor + 0.75*hVertical + hRef_a))); + - (hfloor_a + 0.25*hVertical + hRef_a)), + res2(A=A_glass/2, h_a=Habs - (hfloor_a + 0.75*hVertical + hRef_a))); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); From 5030954057290e9f27878d53bbca054510bcd0e3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 18:54:37 +0100 Subject: [PATCH 010/140] Update PartialSurface.mo --- .../Components/Interfaces/PartialSurface.mo | 39 +++++++++++++------ 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index d788292cb7..7eb12ea1a6 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -47,10 +47,10 @@ partial model PartialSurface "Partial model for building envelope component" parameter Boolean use_custom_q50=false "set to true to disable the default q50 computation and to assign a custom q50 value" annotation (Dialog(tab="Airflow", group="Airtightness"), Evaluate=true); - parameter Real custom_q50 = 2 + parameter Real custom_q50(unit="m3/(h.m2)") = 2 "Envelope air tightness" annotation (Dialog(enable=use_custom_q50,tab="Airflow", group="Airtightness")); - final parameter Real q50_internal(fixed=false) + final parameter Real q50_internal(unit="m3/(h.m2)",fixed=false) "Envelope air tightness"; final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation @@ -273,6 +273,13 @@ model PowerLaw_q50_stack parameter Real m=0.65; final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used"; + //ERROR: Top-level models fail due to non-fixed conditions although at this level, only parameters are considered. + //Dymola wants to handle the connect() statements first, before the initial equations apparantly. + final parameter Boolean ColApos(fixed=false); + final parameter Boolean ColBpos(fixed=false); + final parameter Boolean ColAneg(fixed=false); + final parameter Boolean ColBneg(fixed=false); + parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); parameter Real q50 @@ -298,12 +305,12 @@ model PowerLaw_q50_stack Airflow.Multizone.MediumColumn col_a_pos( redeclare package Medium = Medium, h=abs(h_a), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if StackEff + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if ColApos annotation (Placement(transformation(extent={{-70,0},{-50,20}}))); Airflow.Multizone.MediumColumn col_b_pos( redeclare package Medium = Medium, h=abs(h_b), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if StackEff + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if ColBpos annotation (Placement(transformation(extent={{50,0},{70,20}}))); outer BoundaryConditions.SimInfoManager sim @@ -312,23 +319,34 @@ model PowerLaw_q50_stack Airflow.Multizone.MediumColumn col_b_neg( redeclare package Medium = Medium, h=abs(h_b), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if StackEff + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if ColBneg annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); Airflow.Multizone.MediumColumn col_a_neg( redeclare package Medium = Medium, h=abs(h_a), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if StackEff + densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if ColAneg annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); Fluid.FixedResistances.LosslessPipe No_stack_a( redeclare package Medium = Medium, - allowFlowReversal=false, - m_flow_nominal=0.1) + allowFlowReversal=true, + m_flow_nominal=q50*1.2/3600) if + not StackEff annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); Fluid.FixedResistances.LosslessPipe No_stack_b( redeclare package Medium = Medium, - allowFlowReversal=false, - m_flow_nominal=0.1) + allowFlowReversal=true, + m_flow_nominal=q50*1.2/3600) if + not StackEff annotation (Placement(transformation(extent={{40,40},{60,60}}))); + +initial equation + //attempt to let Dymola handle this before connecting - failed +ColApos= StackEff and h_a>0; +ColBpos= StackEff and h_b>0; +ColAneg= StackEff and not h_a>0; +ColBneg= StackEff and not h_b>0; + + equation connect(port_a, col_a_neg.port_a) annotation (Line(points={{-100,0},{-84,0},{-84, @@ -469,7 +487,6 @@ equation points={{56.09,19.91},{46,19.91},{46,0},{40,0}}, color={191,0,0}, smooth=Smooth.None)); - connect(layMul.port_a, propsBusInt.surfRad) annotation (Line( points={{10,0},{16,0},{16,19.91},{56.09,19.91}}, color={191,0,0}, From fe8c84d298f9d638f0443d9eed1d5f64414a90c5 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 18:54:43 +0100 Subject: [PATCH 011/140] Update InternalWall.mo --- IDEAS/Buildings/Components/InternalWall.mo | 31 +++++++++++++--------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 1f6b621411..cec804a233 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -71,8 +71,10 @@ model InternalWall "interior opaque wall between two zones" parameter Real CD=0.78 "Discharge coefficient of cavity" annotation (Dialog(tab="Airflow")); - final parameter Real hzone_b( fixed=false); - parameter Real hRef_b=if inc == 0 then hzone_b else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; + final parameter Real hzone_b(fixed=false); + final parameter Real hfloor_b(fixed=false); + + parameter Real hRef_b=if inc == 0 then hzone_b else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; //TO CHECK: default should be zone height when it is the ceiling at propsbus protected @@ -121,10 +123,14 @@ public IDEAS.Airflow.Multizone.DoorDiscretizedOpen dooOpe( redeclare package Medium = Medium, wOpe=w, - hOpe=h) if + hOpe=h, + hA=hfloor_a + hRef_a + (hzone_a/2), + hB=hfloor_b + hRef_b + (hzone_b/2), + nCom=4, + CD=CD) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "2-port model for open door" - annotation (Placement(transformation(extent={{-10,80},{10,100}}))); + annotation (Placement(transformation(extent={{-10,82},{10,102}}))); Airflow.Multizone.Orifice resDoor( redeclare package Medium = Medium, A=w*h, @@ -134,6 +140,7 @@ public annotation (Placement(transformation(extent={{-10,58},{10,78}}))); initial equation hzone_b = propsBus_b.hzone; + hfloor_b= propsBus_b.hfloor; equation assert(hasCavity == false or IDEAS.Utilities.Math.Functions.isAngle(incInt, IDEAS.Types.Tilt.Wall), "In " + getInstanceName() + ": Cavities are only supported for vertical walls, but inc=" + String(incInt)); @@ -175,14 +182,14 @@ equation connect(theConDoor.port_b, propsBusInt.surfCon) annotation (Line(points={{10,40}, {46,40},{46,19.91},{56.09,19.91}}, color={191,0,0})); - connect(dooOpe.port_a2, propsBusInt.port_1) annotation (Line(points={{10,84},{ - 38,84},{38,19.91},{56.09,19.91}}, color={0,127,255})); - connect(dooOpe.port_b1, propsBusInt.port_2) annotation (Line(points={{10,96},{ - 42,96},{42,19.91},{56.09,19.91}}, color={0,127,255})); - connect(dooOpe.port_a1, propsBus_b.port_2) annotation (Line(points={{-10,96},{ - -42,96},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,84},{ - -38,84},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(dooOpe.port_a2, propsBusInt.port_1) annotation (Line(points={{10,86},{ + 38,86},{38,19.91},{56.09,19.91}}, color={0,127,255})); + connect(dooOpe.port_b1, propsBusInt.port_2) annotation (Line(points={{10,98},{ + 42,98},{42,19.91},{56.09,19.91}}, color={0,127,255})); + connect(dooOpe.port_a1, propsBus_b.port_2) annotation (Line(points={{-10,98},{ + -42,98},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,86},{ + -38,86},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); connect(resDoor.port_a, propsBus_b.port_1) annotation (Line(points={{-10,68},{ -38,68},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); connect(resDoor.port_b, propsBusInt.port_1) annotation (Line(points={{10,68},{ From 7c4d256131b4a87d57240ca99583221bd3772b80 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 21 Dec 2021 18:56:12 +0100 Subject: [PATCH 012/140] Update BuildingO5_Exp1_2Port.mo --- IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo b/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo index 1a11eeaae1..6ca8b50cd9 100644 --- a/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo +++ b/IDEAS/Examples/TwinHouses/BuildingO5_Exp1_2Port.mo @@ -12,7 +12,7 @@ model BuildingO5_Exp1_2Port n50=1.64, A0=1, a=0.15)); - +/* Real comparison_W40[2] = {struct.W40.resDoor.m_flow, validationDataO5Exp1_Airflow.W40_resDoor}; Real comparison_W1[2] = {struct.W1.propsBus_a.port_1.m_flow, -validationDataO5Exp1_Airflow.W1_FlowRate}; Real comparison_W7[2] = {struct.W7.propsBus_a.port_1.m_flow, -validationDataO5Exp1_Airflow.W7_FlowRate}; @@ -20,7 +20,8 @@ model BuildingO5_Exp1_2Port Real comparison_W37[2] = {struct.W37.propsBus_a.port_1.m_flow, validationDataO5Exp1_Airflow.W37_FlowRate}; IDEAS.Examples.TwinHouses.BaseClasses.Data.ValidationDataO5Exp1_Airflow validationDataO5Exp1_Airflow - annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + annotation (Placement(transformation(extent={{40,-80},{60,-60}}))); + */ annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( coordinateSystem(preserveAspectRatio=false)), experiment( From 96a4087c451d34694692da1c86b1197ea4b040da Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 10 Jan 2022 15:54:57 +0100 Subject: [PATCH 013/140] Update PartialSurface.mo Got rid of the unnecessary initial equations --- .../Components/Interfaces/PartialSurface.mo | 34 ++++++++----------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 7eb12ea1a6..2ea852d794 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -273,12 +273,15 @@ model PowerLaw_q50_stack parameter Real m=0.65; final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used"; - //ERROR: Top-level models fail due to non-fixed conditions although at this level, only parameters are considered. - //Dymola wants to handle the connect() statements first, before the initial equations apparantly. - final parameter Boolean ColApos(fixed=false); - final parameter Boolean ColBpos(fixed=false); - final parameter Boolean ColAneg(fixed=false); - final parameter Boolean ColBneg(fixed=false); + + /*ERROR: Current version of the Modelica translator can only handle +*/ + final parameter Boolean ColApos=StackEff and h_a>0; + final parameter Boolean ColBpos=StackEff and h_b>0; + final parameter Boolean ColAneg=StackEff and not h_a>0; + final parameter Boolean ColBneg=StackEff and not h_b>0; + + parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); @@ -339,14 +342,6 @@ model PowerLaw_q50_stack not StackEff annotation (Placement(transformation(extent={{40,40},{60,60}}))); -initial equation - //attempt to let Dymola handle this before connecting - failed -ColApos= StackEff and h_a>0; -ColBpos= StackEff and h_b>0; -ColAneg= StackEff and not h_a>0; -ColBneg= StackEff and not h_b>0; - - equation connect(port_a, col_a_neg.port_a) annotation (Line(points={{-100,0},{-84,0},{-84, @@ -365,14 +360,13 @@ equation {20,50},{40,50}}, color={0,127,255})); connect(No_stack_b.port_b, port_b) annotation (Line(points={{60,50},{80,50},{80, 0},{100,0}}, color={0,127,255})); - connect(port_a, col_a_pos.port_b) - annotation (Line(points={{-100,0},{-60,0}}, color={0,127,255})); - connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,20},{ + connect(port_a, col_a_pos.port_b) annotation (Line(points={{-100,0},{-60,0}}, color={0,127,255})); + connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,20},{ -40,20},{-40,0},{-12,0}}, color={0,127,255})); - connect(port_b, col_b_pos.port_b) - annotation (Line(points={{100,0},{60,0}}, color={0,127,255})); - connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,20},{34, + connect(port_b, col_b_pos.port_b) annotation (Line(points={{100,0},{60,0}}, color={0,127,255})); + connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,20},{34, 20},{34,0},{8,0}}, color={0,127,255})); + annotation (Icon(graphics={ Text( extent={{-100,100},{-40,60}}, From d0f7ab644ac32f56a15f45e8e28df65340561c9a Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 18 Jan 2022 08:54:24 +0100 Subject: [PATCH 014/140] Update PartialSurface.mo --- .../Components/Interfaces/PartialSurface.mo | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 2ea852d794..1df74ffa5f 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -55,10 +55,11 @@ partial model PartialSurface "Partial model for building envelope component" final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation final parameter Real hfloor_a( fixed=false); - parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings"; + parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); + parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " + annotation(Evaluate=true); - parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; - //TO CHECK: default should be zone height only when it is the ceiling at propsbus a + //TO CHECK: default should be zone height only when it is the ceiling at propsbus IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( @@ -272,14 +273,14 @@ model PowerLaw_q50_stack "Surface area"; parameter Real m=0.65; - final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used"; + final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); /*ERROR: Current version of the Modelica translator can only handle -*/ - final parameter Boolean ColApos=StackEff and h_a>0; - final parameter Boolean ColBpos=StackEff and h_b>0; - final parameter Boolean ColAneg=StackEff and not h_a>0; - final parameter Boolean ColBneg=StackEff and not h_b>0; + */ + final parameter Boolean ColApos=StackEff and h_a>0 annotation(Evaluate=true); + final parameter Boolean ColBpos=StackEff and h_b>0 annotation(Evaluate=true); + final parameter Boolean ColAneg=StackEff and not h_a>0 annotation(Evaluate=true); + final parameter Boolean ColBneg=StackEff and not h_b>0 annotation(Evaluate=true); From 7795acdf12ca1110b386d8164356655145547215 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 11:59:42 +0100 Subject: [PATCH 015/140] Updated airflow part of PartialSurface New implementation for the density columns to avoid error due to conditional statements in the column heights --- .../Components/Interfaces/PartialSurface.mo | 420 +++++++++++++----- 1 file changed, 321 insertions(+), 99 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 1df74ffa5f..0a52067819 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -175,7 +175,74 @@ protected "Block that contributes surface area to the siminfomanager" annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); -model PowerLaw_q50 + + + + + + +model PowerLaw_q50_stack + + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium constrainedby + Modelica.Media.Interfaces.PartialMedium annotation ( + __Dymola_choicesAllMatching=true); + + + parameter Modelica.SIunits.Area A + "Surface area"; + + parameter Real m=0.65; + final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); + + + parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); + parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); + parameter Real q50 + "Leaked volume flow rate per unit A at 50Pa"; + + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, + {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, + {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); + + + PowerLaw_q50 res1( + redeclare package Medium = Medium, + final forceErrorControlOnFlow=false, + m=m, + useDefaultProperties= not StackEff, + A=A, + final q50=q50) + "Middle or bottom crack " + annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + + + DensityColumn col_a_pos( + redeclare package Medium = Medium, + h=h_a) if StackEff + annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); + DensityColumn col_b_pos( + redeclare package Medium = Medium, + h=h_b) if StackEff + annotation (Placement(transformation(extent={{50,-10},{70,10}}))); + + outer BoundaryConditions.SimInfoManager sim + annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); + + Fluid.FixedResistances.LosslessPipe No_stack_a( + redeclare package Medium = Medium, + allowFlowReversal=true, + m_flow_nominal=q50*1.2/3600) if + not StackEff + annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); + Fluid.FixedResistances.LosslessPipe No_stack_b( + redeclare package Medium = Medium, + allowFlowReversal=true, + m_flow_nominal=q50*1.2/3600) if + not StackEff + annotation (Placement(transformation(extent={{50,30},{70,50}}))); + + model PowerLaw_q50 extends IDEAS.Airflow.Multizone.BaseClasses.PowerLawResistance( m=0.5, @@ -187,7 +254,7 @@ model PowerLaw_q50 "Leaked volume flow rate per unit A at 50Pa"; final parameter Real coeff = (q50/3600)/(50^m) "Conversion coefficient"; -equation + equation v= V_flow/A; annotation (Icon(graphics={ Text( @@ -256,117 +323,271 @@ equation pattern=LinePattern.None, fillColor={255,255,255}, fillPattern=FillPattern.Solid)})); -end PowerLaw_q50; - - - - - -model PowerLaw_q50_stack - - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation ( - __Dymola_choicesAllMatching=true); - - - parameter Modelica.SIunits.Area A - "Surface area"; - - parameter Real m=0.65; - final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); - - /*ERROR: Current version of the Modelica translator can only handle - */ - final parameter Boolean ColApos=StackEff and h_a>0 annotation(Evaluate=true); - final parameter Boolean ColBpos=StackEff and h_b>0 annotation(Evaluate=true); - final parameter Boolean ColAneg=StackEff and not h_a>0 annotation(Evaluate=true); - final parameter Boolean ColBneg=StackEff and not h_b>0 annotation(Evaluate=true); - - - - parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); - parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); - parameter Real q50 - "Leaked volume flow rate per unit A at 50Pa"; + end PowerLaw_q50; - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, - {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, - {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); + model DensityColumn + "Vertical shaft with no friction and no storage of heat and mass" - PowerLaw_q50 res1( - redeclare package Medium = Medium, - final forceErrorControlOnFlow=false, - m=m, - useDefaultProperties= not StackEff, - A=A, - final q50=q50) - "Middle or bottom crack " - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component" + annotation (choices( + choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); + parameter Modelica.SIunits.Length h= 3 "Height of shaft"; - Airflow.Multizone.MediumColumn col_a_pos( + Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare package Medium = Medium, - h=abs(h_a), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if ColApos - annotation (Placement(transformation(extent={{-70,0},{-50,20}}))); - Airflow.Multizone.MediumColumn col_b_pos( + p(start=Medium.p_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-10,90},{10,110}}), + iconTransformation(extent={{-10,90},{10,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( redeclare package Medium = Medium, - h=abs(h_b), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom) if ColBpos - annotation (Placement(transformation(extent={{50,0},{70,20}}))); + p(start=Medium.p_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); + + Modelica.SIunits.VolumeFlowRate V_flow + "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; + Modelica.SIunits.MassFlowRate m_flow + "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; + Modelica.SIunits.PressureDifference dp(displayUnit="Pa") + "Pressure difference between port_a and port_b"; + Modelica.SIunits.Density rho "Density in medium column"; + + protected + Medium.ThermodynamicState sta_b=Medium.setState_phX( + port_b.p, + actualStream(port_b.h_outflow), + actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; + Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; + + equation + // Design direction of mass flow rate + m_flow = port_a.m_flow; + + // Pressure difference between ports + // Xi is computed first as it is used in two expression, and in one + // of them only one component is used. + // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no + // moisture and hence Xi[1] is an illegal statement. + // We first compute temperature and then invoke a density function that + // takes temperature as an argument. Simply calling a density function + // of a medium that takes enthalpy as an argument would be dangerous + // as different media can have different datum for the enthalpy. + + Xi = inStream(port_b.Xi_outflow); + rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( + p=Medium.p_default, + T=Medium.temperature(Medium.setState_phX(port_b.p, inStream(port_b.h_outflow), Xi)), + X_w=if Medium.nXi == 0 then 0 else Xi[1]); + + V_flow = m_flow/Medium.density(sta_b); + + dp = if h>0 then port_a.p - port_b.p else -port_a.p + port_b.p; + dp = -abs(h)*rho*Modelica.Constants.g_n; + + // Isenthalpic state transformation (no storage and no loss of energy) + port_a.h_outflow = inStream(port_b.h_outflow); + port_b.h_outflow = inStream(port_a.h_outflow); + + // Mass balance (no storage) + port_a.m_flow + port_b.m_flow = 0; + + // Transport of substances + port_a.Xi_outflow = inStream(port_b.Xi_outflow); + port_b.Xi_outflow = inStream(port_a.Xi_outflow); + + port_a.C_outflow = inStream(port_b.C_outflow); + port_b.C_outflow = inStream(port_a.C_outflow); - outer BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); + annotation ( + Icon(graphics={ + Line( + points={{0,100},{0,-100},{0,-98}}), + Text( + extent={{24,-78},{106,-100}}, + lineColor={0,0,127}, + textString="Zone/Amb"), + Text( + extent={{32,104},{98,70}}, + lineColor={0,0,127}, + textString="FlowElem"), + Text( + extent={{36,26},{88,-10}}, + lineColor={0,0,127}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString="h=%h"), + Rectangle( + extent={{-16,80},{16,-80}}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, + extent={{-16,80},{16,0}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,80},{16,54}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, + extent={{-16,0},{16,-82}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,-55},{16,-80}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0})}), + defaultComponentName="col", + Documentation(info= + " +

+This model describes the pressure difference of a vertical medium +column. It can be used to model the pressure difference caused by +stack effect. +

+

Typical use and important parameters

+

+The model can be used with the following three configurations, which are +controlled by the setting of the parameter densitySelection: +

+
    +
  • +top: +Use this setting to use the density from the volume that is connected +to port_a. +
  • +
  • +bottom: +Use this setting to use the density from the volume that is connected +to port_b. +
  • +
  • +actual: +Use this setting to use the density based on the actual flow direction. +
  • +
+

+The settings top and bottom +should be used when rooms or different floors of a building are +connected since multizone airflow models assume that each floor is completely mixed. +For these two seetings, this model will compute the pressure between the center of the room +and an opening that is at height h relative to the center of the room. +The setting actual may be used to model a chimney in which +a column of air will change its density based on the flow direction. +

+

+In this model, the parameter h must always be positive, and the port port_a must be +at the top of the column. +

+

Dynamics

+

+For a dynamic model, use + +IDEAS.Airflow.Multizone.MediumColumnDynamic instead of this model. +

+", revisions= + " +
    +
  • +January 18, 2019, by Jianjun Hu:
    +Limited the media choice to moist air only. +See #1050. +
  • +
  • +May 1, 2018, by Filip Jorissen:
    +Removed declaration of allowFlowReversal +and changed default density computation such +that it assumes a constant pressure. +See #877. +
  • +
  • +November 3, 2016, by Michael Wetter:
    +Removed start values for mass flow rate and pressure difference +to simplify the parameter window.
    +This is for +#552. +
  • +
  • +January 22, 2016, by Michael Wetter:
    +Corrected type declaration of pressure difference. +This is +for #404. +
  • +
  • +February 24, 2015 by Michael Wetter:
    +Changed model to use + +IDEAS.Utilities.Psychrometrics.Functions.density_pTX +for the density computation +as + +IDEAS.Media.Air.density +does not depend on temperature. +
  • +
  • +December 22, 2014 by Michael Wetter:
    +Removed Modelica.Fluid.System +to address issue +#311. +
  • +
  • October 4, 2014 by Michael Wetter:
    +Removed assignment of port_?.p.nominal to avoid a warning in OpenModelica because +alias sets have different nominal values. +
  • +
  • April 17, 2013 by Michael Wetter:
    +Reformulated the assert statement that checks for the correct value of densitySelection. +
  • +
  • July 28, 2010 by Michael Wetter:
    +Changed sign for pressure difference. +
  • +
  • +July 20, 2010 by Michael Wetter:
    +Migrated model to Modelica 3.1 and integrated it into the Buildings library. +Reimplemented assignment of density based on flow direction or based on outflowing state. +
  • +
  • +February 24, 2005 by Michael Wetter:
    +Released first version. +
  • +
+")); + end DensityColumn; - Airflow.Multizone.MediumColumn col_b_neg( - redeclare package Medium = Medium, - h=abs(h_b), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if ColBneg - annotation (Placement(transformation(extent={{50,-40},{70,-20}}))); - Airflow.Multizone.MediumColumn col_a_neg( - redeclare package Medium = Medium, - h=abs(h_a), - densitySelection=IDEAS.Airflow.Multizone.Types.densitySelection.fromTop) if ColAneg - annotation (Placement(transformation(extent={{-70,-40},{-50,-20}}))); - Fluid.FixedResistances.LosslessPipe No_stack_a( - redeclare package Medium = Medium, - allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if - not StackEff - annotation (Placement(transformation(extent={{-60,40},{-40,60}}))); - Fluid.FixedResistances.LosslessPipe No_stack_b( - redeclare package Medium = Medium, - allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if - not StackEff - annotation (Placement(transformation(extent={{40,40},{60,60}}))); equation - connect(port_a, col_a_neg.port_a) annotation (Line(points={{-100,0},{-84,0},{-84, - -20},{-60,-20}}, color={0,127,255})); - connect(port_b, col_b_neg.port_a) annotation (Line(points={{100,0},{80,0},{80, - -20},{60,-20}}, color={0,127,255})); - connect(col_b_neg.port_b, res1.port_b) annotation (Line(points={{60,-40},{20,-40}, - {20,0},{8,0}}, color={0,127,255})); - connect(col_a_neg.port_b, res1.port_a) annotation (Line(points={{-60,-40},{-20, - -40},{-20,0},{-12,0}}, color={0,127,255})); - connect(port_a, No_stack_a.port_a) annotation (Line(points={{-100,0},{-84,0},{ - -84,50},{-60,50}}, color={0,127,255})); - connect(No_stack_a.port_b, res1.port_a) annotation (Line(points={{-40,50},{-20, - 50},{-20,0},{-12,0}}, color={0,127,255})); + connect(port_a, No_stack_a.port_a) annotation (Line(points={{-100,0},{-80,0},{ + -80,40},{-68,40}}, color={0,127,255})); + connect(No_stack_a.port_b, res1.port_a) annotation (Line(points={{-48,40},{-20, + 40},{-20,0},{-12,0}}, color={0,127,255})); connect(res1.port_b, No_stack_b.port_a) annotation (Line(points={{8,0},{20,0}, - {20,50},{40,50}}, color={0,127,255})); - connect(No_stack_b.port_b, port_b) annotation (Line(points={{60,50},{80,50},{80, + {20,40},{50,40}}, color={0,127,255})); + connect(No_stack_b.port_b, port_b) annotation (Line(points={{70,40},{80,40},{80, 0},{100,0}}, color={0,127,255})); - connect(port_a, col_a_pos.port_b) annotation (Line(points={{-100,0},{-60,0}}, color={0,127,255})); - connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,20},{ - -40,20},{-40,0},{-12,0}}, color={0,127,255})); - connect(port_b, col_b_pos.port_b) annotation (Line(points={{100,0},{60,0}}, color={0,127,255})); - connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,20},{34, - 20},{34,0},{8,0}}, color={0,127,255})); + connect(port_a, col_a_pos.port_b) annotation (Line(points={{-100,0},{-80,0},{-80, + -10},{-60,-10}}, color={0,127,255})); + connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,10},{-40, + 10},{-40,0},{-12,0}}, color={0,127,255})); + connect(port_b, col_b_pos.port_b) annotation (Line(points={{100,0},{80,0},{80, + -10},{60,-10}}, color={0,127,255})); + connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,10},{34,10}, + {34,0},{8,0}}, color={0,127,255})); annotation (Icon(graphics={ Text( @@ -468,6 +689,7 @@ model Q50_parameterToConnector "Converts parameter values into connectors for pr fillColor={145,167,175}, fillPattern=FillPattern.Forward)})); end Q50_parameterToConnector; + initial equation q50_internal=if use_custom_q50 then custom_q50 else q50_zone.q50_zone; hzone_a=propsBusInt.hzone; From c86cad218d47cdb40e150c0e0b1d6f3e2ed09d48 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 12:00:15 +0100 Subject: [PATCH 016/140] Update InternalWall.mo Changed error in input of door component. --- IDEAS/Buildings/Components/InternalWall.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index cec804a233..d8d36d7a56 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -124,8 +124,8 @@ public redeclare package Medium = Medium, wOpe=w, hOpe=h, - hA=hfloor_a + hRef_a + (hzone_a/2), - hB=hfloor_b + hRef_b + (hzone_b/2), + hA=(hzone_a/2) - hRef_a, + hB=(hzone_b/2) - hRef_b, nCom=4, CD=CD) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts From 1444989de6fa887cec02c1bb5e49489061f5d034 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 12:06:42 +0100 Subject: [PATCH 017/140] Changed documentation of PowerLaw_q50_stack --- .../Components/Interfaces/PartialSurface.mo | 112 ++---------------- 1 file changed, 9 insertions(+), 103 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 0a52067819..ad088cd879 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -454,116 +454,22 @@ model PowerLaw_q50_stack pattern=LinePattern.None, lineColor={0,0,0})}), defaultComponentName="col", - Documentation(info= - " + Documentation(info="

This model describes the pressure difference of a vertical medium column. It can be used to model the pressure difference caused by stack effect. + +It is a variation on IDEAS.Airflow.Multizone.MediumColumn. +

-

Typical use and important parameters

-

-The model can be used with the following three configurations, which are -controlled by the setting of the parameter densitySelection: -

-
    -
  • -top: -Use this setting to use the density from the volume that is connected -to port_a. -
  • -
  • -bottom: -Use this setting to use the density from the volume that is connected -to port_b. -
  • -
  • -actual: -Use this setting to use the density based on the actual flow direction. -
  • -
-

-The settings top and bottom -should be used when rooms or different floors of a building are -connected since multizone airflow models assume that each floor is completely mixed. -For these two seetings, this model will compute the pressure between the center of the room -and an opening that is at height h relative to the center of the room. -The setting actual may be used to model a chimney in which -a column of air will change its density based on the flow direction. -

-

-In this model, the parameter h must always be positive, and the port port_a must be -at the top of the column. -

-

Dynamics

-

-For a dynamic model, use - -IDEAS.Airflow.Multizone.MediumColumnDynamic instead of this model. -

-", revisions= - " +", revisions="
  • -January 18, 2019, by Jianjun Hu:
    -Limited the media choice to moist air only. -See #1050. -
  • -
  • -May 1, 2018, by Filip Jorissen:
    -Removed declaration of allowFlowReversal -and changed default density computation such -that it assumes a constant pressure. -See #877. -
  • -
  • -November 3, 2016, by Michael Wetter:
    -Removed start values for mass flow rate and pressure difference -to simplify the parameter window.
    -This is for -#552. -
  • -
  • -January 22, 2016, by Michael Wetter:
    -Corrected type declaration of pressure difference. -This is -for #404. -
  • -
  • -February 24, 2015 by Michael Wetter:
    -Changed model to use - -IDEAS.Utilities.Psychrometrics.Functions.density_pTX -for the density computation -as - -IDEAS.Media.Air.density -does not depend on temperature. -
  • -
  • -December 22, 2014 by Michael Wetter:
    -Removed Modelica.Fluid.System -to address issue -#311. -
  • -
  • October 4, 2014 by Michael Wetter:
    -Removed assignment of port_?.p.nominal to avoid a warning in OpenModelica because -alias sets have different nominal values. -
  • -
  • April 17, 2013 by Michael Wetter:
    -Reformulated the assert statement that checks for the correct value of densitySelection. -
  • -
  • July 28, 2010 by Michael Wetter:
    -Changed sign for pressure difference. -
  • -
  • -July 20, 2010 by Michael Wetter:
    -Migrated model to Modelica 3.1 and integrated it into the Buildings library. -Reimplemented assignment of density based on flow direction or based on outflowing state. -
  • -
  • -February 24, 2005 by Michael Wetter:
    -Released first version. +January 19, 2022, by Klaas De Jonge:
    +Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of h can be negative and cleaned out the model as the density should always be set by port_b. +This makes port_a not nececarilly always the top port. +
")); From 337f5557fea17c7a78d0678509a4150790e700bf Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 15:59:41 +0100 Subject: [PATCH 018/140] Assign height difference between meteorological pressure measurements and flow element(s) Assign height difference between meteorological pressure measurements and flow element(s). Also, by default corrects for the windspeed using this height when the TwoPort implementation is used. --- .../Interfaces/PartialSimInfoManager.mo | 2 ++ IDEAS/Buildings/Components/OuterWall.mo | 19 ++++++++++++------- IDEAS/Buildings/Components/Window.mo | 15 ++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo index 1441e32732..e39032f7e4 100644 --- a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo +++ b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo @@ -108,6 +108,8 @@ partial model PartialSimInfoManager parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); parameter Real a=0.28 "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); + parameter Modelica.SIunits.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" + annotation(Dialog(group="Wind")); parameter Modelica.SIunits.Length Hwin=10 "Height above ground of meteorological wind speed measurement" annotation(Dialog(group="Wind")); diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index bb1b9f8e9f..48b081d45e 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -5,8 +5,8 @@ model OuterWall "Opaque building envelope construction" final nWin=1, dT_nominal_a=-3, QTra_design(fixed=false), - res1(h_a=Habs - (hfloor_a + 0.25*hVertical + hRef_a)), - res2(h_a=Habs - (hfloor_a + 0.75*hVertical + hRef_a))); + res1(h_a=(Habs - sim.Hpres) + 0.25*hVertical), + res2(h_a=(Habs - sim.Hpres) - 0.25*hVertical)); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" @@ -46,12 +46,15 @@ model OuterWall "Opaque building envelope construction" + parameter Boolean Use_custom_Cs = false + "if checked, Cs will be used in stead of the default related to the interzonal airflow type " + annotation(choices(checkBox=true),Dialog(enable=true,tab="Airflow", group="Wind Pressure")); parameter Real Cs=sim.Cs "Wind speed modifier" - annotation (Dialog(tab="Airflow", group="Wind Pressure")); - parameter Real Habs=1 - "Absolute height of boundary for correcting the wind speed" - annotation (Dialog(tab="Airflow", group="Wind Pressure")); + annotation (Dialog(enable=Use_custom_Cs,tab="Airflow", group="Wind Pressure")); + final parameter Real Habs=hfloor_a + hRef_a + (hVertical/2) + "Absolute height of the center of the surface for correcting the wind speed, used in TwoPort implementation" + annotation (Dialog(tab="Airflow", group="Wind")); protected IDEAS.Buildings.Components.BaseClasses.ConvectiveHeatTransfer.ExteriorConvection extCon( @@ -82,7 +85,9 @@ protected redeclare package Medium = Medium, final table=coeffsCp, final azi=aziInt, - Cs=Cs, + Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + then (A0*A0)*((Habs/Hwin)^(2*a)) elseif not Use_custom_Cs then sim.Cs + else Cs, Habs=Habs, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 1 else 2) if diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index b506d512e0..a1a89db8c6 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -30,9 +30,9 @@ model Window "Multipane window" checkCoatings=glazing.checkLowPerformanceGlazing), setArea(A=A_glass*nWin), q50_zone(v50_surf=q50_internal*A_glass), - res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=Habs - - (hfloor_a + 0.25*hVertical + hRef_a)), - res2(A=A_glass/2, h_a=Habs - (hfloor_a + 0.75*hVertical + hRef_a))); + res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=( + Habs - sim.Hpres) + 0.25*hVertical), + res2(A=A_glass/2, h_a=(Habs - sim.Hpres) - 0.25*hVertical)); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); @@ -84,10 +84,9 @@ model Window "Multipane window" "Wind speed modifier" annotation (Dialog(tab="Airflow", group="Wind")); - parameter Real Habs=1 - "Absolute height of boundary for correcting the wind speed" + final parameter Real Habs=hfloor_a + hRef_a + (hVertical/2) + "Absolute height of the ambient boundary for correcting the wind speed" annotation (Dialog(tab="Airflow", group="Wind")); - protected final parameter Real U_value=glazing.U_value*(1-frac)+fraType.U_value*frac "Average window U-value"; @@ -196,7 +195,9 @@ protected redeclare package Medium = Medium, final table=coeffsCp, final azi=aziInt, - Cs=Cs, + Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + then (A0*A0)*((Habs/Hwin)^(2*a)) elseif not Use_custom_Cs then sim.Cs + else Cs, Habs=Habs, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 1 else 2) if From a9e4c01f7d2f5b09a88aa9a4763248db1e0d081c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 16:00:00 +0100 Subject: [PATCH 019/140] Update PartialSurface.mo cosmetic change --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index ad088cd879..5af34b2e39 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -45,8 +45,8 @@ partial model PartialSurface "Partial model for building envelope component" "Medium in the component" annotation(Dialog(enable=use_custom_q50,tab="Airflow", group="Airtightness")); parameter Boolean use_custom_q50=false - "set to true to disable the default q50 computation and to assign a custom q50 value" - annotation (Dialog(tab="Airflow", group="Airtightness"), Evaluate=true); + "check to disable the default q50 computation and to assign a custom q50 value" + annotation (choices(checkBox=true),Dialog(tab="Airflow", group="Airtightness"), Evaluate=true); parameter Real custom_q50(unit="m3/(h.m2)") = 2 "Envelope air tightness" annotation (Dialog(enable=use_custom_q50,tab="Airflow", group="Airtightness")); From cb815c695c90016707460114a9af9769a26ff3ac Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 16:38:13 +0100 Subject: [PATCH 020/140] Internal references for Cs --- IDEAS/Buildings/Components/OuterWall.mo | 4 ++-- IDEAS/Buildings/Components/Window.mo | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index 48b081d45e..014f4a7d63 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -86,8 +86,8 @@ protected final table=coeffsCp, final azi=aziInt, Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - then (A0*A0)*((Habs/Hwin)^(2*a)) elseif not Use_custom_Cs then sim.Cs - else Cs, + then (outsideAir.A0*outsideAir.A0)*((Habs/outsideAir.Hwin)^(2* + outsideAir.a)) elseif not Use_custom_Cs then sim.Cs else Cs, Habs=Habs, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 1 else 2) if diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index a1a89db8c6..8b1a8c1ed8 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -196,8 +196,8 @@ protected final table=coeffsCp, final azi=aziInt, Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - then (A0*A0)*((Habs/Hwin)^(2*a)) elseif not Use_custom_Cs then sim.Cs - else Cs, + then (outsideAir.A0*outsideAir.A0)*((Habs/outsideAir.Hwin)^(2* + outsideAir.a)) elseif not Use_custom_Cs then sim.Cs else Cs, Habs=Habs, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 1 else 2) if From 779799513cc74cffcd2603127602eae24fee274e Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 16:52:15 +0100 Subject: [PATCH 021/140] Update Window.mo --- IDEAS/Buildings/Components/Window.mo | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 8b1a8c1ed8..6dcef38f8b 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -80,9 +80,12 @@ model Window "Multipane window" -0.35; 270,-0.3; 315,0.1; 360,0.4] "Cp at different angles of attack" annotation(Dialog(tab="Airflow",group="Wind")); + parameter Boolean Use_custom_Cs = false + "if checked, Cs will be used in stead of the default related to the interzonal airflow type " + annotation(choices(checkBox=true),Dialog(enable=true,tab="Airflow", group="Wind Pressure")); parameter Real Cs=sim.Cs "Wind speed modifier" - annotation (Dialog(tab="Airflow", group="Wind")); + annotation (Dialog(enable=Use_custom_Cs,tab="Airflow", group="Wind Pressure")); final parameter Real Habs=hfloor_a + hRef_a + (hVertical/2) "Absolute height of the ambient boundary for correcting the wind speed" From 40ed8546120d0bd136474eb0914b904adbf4c0d2 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 19 Jan 2022 17:12:52 +0100 Subject: [PATCH 022/140] Check Ceiling vs Floor succesfull --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 3 --- 1 file changed, 3 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 5af34b2e39..e07216fb6f 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -59,9 +59,6 @@ partial model PartialSurface "Partial model for building envelope component" parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " annotation(Evaluate=true); - //TO CHECK: default should be zone height only when it is the ceiling at propsbus - - IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( redeclare final package Medium = Medium, numIncAndAziInBus=sim.numIncAndAziInBus, outputAngles=sim.outputAngles, From 82c4b3d98dda4fb72ab94c26ee9a8aa5207d4ed9 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 20 Jan 2022 13:17:34 +0100 Subject: [PATCH 023/140] Added replaceable records for wind pressur coefficient option added to get better default for roofs. This needs to be fine-tuned based on available data. --- IDEAS/Buildings/Components/OuterWall.mo | 10 ++++++++-- IDEAS/Buildings/Components/Window.mo | 12 +++++++++--- .../Data/Interfaces/WindPressureCoeff.mo | 10 ++++++++++ IDEAS/Buildings/Data/Interfaces/package.order | 1 + .../Data/WindPressureCoeff/Lowrise_Cubic.mo | 16 ++++++++++++++++ .../Buildings/Data/WindPressureCoeff/package.mo | 4 ++++ .../Data/WindPressureCoeff/package.order | 1 + IDEAS/Buildings/Data/package.order | 1 + 8 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo create mode 100644 IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo create mode 100644 IDEAS/Buildings/Data/WindPressureCoeff/package.mo create mode 100644 IDEAS/Buildings/Data/WindPressureCoeff/package.order diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index 014f4a7d63..59f1eb30e2 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -28,8 +28,14 @@ model OuterWall "Opaque building envelope construction" final parameter Real U_value=1/(1/8 + sum(constructionType.mats.R) + 1/25) "Wall U-value"; - parameter Real coeffsCp[:,:]=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, - -0.35; 270,-0.3; 315,0.1; 360,0.4] + + replaceable parameter IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Cubic Cp_table + constrainedby IDEAS.Buildings.Data.Interfaces.WindPressureCoeff + "Table with default table for wind pressure coefficients for walls, floors and roofs" annotation ( + __Dymola_choicesAllMatching=true, + Placement(transformation(extent={{-34,78},{-30,82}})), + Dialog(tab="Airflow", group="Wind Pressure")); + parameter Real coeffsCp[:,:]= if inc==0 then Cp_table.Cp_Roof elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall "Cp at different angles of attack" annotation(Dialog(tab="Airflow", group="Wind Pressure")); diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 6dcef38f8b..7ed6c090f8 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -76,10 +76,16 @@ model Window "Multipane window" - parameter Real coeffsCp[:,:]=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, - -0.35; 270,-0.3; 315,0.1; 360,0.4] + replaceable parameter IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Cubic Cp_table + constrainedby IDEAS.Buildings.Data.Interfaces.WindPressureCoeff + "Table with default table for wind pressure coefficients for walls, floors and roofs" annotation ( + __Dymola_choicesAllMatching=true, + Placement(transformation(extent={{-34,78},{-30,82}})), + Dialog(tab="Airflow", group="Wind Pressure")); + parameter Real coeffsCp[:,:]= if inc==0 then Cp_table.Cp_Roof elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall "Cp at different angles of attack" - annotation(Dialog(tab="Airflow",group="Wind")); + annotation(Dialog(tab="Airflow", group="Wind Pressure")); + parameter Boolean Use_custom_Cs = false "if checked, Cs will be used in stead of the default related to the interzonal airflow type " annotation(choices(checkBox=true),Dialog(enable=true,tab="Airflow", group="Wind Pressure")); diff --git a/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo b/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo new file mode 100644 index 0000000000..6a071a2cf0 --- /dev/null +++ b/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo @@ -0,0 +1,10 @@ +within IDEAS.Buildings.Data.Interfaces; +record WindPressureCoeff + "Record for storing tables for wind pressure coeff" + extends Modelica.Icons.Record; + + parameter Real Cp_Wall [:,:]; + parameter Real Cp_Roof[:,:]; + parameter Real Cp_Floor[:,:]; + +end WindPressureCoeff; diff --git a/IDEAS/Buildings/Data/Interfaces/package.order b/IDEAS/Buildings/Data/Interfaces/package.order index ab13b29a1c..44dd5c8518 100644 --- a/IDEAS/Buildings/Data/Interfaces/package.order +++ b/IDEAS/Buildings/Data/Interfaces/package.order @@ -6,3 +6,4 @@ Insulation Material PartialGlazing OldGlazing +WindPressureCoeff diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo new file mode 100644 index 0000000000..7a0da574c5 --- /dev/null +++ b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo @@ -0,0 +1,16 @@ +within IDEAS.Buildings.Data.WindPressureCoeff; +record Lowrise_Cubic + extends Interfaces.WindPressureCoeff( + Cp_Floor=[0,0; 45,0; 90,0; 135,0; 180,0; 225,0; 270,0; 315,0; 360,0], + Cp_Roof=[0,-0.5; 45,-0.5; 90,-0.5; 135,-0.5; 180,-0.5; 225,-0.5; 270,-0.5; 315, + -0.5; 360,-0.5], + Cp_Wall=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, + -0.35; 270,-0.3; 315,0.1; 360,0.4]); + + + + + + + +end Lowrise_Cubic; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/package.mo b/IDEAS/Buildings/Data/WindPressureCoeff/package.mo new file mode 100644 index 0000000000..a87317879c --- /dev/null +++ b/IDEAS/Buildings/Data/WindPressureCoeff/package.mo @@ -0,0 +1,4 @@ +within IDEAS.Buildings.Data; +package WindPressureCoeff +extends Modelica.Icons.Record; +end WindPressureCoeff; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/package.order b/IDEAS/Buildings/Data/WindPressureCoeff/package.order new file mode 100644 index 0000000000..3ca864abb7 --- /dev/null +++ b/IDEAS/Buildings/Data/WindPressureCoeff/package.order @@ -0,0 +1 @@ +Lowrise_Cubic diff --git a/IDEAS/Buildings/Data/package.order b/IDEAS/Buildings/Data/package.order index 365259e89e..10c9b981e7 100644 --- a/IDEAS/Buildings/Data/package.order +++ b/IDEAS/Buildings/Data/package.order @@ -4,4 +4,5 @@ Frames Glazing Insulation Materials +WindPressureCoeff Interfaces From 164357a7160e5705d103434b2ffbc5a7587b7947 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 20 Jan 2022 15:19:44 +0100 Subject: [PATCH 024/140] Fine-tuned default voor Cp_table Table introduced from Energy efficient guide to ventilation, Appendix 2 Table 2.1 --- IDEAS/Buildings/Components/OuterWall.mo | 8 +++--- IDEAS/Buildings/Components/Window.mo | 11 +++++--- .../Data/Interfaces/WindPressureCoeff.mo | 19 ++++++++++--- .../Data/WindPressureCoeff/Lowrise_Cubic.mo | 16 ----------- .../Lowrise_Square_Exposed.mo | 27 +++++++++++++++++++ .../Data/WindPressureCoeff/package.mo | 2 +- .../Data/WindPressureCoeff/package.order | 2 +- 7 files changed, 57 insertions(+), 28 deletions(-) delete mode 100644 IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo create mode 100644 IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo diff --git a/IDEAS/Buildings/Components/OuterWall.mo b/IDEAS/Buildings/Components/OuterWall.mo index 59f1eb30e2..134bfa2118 100644 --- a/IDEAS/Buildings/Components/OuterWall.mo +++ b/IDEAS/Buildings/Components/OuterWall.mo @@ -29,13 +29,15 @@ model OuterWall "Opaque building envelope construction" "Wall U-value"; - replaceable parameter IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Cubic Cp_table + replaceable parameter + IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Square_Exposed Cp_table constrainedby IDEAS.Buildings.Data.Interfaces.WindPressureCoeff - "Table with default table for wind pressure coefficients for walls, floors and roofs" annotation ( + "Table with default table for wind pressure coefficients for walls, floors and roofs" + annotation ( __Dymola_choicesAllMatching=true, Placement(transformation(extent={{-34,78},{-30,82}})), Dialog(tab="Airflow", group="Wind Pressure")); - parameter Real coeffsCp[:,:]= if inc==0 then Cp_table.Cp_Roof elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall + parameter Real coeffsCp[:,:]= if inc<=Modelica.Constants.pi/18 then Cp_table.Cp_Roof_0_10 elseif inc<=Modelica.Constants.pi/6 then Cp_table.Cp_Roof_11_30 elseif inc<=Modelica.Constants.pi/4 then Cp_table.Cp_Roof_30_45 elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall "Cp at different angles of attack" annotation(Dialog(tab="Airflow", group="Wind Pressure")); diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 7ed6c090f8..19a5c2fe3d 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -76,14 +76,17 @@ model Window "Multipane window" - replaceable parameter IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Cubic Cp_table + replaceable parameter + IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Square_Exposed Cp_table constrainedby IDEAS.Buildings.Data.Interfaces.WindPressureCoeff - "Table with default table for wind pressure coefficients for walls, floors and roofs" annotation ( + "Tables with wind pressure coefficients for walls, floors and roofs" + annotation ( __Dymola_choicesAllMatching=true, Placement(transformation(extent={{-34,78},{-30,82}})), Dialog(tab="Airflow", group="Wind Pressure")); - parameter Real coeffsCp[:,:]= if inc==0 then Cp_table.Cp_Roof elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall - "Cp at different angles of attack" + + parameter Real coeffsCp[:,:]= if inc<=Modelica.Constants.pi/18 then Cp_table.Cp_Roof_0_10 elseif inc<=Modelica.Constants.pi/6 then Cp_table.Cp_Roof_11_30 elseif inc<=Modelica.Constants.pi/4 then Cp_table.Cp_Roof_30_45 elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall + "Cp at different angles of attack, default the correct table will be selected from Cp_table based on the surface tilt" annotation(Dialog(tab="Airflow", group="Wind Pressure")); parameter Boolean Use_custom_Cs = false diff --git a/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo b/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo index 6a071a2cf0..a1a9eded74 100644 --- a/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo +++ b/IDEAS/Buildings/Data/Interfaces/WindPressureCoeff.mo @@ -1,10 +1,23 @@ -within IDEAS.Buildings.Data.Interfaces; +within IDEAS.Buildings.Data.Interfaces; record WindPressureCoeff "Record for storing tables for wind pressure coeff" extends Modelica.Icons.Record; - parameter Real Cp_Wall [:,:]; - parameter Real Cp_Roof[:,:]; + parameter Real Cp_Wall [:,:] "Face 1"; + parameter Real Cp_Roof_0_10[:,:] "Roof (<10° pitch, Average)"; + parameter Real Cp_Roof_11_30[:,:] "Roof (11-30° pitch, Front)"; + parameter Real Cp_Roof_30_45[:,:] "Roof (>30° pitch, Front)"; + parameter Real Cp_Floor[:,:]; + annotation (Documentation(info=" +

+ +M. W. Liddament, A guide to energy efficient ventilation. Coventry: Annex V Air Infiltration and Ventilation Centre, 1996.
+
+Appendix 2 - Wind Pressure Coefficient Data + + +

+")); end WindPressureCoeff; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo deleted file mode 100644 index 7a0da574c5..0000000000 --- a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Cubic.mo +++ /dev/null @@ -1,16 +0,0 @@ -within IDEAS.Buildings.Data.WindPressureCoeff; -record Lowrise_Cubic - extends Interfaces.WindPressureCoeff( - Cp_Floor=[0,0; 45,0; 90,0; 135,0; 180,0; 225,0; 270,0; 315,0; 360,0], - Cp_Roof=[0,-0.5; 45,-0.5; 90,-0.5; 135,-0.5; 180,-0.5; 225,-0.5; 270,-0.5; 315, - -0.5; 360,-0.5], - Cp_Wall=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, - -0.35; 270,-0.3; 315,0.1; 360,0.4]); - - - - - - - -end Lowrise_Cubic; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo new file mode 100644 index 0000000000..39ad6ba727 --- /dev/null +++ b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo @@ -0,0 +1,27 @@ +within IDEAS.Buildings.Data.WindPressureCoeff; +record Lowrise_Square_Exposed + extends Interfaces.WindPressureCoeff( + Cp_Roof_30_45=[0,0.3; 45,-0.4; 90,-0.6; 135,-0.4; 180,-0.5; 225,-0.4; 270, + -0.6; 315,-0.4; 360,0.3], + Cp_Roof_11_30=[0,-0.4; 45,-0.5; 90,-0.6; 135,-0.5; 180,-0.4; 225,-0.5; 270, + -0.6; 315,-0.5; 360,-0.4], + Cp_Roof_0_10=[0,-0.6; 45,-0.6; 90,-0.6; 135,-0.6], + Cp_Floor=[0,0; 45,0; 90,0; 135,0; 180,0; 225,0; 270,0; 315,0; 360,0], + Cp_Wall=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, + -0.35; 270,-0.3; 315,0.1; 360,0.4]); + + annotation (Documentation(info=" +

+ +M. W. Liddament, A guide to energy efficient ventilation. Coventry: Annex V Air Infiltration and Ventilation Centre, 1996.
+
+Table A2.1 Wind Pressure Coefficient Data
+Low-rise buildings (up to 3 storeys)
+Length to width ratio: 1:1
+Shielding condition: Exposed
+Wind speed reference level: Building height
+ + +

+")); +end Lowrise_Square_Exposed; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/package.mo b/IDEAS/Buildings/Data/WindPressureCoeff/package.mo index a87317879c..423d69c6da 100644 --- a/IDEAS/Buildings/Data/WindPressureCoeff/package.mo +++ b/IDEAS/Buildings/Data/WindPressureCoeff/package.mo @@ -1,4 +1,4 @@ within IDEAS.Buildings.Data; package WindPressureCoeff -extends Modelica.Icons.Record; + end WindPressureCoeff; diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/package.order b/IDEAS/Buildings/Data/WindPressureCoeff/package.order index 3ca864abb7..333467cbbf 100644 --- a/IDEAS/Buildings/Data/WindPressureCoeff/package.order +++ b/IDEAS/Buildings/Data/WindPressureCoeff/package.order @@ -1 +1 @@ -Lowrise_Cubic +Lowrise_Square_Exposed From 82cfd9f6e352651c49dbd16022be9221d5666185 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 20 Jan 2022 15:27:48 +0100 Subject: [PATCH 025/140] Update Lowrise_Square_Exposed.mo --- .../WindPressureCoeff/Lowrise_Square_Exposed.mo | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo index 39ad6ba727..6e597e4d66 100644 --- a/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo +++ b/IDEAS/Buildings/Data/WindPressureCoeff/Lowrise_Square_Exposed.mo @@ -1,15 +1,14 @@ within IDEAS.Buildings.Data.WindPressureCoeff; record Lowrise_Square_Exposed extends Interfaces.WindPressureCoeff( - Cp_Roof_30_45=[0,0.3; 45,-0.4; 90,-0.6; 135,-0.4; 180,-0.5; 225,-0.4; 270, - -0.6; 315,-0.4; 360,0.3], + Cp_Wall=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, + -0.35; 270,-0.3; 315,0.1; 360,0.4], + Cp_Roof_0_10=[0,-0.6; 45,-0.6; 90,-0.6; 135,-0.6], Cp_Roof_11_30=[0,-0.4; 45,-0.5; 90,-0.6; 135,-0.5; 180,-0.4; 225,-0.5; 270, -0.6; 315,-0.5; 360,-0.4], - Cp_Roof_0_10=[0,-0.6; 45,-0.6; 90,-0.6; 135,-0.6], - Cp_Floor=[0,0; 45,0; 90,0; 135,0; 180,0; 225,0; 270,0; 315,0; 360,0], - Cp_Wall=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, - -0.35; 270,-0.3; 315,0.1; 360,0.4]); - + Cp_Roof_30_45=[0,0.3; 45,-0.4; 90,-0.6; 135,-0.4; 180,-0.5; 225,-0.4; 270, + -0.6; 315,-0.4; 360,0.3], + Cp_Floor=[0,0; 45,0; 90,0; 135,0; 180,0; 225,0; 270,0; 315,0; 360,0]) annotation (Documentation(info="

@@ -24,4 +23,6 @@ Wind speed reference level: Building height

")); + + end Lowrise_Square_Exposed; From 894876e6134c61cb2de8ef282ac8e5064f3f02a7 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 24 Jan 2022 17:49:30 +0100 Subject: [PATCH 026/140] Simple zone template examples with 3 different airflow implementation examples Examples not connected to case 900 for the rectangular zone template including "simulate and plot" scripts. Error for TwoPort still needs to be fixed. --- .../Examples/RectangularZoneTemplate.mo | 62 +++++++++++++++++++ .../RectangularZoneTemplateOnePort.mo | 27 ++++++++ .../RectangularZoneTemplateTwoPort.mo | 27 ++++++++ .../Components/Examples/package.order | 3 + .../Examples/RectangularZoneTemplate.mos | 3 + .../RectangularZoneTemplateOnePort.mos | 3 + .../RectangularZoneTemplateTwoPort.mos | 3 + 7 files changed, 128 insertions(+) create mode 100644 IDEAS/Buildings/Components/Examples/RectangularZoneTemplate.mo create mode 100644 IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo create mode 100644 IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo create mode 100644 IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplate.mos create mode 100644 IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mos create mode 100644 IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mos diff --git a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplate.mo b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplate.mo new file mode 100644 index 0000000000..7481d132b9 --- /dev/null +++ b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplate.mo @@ -0,0 +1,62 @@ +within IDEAS.Buildings.Components.Examples; +model RectangularZoneTemplate + "This example illustrates the use of the RectangularZoneTemplate to model a room or building" + extends Modelica.Icons.Example; + inner BoundaryConditions.SimInfoManager sim + "Simulation information manager for climate data" + annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate Zone( + h=2.7, + redeclare replaceable package Medium = IDEAS.Media.Air, + T_start=293.15, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + hasWinCei=false, + redeclare IDEAS.Buildings.Validation.Data.Constructions.LightRoof conTypCei, + + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Buildings.Validation.Data.Constructions.HeavyFloor + conTypFlo, + redeclare IDEAS.Buildings.Validation.Data.Constructions.HeavyWall conTypA, + redeclare IDEAS.Buildings.Validation.Data.Constructions.HeavyWall conTypB, + redeclare IDEAS.Buildings.Validation.Data.Constructions.HeavyWall conTypC, + redeclare IDEAS.Buildings.Validation.Data.Constructions.HeavyWall conTypD, + hasWinA=true, + fracA=0, + redeclare IDEAS.Buildings.Validation.Data.Glazing.GlaBesTest glazingA, + redeclare IDEAS.Buildings.Components.Shading.Interfaces.ShadingProperties + shaTypA, + hasWinB=false, + hasWinC=false, + hasWinD=false, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + aziA=IDEAS.Types.Azimuth.S, + l=8, + w=6, + A_winA=12) + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=604800, + Tolerance=1e-006, + __Dymola_Algorithm="Lsodar"), + Documentation(info=" +

+This example illustrates the use of the RectangularZoneTemplate to model a room or building. +

+", revisions=" +
    +
  • +January 2022 by Klaas De Jonge:
    +First implementation +
  • +
+"), + __Dymola_Commands(file(inherit=true) = "Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplate.mos" + "Simulate and Plot")); +end RectangularZoneTemplate; diff --git a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo new file mode 100644 index 0000000000..083be8124d --- /dev/null +++ b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mo @@ -0,0 +1,27 @@ +within IDEAS.Buildings.Components.Examples; +model RectangularZoneTemplateOnePort + "Example that compares a zone with internal wall and without internal wall" + extends Modelica.Icons.Example; + extends IDEAS.Buildings.Components.Examples.RectangularZoneTemplate(sim( + interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=604800, + Tolerance=1e-006, + __Dymola_Algorithm="Lsodar"), + Documentation(info=" +

+This example illustrates the use of the RectangularZoneTemplate to model a room or building with the OnePort interzonal airflow implementation activated +

+", revisions=" +
    +
  • +August 10, 2018 by Damien Picard:
    +First implementation +
  • +
+"), + __Dymola_Commands(file(inherit=true) = "Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mos" + "Simulate and Plot")); +end RectangularZoneTemplateOnePort; diff --git a/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo new file mode 100644 index 0000000000..5c5bf68200 --- /dev/null +++ b/IDEAS/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mo @@ -0,0 +1,27 @@ +within IDEAS.Buildings.Components.Examples; +model RectangularZoneTemplateTwoPort + "Example that compares a zone with internal wall and without internal wall" + extends Modelica.Icons.Example; + extends IDEAS.Buildings.Components.Examples.RectangularZoneTemplate( sim( + interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts)); + annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram( + coordinateSystem(preserveAspectRatio=false)), + experiment( + StopTime=604800, + Tolerance=1e-006, + __Dymola_Algorithm="Lsodar"), + Documentation(info=" +

+This example illustrates the use of the RectangularZoneTemplate to model a room or building with the TwoPort interzonal airflow implementation activated +

+", revisions=" +
    +
  • +August 10, 2018 by Damien Picard:
    +First implementation +
  • +
+"), + __Dymola_Commands(file(inherit=true) = "Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mos" + "Simulate and Plot")); +end RectangularZoneTemplateTwoPort; diff --git a/IDEAS/Buildings/Components/Examples/package.order b/IDEAS/Buildings/Components/Examples/package.order index 156f08f61f..ec27110e2f 100644 --- a/IDEAS/Buildings/Components/Examples/package.order +++ b/IDEAS/Buildings/Components/Examples/package.order @@ -9,6 +9,9 @@ RectangularZone RectangularZoneEmbedded RectangularZoneExternalSurfaces RectangularZoneRedeclarationWindows +RectangularZoneTemplate +RectangularZoneTemplateOnePort +RectangularZoneTemplateTwoPort ScalingWindow WallUnitTest WindowDynamics diff --git a/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplate.mos b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplate.mos new file mode 100644 index 0000000000..0aa721da5a --- /dev/null +++ b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplate.mos @@ -0,0 +1,3 @@ +simulateModel("IDEAS.Buildings.Components.Examples.RectangularZoneTemplate", startTime=0, stopTime=604800, method="Lsodar", tolerance=1e-06, resultFile="RectangularZoneTemplate"); +createPlot(id=1, position={0, 0, 1283, 740}, y={"Zone.TSensor"}, range={0.0, 620000.0, 5.0, 21.0}, grid=true, colors={{28,108,200}}); + diff --git a/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mos b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mos new file mode 100644 index 0000000000..a82bb2fad8 --- /dev/null +++ b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateOnePort.mos @@ -0,0 +1,3 @@ +simulateModel("IDEAS.Buildings.Components.Examples.RectangularZoneTemplateOnePort", startTime=0, stopTime=604800, method="Lsodar", tolerance=1e-06, resultFile="RectangularZoneTemplateOnePort"); +createPlot(id=1, position={0, 0, 1283, 740}, y={"Zone.TSensor"}, range={0.0, 620000.0, 5.0, 21.0}, grid=true, colors={{28,108,200}}); +createPlot(id=1, position={0, 0, 1283, 740}, y={"Zone.airModel.ACH"}, range={0.0, 620000.0, -0.1, 0.4}, grid=true, subPlot=102, colors={{28,108,200}}, displayUnits={"1/h"}); diff --git a/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mos b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mos new file mode 100644 index 0000000000..94bb5bdb7b --- /dev/null +++ b/IDEAS/Resources/Scripts/Dymola/Buildings/Components/Examples/RectangularZoneTemplateTwoPort.mos @@ -0,0 +1,3 @@ +simulateModel("IDEAS.Buildings.Components.Examples.RectangularZoneTemplateTwoPort", startTime=0, stopTime=604800, method="Lsodar", tolerance=1e-06, resultFile="RectangularZoneTemplateTwoPort"); +createPlot(id=1, position={0, 0, 1283, 740}, y={"Zone.TSensor"}, range={0.0, 620000.0, 5.0, 21.0}, grid=true, colors={{28,108,200}}); +createPlot(id=1, position={0, 0, 1283, 740}, y={"Zone.airModel.ACH"}, range={0.0, 620000.0, -0.1, 0.4}, grid=true, subPlot=102, colors={{28,108,200}}, displayUnits={"1/h"}); From f1d523d03ad7991d75c9e73cdc2d48531266b4b7 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 10:20:53 +0200 Subject: [PATCH 027/140] Additional MSL4.0 updates --- .../Interfaces/PartialSimInfoManager.mo | 76 +++++++++---------- .../Validation/BESTEST/WD100.mo | 2 +- .../Components/Interfaces/PartialSurface.mo | 52 ++++++------- IDEAS/Buildings/Components/InternalWall.mo | 32 ++++---- IDEAS/Buildings/Components/Window.mo | 36 ++++----- 5 files changed, 99 insertions(+), 99 deletions(-) diff --git a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo index e39032f7e4..963e3827b2 100644 --- a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo +++ b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo @@ -1,39 +1,39 @@ -within IDEAS.BoundaryConditions.Interfaces; +within IDEAS.BoundaryConditions.Interfaces; partial model PartialSimInfoManager "Partial providing structure for SimInfoManager" parameter String filNam= Modelica.Utilities.Files.loadResource("modelica://IDEAS/Resources/weatherdata/Brussels.mos") "File name of TMY3 weather file" annotation(Dialog(loadSelector(filter="TMY-files (*.TMY);;Text files (*.txt);;All files (*.*)", caption="Select the weather file"))); - parameter Modelica.SIunits.Angle lat(displayUnit="deg") = weaDat.lat + parameter Modelica.Units.SI.Angle lat(displayUnit="deg") = weaDat.lat "Latitude of the location" annotation(Dialog(tab="Advanced")); - parameter Modelica.SIunits.Angle lon(displayUnit="deg") = weaDat.lon + parameter Modelica.Units.SI.Angle lon(displayUnit="deg") = weaDat.lon "Longitude of the location" annotation(Dialog(tab="Advanced")); - parameter Modelica.SIunits.Time timZon(displayUnit="h") = weaDat.timZon + parameter Modelica.Units.SI.Time timZon(displayUnit="h") = weaDat.timZon "Time zone for which the simulation time t=0 corresponds to midnight, january 1st"; - parameter Modelica.SIunits.Angle incS = IDEAS.Types.Azimuth.S + parameter Modelica.Units.SI.Angle incS = IDEAS.Types.Azimuth.S "South inclination" annotation(Dialog(tab="Incidence angles")); - parameter Modelica.SIunits.Angle incW = incS +Modelica.Constants.pi/2 + parameter Modelica.Units.SI.Angle incW = incS +Modelica.Constants.pi/2 "West inclination" annotation(Dialog(tab="Incidence angles")); - parameter Modelica.SIunits.Angle incN = incS +Modelica.Constants.pi + parameter Modelica.Units.SI.Angle incN = incS +Modelica.Constants.pi "North inclination" annotation(Dialog(tab="Incidence angles")); - parameter Modelica.SIunits.Angle incE = incS +3*Modelica.Constants.pi/2 + parameter Modelica.Units.SI.Angle incE = incS +3*Modelica.Constants.pi/2 "East inclination" annotation(Dialog(tab="Incidence angles")); - parameter Modelica.SIunits.Angle incAndAziInBus[:,:] = {{IDEAS.Types.Tilt.Ceiling,0},{IDEAS.Types.Tilt.Wall,incS}, + parameter Modelica.Units.SI.Angle incAndAziInBus[:,:] = {{IDEAS.Types.Tilt.Ceiling,0},{IDEAS.Types.Tilt.Wall,incS}, {IDEAS.Types.Tilt.Wall,incW},{IDEAS.Types.Tilt.Wall,incN},{IDEAS.Types.Tilt.Wall,incE}, {IDEAS.Types.Tilt.Floor,0}} "Combination of inclination and azimuth which are pre-computed and added to solBus." annotation(Dialog(tab="Incidence angles")); - final parameter Modelica.SIunits.Angle aziOpts[5]={incS, incW, incN, incE, incS} + final parameter Modelica.Units.SI.Angle aziOpts[5]={incS, incW, incN, incE, incS} "Inclination options, default south"; - final parameter Modelica.SIunits.Angle incOpts[4]={IDEAS.Types.Tilt.Wall, IDEAS.Types.Tilt.Floor, IDEAS.Types.Tilt.Ceiling, IDEAS.Types.Tilt.Wall} + final parameter Modelica.Units.SI.Angle incOpts[4]={IDEAS.Types.Tilt.Wall, IDEAS.Types.Tilt.Floor, IDEAS.Types.Tilt.Ceiling, IDEAS.Types.Tilt.Wall} "Azimuth options, default wall"; parameter Boolean computeConservationOfEnergy=false @@ -72,10 +72,10 @@ partial model PartialSimInfoManager parameter Boolean linExtRadWin=true "= true, if exterior radiative heat transfer for windows should be linearised" annotation (Dialog(tab="Linearisation", group="Radiation")); - parameter Modelica.SIunits.Energy Emax=1 + parameter Modelica.Units.SI.Energy Emax=1 "Error bound for violation of conservation of energy" annotation (Evaluate=true, Dialog(tab="Conservation of energy", enable=strictConservationOfEnergy)); - parameter Modelica.SIunits.Temperature Tenv_nom=280 + parameter Modelica.Units.SI.Temperature Tenv_nom=280 "Nominal ambient temperature, only used when linearising equations"; parameter Integer nWindow = 1 @@ -103,15 +103,15 @@ partial model PartialSimInfoManager annotation(Dialog(enable=interZonalAirFlowType<> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None or unify_n50,group="Interzonal airflow")); - parameter Modelica.SIunits.Length H=10 "Building or roof height" - annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length H=10 "Building or roof height" + annotation(Dialog(group="Wind")); parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); parameter Real a=0.28 "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); - parameter Modelica.SIunits.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" - annotation(Dialog(group="Wind")); - parameter Modelica.SIunits.Length Hwin=10 "Height above ground of meteorological wind speed measurement" - annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" + annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hwin=10 "Height above ground of meteorological wind speed measurement" + annotation(Dialog(group="Wind")); parameter Real Cs= (A0*A0)*((H/Hwin)^(2*a)) "Wind speed modifier" annotation(Dialog(group="Wind")); @@ -119,29 +119,29 @@ partial model PartialSimInfoManager final parameter Integer numIncAndAziInBus = size(incAndAziInBus,1) "Number of pre-computed azimuth"; - final parameter Modelica.SIunits.Temperature Tdes=-8 + 273.15 + final parameter Modelica.Units.SI.Temperature Tdes=-8 + 273.15 "design outdoor temperature"; - final parameter Modelica.SIunits.Temperature TdesGround=10 + 273.15 + final parameter Modelica.Units.SI.Temperature TdesGround=10 + 273.15 "design ground temperature"; final parameter Boolean linearise=lineariseDymola or lineariseJModelica "Linearises building model equations" annotation (Dialog(tab="Linearisation")); - input Modelica.SIunits.Temperature Te + input Modelica.Units.SI.Temperature Te "ambient outdoor temperature for determination of sky radiation exchange"; - input Modelica.SIunits.Temperature Tsky "effective overall sky temperature"; - input Modelica.SIunits.Temperature TeAv + input Modelica.Units.SI.Temperature Tsky "effective overall sky temperature"; + input Modelica.Units.SI.Temperature TeAv "running average of ambient outdoor temperature of the last 5 days, not yet implemented"; - input Modelica.SIunits.Temperature Tground "ground temperature"; - input Modelica.SIunits.Velocity Va "wind speed"; - input Modelica.SIunits.Angle Vdir "wind direction"; + input Modelica.Units.SI.Temperature Tground "ground temperature"; + input Modelica.Units.SI.Velocity Va "wind speed"; + input Modelica.Units.SI.Angle Vdir "wind direction"; input Real relHum(final unit="1") "Relative humidity"; - input Modelica.SIunits.Temperature TDewPoi "Dewpoint"; + input Modelica.Units.SI.Temperature TDewPoi "Dewpoint"; - Modelica.SIunits.Energy Etot "Total internal energy"; - Modelica.SIunits.Energy Qint "Total energy from boundary"; + Modelica.Units.SI.Energy Etot "Total internal energy"; + Modelica.Units.SI.Energy Qint "Total energy from boundary"; IDEAS.Utilities.Psychrometrics.X_pTphi XiEnv(use_p_in=false) annotation (Placement(transformation(extent={{-20,20},{0,40}}))); @@ -191,10 +191,10 @@ partial model PartialSimInfoManager final parameter Real q50_def( unit="m3/(h.m2)") = if A_def< Modelica.Constants.small then q50_av else V50_def/A_def; final parameter Real q50_av( unit="m3/(h.m2)") = if A_tot < Modelica.Constants.small then 0 else V50/A_tot "average, not corrected q50"; - final parameter Modelica.SIunits.Volume V_tot(fixed=false) "Total conditioned building volume"; - final parameter Modelica.SIunits.Area A_tot(fixed=false) "Total surface area of OuterWalls and Windows"; + final parameter Modelica.Units.SI.Volume V_tot(fixed=false) "Total conditioned building volume"; + final parameter Modelica.Units.SI.Area A_tot(fixed=false) "Total surface area of OuterWalls and Windows"; final parameter Real V50_custom( unit="m3/h",fixed=false) "Sum of v50 values for components that have a custom assignment"; - final parameter Modelica.SIunits.Area A_def( fixed=false) "Total area with default q50, i.e. without custom q50 assignment, or connected to zone with custom n50 assigned"; + final parameter Modelica.Units.SI.Area A_def( fixed=false) "Total area with default q50, i.e. without custom q50 assignment, or connected to zone with custom n50 assigned"; input IDEAS.Buildings.Components.Interfaces.WindowBus[nWindow] winBusOut( each nLay=nLayWin) if createOutputs @@ -311,7 +311,7 @@ equation color={0,0,127}, smooth=Smooth.None)); connect(relativeAirMass.relAirMas, skyBrightness.relAirMas) annotation (Line( - points={{-39,70},{-38,70},{-38,74},{-32,74}}, + points={{-39,70},{-38,70},{-38,76},{-32,76}}, color={0,0,127}, smooth=Smooth.None)); @@ -430,10 +430,10 @@ equation smooth=Smooth.None)); connect(skyBrightnessCoefficients.zen, angZen.y) annotation (Line(points={{-2,84},{-77.6,84}}, color={0,0,127})); - connect(skyBrightness.HDifHor,HDifHor. y) annotation (Line(points={{-32,66},{-70, - 66},{-70,98},{-77.6,98}}, color={0,0,127})); - connect(relativeAirMass.zen, angZen.y) annotation (Line(points={{-62,70},{-68, - 70},{-68,84},{-77.6,84}}, color={0,0,127})); + connect(skyBrightness.HDifHor,HDifHor. y) annotation (Line(points={{-32,70},{-70, + 70},{-70,98},{-77.6,98}}, color={0,0,127})); + connect(relativeAirMass.zen, angZen.y) annotation (Line(points={{-62,64},{-68, + 64},{-68,84},{-77.6,84}}, color={0,0,127})); connect(skyClearness.zen, angZen.y) annotation (Line(points={{-62,104},{-68,104}, {-68,84},{-77.6,84}}, color={0,0,127})); connect(skyClearness.HDifHor,HDifHor. y) annotation (Line(points={{-62,110},{-70, diff --git a/IDEAS/BoundaryConditions/Validation/BESTEST/WD100.mo b/IDEAS/BoundaryConditions/Validation/BESTEST/WD100.mo index 876f2b19dc..d23b1e315b 100644 --- a/IDEAS/BoundaryConditions/Validation/BESTEST/WD100.mo +++ b/IDEAS/BoundaryConditions/Validation/BESTEST/WD100.mo @@ -1,4 +1,4 @@ -within IDEAS.BoundaryConditions.Validation.BESTEST; +within IDEAS.BoundaryConditions.Validation.BESTEST; model WD100 "Test model for BESTEST weather data: base case" extends Modelica.Icons.Example; diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index e07216fb6f..92306b8c9f 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -7,34 +7,34 @@ partial model PartialSurface "Partial model for building envelope component" parameter Integer incOpt = 4 "Tilt angle option from simInfoManager, or custom using inc" annotation(choices(__Dymola_radioButtons=true, choice=1 "Wall", choice=2 "Floor", choice=3 "Ceiling", choice=4 "Custom")); - parameter Modelica.SIunits.Angle inc = sim.incOpts[incOpt] + parameter Modelica.Units.SI.Angle inc = sim.incOpts[incOpt] "Custom inclination (tilt) angle of the wall, default wall" annotation(Dialog(enable=incOpt==4)); parameter Integer aziOpt = 5 "Azimuth angle option from simInfoManager, or custom using azi" annotation(choices(__Dymola_radioButtons=true, choice=1 "South", choice=2 "West", choice=3 "North", choice=4 "East", choice=5 "Custom")); - parameter Modelica.SIunits.Angle azi=sim.aziOpts[aziOpt] + parameter Modelica.Units.SI.Angle azi=sim.aziOpts[aziOpt] "Custom azimuth angle of the wall, default south" annotation(Dialog(enable=aziOpt==5)); - parameter Modelica.SIunits.Area A + parameter Modelica.Units.SI.Area A "Component surface area"; parameter Real nWin = 1 "Use this factor to scale the component to nWin identical components" annotation(Evaluate=true); - parameter Modelica.SIunits.Power QTra_design + parameter Modelica.Units.SI.Power QTra_design "Design heat losses at reference temperature of the boundary space" annotation (Dialog(group="Design power",tab="Advanced")); - parameter Modelica.SIunits.Temperature T_start=293.15 + parameter Modelica.Units.SI.Temperature T_start=293.15 "Start temperature for each of the layers" annotation(Dialog(tab="Dynamics", group="Initial condition")); - parameter Modelica.SIunits.Temperature TRef_a=291.15 + parameter Modelica.Units.SI.Temperature TRef_a=291.15 "Reference temperature of zone on side of propsBus_a, for calculation of design heat loss" annotation (Dialog(group="Design power",tab="Advanced")); parameter Boolean linIntCon_a=sim.linIntCon "= true, if convective heat transfer should be linearised" annotation (Dialog(tab="Convection")); - parameter Modelica.SIunits.TemperatureDifference dT_nominal_a=1 + parameter Modelica.Units.SI.TemperatureDifference dT_nominal_a=1 "Nominal temperature difference used for linearisation, negative temperatures indicate the solid is colder" annotation (Dialog(tab="Convection")); parameter Modelica.Fluid.Types.Dynamics energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial @@ -97,8 +97,8 @@ partial model PartialSurface "Partial model for building envelope component" A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A/2 else A, h_b= -0.5*hzone_a + 0.25*hVertical +hRef_a, - final q50=q50_internal) if - add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + final q50=q50_internal) + if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Middle or bottom crack " annotation (Placement(transformation(extent={{20,-46},{40,-26}}))); @@ -108,8 +108,8 @@ partial model PartialSurface "Partial model for building envelope component" Medium = Medium, A=A/2, h_b= -0.5*hzone_a + 0.75*hVertical +hRef_a, - final q50=q50_internal) if - add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + final q50=q50_internal) + if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Top crack" annotation (Placement(transformation(extent={{20,-70},{40,-50}}))); @@ -125,12 +125,12 @@ partial model PartialSurface "Partial model for building envelope component" protected parameter Boolean add_cracks = true "Add cracks"; - final parameter Modelica.SIunits.Angle aziInt= + final parameter Modelica.Units.SI.Angle aziInt= if aziOpt==5 then azi else sim.aziOpts[aziOpt] "Azimuth angle"; - final parameter Modelica.SIunits.Angle incInt= + final parameter Modelica.Units.SI.Angle incInt= if incOpt==4 then inc else sim.incOpts[incOpt] @@ -185,7 +185,7 @@ model PowerLaw_q50_stack __Dymola_choicesAllMatching=true); - parameter Modelica.SIunits.Area A + parameter Modelica.Units.SI.Area A "Surface area"; parameter Real m=0.65; @@ -216,11 +216,11 @@ model PowerLaw_q50_stack DensityColumn col_a_pos( redeclare package Medium = Medium, - h=h_a) if StackEff + h=h_a) if StackEff annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); DensityColumn col_b_pos( redeclare package Medium = Medium, - h=h_b) if StackEff + h=h_b) if StackEff annotation (Placement(transformation(extent={{50,-10},{70,10}}))); outer BoundaryConditions.SimInfoManager sim @@ -229,14 +229,14 @@ model PowerLaw_q50_stack Fluid.FixedResistances.LosslessPipe No_stack_a( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if - not StackEff + m_flow_nominal=q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); Fluid.FixedResistances.LosslessPipe No_stack_b( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if - not StackEff + m_flow_nominal=q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{50,30},{70,50}}))); model PowerLaw_q50 @@ -245,7 +245,7 @@ model PowerLaw_q50_stack m=0.5, k=A*coeff); //mass flow form of orifice equation - parameter Modelica.SIunits.Area A + parameter Modelica.Units.SI.Area A "Surface area"; parameter Real q50(unit="m3/(h.m2)") "Leaked volume flow rate per unit A at 50Pa"; @@ -330,7 +330,7 @@ model PowerLaw_q50_stack Modelica.Media.Interfaces.PartialMedium "Medium in the component" annotation (choices( choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); - parameter Modelica.SIunits.Length h= 3 "Height of shaft"; + parameter Modelica.Units.SI.Length h= 3 "Height of shaft"; Modelica.Fluid.Interfaces.FluidPort_a port_a( @@ -345,13 +345,13 @@ model PowerLaw_q50_stack "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); - Modelica.SIunits.VolumeFlowRate V_flow + Modelica.Units.SI.VolumeFlowRate V_flow "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; - Modelica.SIunits.MassFlowRate m_flow + Modelica.Units.SI.MassFlowRate m_flow "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; - Modelica.SIunits.PressureDifference dp(displayUnit="Pa") + Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") "Pressure difference between port_a and port_b"; - Modelica.SIunits.Density rho "Density in medium column"; + Modelica.Units.SI.Density rho "Density in medium column"; protected Medium.ThermodynamicState sta_b=Medium.setState_phX( diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index d8d36d7a56..91b504112c 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -17,10 +17,10 @@ model InternalWall "interior opaque wall between two zones" parameter Boolean linIntCon_b=sim.linIntCon "= true, if convective heat transfer should be linearised" annotation(Dialog(tab="Convection")); - parameter Modelica.SIunits.TemperatureDifference dT_nominal_b=1 + parameter Modelica.Units.SI.TemperatureDifference dT_nominal_b=1 "Nominal temperature difference used for linearisation, negative temperatures indicate the solid is colder" annotation(Dialog(tab="Convection")); - parameter Modelica.SIunits.Temperature TRef_b=291.15 + parameter Modelica.Units.SI.Temperature TRef_b=291.15 "Reference temperature of zone on side of propsBus_b, for calculation of design heat loss" annotation (Dialog(group="Design power",tab="Advanced")); @@ -28,28 +28,28 @@ model InternalWall "interior opaque wall between two zones" parameter Boolean hasCavity = false "=true, to model open door or cavity in wall" annotation(Dialog(group="Cavity or open door")); - parameter Modelica.SIunits.Length h = 2 + parameter Modelica.Units.SI.Length h = 2 "Height of (rectangular) cavity in wall" annotation(Dialog(enable=hasCavity,group="Cavity or open door")); - parameter Modelica.SIunits.Length w = 1 + parameter Modelica.Units.SI.Length w = 1 "Width of (rectangular) cavity in wall" annotation(Dialog(enable=hasCavity,group="Cavity or open door")); - parameter Modelica.SIunits.Acceleration g = Modelica.Constants.g_n + parameter Modelica.Units.SI.Acceleration g = Modelica.Constants.g_n "Gravity, for computation of buoyancy" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); - parameter Modelica.SIunits.Pressure p=101300 + parameter Modelica.Units.SI.Pressure p=101300 "Absolute pressure for computation of buoyancy" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); - parameter Modelica.SIunits.Density rho = p/r/T + parameter Modelica.Units.SI.Density rho = p/r/T "Nominal density for computation of buoyancy mass flow rate" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); - parameter Modelica.SIunits.SpecificHeatCapacity c_p = 1013 + parameter Modelica.Units.SI.SpecificHeatCapacity c_p = 1013 "Nominal heat capacity for computation of buoyancy heat flow rate" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); - parameter Modelica.SIunits.Temperature T=293 + parameter Modelica.Units.SI.Temperature T=293 "Nominal temperature for linearising heat flow rate" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); - parameter Modelica.SIunits.TemperatureDifference dT = 1 + parameter Modelica.Units.SI.TemperatureDifference dT = 1 "Nominal temperature difference when linearising heat flow rate" annotation(Dialog(enable=hasCavity,group="Cavity or open door",tab="Advanced")); @@ -115,8 +115,8 @@ protected rho=rho, c_p=c_p, T=T, - dT=dT) if - hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + dT=dT) + if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Thermal-only model for open door" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); public @@ -127,15 +127,15 @@ public hA=(hzone_a/2) - hRef_a, hB=(hzone_b/2) - hRef_b, nCom=4, - CD=CD) if - hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + CD=CD) + if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "2-port model for open door" annotation (Placement(transformation(extent={{-10,82},{10,102}}))); Airflow.Multizone.Orifice resDoor( redeclare package Medium = Medium, A=w*h, - CD=CD) if - hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort + CD=CD) + if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); initial equation diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 19a5c2fe3d..7e5f0e9031 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -106,11 +106,11 @@ protected "Add lumped thermal capacitor for window glazing"; final parameter Boolean addCapFra = fraType.present and not energyDynamics == Modelica.Fluid.Types.Dynamics.SteadyState "Added lumped thermal capacitor for window frame"; - final parameter Modelica.SIunits.HeatCapacity Cgla = layMul.C + final parameter Modelica.Units.SI.HeatCapacity Cgla = layMul.C "Heat capacity of glazing state"; - final parameter Modelica.SIunits.HeatCapacity Cfra = layMul.C*fraC + final parameter Modelica.Units.SI.HeatCapacity Cfra = layMul.C*fraC "Heat capacity of frame state"; - final parameter Modelica.SIunits.Area A_glass = A*(1 - frac); + final parameter Modelica.Units.SI.Area A_glass = A*(1 - frac); IDEAS.Buildings.Components.BaseClasses.ConvectiveHeatTransfer.ExteriorConvection eCon( @@ -138,26 +138,26 @@ protected IDEAS.Buildings.Components.BaseClasses.ConvectiveHeatTransfer.InteriorConvection iConFra(final A=A*frac, final inc=incInt, - linearise=linIntCon_a or sim.linearise) if - fraType.present + linearise=linIntCon_a or sim.linearise) + if fraType.present "convective surface heat transimission on the interior side of the wall" annotation (Placement(transformation(extent={{20,60},{40,80}}))); IDEAS.Buildings.Components.BaseClasses.RadiativeHeatTransfer.ExteriorHeatRadiation skyRadFra(final A=A*frac, Tenv_nom=sim.Tenv_nom, - linearise=linExtRad or sim.linearise) if - fraType.present + linearise=linExtRad or sim.linearise) + if fraType.present "determination of radiant heat exchange with the environment and sky" annotation (Placement(transformation(extent={{-20,80},{-40,100}}))); IDEAS.Buildings.Components.BaseClasses.ConvectiveHeatTransfer.ExteriorConvection eConFra(final A=A*frac, linearise=linExtCon or sim.linearise, inc=incInt, - azi=aziInt) if - fraType.present + azi=aziInt) + if fraType.present "convective surface heat transimission on the exterior side of the wall" annotation (Placement(transformation(extent={{-20,60},{-40,80}}))); Modelica.Thermal.HeatTransfer.Components.ThermalConductor layFra(final G=(if fraType.briTyp.present then fraType.briTyp.G else 0) + (fraType.U_value) - *A*frac) if fraType.present annotation (Placement(transformation(extent={{10,60}, + *A*frac) if fraType.present annotation (Placement(transformation(extent={{10,60}, {-10,80}}))); BoundaryConditions.SolarIrradiation.RadSolData radSolData( @@ -174,20 +174,20 @@ protected "Design temperature passthrough since propsBus variables cannot be addressed directly"; Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapGlaInt(C=Cgla/2, T(fixed=energyDynamics == Modelica.Fluid.Types.Dynamics.FixedInitial, - start=T_start)) if addCapGla + start=T_start)) if addCapGla "Heat capacitor for glazing at interior" annotation (Placement(transformation(extent={{6,-12},{26,-32}}))); Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapFraIn(C=Cfra/2, T(fixed=energyDynamics == Modelica.Fluid.Types.Dynamics.FixedInitial, - start=T_start)) if addCapFra + start=T_start)) if addCapFra "Heat capacitor for frame at interior" annotation (Placement(transformation(extent={{4,100},{24,120}}))); Modelica.Blocks.Sources.Constant constEpsLwFra(final k=fraType.mat.epsLw) "Shortwave emissivity of frame" annotation (Placement(transformation(extent={{4,86},{-6,96}}))); IDEAS.Buildings.Components.BaseClasses.RadiativeHeatTransfer.ExteriorSolarAbsorption - solAbs(A=A*frac, epsSw=fraType.mat.epsSw) if - fraType.present + solAbs(A=A*frac, epsSw=fraType.mat.epsSw) + if fraType.present "Solar absorption model for shortwave radiation" annotation (Placement(transformation(extent={{-20,40},{-40,60}}))); Modelica.Blocks.Math.Add solDif(final k1=1, final k2=1) @@ -195,12 +195,12 @@ protected annotation (Placement(transformation(extent={{-56,-50},{-50,-44}}))); Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapFraExt(C=Cfra/2, T(fixed=energyDynamics == Modelica.Fluid.Types.Dynamics.FixedInitial, - start=T_start)) if addCapFra + start=T_start)) if addCapFra "Heat capacitor for frame at exterior" annotation (Placement(transformation(extent={{-20,100},{0,120}}))); Modelica.Thermal.HeatTransfer.Components.HeatCapacitor heaCapGlaExt(C=Cgla/2, T(fixed=energyDynamics == Modelica.Fluid.Types.Dynamics.FixedInitial, - start=T_start)) if addCapGla + start=T_start)) if addCapGla "Heat capacitor for glazing at exterior" annotation (Placement(transformation(extent={{-20,-12},{0,-32}}))); Fluid.Sources.OutsideAir outsideAir( @@ -212,8 +212,8 @@ protected outsideAir.a)) elseif not Use_custom_Cs then sim.Cs else Cs, Habs=Habs, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort - then 1 else 2) if - sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + then 1 else 2) + if sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Outside air model" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); initial equation From 3e68759d880d55a9a09b6d8bd016030866019489 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 10:54:35 +0200 Subject: [PATCH 028/140] Replace Res to Airflow.Multizone.Point_m_flow model --- .../Components/Interfaces/PartialSurface.mo | 133 ++++-------------- 1 file changed, 25 insertions(+), 108 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 92306b8c9f..3415bbd4a5 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -197,132 +197,47 @@ model PowerLaw_q50_stack parameter Real q50 "Leaked volume flow rate per unit A at 50Pa"; + Modelica.Units.SI.Density rho "Density in resistance"; + Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); + outer BoundaryConditions.SimInfoManager sim + annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); - PowerLaw_q50 res1( + Airflow.Multizone.Point_m_flow + res1( redeclare package Medium = Medium, final forceErrorControlOnFlow=false, m=m, useDefaultProperties= not StackEff, - A=A, - final q50=q50) + dpMea_nominal=50, + mMea_flow_nominal=A*(q50*rho)/3600) "Middle or bottom crack " - annotation (Placement(transformation(extent={{-12,-10},{8,10}}))); - + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - DensityColumn col_a_pos( + DensityColumn col_a_pos( redeclare package Medium = Medium, - h=h_a) if StackEff + h=h_a) if StackEff annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - DensityColumn col_b_pos( + DensityColumn col_b_pos( redeclare package Medium = Medium, - h=h_b) if StackEff + h=h_b) if StackEff annotation (Placement(transformation(extent={{50,-10},{70,10}}))); - outer BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); - - Fluid.FixedResistances.LosslessPipe No_stack_a( + Fluid.FixedResistances.LosslessPipe No_stack_a( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) - if not StackEff + m_flow_nominal=q50*1.2/3600) if not StackEff annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); - Fluid.FixedResistances.LosslessPipe No_stack_b( + Fluid.FixedResistances.LosslessPipe No_stack_b( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) - if not StackEff + m_flow_nominal=q50*1.2/3600) if not StackEff annotation (Placement(transformation(extent={{50,30},{70,50}}))); - model PowerLaw_q50 - - extends IDEAS.Airflow.Multizone.BaseClasses.PowerLawResistance( - m=0.5, - k=A*coeff); //mass flow form of orifice equation - - parameter Modelica.Units.SI.Area A - "Surface area"; - parameter Real q50(unit="m3/(h.m2)") - "Leaked volume flow rate per unit A at 50Pa"; - final parameter Real coeff = (q50/3600)/(50^m) - "Conversion coefficient"; - equation - v= V_flow/A; - annotation (Icon(graphics={ - Text( - extent={{-100,100},{-40,60}}, - lineColor={28,108,200}, - fillColor={215,215,215}, - fillPattern=FillPattern.None, - textString="q50"), - Rectangle( - extent={{-20,80},{20,-80}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,0,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-60,58},{64,46}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-94,4},{-58,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{54,6},{106,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-64,2},{-46,-6}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-82,4},{-46,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={0,127,0}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-58,36},{66,24}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-58,-54},{66,-66}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-56,-24},{68,-36}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid), - Rectangle( - extent={{-38,4},{40,-8}}, - lineColor={0,0,255}, - pattern=LinePattern.None, - fillColor={255,255,255}, - fillPattern=FillPattern.Solid)})); - end PowerLaw_q50; - - model DensityColumn "Vertical shaft with no friction and no storage of heat and mass" @@ -478,19 +393,21 @@ equation connect(port_a, No_stack_a.port_a) annotation (Line(points={{-100,0},{-80,0},{ -80,40},{-68,40}}, color={0,127,255})); connect(No_stack_a.port_b, res1.port_a) annotation (Line(points={{-48,40},{-20, - 40},{-20,0},{-12,0}}, color={0,127,255})); - connect(res1.port_b, No_stack_b.port_a) annotation (Line(points={{8,0},{20,0}, + 40},{-20,0},{-10,0}}, color={0,127,255})); + connect(res1.port_b, No_stack_b.port_a) annotation (Line(points={{10,0},{20,0}, {20,40},{50,40}}, color={0,127,255})); connect(No_stack_b.port_b, port_b) annotation (Line(points={{70,40},{80,40},{80, 0},{100,0}}, color={0,127,255})); connect(port_a, col_a_pos.port_b) annotation (Line(points={{-100,0},{-80,0},{-80, -10},{-60,-10}}, color={0,127,255})); - connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,10},{-40, - 10},{-40,0},{-12,0}}, color={0,127,255})); + connect(col_a_pos.port_a, res1.port_a) annotation (Line(points={{-60,10},{-60, + 14},{-20,14},{-20,0},{-10,0}}, + color={0,127,255})); connect(port_b, col_b_pos.port_b) annotation (Line(points={{100,0},{80,0},{80, -10},{60,-10}}, color={0,127,255})); - connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,10},{34,10}, - {34,0},{8,0}}, color={0,127,255})); + connect(col_b_pos.port_a, res1.port_b) annotation (Line(points={{60,10},{60,14}, + {20,14},{20,0},{10,0}}, + color={0,127,255})); annotation (Icon(graphics={ Text( From ec00e8bde0449c36040d3bf4571612b69394101c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 11:01:28 +0200 Subject: [PATCH 029/140] Update ZoneInterface.mo --- IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo index 9eb3ee540d..2764720e6e 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo @@ -12,15 +12,15 @@ partial model ZoneInterface "Partial model for thermal building zones" "Number of surfaces adjacent to and heat exchanging with the zone"; parameter Integer nPorts(min=0)=2 "Number of ports for ventilation connections"; - parameter Modelica.SIunits.Volume V "Total zone air volume" + parameter Modelica.Units.SI.Volume V "Total zone air volume" annotation(Dialog(group="Building physics")); - parameter Modelica.SIunits.Length hZone = 2.8 + parameter Modelica.Units.SI.Length hZone = 2.8 "Zone height: distance between floor and ceiling" annotation(Dialog(group="Building physics")); - parameter Modelica.SIunits.Length hFloor = 0 + parameter Modelica.Units.SI.Length hFloor = 0 "Absolute height of zone floor" annotation(Dialog(group="Building physics")); - parameter Modelica.SIunits.Area A = V/hZone "Total conditioned floor area" + parameter Modelica.Units.SI.Area A = V/hZone "Total conditioned floor area" annotation(Dialog(group="Building physics")); parameter Boolean useOccNumInput "=false, to remove icon of yOcc" @@ -29,7 +29,7 @@ partial model ZoneInterface "Partial model for thermal building zones" "=false, to remove icon of lightCtrl" annotation(Dialog(tab="Advanced",group="Lighting")); //default ACH=2 for ventilation - parameter Modelica.SIunits.MassFlowRate m_flow_nominal = V * 1.2*2/3600 + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = V * 1.2*2/3600 "Nominal flow rate of the air flow system fluid ports" annotation(Dialog(tab="Airflow",group="Air model")); From 93fbc64ae02cefb79fb3d6f09a6587265c6846c3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 12:38:15 +0200 Subject: [PATCH 030/140] Un-protect parameters It gave warnings for the calculation of Cs --- IDEAS/Fluid/Sources/OutsideAir.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Fluid/Sources/OutsideAir.mo b/IDEAS/Fluid/Sources/OutsideAir.mo index ca5d2f46b4..6ba0d38076 100644 --- a/IDEAS/Fluid/Sources/OutsideAir.mo +++ b/IDEAS/Fluid/Sources/OutsideAir.mo @@ -27,7 +27,7 @@ model OutsideAir "Sum of atmospheric pressure and wind pressure"; -protected + parameter Real A0=sim.A0 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); parameter Real a=sim.a "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); @@ -35,7 +35,7 @@ protected "Height above ground of meteorological wind speed measurement" annotation (Dialog(group="Wind")); - +protected constant Integer s[:]= { if ( Modelica.Utilities.Strings.isEqual(string1=Medium.extraPropertiesNames[i], string2="CO2", From d345e16b4c2b2d77992e1567e6939d94c3edf2b0 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 12:44:25 +0200 Subject: [PATCH 031/140] Update PartialZone.mo --- IDEAS/Buildings/Components/Interfaces/PartialZone.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo index 7a15263cca..a0202912a1 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialZone.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialZone.mo @@ -261,8 +261,8 @@ model Setq50 "q50 computation for zones" parameter Real v50_custom[nSurf](each fixed=false) "custom assigned v50 value, else zero"; - parameter Modelica.SIunits.Length hZone "Zone height: distance between floor and ceiling"; - parameter Modelica.SIunits.Length hFloor = 0 "Absolute height of zone floor"; + parameter Modelica.Units.SI.Length hZone "Zone height: distance between floor and ceiling"; + parameter Modelica.Units.SI.Length hFloor = 0 "Absolute height of zone floor"; Modelica.Blocks.Interfaces.RealInput v50_surf[nSurf] annotation (Placement(transformation(extent={{-126,28},{-86,68}}))); From 05f78590ef6030c771a39e4e08bed5823ce56bf2 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 12:44:57 +0200 Subject: [PATCH 032/140] Update PartialSurface.mo --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 3415bbd4a5..d5b531e850 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -214,7 +214,7 @@ model PowerLaw_q50_stack m=m, useDefaultProperties= not StackEff, dpMea_nominal=50, - mMea_flow_nominal=A*(q50*rho)/3600) + mMea_flow_nominal=A*(q50*1.2)/3600) "Middle or bottom crack " annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); @@ -230,12 +230,14 @@ model PowerLaw_q50_stack Fluid.FixedResistances.LosslessPipe No_stack_a( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if not StackEff + m_flow_nominal=A*q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); Fluid.FixedResistances.LosslessPipe No_stack_b( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=q50*1.2/3600) if not StackEff + m_flow_nominal=A*q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{50,30},{70,50}}))); model DensityColumn From 214bcc63129aae1df5a692d99f5522795c407f6d Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 12:45:22 +0200 Subject: [PATCH 033/140] Update PartialSimInfoManager.mo Changes of master were not correctly merged --- .../Interfaces/PartialSimInfoManager.mo | 86 +++++++++++-------- 1 file changed, 50 insertions(+), 36 deletions(-) diff --git a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo index 963e3827b2..bab18d24dc 100644 --- a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo +++ b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo @@ -6,34 +6,31 @@ partial model PartialSimInfoManager Modelica.Utilities.Files.loadResource("modelica://IDEAS/Resources/weatherdata/Brussels.mos") "File name of TMY3 weather file" annotation(Dialog(loadSelector(filter="TMY-files (*.TMY);;Text files (*.txt);;All files (*.*)", caption="Select the weather file"))); parameter Modelica.Units.SI.Angle lat(displayUnit="deg") = weaDat.lat - "Latitude of the location" - annotation(Dialog(tab="Advanced")); + "Latitude of the location" annotation (Dialog(tab="Advanced")); parameter Modelica.Units.SI.Angle lon(displayUnit="deg") = weaDat.lon - "Longitude of the location" - annotation(Dialog(tab="Advanced")); + "Longitude of the location" annotation (Dialog(tab="Advanced")); parameter Modelica.Units.SI.Time timZon(displayUnit="h") = weaDat.timZon "Time zone for which the simulation time t=0 corresponds to midnight, january 1st"; - parameter Modelica.Units.SI.Angle incS = IDEAS.Types.Azimuth.S - "South inclination" - annotation(Dialog(tab="Incidence angles")); - parameter Modelica.Units.SI.Angle incW = incS +Modelica.Constants.pi/2 - "West inclination" - annotation(Dialog(tab="Incidence angles")); - parameter Modelica.Units.SI.Angle incN = incS +Modelica.Constants.pi - "North inclination" - annotation(Dialog(tab="Incidence angles")); - parameter Modelica.Units.SI.Angle incE = incS +3*Modelica.Constants.pi/2 - "East inclination" - annotation(Dialog(tab="Incidence angles")); - - parameter Modelica.Units.SI.Angle incAndAziInBus[:,:] = {{IDEAS.Types.Tilt.Ceiling,0},{IDEAS.Types.Tilt.Wall,incS}, - {IDEAS.Types.Tilt.Wall,incW},{IDEAS.Types.Tilt.Wall,incN},{IDEAS.Types.Tilt.Wall,incE}, {IDEAS.Types.Tilt.Floor,0}} - "Combination of inclination and azimuth which are pre-computed and added to solBus." annotation(Dialog(tab="Incidence angles")); - final parameter Modelica.Units.SI.Angle aziOpts[5]={incS, incW, incN, incE, incS} + parameter Modelica.Units.SI.Angle incS=IDEAS.Types.Azimuth.S + "South inclination" annotation (Dialog(tab="Incidence angles")); + parameter Modelica.Units.SI.Angle incW=incS + Modelica.Constants.pi/2 + "West inclination" annotation (Dialog(tab="Incidence angles")); + parameter Modelica.Units.SI.Angle incN=incS + Modelica.Constants.pi + "North inclination" annotation (Dialog(tab="Incidence angles")); + parameter Modelica.Units.SI.Angle incE=incS + 3*Modelica.Constants.pi/2 + "East inclination" annotation (Dialog(tab="Incidence angles")); + + parameter Modelica.Units.SI.Angle incAndAziInBus[:,:]={{IDEAS.Types.Tilt.Ceiling, + 0},{IDEAS.Types.Tilt.Wall,incS},{IDEAS.Types.Tilt.Wall,incW},{IDEAS.Types.Tilt.Wall, + incN},{IDEAS.Types.Tilt.Wall,incE},{IDEAS.Types.Tilt.Floor,0}} + "Combination of inclination and azimuth which are pre-computed and added to solBus." + annotation (Dialog(tab="Incidence angles")); + final parameter Modelica.Units.SI.Angle aziOpts[5]={incS,incW,incN,incE,incS} "Inclination options, default south"; - final parameter Modelica.Units.SI.Angle incOpts[4]={IDEAS.Types.Tilt.Wall, IDEAS.Types.Tilt.Floor, IDEAS.Types.Tilt.Ceiling, IDEAS.Types.Tilt.Wall} + final parameter Modelica.Units.SI.Angle incOpts[4]={IDEAS.Types.Tilt.Wall, + IDEAS.Types.Tilt.Floor,IDEAS.Types.Tilt.Ceiling,IDEAS.Types.Tilt.Wall} "Azimuth options, default wall"; parameter Boolean computeConservationOfEnergy=false @@ -73,8 +70,9 @@ partial model PartialSimInfoManager "= true, if exterior radiative heat transfer for windows should be linearised" annotation (Dialog(tab="Linearisation", group="Radiation")); parameter Modelica.Units.SI.Energy Emax=1 - "Error bound for violation of conservation of energy" annotation (Evaluate=true, - Dialog(tab="Conservation of energy", enable=strictConservationOfEnergy)); + "Error bound for violation of conservation of energy" annotation (Evaluate= + true, Dialog(tab="Conservation of energy", enable= + strictConservationOfEnergy)); parameter Modelica.Units.SI.Temperature Tenv_nom=280 "Nominal ambient temperature, only used when linearising equations"; @@ -104,14 +102,15 @@ partial model PartialSimInfoManager IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None or unify_n50,group="Interzonal airflow")); parameter Modelica.Units.SI.Length H=10 "Building or roof height" - annotation(Dialog(group="Wind")); + annotation (Dialog(group="Wind")); parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); parameter Real a=0.28 "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); - parameter Modelica.Units.SI.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" - annotation(Dialog(group="Wind")); - parameter Modelica.Units.SI.Length Hwin=10 "Height above ground of meteorological wind speed measurement" - annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hwin=10 + "Height above ground of meteorological wind speed measurement" + annotation (Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" annotation(Dialog(group="Wind")); + parameter Real Cs= (A0*A0)*((H/Hwin)^(2*a)) "Wind speed modifier" annotation(Dialog(group="Wind")); @@ -191,16 +190,18 @@ partial model PartialSimInfoManager final parameter Real q50_def( unit="m3/(h.m2)") = if A_def< Modelica.Constants.small then q50_av else V50_def/A_def; final parameter Real q50_av( unit="m3/(h.m2)") = if A_tot < Modelica.Constants.small then 0 else V50/A_tot "average, not corrected q50"; - final parameter Modelica.Units.SI.Volume V_tot(fixed=false) "Total conditioned building volume"; - final parameter Modelica.Units.SI.Area A_tot(fixed=false) "Total surface area of OuterWalls and Windows"; + final parameter Modelica.Units.SI.Volume V_tot(fixed=false) + "Total conditioned building volume"; + final parameter Modelica.Units.SI.Area A_tot(fixed=false) + "Total surface area of OuterWalls and Windows"; final parameter Real V50_custom( unit="m3/h",fixed=false) "Sum of v50 values for components that have a custom assignment"; - final parameter Modelica.Units.SI.Area A_def( fixed=false) "Total area with default q50, i.e. without custom q50 assignment, or connected to zone with custom n50 assigned"; + final parameter Modelica.Units.SI.Area A_def(fixed=false) + "Total area with default q50, i.e. without custom q50 assignment, or connected to zone with custom n50 assigned"; input IDEAS.Buildings.Components.Interfaces.WindowBus[nWindow] winBusOut( each nLay=nLayWin) if createOutputs "Bus for windows in case of linearisation"; - Modelica.Blocks.Routing.RealPassThrough solTim - "Solar time" + Modelica.Blocks.Routing.RealPassThrough solTim "Solar time" annotation (Placement(transformation(extent={{-86,-2},{-78,6}}))); IDEAS.BoundaryConditions.WeatherData.Bus weaDatBus "Weather data bus connectable to weaBus connector from Buildings Library" @@ -217,6 +218,8 @@ partial model PartialSimInfoManager "Port for summing surface areas of all surfaces" annotation (Placement(transformation(extent={{70,-110},{90,-90}}))); + Modelica.Blocks.Routing.RealPassThrough alt "Altitude" + annotation (Placement(transformation(extent={{-86,-22},{-78,-14}}))); protected final parameter Integer yr=2014 "depcited year for DST only"; @@ -438,8 +441,9 @@ equation {-68,84},{-77.6,84}}, color={0,0,127})); connect(skyClearness.HDifHor,HDifHor. y) annotation (Line(points={{-62,110},{-70, 110},{-70,98},{-77.6,98}},color={0,0,127})); - connect(skyClearness.HGloHor,HGloHor. y) annotation (Line(points={{-62,116},{-72, - 116},{-72,112},{-77.6,112}},color={0,0,127})); + connect(skyClearness.HDirNor,HDirNor. y) annotation (Line(points={{-62,116},{ + -72,116},{-72,44},{-77.6,44}}, + color={0,0,127})); connect(solTim.u, weaDatBus.solTim) annotation (Line(points={{-86.8,2},{-100,2},{-100,-10}},color={0,0,127})); connect(angZen.u, weaDatBus.solZen) annotation (Line(points={{-86.8,84},{-100, @@ -481,6 +485,16 @@ equation index=1, extent={{-6,3},{-6,3}}, horizontalAlignment=TextAlignment.Right)); + connect(alt.u, weaDatBus.alt) annotation (Line(points={{-86.8,-18},{-100,-18}, + {-100,-10}}, color={0,0,127}), Text( + string="%second", + index=1, + extent={{-6,3},{-6,3}}, + horizontalAlignment=TextAlignment.Right)); + connect(alt.y, relativeAirMass.alt) annotation (Line(points={{-77.6,-18},{-66, + -18},{-66,68},{-62,68},{-62,76}}, color={0,0,127})); + connect(solTim.y, skyBrightness.solTim) annotation (Line(points={{-77.6,2},{ + -68,2},{-68,4},{-32,4},{-32,64}}, color={0,0,127})); annotation ( defaultComponentName="sim", defaultComponentPrefixes="inner", From 71d0aefcb9a4737ea3a3a65a7864e8c33a747895 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 21 Apr 2022 13:00:31 +0200 Subject: [PATCH 034/140] Update PartialSurface.mo Not used --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 2 -- 1 file changed, 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index d5b531e850..1c713782a1 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -197,8 +197,6 @@ model PowerLaw_q50_stack parameter Real q50 "Leaked volume flow rate per unit A at 50Pa"; - Modelica.Units.SI.Density rho "Density in resistance"; - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, From d88a752739a0553c4bf196ad0f2b65d93505cb7c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 22 Aug 2022 16:50:06 +0200 Subject: [PATCH 035/140] Added density columns for internal wall 1-port implementation Not really a clean implementation at this point. --- IDEAS/Buildings/Components/InternalWall.mo | 186 ++++++++++++++++++++- 1 file changed, 181 insertions(+), 5 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 3193493b0f..7a23eb475d 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -75,7 +75,14 @@ model InternalWall "interior opaque wall between two zones" final parameter Real hfloor_b(fixed=false); parameter Real hRef_b=if inc == 0 then hzone_b else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; - //TO CHECK: default should be zone height when it is the ceiling at propsbus + + parameter Real Ope_hvert= if inc==Modelica.Constants.pi or inc==0 then 0 else h "Vertical opening height, height of the surface projected to the vertical, 0 for openings in horizontal floors and ceilings" annotation(Dialog(enable=hasCavity,group="Cavity or open door")); + parameter Real Ope_hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the opening starts" + annotation(Dialog(enable=hasCavity,group="Cavity or open door")); + parameter Real Ope_hRef_b= if inc==0 then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the opening starts" + annotation(Dialog(enable=hasCavity,group="Cavity or open door")); + + protected final parameter Real U_value=1/(1/8 + sum(constructionType.mats.R) + 1/8) @@ -138,6 +145,171 @@ public if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); + + //Submodel of density column a copy because reference to submodel of PowerLaw_q50_stack can't be made + model DensityColumn + "Vertical shaft with no friction and no storage of heat and mass" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component" + annotation (choices( + choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); + parameter Modelica.Units.SI.Length h=3 "Height of shaft"; + + + Modelica.Fluid.Interfaces.FluidPort_a port_a( + redeclare package Medium = Medium, + p(start=Medium.p_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{-10,90},{10,110}}), + iconTransformation(extent={{-10,90},{10,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( + redeclare package Medium = Medium, + p(start=Medium.p_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" + annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); + + Modelica.Units.SI.VolumeFlowRate V_flow + "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; + Modelica.Units.SI.MassFlowRate m_flow + "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; + Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") + "Pressure difference between port_a and port_b"; + Modelica.Units.SI.Density rho "Density in medium column"; + + protected + Medium.ThermodynamicState sta_b=Medium.setState_phX( + port_b.p, + actualStream(port_b.h_outflow), + actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; + Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; + + equation + // Design direction of mass flow rate + m_flow = port_a.m_flow; + + // Pressure difference between ports + // Xi is computed first as it is used in two expression, and in one + // of them only one component is used. + // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no + // moisture and hence Xi[1] is an illegal statement. + // We first compute temperature and then invoke a density function that + // takes temperature as an argument. Simply calling a density function + // of a medium that takes enthalpy as an argument would be dangerous + // as different media can have different datum for the enthalpy. + + Xi = inStream(port_b.Xi_outflow); + rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( + p=Medium.p_default, + T=Medium.temperature(Medium.setState_phX( + port_b.p, + inStream(port_b.h_outflow), + Xi)), + X_w=if Medium.nXi == 0 then 0 else Xi[1]); + + V_flow = m_flow/Medium.density(sta_b); + + dp = if h > 0 then port_a.p - port_b.p else -port_a.p + port_b.p; + dp = -abs(h)*rho*Modelica.Constants.g_n; + + // Isenthalpic state transformation (no storage and no loss of energy) + port_a.h_outflow = inStream(port_b.h_outflow); + port_b.h_outflow = inStream(port_a.h_outflow); + + // Mass balance (no storage) + port_a.m_flow + port_b.m_flow = 0; + + // Transport of substances + port_a.Xi_outflow = inStream(port_b.Xi_outflow); + port_b.Xi_outflow = inStream(port_a.Xi_outflow); + + port_a.C_outflow = inStream(port_b.C_outflow); + port_b.C_outflow = inStream(port_a.C_outflow); + + annotation ( + Icon(graphics={ + Line( + points={{0,100},{0,-100},{0,-98}}), + Text( + extent={{24,-78},{106,-100}}, + lineColor={0,0,127}, + textString="Zone/Amb"), + Text( + extent={{32,104},{98,70}}, + lineColor={0,0,127}, + textString="FlowElem"), + Text( + extent={{36,26},{88,-10}}, + lineColor={0,0,127}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString="h=%h"), + Rectangle( + extent={{-16,80},{16,-80}}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, + extent={{-16,80},{16,0}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,80},{16,54}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, + extent={{-16,0},{16,-82}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,-55},{16,-80}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0})}), + defaultComponentName="col", + Documentation(info=" +

+This model describes the pressure difference of a vertical medium +column. It can be used to model the pressure difference caused by +stack effect. + +It is a variation on IDEAS.Airflow.Multizone.MediumColumn. + +

+", + revisions=" +
    +
  • +January 19, 2022, by Klaas De Jonge:
    +Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of h can be negative and cleaned out the model as the density should always be set by port_b. +This makes port_a not nececarilly always the top port. + +
  • +
+")); + end DensityColumn; + + + DensityColumn col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + + 0.5*Ope_hvert + Ope_hRef_a) + if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort + annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); + DensityColumn col_b_pos( + redeclare package Medium = Medium, h=-0.5*hzone_b + 0.5*Ope_hvert + + Ope_hRef_b) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort + annotation (Placement(transformation(extent={{16,42},{36,62}}))); + initial equation hzone_b = propsBus_b.hzone; hfloor_b= propsBus_b.hfloor; @@ -191,10 +363,6 @@ equation -42,98},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,86},{ -38,86},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(resDoor.port_a, propsBus_b.port_1) annotation (Line(points={{-10,68},{ - -38,68},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(resDoor.port_b, propsBusInt.port_1) annotation (Line(points={{10,68},{ - 38,68},{38,19.91},{56.09,19.91}}, color={0,127,255})); connect(res1.port_a, propsBus_b.port_1) annotation (Line(points={{20,-36},{-60, -36},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); connect(res2.port_a, propsBus_b.port_2) annotation (Line(points={{20,-60},{-60, @@ -204,6 +372,14 @@ equation connect(q50_zone.using_custom_q50, propsBus_b.use_custom_q50) annotation (Line(points={{79,-52}, {56,-52},{56,20.1},{-100.1,20.1}}, color={0,0,127})); + connect(col_a_pos.port_b, propsBus_b.port_1) annotation (Line(points={{-30,42}, + {-30,20},{-44,20},{-44,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(col_a_pos.port_a, resDoor.port_a) + annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); + connect(col_b_pos.port_b, propsBusInt.port_1) annotation (Line(points={{26,42}, + {26,19.91},{56.09,19.91}}, color={0,127,255})); + connect(col_b_pos.port_a, resDoor.port_b) + annotation (Line(points={{26,62},{26,68},{10,68}}, color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false,extent={{-60,-100},{60,100}}), graphics={ From 7b59d9fa87ab9733dabadc44fbbf9714fa4a822b Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 23 Aug 2022 14:09:55 +0200 Subject: [PATCH 036/140] Clarifies convention for INC --- IDEAS/Buildings/Components/InternalWall.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 7a23eb475d..cfeee046b0 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -429,7 +429,7 @@ Each propsbus needs to be connected to a zone, which may be the same zone.

Note that this model is not symmetric: the convection equations depend on the inclination inc, -which is turned 180 degrees between both side. The value of inc is applied to the right side of the model. +which is turned 180 degrees between both side. The value of inc is applied to the right side of the model (propsBus_a).

Parameter hasCavity can be set to true to simulate heat transfer From 97789c24fe78b988542a354f8c16e4171bc0d315 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 23 Aug 2022 14:59:33 +0200 Subject: [PATCH 037/140] Proposal: assert statement can check if floorheights and INC makes sense --- IDEAS/Buildings/Components/InternalWall.mo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index cfeee046b0..4c95067478 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -314,6 +314,8 @@ initial equation hzone_b = propsBus_b.hzone; hfloor_b= propsBus_b.hfloor; equation + //assert(inc==0 and hfloor_a>hfloor_b, getInstanceName()+ "is a ceiling, but the floor of the zone at probsbus_b lies above the floor of zone at probsbus_a, this is probably a mistake",level=AssertionLevel.warning); + //assert(inc==pi() and hfloor_a Date: Tue, 23 Aug 2022 15:16:20 +0200 Subject: [PATCH 038/140] Corrected propsbus_a <>b --- IDEAS/Buildings/Components/InternalWall.mo | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 4c95067478..e30e260ace 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -301,13 +301,13 @@ This makes port_a not nececarilly always the top port. end DensityColumn; - DensityColumn col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + - 0.5*Ope_hvert + Ope_hRef_a) + DensityColumn col_b_pos(redeclare package Medium = Medium, h=-0.5*hzone_b + + 0.5*Ope_hvert + hRef_b) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); - DensityColumn col_b_pos( - redeclare package Medium = Medium, h=-0.5*hzone_b + 0.5*Ope_hvert + - Ope_hRef_b) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort + DensityColumn col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + 0.5 + *Ope_hvert + hRef_a) if hasCavity and sim.interZonalAirFlowType == + IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort annotation (Placement(transformation(extent={{16,42},{36,62}}))); initial equation @@ -374,13 +374,13 @@ equation connect(q50_zone.using_custom_q50, propsBus_b.use_custom_q50) annotation (Line(points={{79,-52}, {56,-52},{56,20.1},{-100.1,20.1}}, color={0,0,127})); - connect(col_a_pos.port_b, propsBus_b.port_1) annotation (Line(points={{-30,42}, + connect(col_b_pos.port_b, propsBus_b.port_1) annotation (Line(points={{-30,42}, {-30,20},{-44,20},{-44,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(col_a_pos.port_a, resDoor.port_a) + connect(col_b_pos.port_a, resDoor.port_a) annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); - connect(col_b_pos.port_b, propsBusInt.port_1) annotation (Line(points={{26,42}, + connect(col_a_pos.port_b, propsBusInt.port_1) annotation (Line(points={{26,42}, {26,19.91},{56.09,19.91}}, color={0,127,255})); - connect(col_b_pos.port_a, resDoor.port_b) + connect(col_a_pos.port_a, resDoor.port_b) annotation (Line(points={{26,62},{26,68},{10,68}}, color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false,extent={{-60,-100},{60,100}}), From 5f28c8c3e64d4e4cf508d9c4e326a8f5545d9cc3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 23 Aug 2022 15:17:27 +0200 Subject: [PATCH 039/140] Make correction for height when the opening is inclined/horizontal --- IDEAS/Buildings/Components/InternalWall.mo | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index e30e260ace..455aa8ea0b 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -85,6 +85,7 @@ model InternalWall "interior opaque wall between two zones" protected + parameter Real Ope_hvert= sin(inc)*h "Vertical opening height, height of the surface projected to the vertical, 0 for openings in horizontal floors and ceilings" annotation(Dialog(enable=hasCavity,group="Cavity or open door")); final parameter Real U_value=1/(1/8 + sum(constructionType.mats.R) + 1/8) "Wall U-value"; constant Real r = 287 "Gas constant"; @@ -130,7 +131,7 @@ public IDEAS.Airflow.Multizone.DoorDiscretizedOpen dooOpe( redeclare package Medium = Medium, wOpe=w, - hOpe=h, + hOpe=Ope_hvert, hA=(hzone_a/2) - hRef_a, hB=(hzone_b/2) - hRef_b, nCom=4, From 47f4b0809da2573759bb597114e7de4b2885d9ce Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 23 Aug 2022 15:17:52 +0200 Subject: [PATCH 040/140] Simplify hRef input --- IDEAS/Buildings/Components/InternalWall.mo | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 455aa8ea0b..23a3e71562 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -74,13 +74,7 @@ model InternalWall "interior opaque wall between two zones" final parameter Real hzone_b(fixed=false); final parameter Real hfloor_b(fixed=false); - parameter Real hRef_b=if inc == 0 then hzone_b else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; - - parameter Real Ope_hvert= if inc==Modelica.Constants.pi or inc==0 then 0 else h "Vertical opening height, height of the surface projected to the vertical, 0 for openings in horizontal floors and ceilings" annotation(Dialog(enable=hasCavity,group="Cavity or open door")); - parameter Real Ope_hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the opening starts" - annotation(Dialog(enable=hasCavity,group="Cavity or open door")); - parameter Real Ope_hRef_b= if inc==0 then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the opening starts" - annotation(Dialog(enable=hasCavity,group="Cavity or open door")); + parameter Real hRef_b=if inc==pi() then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; From c56964cbd03216f29a10b1dc7963f01524b667ac Mon Sep 17 00:00:00 2001 From: kldjonge Date: Tue, 23 Aug 2022 15:27:50 +0200 Subject: [PATCH 041/140] Clean up implementation by making ReversibleDensityColumn a class --- .../BaseClasses/ReversibleDensityColumn.mo | 152 +++++++++++++++++ .../Multizone/BaseClasses/package.order | 1 + .../Components/Interfaces/PartialSurface.mo | 155 +---------------- IDEAS/Buildings/Components/InternalWall.mo | 160 +----------------- 4 files changed, 161 insertions(+), 307 deletions(-) create mode 100644 IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo diff --git a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo new file mode 100644 index 0000000000..7aa580a37c --- /dev/null +++ b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo @@ -0,0 +1,152 @@ +within IDEAS.Airflow.Multizone.BaseClasses; +model ReversibleDensityColumn + "Vertical shaft with no friction and no storage of heat and mass, reversible because it can handle negative column heights" + + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component" + annotation (choices( + choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); + parameter Modelica.Units.SI.Length h=3 "Height of shaft"; + + Modelica.Fluid.Interfaces.FluidPort_a port_a( +redeclare package Medium = Medium, +p(start=Medium.p_default)) +"Fluid connector a (positive design flow direction is from port_a to port_b)" +annotation (Placement(transformation(extent={{-10,90},{10,110}}), + iconTransformation(extent={{-10,90},{10,110}}))); + Modelica.Fluid.Interfaces.FluidPort_b port_b( +redeclare package Medium = Medium, +p(start=Medium.p_default)) +"Fluid connector b (positive design flow direction is from port_a to port_b)" +annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); + + Modelica.Units.SI.VolumeFlowRate V_flow +"Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; + Modelica.Units.SI.MassFlowRate m_flow +"Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; + Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") +"Pressure difference between port_a and port_b"; + Modelica.Units.SI.Density rho "Density in medium column"; + +protected + Medium.ThermodynamicState sta_b=Medium.setState_phX( + port_b.p, + actualStream(port_b.h_outflow), + actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; + Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; + +equation + // Design direction of mass flow rate + m_flow = port_a.m_flow; + + // Pressure difference between ports + // Xi is computed first as it is used in two expression, and in one + // of them only one component is used. + // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no + // moisture and hence Xi[1] is an illegal statement. + // We first compute temperature and then invoke a density function that + // takes temperature as an argument. Simply calling a density function + // of a medium that takes enthalpy as an argument would be dangerous + // as different media can have different datum for the enthalpy. + + Xi = inStream(port_b.Xi_outflow); + rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( + p=Medium.p_default, + T=Medium.temperature(Medium.setState_phX( + port_b.p, + inStream(port_b.h_outflow), + Xi)), + X_w=if Medium.nXi == 0 then 0 else Xi[1]); + + V_flow = m_flow/Medium.density(sta_b); + + dp = if h > 0 then port_a.p - port_b.p else -port_a.p + port_b.p; + dp = -abs(h)*rho*Modelica.Constants.g_n; + + // Isenthalpic state transformation (no storage and no loss of energy) + port_a.h_outflow = inStream(port_b.h_outflow); + port_b.h_outflow = inStream(port_a.h_outflow); + + // Mass balance (no storage) + port_a.m_flow + port_b.m_flow = 0; + + // Transport of substances + port_a.Xi_outflow = inStream(port_b.Xi_outflow); + port_b.Xi_outflow = inStream(port_a.Xi_outflow); + + port_a.C_outflow = inStream(port_b.C_outflow); + port_b.C_outflow = inStream(port_a.C_outflow); + + annotation ( +Icon(graphics={ + Line( + points={{0,100},{0,-100},{0,-98}}), + Text( + extent={{24,-78},{106,-100}}, + lineColor={0,0,127}, + textString="Zone/Amb"), + Text( + extent={{32,104},{98,70}}, + lineColor={0,0,127}, + textString="FlowElem"), + Text( + extent={{36,26},{88,-10}}, + lineColor={0,0,127}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + textString="h=%h"), + Rectangle( + extent={{-16,80},{16,-80}}, + fillColor={255,0,0}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, + extent={{-16,80},{16,0}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,80},{16,54}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, + extent={{-16,0},{16,-82}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0}), + Rectangle( + visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, + extent={{-16,-55},{16,-80}}, + fillColor={85,170,255}, + fillPattern=FillPattern.Solid, + pattern=LinePattern.None, + lineColor={0,0,0})}), + defaultComponentName="col", + Documentation(info=" +

+This model describes the pressure difference of a vertical medium +column. It can be used to model the pressure difference caused by +stack effect. + +It is a variation on IDEAS.Airflow.Multizone.MediumColumn. + +

+", + revisions=" +
    +
  • +January 19, 2022, by Klaas De Jonge:
    +Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of h can be negative and cleaned out the model as the density should always be set by port_b. +This makes port_a not nececarilly always the top port. + +
  • +
+")); +end ReversibleDensityColumn; diff --git a/IDEAS/Airflow/Multizone/BaseClasses/package.order b/IDEAS/Airflow/Multizone/BaseClasses/package.order index 698bba52a4..b7c99a59a1 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/package.order +++ b/IDEAS/Airflow/Multizone/BaseClasses/package.order @@ -3,6 +3,7 @@ DoorDiscretized ErrorControl PartialOneWayFlowElement PowerLawResistanceParameters +ReversibleDensityColumn TwoWayFlowElement TwoWayFlowElementBuoyancy ZonalFlow diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 1c713782a1..4dbf1addf9 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -216,11 +216,13 @@ model PowerLaw_q50_stack "Middle or bottom crack " annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - DensityColumn col_a_pos( + Airflow.Multizone.BaseClasses.ReversibleDensityColumn + col_a_pos( redeclare package Medium = Medium, h=h_a) if StackEff annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - DensityColumn col_b_pos( + Airflow.Multizone.BaseClasses.ReversibleDensityColumn + col_b_pos( redeclare package Medium = Medium, h=h_b) if StackEff annotation (Placement(transformation(extent={{50,-10},{70,10}}))); @@ -238,155 +240,6 @@ model PowerLaw_q50_stack if not StackEff annotation (Placement(transformation(extent={{50,30},{70,50}}))); - model DensityColumn - "Vertical shaft with no friction and no storage of heat and mass" - - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component" - annotation (choices( - choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); - parameter Modelica.Units.SI.Length h= 3 "Height of shaft"; - - - Modelica.Fluid.Interfaces.FluidPort_a port_a( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-10,90},{10,110}}), - iconTransformation(extent={{-10,90},{10,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); - - Modelica.Units.SI.VolumeFlowRate V_flow - "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; - Modelica.Units.SI.MassFlowRate m_flow - "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; - Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") - "Pressure difference between port_a and port_b"; - Modelica.Units.SI.Density rho "Density in medium column"; - - protected - Medium.ThermodynamicState sta_b=Medium.setState_phX( - port_b.p, - actualStream(port_b.h_outflow), - actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; - Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; - - equation - // Design direction of mass flow rate - m_flow = port_a.m_flow; - - // Pressure difference between ports - // Xi is computed first as it is used in two expression, and in one - // of them only one component is used. - // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no - // moisture and hence Xi[1] is an illegal statement. - // We first compute temperature and then invoke a density function that - // takes temperature as an argument. Simply calling a density function - // of a medium that takes enthalpy as an argument would be dangerous - // as different media can have different datum for the enthalpy. - - Xi = inStream(port_b.Xi_outflow); - rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( - p=Medium.p_default, - T=Medium.temperature(Medium.setState_phX(port_b.p, inStream(port_b.h_outflow), Xi)), - X_w=if Medium.nXi == 0 then 0 else Xi[1]); - - V_flow = m_flow/Medium.density(sta_b); - - dp = if h>0 then port_a.p - port_b.p else -port_a.p + port_b.p; - dp = -abs(h)*rho*Modelica.Constants.g_n; - - // Isenthalpic state transformation (no storage and no loss of energy) - port_a.h_outflow = inStream(port_b.h_outflow); - port_b.h_outflow = inStream(port_a.h_outflow); - - // Mass balance (no storage) - port_a.m_flow + port_b.m_flow = 0; - - // Transport of substances - port_a.Xi_outflow = inStream(port_b.Xi_outflow); - port_b.Xi_outflow = inStream(port_a.Xi_outflow); - - port_a.C_outflow = inStream(port_b.C_outflow); - port_b.C_outflow = inStream(port_a.C_outflow); - - annotation ( - Icon(graphics={ - Line( - points={{0,100},{0,-100},{0,-98}}), - Text( - extent={{24,-78},{106,-100}}, - lineColor={0,0,127}, - textString="Zone/Amb"), - Text( - extent={{32,104},{98,70}}, - lineColor={0,0,127}, - textString="FlowElem"), - Text( - extent={{36,26},{88,-10}}, - lineColor={0,0,127}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - textString="h=%h"), - Rectangle( - extent={{-16,80},{16,-80}}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, - extent={{-16,80},{16,0}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,80},{16,54}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, - extent={{-16,0},{16,-82}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,-55},{16,-80}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0})}), - defaultComponentName="col", - Documentation(info=" -

-This model describes the pressure difference of a vertical medium -column. It can be used to model the pressure difference caused by -stack effect. - -It is a variation on IDEAS.Airflow.Multizone.MediumColumn. - -

-", revisions=" -
    -
  • -January 19, 2022, by Klaas De Jonge:
    -Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of h can be negative and cleaned out the model as the density should always be set by port_b. -This makes port_a not nececarilly always the top port. - -
  • -
-")); - end DensityColumn; - equation diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 23a3e71562..21328bc995 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -141,166 +141,14 @@ public "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); - //Submodel of density column a copy because reference to submodel of PowerLaw_q50_stack can't be made - model DensityColumn - "Vertical shaft with no friction and no storage of heat and mass" - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component" - annotation (choices( - choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); - parameter Modelica.Units.SI.Length h=3 "Height of shaft"; - - - Modelica.Fluid.Interfaces.FluidPort_a port_a( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector a (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{-10,90},{10,110}}), - iconTransformation(extent={{-10,90},{10,110}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b( - redeclare package Medium = Medium, - p(start=Medium.p_default)) - "Fluid connector b (positive design flow direction is from port_a to port_b)" - annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); - - Modelica.Units.SI.VolumeFlowRate V_flow - "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; - Modelica.Units.SI.MassFlowRate m_flow - "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; - Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") - "Pressure difference between port_a and port_b"; - Modelica.Units.SI.Density rho "Density in medium column"; - - protected - Medium.ThermodynamicState sta_b=Medium.setState_phX( - port_b.p, - actualStream(port_b.h_outflow), - actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; - Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; - - equation - // Design direction of mass flow rate - m_flow = port_a.m_flow; - - // Pressure difference between ports - // Xi is computed first as it is used in two expression, and in one - // of them only one component is used. - // We test for Medium.nXi == 0 as Modelica.Media.Air.SimpleAir has no - // moisture and hence Xi[1] is an illegal statement. - // We first compute temperature and then invoke a density function that - // takes temperature as an argument. Simply calling a density function - // of a medium that takes enthalpy as an argument would be dangerous - // as different media can have different datum for the enthalpy. - - Xi = inStream(port_b.Xi_outflow); - rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( - p=Medium.p_default, - T=Medium.temperature(Medium.setState_phX( - port_b.p, - inStream(port_b.h_outflow), - Xi)), - X_w=if Medium.nXi == 0 then 0 else Xi[1]); - - V_flow = m_flow/Medium.density(sta_b); - - dp = if h > 0 then port_a.p - port_b.p else -port_a.p + port_b.p; - dp = -abs(h)*rho*Modelica.Constants.g_n; - - // Isenthalpic state transformation (no storage and no loss of energy) - port_a.h_outflow = inStream(port_b.h_outflow); - port_b.h_outflow = inStream(port_a.h_outflow); - - // Mass balance (no storage) - port_a.m_flow + port_b.m_flow = 0; - - // Transport of substances - port_a.Xi_outflow = inStream(port_b.Xi_outflow); - port_b.Xi_outflow = inStream(port_a.Xi_outflow); - - port_a.C_outflow = inStream(port_b.C_outflow); - port_b.C_outflow = inStream(port_a.C_outflow); - - annotation ( - Icon(graphics={ - Line( - points={{0,100},{0,-100},{0,-98}}), - Text( - extent={{24,-78},{106,-100}}, - lineColor={0,0,127}, - textString="Zone/Amb"), - Text( - extent={{32,104},{98,70}}, - lineColor={0,0,127}, - textString="FlowElem"), - Text( - extent={{36,26},{88,-10}}, - lineColor={0,0,127}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - textString="h=%h"), - Rectangle( - extent={{-16,80},{16,-80}}, - fillColor={255,0,0}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromTop, - extent={{-16,80},{16,0}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,80},{16,54}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.fromBottom, - extent={{-16,0},{16,-82}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0}), - Rectangle( - visible=densitySelection == IDEAS.Airflow.Multizone.Types.densitySelection.actual, - extent={{-16,-55},{16,-80}}, - fillColor={85,170,255}, - fillPattern=FillPattern.Solid, - pattern=LinePattern.None, - lineColor={0,0,0})}), - defaultComponentName="col", - Documentation(info=" -

-This model describes the pressure difference of a vertical medium -column. It can be used to model the pressure difference caused by -stack effect. - -It is a variation on IDEAS.Airflow.Multizone.MediumColumn. - -

-", - revisions=" -
    -
  • -January 19, 2022, by Klaas De Jonge:
    -Adapted IDEAS.Airflow.Multizone.MediumColumn to obtain the current model where input of h can be negative and cleaned out the model as the density should always be set by port_b. -This makes port_a not nececarilly always the top port. - -
  • -
-")); - end DensityColumn; - - - DensityColumn col_b_pos(redeclare package Medium = Medium, h=-0.5*hzone_b + + Airflow.Multizone.BaseClasses.ReversibleDensityColumn + col_b_pos(redeclare package Medium = Medium, h=-0.5*hzone_b + 0.5*Ope_hvert + hRef_b) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); - DensityColumn col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + 0.5 + Airflow.Multizone.BaseClasses.ReversibleDensityColumn + col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + 0.5 *Ope_hvert + hRef_a) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort annotation (Placement(transformation(extent={{16,42},{36,62}}))); From c692dbcc9fb160c040cad107156958aec0eb44e7 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 25 Aug 2022 14:30:14 +0200 Subject: [PATCH 042/140] Added Habs to surface Derived Habs to be able to easily check the model after translation --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 1 + 1 file changed, 1 insertion(+) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 4dbf1addf9..cac24de0c8 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -58,6 +58,7 @@ partial model PartialSurface "Partial model for building envelope component" parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " annotation(Evaluate=true); + parameter Real Habs=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( redeclare final package Medium = Medium, From 4ada5dc9a78eda9b3ad7902183262023e2927751 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Thu, 25 Aug 2022 14:44:01 +0200 Subject: [PATCH 043/140] pi() -> constants.pi --- IDEAS/Buildings/Components/InternalWall.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 21328bc995..7c3172d9f4 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -74,7 +74,7 @@ model InternalWall "interior opaque wall between two zones" final parameter Real hzone_b(fixed=false); final parameter Real hfloor_b(fixed=false); - parameter Real hRef_b=if inc==pi() then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; + parameter Real hRef_b=if inc== Modelica.Constants.pi then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; @@ -158,7 +158,7 @@ initial equation hfloor_b= propsBus_b.hfloor; equation //assert(inc==0 and hfloor_a>hfloor_b, getInstanceName()+ "is a ceiling, but the floor of the zone at probsbus_b lies above the floor of zone at probsbus_a, this is probably a mistake",level=AssertionLevel.warning); - //assert(inc==pi() and hfloor_a Date: Thu, 25 Aug 2022 14:44:14 +0200 Subject: [PATCH 044/140] Update PartialSurface.mo --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index cac24de0c8..53e45c6d3b 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -58,7 +58,7 @@ partial model PartialSurface "Partial model for building envelope component" parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " annotation(Evaluate=true); - parameter Real Habs=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; + parameter Real Habs_surf=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( redeclare final package Medium = Medium, From 777d1459bb423e006bda16c0cba43bbb4d307502 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 14:22:55 +0200 Subject: [PATCH 045/140] Airtight internal floors and ceilings Changed the default to handle floors and ceilings as airtight --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 4 ++-- IDEAS/Buildings/Components/InternalWall.mo | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 53e45c6d3b..c8e6d19ba6 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -48,10 +48,10 @@ partial model PartialSurface "Partial model for building envelope component" "check to disable the default q50 computation and to assign a custom q50 value" annotation (choices(checkBox=true),Dialog(tab="Airflow", group="Airtightness"), Evaluate=true); parameter Real custom_q50(unit="m3/(h.m2)") = 2 - "Envelope air tightness" + "Surface air tightness" annotation (Dialog(enable=use_custom_q50,tab="Airflow", group="Airtightness")); final parameter Real q50_internal(unit="m3/(h.m2)",fixed=false) - "Envelope air tightness"; + "Surface air tightness"; final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation final parameter Real hfloor_a( fixed=false); diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 7c3172d9f4..40739bbad0 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -2,7 +2,7 @@ within IDEAS.Buildings.Components; model InternalWall "interior opaque wall between two zones" extends IDEAS.Buildings.Components.Interfaces.PartialOpaqueSurface( final use_custom_q50=true, - custom_q50=2, + custom_q50=if inc==0 or inc == Modelica.Constants.pi then 0 else 2, final nWin=1, dT_nominal_a=1, E(y=if sim.computeConservationOfEnergy then layMul.E else 0), From 39cea705f33430d4778c9aa61eb60c8716964c5c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 14:24:26 +0200 Subject: [PATCH 046/140] Added 2-port variation --- IDEAS/Examples/PPD12/Structure_2Port.mo | 532 ++++++++++++++++++++++++ IDEAS/Examples/PPD12/package.order | 1 + 2 files changed, 533 insertions(+) create mode 100644 IDEAS/Examples/PPD12/Structure_2Port.mo diff --git a/IDEAS/Examples/PPD12/Structure_2Port.mo b/IDEAS/Examples/PPD12/Structure_2Port.mo new file mode 100644 index 0000000000..1f28cc8aa5 --- /dev/null +++ b/IDEAS/Examples/PPD12/Structure_2Port.mo @@ -0,0 +1,532 @@ +within IDEAS.Examples.PPD12; +model Structure_2Port "Ppd 12 example model" + extends Modelica.Icons.Example; + inner replaceable IDEAS.BoundaryConditions.SimInfoManager sim( + interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, + n50=3) + annotation (Placement(transformation(extent={{400,38},{380,58}}))); + parameter Real n50=1.1 + "n50 value cfr airtightness, i.e. the ACH at a pressure diffence of 50 Pa"; + replaceable package MediumAir = IDEAS.Media.Air; + replaceable package MediumWater = IDEAS.Media.Water; + + // GEOMETRY + parameter Modelica.Units.SI.Length hFloor0=2.9 "Height of ground floor"; + parameter Modelica.Units.SI.Length hFloor1=2.7 "Height of first floor"; + parameter Modelica.Units.SI.Length hFloor2=2.5 "Height of second floor"; + parameter Modelica.Units.SI.Length lHallway=8 "Length of hallway"; + parameter Modelica.Units.SI.Length wHallwayAvg=(wHallway1 + wHallway2)/2 + "Hallway width"; + parameter Modelica.Units.SI.Length wHallway1=1.1 "Hallway width"; + parameter Modelica.Units.SI.Length wHallway2=1.4 "Hallway width"; + parameter Modelica.Units.SI.Length wZon=(wZonStr + wBathroom)/2 + "Avg living width"; + parameter Modelica.Units.SI.Length wZonStr=3.2 "Living width at street"; + parameter Modelica.Units.SI.Length wBuilding=4.6; + parameter Modelica.Units.SI.Length wBathroom=2.85; + parameter Modelica.Units.SI.Length lDiner=3; + parameter Modelica.Units.SI.Length wBedroom=4.4; + parameter Modelica.Units.SI.Length wDiner=4.5; + parameter Modelica.Units.SI.Length lPorch=2; + parameter Modelica.Units.SI.Length wPorch=wBuilding - wKitchen; + parameter Modelica.Units.SI.Length wKitchen=1.4; + parameter Modelica.Units.SI.Length lHalfBuilding=3.75; + parameter Modelica.Units.SI.Length lBuilding=8; + + parameter Modelica.Units.NonSI.Angle_deg angDelta=23.6; + parameter Modelica.Units.SI.Angle north=IDEAS.Types.Azimuth.N + + Modelica.Units.Conversions.from_deg(angDelta) + "Azimuth of the wall, i.e. 0deg denotes South"; + parameter Modelica.Units.SI.Angle south=IDEAS.Types.Azimuth.S + + Modelica.Units.Conversions.from_deg(angDelta) + "Azimuth of the wall, i.e. 0deg denotes South"; + parameter Modelica.Units.SI.Angle west=IDEAS.Types.Azimuth.W + + Modelica.Units.Conversions.from_deg(angDelta) + "Azimuth of the wall, i.e. 0deg denotes South"; + parameter Modelica.Units.SI.Angle east=IDEAS.Types.Azimuth.E + + Modelica.Units.Conversions.from_deg(angDelta) + "Azimuth of the wall, i.e. 0deg denotes South"; + + IDEAS.Buildings.Components.BoundaryWall com1( + inc=IDEAS.Types.Tilt.Wall, + azi=south, + redeclare IDEAS.Examples.PPD12.Data.CommonWall constructionType, + A=2.3*lPorch) "Common wall on south side" + annotation (Placement(transformation(extent={{-104,-72},{-94,-52}}))); + IDEAS.Buildings.Components.OuterWall out1( + inc=IDEAS.Types.Tilt.Wall, + A=hFloor0*wKitchen, + azi=east, + redeclare IDEAS.Templates.OuterWall constructionType) + "Outerwall on east side - kitchen" annotation (Placement(transformation( + extent={{-5,-10},{5,10}}, + rotation=90, + origin={-89,-94}))); + IDEAS.Buildings.Components.InternalWall cei2( + A=wZon*lHallway/2, + azi=0, + redeclare IDEAS.Examples.PPD12.Data.Floor constructionType, + inc=IDEAS.Types.Tilt.Floor) "Floor between living and bedroom 1" + annotation (Placement(transformation(extent={{94,72},{104,52}}))); + IDEAS.Buildings.Components.InternalWall cei1( + azi=0, + A=lHallway*wHallway1, + redeclare IDEAS.Examples.PPD12.Data.Floor constructionType, + inc=IDEAS.Types.Tilt.Floor) "Floor between hallway and bedroom 1" + annotation (Placement(transformation(extent={{70,68},{80,88}}))); + IDEAS.Buildings.Components.Window winBed3( + frac=0.1, + azi=east, + redeclare IDEAS.Examples.PPD12.Data.PvcInsulated fraType, + redeclare IDEAS.Buildings.Data.Glazing.Ins2Ar glazing, + inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, + A=1.2*1) "Window roof, bedroom 3" + annotation (Placement(transformation( + extent={{-5,10},{5,-10}}, + rotation=90, + origin={305,-2}))); + IDEAS.Buildings.Components.OuterWall Roof2( + azi=east, + inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, + A=wBedroom*lHalfBuilding*sqrt(2)/2, + redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) + "Roof, east side" + annotation (Placement(transformation( + extent={{-5,-10},{5,10}}, + rotation=90, + origin={263,-2}))); + IDEAS.Buildings.Components.OuterWall out2( + inc=IDEAS.Types.Tilt.Wall, + redeclare IDEAS.Templates.OuterWall constructionType, + azi=east, + A=0.5*wBedroom) "Outer wall of top floor on east facade" annotation ( + Placement(transformation( + extent={{-5,-10},{5,10}}, + rotation=90, + origin={235,-2}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate living( + h=hFloor0, + aziA=east, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + hasWinC=true, + l=wZon, + w=lBuilding, + redeclare package Medium = MediumAir, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + A_winC=2.55*1.74, + fracC=0.1, + redeclare IDEAS.Templates.OuterWall conTypC, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypB, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, + nSurfExt=1, + redeclare Data.Ppd12WestShadingGnd shaTypC, + n50=n50, + hasCavityA=true, + hA=2.7, + wA=2, + redeclare Data.InteriorWall18 conTypA, + mSenFac=1) + annotation (Placement(transformation(extent={{-26,56},{-46,36}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate hallway( + h=hFloor0, + aziA=east, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + w=lBuilding, + redeclare package Medium = MediumAir, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + A_winC=2.55*1.74, + fracC=0.1, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + l=wHallwayAvg, + redeclare IDEAS.Templates.OuterWall conTypC, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall30 conTypA, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + nSurfExt=1, + n50=n50, + mSenFac=1, + redeclare Data.FloorOnGround conTypFlo) + annotation (Placement(transformation(extent={{-72,60},{-92,40}}))); + IDEAS.Buildings.Components.RectangularZoneTemplate Diner( + h=hFloor0, + aziA=east, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare package Medium = MediumAir, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + A_winC=2.55*1.74, + fracC=0.1, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + l=wDiner, + w=lDiner, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + nSurfExt=4, + redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, + n50=n50, + redeclare Data.RoofHor conTypCei, + redeclare Data.GlassWall conTypA, + mSenFac=1) + annotation (Placement(transformation(extent={{-46,-18},{-26,-38}}))); + IDEAS.Buildings.Components.RectangularZoneTemplate Porch( + aziA=east, + redeclare package Medium = MediumAir, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + A_winC=2.55*1.74, + fracC=0.1, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + redeclare IDEAS.Examples.PPD12.Data.Roof conTypCei, + l=wPorch, + w=lPorch, + h=2.3, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypD, + nSurfExt=0, + redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + redeclare IDEAS.Buildings.Data.Glazing.EpcDouble glazingCei, + redeclare IDEAS.Buildings.Data.Glazing.EpcDouble glazingA, + hasWinCei=true, + hasWinA=true, + A_winA=wPorch*2.3*0.9, + A_winCei=wPorch*lPorch*0.9, + redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall + conTypA, + n50=n50, + mSenFac=1) + annotation (Placement(transformation(extent={{-44,-66},{-24,-86}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom1( + aziA=east, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + hasWinC=true, + redeclare package Medium = MediumAir, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + redeclare IDEAS.Templates.OuterWall conTypC, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + fracC=0.15, + A_winC=1.9*(1 + 1.5), + l=wBedroom, + w=lHalfBuilding, + h=hFloor1, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + nSurfExt=2, + redeclare Data.Ppd12WestShadingFirst shaTypC, + n50=n50, + mSenFac=1) "Master bedroom" + annotation (Placement(transformation(extent={{140,80},{120,60}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate bathRoom( + aziA=east, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare package Medium = MediumAir, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + hasWinA=true, + A_winA=1.21*1.99, + redeclare IDEAS.Templates.OuterWall conTypA, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, + w=lHalfBuilding, + h=hFloor1, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + l=wBathroom, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypB, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall18 conTypC, + nSurfExt=0, + n50=n50, + mSenFac=1) "Bathroom" + annotation (Placement(transformation(extent={{140,26},{120,6}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate stairWay( + redeclare package Medium = MediumAir, + redeclare IDEAS.Templates.OuterWall conTypA, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall conTypFlo, + + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypC, + A_winA=1.09*1.69, + aziA=east, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + fracA=0.1, + h=hFloor1, + bFlo=2, + hasCavityFlo=true, + hasWinA=true, + l=wHallway2, + mSenFac=1, + n50=n50, + nSurfExt=0, + w=lHalfBuilding, + wFlo=0.8) "Stairway" + annotation (Placement(transformation(extent={{86,26},{66,6}}))); + + IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom2( + aziA=east, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + hasWinC=true, + redeclare package Medium = MediumAir, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + fracC=0.15, + l=wBedroom, + w=lHalfBuilding, + h=hFloor1, + A_winC=1.1*0.66 + 1.1*1.54, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall18 conTypC, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypA, + nSurfExt=0, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + redeclare IDEAS.Examples.PPD12.Data.FloorAttic conTypCei, + redeclare Data.Ppd12WestShadingSecond shaTypC, + n50=n50, + mSenFac=1) + "Master bedroom" + annotation (Placement(transformation(extent={{276,82},{256,62}}))); + IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom3( + redeclare package Medium = MediumAir, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, + redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, + redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypA, + redeclare IDEAS.Examples.PPD12.Data.Roof conTypCei, + redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, + redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, + A_winA=1.1*0.73,aziA=east, + bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, + bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, + bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, + calculateViewFactor=false, + fracA=0.15, + h=hFloor1, bFlo = 2, hasCavityFlo = true, + hasWinA=true, + l=wBedroom, + mSenFac=1, + n50=n50, + nSurfExt=3, + w=lHalfBuilding, wFlo = 0.8) + "Master bedroom" + annotation (Placement(transformation(extent={{280,40},{260,20}}))); + + IDEAS.Buildings.Components.OuterWall Roof1( + inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, + azi=west, + A=wBedroom*lHalfBuilding*sqrt(2), + redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) + "Roof, west side" annotation (Placement(transformation( + extent={{-5,-10},{5,10}}, + rotation=90, + origin={283,-2}))); + IDEAS.Buildings.Components.InternalWall cei3( + azi=0, + redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall + constructionType, + A=lHallway*wHallway2, + inc=IDEAS.Types.Tilt.Floor) + "Dummy for representing stairway connection between floors" + annotation (Placement(transformation(extent={{182,-22},{192,-2}}))); +equation + connect(hallway.proBusD[1], living.proBusB[1]) annotation (Line( + points={{-72.4,57},{-45,57},{-45,40}}, + color={255,204,51}, + thickness=0.5)); + connect(Diner.proBusC[1], living.proBusA[1]) annotation (Line( + points={{-29.2,-18.2},{-30,-18.2},{-30,37}}, + color={255,204,51}, + thickness=0.5)); + connect(Diner.proBusExt[1], hallway.proBusA[1]) annotation (Line( + points={{-48,-36.5},{-76,-36.5},{-76,41}}, + color={255,204,51}, + thickness=0.5)); + connect(Diner.proBusExt[2], com1.propsBus_a) annotation (Line( + points={{-48,-37.5},{-48,-36},{-94.8333,-36},{-94.8333,-60}}, + color={255,204,51}, + thickness=0.5)); + connect(out1.propsBus_a, Diner.proBusExt[3]) annotation (Line( + points={{-91,-89.8333},{-91,-38.5},{-48,-38.5}}, + color={255,204,51}, + thickness=0.5)); + connect(Porch.proBusC[1], Diner.proBusA[1]) annotation (Line( + points={{-27.2,-66.2},{-27.2,-48},{-42,-48},{-42,-37}}, + color={255,204,51}, + thickness=0.5)); + connect(Porch.proBusD[1], Diner.proBusExt[4]) annotation (Line( + points={{-43.6,-69},{-88,-69},{-88,-38},{-48,-38},{-48,-39.5}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom1.proBusFlo[1], cei2.propsBus_a) annotation (Line( + points={{130,76},{120,76},{120,60},{103.167,60}}, + color={255,204,51}, + thickness=0.5)); + connect(cei2.propsBus_b, living.proBusCei[1]) annotation (Line( + points={{94.8333,60},{-35.8,60},{-35.8,40}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom1.proBusExt[1], cei1.propsBus_a) annotation (Line( + points={{142,61},{144,61},{144,80},{79.1667,80}}, + color={255,204,51}, + thickness=0.5)); + connect(cei1.propsBus_b, hallway.proBusCei[1]) annotation (Line( + points={{70.8333,80},{-81.8,80},{-81.8,44}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom1.proBusA[1], bathRoom.proBusC[1]) annotation (Line( + points={{136,61},{136,52},{136,25.8},{123.2,25.8}}, + color={255,204,51}, + thickness=0.5)); + connect(bathRoom.proBusFlo[1], living.proBusExt[1]) annotation (Line( + points={{130,22},{96,22},{96,32},{96,38},{-24,38},{-24,36}}, + color={255,204,51}, + thickness=0.5)); + connect(stairWay.proBusC[1], bedRoom1.proBusExt[2]) annotation (Line( + points={{69.2,25.8},{69.2,25.8},{69.2,50},{76,50},{142,50},{142,59}}, + color={255,204,51}, + thickness=0.5)); + connect(stairWay.proBusFlo[1], hallway.proBusExt[1]) annotation (Line( + points={{76,22},{46,22},{-70,22},{-70,40}}, + color={255,204,51}, + thickness=0.5)); + connect(stairWay.proBusD[1], bathRoom.proBusB[1]) annotation (Line( + points={{85.6,23},{121,23},{121,10}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom2.proBusFlo[1], bedRoom1.proBusCei[1]) annotation (Line( + points={{266,78},{266,90},{192,90},{192,64},{130.2,64}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom3.proBusC[1], bedRoom2.proBusA[1]) annotation (Line( + points={{263.2,39.8},{264,39.8},{264,63},{272,63}}, + color={255,204,51}, + thickness=0.5)); + connect(bedRoom3.proBusFlo[1], bathRoom.proBusCei[1]) annotation (Line( + points={{270,36},{202,36},{202,10},{130.2,10}}, + color={255,204,51}, + thickness=0.5)); + connect(out2.propsBus_a, bedRoom3.proBusA[1]) annotation (Line( + points={{233,2.16667},{233,14},{276,14},{276,21}}, + color={255,204,51}, + thickness=0.5)); + connect(winBed3.propsBus_a, bedRoom3.proBusExt[1]) annotation (Line( + points={{307,2.16667},{307,21.3333},{282,21.3333}}, + color={255,204,51}, + thickness=0.5)); + connect(Roof1.propsBus_a, bedRoom3.proBusExt[2]) annotation (Line( + points={{281,2.16667},{281,11.5},{282,11.5},{282,20}}, + color={255,204,51}, + thickness=0.5)); + connect(Roof2.propsBus_a, bedRoom3.proBusCei[1]) annotation (Line( + points={{261,2.16667},{261,24},{270.2,24}}, + color={255,204,51}, + thickness=0.5)); + connect(cei3.propsBus_a, bedRoom3.proBusExt[3]) annotation (Line( + points={{191.167,-10},{282,-10},{282,18.6667}}, + color={255,204,51}, + thickness=0.5)); + connect(cei3.propsBus_b, stairWay.proBusCei[1]) annotation (Line( + points={{182.833,-10},{76.2,-10},{76.2,10}}, + color={255,204,51}, + thickness=0.5)); + annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, + -200},{400,240}}, + initialScale=0.1), graphics={ + Line(points={{-72,-100},{-100,-100},{-100,100},{-68,100},{-68,-10},{0,-10}, + {0,100},{-68,100}}, color={28,108,200}), + Line(points={{-72,-98}}, color={28,108,200}), + Line(points={{-72,-100},{-72,-50},{0,-50},{0,-8}}, color={28,108,200}), + Line(points={{-60,-10},{-100,-10}}, color={28,108,200}), + Line(points={{-72,-100},{0,-100},{0,-50}}, color={28,108,200}), + Line(points={{60,100},{160,100},{160,46},{60,46},{60,100}}, color={28,108, + 200}), + Line( + points={{92,100},{92,46}}, + color={28,108,200}, + pattern=LinePattern.Dash), + Line(points={{60,46},{160,46},{160,-8},{60,-8},{60,46}}, color={28,108,200}), + Line(points={{92,46},{92,-8}}, color={28,108,200}), + Line(points={{220,100},{320,100},{320,46},{220,46},{220,100}}, + color={28,108, + 200}), + Line(points={{220,46},{320,46},{320,-8},{220,-8},{220,46}}, color={28,108, + 200}), + Line( + points={{-68,46},{0,46}}, + color={28,108,200}, + pattern=LinePattern.Dash)}), + Icon(coordinateSystem( + preserveAspectRatio=false, + initialScale=0.1)), + experiment( + StopTime=500000, + __Dymola_NumberOfIntervals=5000, + __Dymola_fixedstepsize=15, + __Dymola_Algorithm="Euler"), + __Dymola_Commands, + Documentation(info=" +

+Example model of a partially renovated terraced house in Belgium. +This model only contains the building structure. +

+", revisions=" +
    +
  • +August 2, 2022, by Filip Jorissen:
    +Added cavity in internal floors to represent staircases. +See #1293. +
  • +
  • +October 13, 2019, by Filip Jorissen:
    +Fixed floor type in hallway. +See #1017. +
  • +
  • +May 21, 2018, by Filip Jorissen:
    +Using model for air flow through vertical cavity. +See #822. +
  • +
  • +December 20, 2016 by Filip Jorissen:
    +First implementation. +
  • +
+")); +end Structure_2Port; diff --git a/IDEAS/Examples/PPD12/package.order b/IDEAS/Examples/PPD12/package.order index a4436f1ce9..37bf16d671 100644 --- a/IDEAS/Examples/PPD12/package.order +++ b/IDEAS/Examples/PPD12/package.order @@ -2,5 +2,6 @@ Heating Structure VentilationMPC VentilationRBC +Structure_2Port Data BaseClasses From 69e9b9253e1e3ff77a480f0d85a80a42d51fed9e Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 14:26:45 +0200 Subject: [PATCH 047/140] Extend instead of duplicate --- IDEAS/Examples/PPD12/StructureExt_2Port.mo | 5 + IDEAS/Examples/PPD12/Structure_2Port.mo | 532 --------------------- IDEAS/Examples/PPD12/package.order | 2 +- 3 files changed, 6 insertions(+), 533 deletions(-) create mode 100644 IDEAS/Examples/PPD12/StructureExt_2Port.mo delete mode 100644 IDEAS/Examples/PPD12/Structure_2Port.mo diff --git a/IDEAS/Examples/PPD12/StructureExt_2Port.mo b/IDEAS/Examples/PPD12/StructureExt_2Port.mo new file mode 100644 index 0000000000..1261643eba --- /dev/null +++ b/IDEAS/Examples/PPD12/StructureExt_2Port.mo @@ -0,0 +1,5 @@ +within IDEAS.Examples.PPD12; +model StructureExt_2Port "Extended the structure but with 2-port option ON" + extends Structure(sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, + n50=3)); +end StructureExt_2Port; diff --git a/IDEAS/Examples/PPD12/Structure_2Port.mo b/IDEAS/Examples/PPD12/Structure_2Port.mo deleted file mode 100644 index 1f28cc8aa5..0000000000 --- a/IDEAS/Examples/PPD12/Structure_2Port.mo +++ /dev/null @@ -1,532 +0,0 @@ -within IDEAS.Examples.PPD12; -model Structure_2Port "Ppd 12 example model" - extends Modelica.Icons.Example; - inner replaceable IDEAS.BoundaryConditions.SimInfoManager sim( - interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, - n50=3) - annotation (Placement(transformation(extent={{400,38},{380,58}}))); - parameter Real n50=1.1 - "n50 value cfr airtightness, i.e. the ACH at a pressure diffence of 50 Pa"; - replaceable package MediumAir = IDEAS.Media.Air; - replaceable package MediumWater = IDEAS.Media.Water; - - // GEOMETRY - parameter Modelica.Units.SI.Length hFloor0=2.9 "Height of ground floor"; - parameter Modelica.Units.SI.Length hFloor1=2.7 "Height of first floor"; - parameter Modelica.Units.SI.Length hFloor2=2.5 "Height of second floor"; - parameter Modelica.Units.SI.Length lHallway=8 "Length of hallway"; - parameter Modelica.Units.SI.Length wHallwayAvg=(wHallway1 + wHallway2)/2 - "Hallway width"; - parameter Modelica.Units.SI.Length wHallway1=1.1 "Hallway width"; - parameter Modelica.Units.SI.Length wHallway2=1.4 "Hallway width"; - parameter Modelica.Units.SI.Length wZon=(wZonStr + wBathroom)/2 - "Avg living width"; - parameter Modelica.Units.SI.Length wZonStr=3.2 "Living width at street"; - parameter Modelica.Units.SI.Length wBuilding=4.6; - parameter Modelica.Units.SI.Length wBathroom=2.85; - parameter Modelica.Units.SI.Length lDiner=3; - parameter Modelica.Units.SI.Length wBedroom=4.4; - parameter Modelica.Units.SI.Length wDiner=4.5; - parameter Modelica.Units.SI.Length lPorch=2; - parameter Modelica.Units.SI.Length wPorch=wBuilding - wKitchen; - parameter Modelica.Units.SI.Length wKitchen=1.4; - parameter Modelica.Units.SI.Length lHalfBuilding=3.75; - parameter Modelica.Units.SI.Length lBuilding=8; - - parameter Modelica.Units.NonSI.Angle_deg angDelta=23.6; - parameter Modelica.Units.SI.Angle north=IDEAS.Types.Azimuth.N + - Modelica.Units.Conversions.from_deg(angDelta) - "Azimuth of the wall, i.e. 0deg denotes South"; - parameter Modelica.Units.SI.Angle south=IDEAS.Types.Azimuth.S + - Modelica.Units.Conversions.from_deg(angDelta) - "Azimuth of the wall, i.e. 0deg denotes South"; - parameter Modelica.Units.SI.Angle west=IDEAS.Types.Azimuth.W + - Modelica.Units.Conversions.from_deg(angDelta) - "Azimuth of the wall, i.e. 0deg denotes South"; - parameter Modelica.Units.SI.Angle east=IDEAS.Types.Azimuth.E + - Modelica.Units.Conversions.from_deg(angDelta) - "Azimuth of the wall, i.e. 0deg denotes South"; - - IDEAS.Buildings.Components.BoundaryWall com1( - inc=IDEAS.Types.Tilt.Wall, - azi=south, - redeclare IDEAS.Examples.PPD12.Data.CommonWall constructionType, - A=2.3*lPorch) "Common wall on south side" - annotation (Placement(transformation(extent={{-104,-72},{-94,-52}}))); - IDEAS.Buildings.Components.OuterWall out1( - inc=IDEAS.Types.Tilt.Wall, - A=hFloor0*wKitchen, - azi=east, - redeclare IDEAS.Templates.OuterWall constructionType) - "Outerwall on east side - kitchen" annotation (Placement(transformation( - extent={{-5,-10},{5,10}}, - rotation=90, - origin={-89,-94}))); - IDEAS.Buildings.Components.InternalWall cei2( - A=wZon*lHallway/2, - azi=0, - redeclare IDEAS.Examples.PPD12.Data.Floor constructionType, - inc=IDEAS.Types.Tilt.Floor) "Floor between living and bedroom 1" - annotation (Placement(transformation(extent={{94,72},{104,52}}))); - IDEAS.Buildings.Components.InternalWall cei1( - azi=0, - A=lHallway*wHallway1, - redeclare IDEAS.Examples.PPD12.Data.Floor constructionType, - inc=IDEAS.Types.Tilt.Floor) "Floor between hallway and bedroom 1" - annotation (Placement(transformation(extent={{70,68},{80,88}}))); - IDEAS.Buildings.Components.Window winBed3( - frac=0.1, - azi=east, - redeclare IDEAS.Examples.PPD12.Data.PvcInsulated fraType, - redeclare IDEAS.Buildings.Data.Glazing.Ins2Ar glazing, - inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, - A=1.2*1) "Window roof, bedroom 3" - annotation (Placement(transformation( - extent={{-5,10},{5,-10}}, - rotation=90, - origin={305,-2}))); - IDEAS.Buildings.Components.OuterWall Roof2( - azi=east, - inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, - A=wBedroom*lHalfBuilding*sqrt(2)/2, - redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) - "Roof, east side" - annotation (Placement(transformation( - extent={{-5,-10},{5,10}}, - rotation=90, - origin={263,-2}))); - IDEAS.Buildings.Components.OuterWall out2( - inc=IDEAS.Types.Tilt.Wall, - redeclare IDEAS.Templates.OuterWall constructionType, - azi=east, - A=0.5*wBedroom) "Outer wall of top floor on east facade" annotation ( - Placement(transformation( - extent={{-5,-10},{5,10}}, - rotation=90, - origin={235,-2}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate living( - h=hFloor0, - aziA=east, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - hasWinC=true, - l=wZon, - w=lBuilding, - redeclare package Medium = MediumAir, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - A_winC=2.55*1.74, - fracC=0.1, - redeclare IDEAS.Templates.OuterWall conTypC, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypB, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, - nSurfExt=1, - redeclare Data.Ppd12WestShadingGnd shaTypC, - n50=n50, - hasCavityA=true, - hA=2.7, - wA=2, - redeclare Data.InteriorWall18 conTypA, - mSenFac=1) - annotation (Placement(transformation(extent={{-26,56},{-46,36}}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate hallway( - h=hFloor0, - aziA=east, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - w=lBuilding, - redeclare package Medium = MediumAir, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - A_winC=2.55*1.74, - fracC=0.1, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - l=wHallwayAvg, - redeclare IDEAS.Templates.OuterWall conTypC, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall30 conTypA, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - nSurfExt=1, - n50=n50, - mSenFac=1, - redeclare Data.FloorOnGround conTypFlo) - annotation (Placement(transformation(extent={{-72,60},{-92,40}}))); - IDEAS.Buildings.Components.RectangularZoneTemplate Diner( - h=hFloor0, - aziA=east, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare package Medium = MediumAir, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - A_winC=2.55*1.74, - fracC=0.1, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - l=wDiner, - w=lDiner, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - nSurfExt=4, - redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, - n50=n50, - redeclare Data.RoofHor conTypCei, - redeclare Data.GlassWall conTypA, - mSenFac=1) - annotation (Placement(transformation(extent={{-46,-18},{-26,-38}}))); - IDEAS.Buildings.Components.RectangularZoneTemplate Porch( - aziA=east, - redeclare package Medium = MediumAir, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - A_winC=2.55*1.74, - fracC=0.1, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - redeclare IDEAS.Examples.PPD12.Data.Roof conTypCei, - l=wPorch, - w=lPorch, - h=2.3, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypD, - nSurfExt=0, - redeclare IDEAS.Examples.PPD12.Data.FloorOnGround conTypFlo, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - redeclare IDEAS.Buildings.Data.Glazing.EpcDouble glazingCei, - redeclare IDEAS.Buildings.Data.Glazing.EpcDouble glazingA, - hasWinCei=true, - hasWinA=true, - A_winA=wPorch*2.3*0.9, - A_winCei=wPorch*lPorch*0.9, - redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall - conTypA, - n50=n50, - mSenFac=1) - annotation (Placement(transformation(extent={{-44,-66},{-24,-86}}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom1( - aziA=east, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - hasWinC=true, - redeclare package Medium = MediumAir, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - redeclare IDEAS.Templates.OuterWall conTypC, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - fracC=0.15, - A_winC=1.9*(1 + 1.5), - l=wBedroom, - w=lHalfBuilding, - h=hFloor1, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - nSurfExt=2, - redeclare Data.Ppd12WestShadingFirst shaTypC, - n50=n50, - mSenFac=1) "Master bedroom" - annotation (Placement(transformation(extent={{140,80},{120,60}}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate bathRoom( - aziA=east, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare package Medium = MediumAir, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - hasWinA=true, - A_winA=1.21*1.99, - redeclare IDEAS.Templates.OuterWall conTypA, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, - w=lHalfBuilding, - h=hFloor1, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - l=wBathroom, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypB, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall18 conTypC, - nSurfExt=0, - n50=n50, - mSenFac=1) "Bathroom" - annotation (Placement(transformation(extent={{140,26},{120,6}}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate stairWay( - redeclare package Medium = MediumAir, - redeclare IDEAS.Templates.OuterWall conTypA, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall conTypFlo, - - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypC, - A_winA=1.09*1.69, - aziA=east, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - fracA=0.1, - h=hFloor1, - bFlo=2, - hasCavityFlo=true, - hasWinA=true, - l=wHallway2, - mSenFac=1, - n50=n50, - nSurfExt=0, - w=lHalfBuilding, - wFlo=0.8) "Stairway" - annotation (Placement(transformation(extent={{86,26},{66,6}}))); - - IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom2( - aziA=east, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - hasWinC=true, - redeclare package Medium = MediumAir, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingC, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - fracC=0.15, - l=wBedroom, - w=lHalfBuilding, - h=hFloor1, - A_winC=1.1*0.66 + 1.1*1.54, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall18 conTypC, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypA, - nSurfExt=0, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - redeclare IDEAS.Examples.PPD12.Data.FloorAttic conTypCei, - redeclare Data.Ppd12WestShadingSecond shaTypC, - n50=n50, - mSenFac=1) - "Master bedroom" - annotation (Placement(transformation(extent={{276,82},{256,62}}))); - IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom3( - redeclare package Medium = MediumAir, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, - redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, - redeclare IDEAS.Examples.PPD12.Data.InteriorWall10 conTypA, - redeclare IDEAS.Examples.PPD12.Data.Roof conTypCei, - redeclare IDEAS.Examples.PPD12.Data.Floor conTypFlo, - redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, - A_winA=1.1*0.73,aziA=east, - bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypB=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypCei=IDEAS.Buildings.Components.Interfaces.BoundaryType.External, - bouTypD=IDEAS.Buildings.Components.Interfaces.BoundaryType.BoundaryWall, - bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, - calculateViewFactor=false, - fracA=0.15, - h=hFloor1, bFlo = 2, hasCavityFlo = true, - hasWinA=true, - l=wBedroom, - mSenFac=1, - n50=n50, - nSurfExt=3, - w=lHalfBuilding, wFlo = 0.8) - "Master bedroom" - annotation (Placement(transformation(extent={{280,40},{260,20}}))); - - IDEAS.Buildings.Components.OuterWall Roof1( - inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, - azi=west, - A=wBedroom*lHalfBuilding*sqrt(2), - redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) - "Roof, west side" annotation (Placement(transformation( - extent={{-5,-10},{5,10}}, - rotation=90, - origin={283,-2}))); - IDEAS.Buildings.Components.InternalWall cei3( - azi=0, - redeclare IDEAS.Buildings.Validation.Data.Constructions.LightWall - constructionType, - A=lHallway*wHallway2, - inc=IDEAS.Types.Tilt.Floor) - "Dummy for representing stairway connection between floors" - annotation (Placement(transformation(extent={{182,-22},{192,-2}}))); -equation - connect(hallway.proBusD[1], living.proBusB[1]) annotation (Line( - points={{-72.4,57},{-45,57},{-45,40}}, - color={255,204,51}, - thickness=0.5)); - connect(Diner.proBusC[1], living.proBusA[1]) annotation (Line( - points={{-29.2,-18.2},{-30,-18.2},{-30,37}}, - color={255,204,51}, - thickness=0.5)); - connect(Diner.proBusExt[1], hallway.proBusA[1]) annotation (Line( - points={{-48,-36.5},{-76,-36.5},{-76,41}}, - color={255,204,51}, - thickness=0.5)); - connect(Diner.proBusExt[2], com1.propsBus_a) annotation (Line( - points={{-48,-37.5},{-48,-36},{-94.8333,-36},{-94.8333,-60}}, - color={255,204,51}, - thickness=0.5)); - connect(out1.propsBus_a, Diner.proBusExt[3]) annotation (Line( - points={{-91,-89.8333},{-91,-38.5},{-48,-38.5}}, - color={255,204,51}, - thickness=0.5)); - connect(Porch.proBusC[1], Diner.proBusA[1]) annotation (Line( - points={{-27.2,-66.2},{-27.2,-48},{-42,-48},{-42,-37}}, - color={255,204,51}, - thickness=0.5)); - connect(Porch.proBusD[1], Diner.proBusExt[4]) annotation (Line( - points={{-43.6,-69},{-88,-69},{-88,-38},{-48,-38},{-48,-39.5}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom1.proBusFlo[1], cei2.propsBus_a) annotation (Line( - points={{130,76},{120,76},{120,60},{103.167,60}}, - color={255,204,51}, - thickness=0.5)); - connect(cei2.propsBus_b, living.proBusCei[1]) annotation (Line( - points={{94.8333,60},{-35.8,60},{-35.8,40}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom1.proBusExt[1], cei1.propsBus_a) annotation (Line( - points={{142,61},{144,61},{144,80},{79.1667,80}}, - color={255,204,51}, - thickness=0.5)); - connect(cei1.propsBus_b, hallway.proBusCei[1]) annotation (Line( - points={{70.8333,80},{-81.8,80},{-81.8,44}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom1.proBusA[1], bathRoom.proBusC[1]) annotation (Line( - points={{136,61},{136,52},{136,25.8},{123.2,25.8}}, - color={255,204,51}, - thickness=0.5)); - connect(bathRoom.proBusFlo[1], living.proBusExt[1]) annotation (Line( - points={{130,22},{96,22},{96,32},{96,38},{-24,38},{-24,36}}, - color={255,204,51}, - thickness=0.5)); - connect(stairWay.proBusC[1], bedRoom1.proBusExt[2]) annotation (Line( - points={{69.2,25.8},{69.2,25.8},{69.2,50},{76,50},{142,50},{142,59}}, - color={255,204,51}, - thickness=0.5)); - connect(stairWay.proBusFlo[1], hallway.proBusExt[1]) annotation (Line( - points={{76,22},{46,22},{-70,22},{-70,40}}, - color={255,204,51}, - thickness=0.5)); - connect(stairWay.proBusD[1], bathRoom.proBusB[1]) annotation (Line( - points={{85.6,23},{121,23},{121,10}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom2.proBusFlo[1], bedRoom1.proBusCei[1]) annotation (Line( - points={{266,78},{266,90},{192,90},{192,64},{130.2,64}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom3.proBusC[1], bedRoom2.proBusA[1]) annotation (Line( - points={{263.2,39.8},{264,39.8},{264,63},{272,63}}, - color={255,204,51}, - thickness=0.5)); - connect(bedRoom3.proBusFlo[1], bathRoom.proBusCei[1]) annotation (Line( - points={{270,36},{202,36},{202,10},{130.2,10}}, - color={255,204,51}, - thickness=0.5)); - connect(out2.propsBus_a, bedRoom3.proBusA[1]) annotation (Line( - points={{233,2.16667},{233,14},{276,14},{276,21}}, - color={255,204,51}, - thickness=0.5)); - connect(winBed3.propsBus_a, bedRoom3.proBusExt[1]) annotation (Line( - points={{307,2.16667},{307,21.3333},{282,21.3333}}, - color={255,204,51}, - thickness=0.5)); - connect(Roof1.propsBus_a, bedRoom3.proBusExt[2]) annotation (Line( - points={{281,2.16667},{281,11.5},{282,11.5},{282,20}}, - color={255,204,51}, - thickness=0.5)); - connect(Roof2.propsBus_a, bedRoom3.proBusCei[1]) annotation (Line( - points={{261,2.16667},{261,24},{270.2,24}}, - color={255,204,51}, - thickness=0.5)); - connect(cei3.propsBus_a, bedRoom3.proBusExt[3]) annotation (Line( - points={{191.167,-10},{282,-10},{282,18.6667}}, - color={255,204,51}, - thickness=0.5)); - connect(cei3.propsBus_b, stairWay.proBusCei[1]) annotation (Line( - points={{182.833,-10},{76.2,-10},{76.2,10}}, - color={255,204,51}, - thickness=0.5)); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -200},{400,240}}, - initialScale=0.1), graphics={ - Line(points={{-72,-100},{-100,-100},{-100,100},{-68,100},{-68,-10},{0,-10}, - {0,100},{-68,100}}, color={28,108,200}), - Line(points={{-72,-98}}, color={28,108,200}), - Line(points={{-72,-100},{-72,-50},{0,-50},{0,-8}}, color={28,108,200}), - Line(points={{-60,-10},{-100,-10}}, color={28,108,200}), - Line(points={{-72,-100},{0,-100},{0,-50}}, color={28,108,200}), - Line(points={{60,100},{160,100},{160,46},{60,46},{60,100}}, color={28,108, - 200}), - Line( - points={{92,100},{92,46}}, - color={28,108,200}, - pattern=LinePattern.Dash), - Line(points={{60,46},{160,46},{160,-8},{60,-8},{60,46}}, color={28,108,200}), - Line(points={{92,46},{92,-8}}, color={28,108,200}), - Line(points={{220,100},{320,100},{320,46},{220,46},{220,100}}, - color={28,108, - 200}), - Line(points={{220,46},{320,46},{320,-8},{220,-8},{220,46}}, color={28,108, - 200}), - Line( - points={{-68,46},{0,46}}, - color={28,108,200}, - pattern=LinePattern.Dash)}), - Icon(coordinateSystem( - preserveAspectRatio=false, - initialScale=0.1)), - experiment( - StopTime=500000, - __Dymola_NumberOfIntervals=5000, - __Dymola_fixedstepsize=15, - __Dymola_Algorithm="Euler"), - __Dymola_Commands, - Documentation(info=" -

-Example model of a partially renovated terraced house in Belgium. -This model only contains the building structure. -

-", revisions=" -
    -
  • -August 2, 2022, by Filip Jorissen:
    -Added cavity in internal floors to represent staircases. -See #1293. -
  • -
  • -October 13, 2019, by Filip Jorissen:
    -Fixed floor type in hallway. -See #1017. -
  • -
  • -May 21, 2018, by Filip Jorissen:
    -Using model for air flow through vertical cavity. -See #822. -
  • -
  • -December 20, 2016 by Filip Jorissen:
    -First implementation. -
  • -
-")); -end Structure_2Port; diff --git a/IDEAS/Examples/PPD12/package.order b/IDEAS/Examples/PPD12/package.order index 37bf16d671..d1db2cb1f9 100644 --- a/IDEAS/Examples/PPD12/package.order +++ b/IDEAS/Examples/PPD12/package.order @@ -2,6 +2,6 @@ Heating Structure VentilationMPC VentilationRBC -Structure_2Port +StructureExt_2Port Data BaseClasses From 442b2023253cafce72b818fdce3c22845aa8beb0 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 15:22:12 +0200 Subject: [PATCH 048/140] Proposal: hfloor1 >hfloor2 --- IDEAS/Examples/PPD12/Structure.mo | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/IDEAS/Examples/PPD12/Structure.mo b/IDEAS/Examples/PPD12/Structure.mo index 9fbb52724b..0280102808 100644 --- a/IDEAS/Examples/PPD12/Structure.mo +++ b/IDEAS/Examples/PPD12/Structure.mo @@ -268,7 +268,6 @@ model Structure "Ppd 12 example model" annotation (Placement(transformation(extent={{140,26},{120,6}}))); IDEAS.Buildings.Components.RectangularZoneTemplate stairWay( - redeclare package Medium = MediumAir, redeclare IDEAS.Examples.PPD12.Data.OuterWall conTypA, redeclare IDEAS.Examples.PPD12.Data.TripleGlazing glazingA, @@ -293,6 +292,7 @@ model Structure "Ppd 12 example model" w=lHalfBuilding, wFlo = 0.8) "Stairway" annotation (Placement(transformation(extent={{86,26},{66,6}}))); + IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom2( aziA=east, bouTypC=IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall, @@ -306,7 +306,7 @@ model Structure "Ppd 12 example model" fracC=0.15, l=wBedroom, w=lHalfBuilding, - h=hFloor1, + h=hFloor2, A_winC=1.1*0.66 + 1.1*1.54, redeclare IDEAS.Examples.PPD12.Data.InteriorWall18 conTypC, bouTypA=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, @@ -322,7 +322,6 @@ model Structure "Ppd 12 example model" "Master bedroom" annotation (Placement(transformation(extent={{276,82},{256,62}}))); IDEAS.Buildings.Components.RectangularZoneTemplate bedRoom3( - redeclare package Medium = MediumAir, redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypD, redeclare IDEAS.Examples.PPD12.Data.CommonWall conTypB, @@ -339,7 +338,7 @@ model Structure "Ppd 12 example model" bouTypFlo=IDEAS.Buildings.Components.Interfaces.BoundaryType.InternalWall, calculateViewFactor=false, fracA=0.15, - h=hFloor1, bFlo = 2, hasCavityFlo = true, + h=hFloor2, bFlo = 2, hasCavityFlo = true, hasWinA=true, l=wBedroom, mSenFac=1, From 728119e7128beb9c12e8e31e43655165cd8d00ce Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 15:24:00 +0200 Subject: [PATCH 049/140] final Habs_surf --- IDEAS/Buildings/Components/Interfaces/PartialSurface.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index c8e6d19ba6..a081785b8d 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -58,7 +58,7 @@ partial model PartialSurface "Partial model for building envelope component" parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " annotation(Evaluate=true); - parameter Real Habs_surf=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; + final parameter Real Habs_surf=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; IDEAS.Buildings.Components.Interfaces.ZoneBus propsBus_a( redeclare final package Medium = Medium, From 466e8deeaa92d7efc03d077b40a1aac45ace4f24 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 15:32:58 +0200 Subject: [PATCH 050/140] Simplify horizontal openings When an opening is horizontal, no different flows are expected due to the lack of stack effect, thus simplifying to less compartments is logical. Can this be 1? --- IDEAS/Buildings/Components/InternalWall.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 40739bbad0..bd31372730 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -128,7 +128,7 @@ public hOpe=Ope_hvert, hA=(hzone_a/2) - hRef_a, hB=(hzone_b/2) - hRef_b, - nCom=4, + nCom=if Ope_hvert==0 then 2 else 4, CD=CD) if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "2-port model for open door" From e25590cf60a1ef31c4d15274f30aa798c6c6479e Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 26 Aug 2022 16:42:52 +0200 Subject: [PATCH 051/140] Assigned column heights for sloped roof --- IDEAS/Examples/PPD12/Structure.mo | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/IDEAS/Examples/PPD12/Structure.mo b/IDEAS/Examples/PPD12/Structure.mo index 0280102808..f367e77be1 100644 --- a/IDEAS/Examples/PPD12/Structure.mo +++ b/IDEAS/Examples/PPD12/Structure.mo @@ -74,6 +74,8 @@ model Structure "Ppd 12 example model" inc=IDEAS.Types.Tilt.Floor) "Floor between hallway and bedroom 1" annotation (Placement(transformation(extent={{70,68},{80,88}}))); IDEAS.Buildings.Components.Window winBed3( + hVertical=1.2*sin(inc), + hRef_a=hzone_a + 1, frac=0.1, azi=east, redeclare IDEAS.Examples.PPD12.Data.PvcInsulated fraType, @@ -88,7 +90,9 @@ model Structure "Ppd 12 example model" azi=east, inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, A=wBedroom*lHalfBuilding*sqrt(2)/2, - redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) + redeclare IDEAS.Examples.PPD12.Data.Roof constructionType, + hVertical=lHalfBuilding*tan(inc), + hRef_a=hzone_a) "Roof, east side" annotation (Placement(transformation( extent={{-5,-10},{5,10}}, @@ -98,7 +102,8 @@ model Structure "Ppd 12 example model" inc=IDEAS.Types.Tilt.Wall, redeclare IDEAS.Examples.PPD12.Data.OuterWall constructionType, azi=east, - A=0.5*wBedroom) + A=0.5*wBedroom, + hVertical=0.5) "Outer wall of top floor on east facade" annotation ( Placement(transformation( extent={{-5,-10},{5,10}}, @@ -352,7 +357,9 @@ model Structure "Ppd 12 example model" inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, azi=west, A=wBedroom*lHalfBuilding*sqrt(2), - redeclare IDEAS.Examples.PPD12.Data.Roof constructionType) + redeclare IDEAS.Examples.PPD12.Data.Roof constructionType, + hVertical=lHalfBuilding*tan(inc), + hRef_a=hzone_a) "Roof, west side" annotation (Placement(transformation( extent={{-5,-10},{5,10}}, rotation=90, From b87cb1cd062a0605892bd717b94595d5c71bc5b9 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 09:01:17 +0200 Subject: [PATCH 052/140] Squashed commit of the following: commit 121cb9cbd699f3eb6661916014c7172f4d918b01 Merge: 06aa1352d a681abfd6 Author: kldjonge <46526840+kldjonge@users.noreply.github.com> Date: Mon Aug 29 09:00:13 2022 +0200 Merge branch 'open-ideas:master' into master commit a681abfd675f63fbeed961f802c0aef3508bbe5d Author: Filip Jorissen Date: Sat Aug 27 16:04:04 2022 +0200 default value for epsSw_shading in IDEAS//Buildings/Components/Shading/Interfaces/PartialShading.mo --- IDEAS/Buildings/Components/Shading/Interfaces/PartialShading.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Shading/Interfaces/PartialShading.mo b/IDEAS/Buildings/Components/Shading/Interfaces/PartialShading.mo index a8ddb5381c..f03e09c4d4 100644 --- a/IDEAS/Buildings/Components/Shading/Interfaces/PartialShading.mo +++ b/IDEAS/Buildings/Components/Shading/Interfaces/PartialShading.mo @@ -14,7 +14,7 @@ partial model PartialShading "Window shading partial" "Long wave solar absorption coefficient of the frame"; parameter Modelica.Units.SI.Emissivity epsLw_glazing "Long wave solar absorption coefficient of the glazing"; - parameter Modelica.Units.SI.Emissivity epsSw_shading + parameter Modelica.Units.SI.Emissivity epsSw_shading = 0.8 "Short wave emissivity of the shading object"; parameter Real g_glazing(min=0,max=1) "Nominal shading coefficient of the glazing"; From b274c74233e9e2dbd7380f3c9d1916b8c93a5c0e Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 09:45:54 +0200 Subject: [PATCH 053/140] Uprotected A0, a and Hwin and moved it to Overwrite tab --- IDEAS/Fluid/Sources/OutsideAir.mo | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IDEAS/Fluid/Sources/OutsideAir.mo b/IDEAS/Fluid/Sources/OutsideAir.mo index 8026b748cc..7b6c65ba8d 100644 --- a/IDEAS/Fluid/Sources/OutsideAir.mo +++ b/IDEAS/Fluid/Sources/OutsideAir.mo @@ -29,14 +29,14 @@ model OutsideAir Modelica.Blocks.Interfaces.RealInput TDryBul_in if use_TDryBul_in "Optional override input for the dry bulb temperature" annotation( Placement(visible = true, transformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-120, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0))); -protected - parameter Real A0=sim.A0 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); + + parameter Real A0=sim.A0 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(tab="Overwrite",group="Effect of surroundings on wind")); parameter Real a=sim.a "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " - annotation(Dialog(group="Wind")); + annotation(Dialog(tab="Overwrite",group="Effect of surroundings on wind")); parameter Modelica.Units.SI.Length Hwin=sim.Hwin "Height above ground of meteorological wind speed measurement" - annotation (Dialog(group="Wind")); + annotation(Dialog(tab="Overwrite",group="Effect of surroundings on wind")); protected constant Integer s[:]= { @@ -221,4 +221,4 @@ First implementation. ")); -end OutsideAir; \ No newline at end of file +end OutsideAir;end OutsideAir; From 95e84bfe83af8b7a535ebb4a448bbd3271a8b00a Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 09:46:36 +0200 Subject: [PATCH 054/140] Fixed internal references --- IDEAS/Examples/PPD12/Structure.mo | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/IDEAS/Examples/PPD12/Structure.mo b/IDEAS/Examples/PPD12/Structure.mo index f367e77be1..04a23f4cc7 100644 --- a/IDEAS/Examples/PPD12/Structure.mo +++ b/IDEAS/Examples/PPD12/Structure.mo @@ -74,8 +74,8 @@ model Structure "Ppd 12 example model" inc=IDEAS.Types.Tilt.Floor) "Floor between hallway and bedroom 1" annotation (Placement(transformation(extent={{70,68},{80,88}}))); IDEAS.Buildings.Components.Window winBed3( - hVertical=1.2*sin(inc), - hRef_a=hzone_a + 1, + hVertical=1.2*sin(winBed3.inc), + hRef_a=winBed3.hzone_a + 1, frac=0.1, azi=east, redeclare IDEAS.Examples.PPD12.Data.PvcInsulated fraType, @@ -91,8 +91,8 @@ model Structure "Ppd 12 example model" inc=(IDEAS.Types.Tilt.Wall + IDEAS.Types.Tilt.Ceiling)/2, A=wBedroom*lHalfBuilding*sqrt(2)/2, redeclare IDEAS.Examples.PPD12.Data.Roof constructionType, - hVertical=lHalfBuilding*tan(inc), - hRef_a=hzone_a) + hVertical=lHalfBuilding*tan(Roof2.inc), + hRef_a=Roof2.hRef_a) "Roof, east side" annotation (Placement(transformation( extent={{-5,-10},{5,10}}, @@ -358,8 +358,8 @@ model Structure "Ppd 12 example model" azi=west, A=wBedroom*lHalfBuilding*sqrt(2), redeclare IDEAS.Examples.PPD12.Data.Roof constructionType, - hVertical=lHalfBuilding*tan(inc), - hRef_a=hzone_a) + hVertical=lHalfBuilding*tan(Roof1.inc), + hRef_a=Roof1.hzone_a) "Roof, west side" annotation (Placement(transformation( extent={{-5,-10},{5,10}}, rotation=90, From c39e5ccb84bbd0fc5f7a75ae82729d7f3ce2da04 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 09:49:19 +0200 Subject: [PATCH 055/140] Update OutsideAir.mo --- IDEAS/Fluid/Sources/OutsideAir.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Fluid/Sources/OutsideAir.mo b/IDEAS/Fluid/Sources/OutsideAir.mo index 7b6c65ba8d..fe69e0befa 100644 --- a/IDEAS/Fluid/Sources/OutsideAir.mo +++ b/IDEAS/Fluid/Sources/OutsideAir.mo @@ -221,4 +221,4 @@ First implementation. ")); -end OutsideAir;end OutsideAir; +end OutsideAir; From a8f089b6b9415c820ed8dfa5486da880d45a92c3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 12:06:29 +0200 Subject: [PATCH 056/140] Update Structure.mo --- IDEAS/Examples/PPD12/Structure.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Examples/PPD12/Structure.mo b/IDEAS/Examples/PPD12/Structure.mo index 04a23f4cc7..56e2d6b153 100644 --- a/IDEAS/Examples/PPD12/Structure.mo +++ b/IDEAS/Examples/PPD12/Structure.mo @@ -92,7 +92,7 @@ model Structure "Ppd 12 example model" A=wBedroom*lHalfBuilding*sqrt(2)/2, redeclare IDEAS.Examples.PPD12.Data.Roof constructionType, hVertical=lHalfBuilding*tan(Roof2.inc), - hRef_a=Roof2.hRef_a) + hRef_a=Roof2.hzone_a) "Roof, east side" annotation (Placement(transformation( extent={{-5,-10},{5,10}}, From 2d5604ae9fb8b8243de0c4b41dfd71c377bbf5d0 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 15:56:07 +0200 Subject: [PATCH 057/140] Merge fixes --- IDEAS/Buildings/Components/Window.mo | 33 ++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 3c2e295061..4348238e0f 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -83,15 +83,28 @@ model Window "Multipane window" - parameter Real coeffsCp[:,:]=[0,0.4; 45,0.1; 90,-0.3; 135,-0.35; 180,-0.2; 225, - -0.35; 270,-0.3; 315,0.1; 360,0.4] - "Cp at different angles of attack" - annotation(Dialog(tab="Airflow",group="Wind")); + replaceable parameter + IDEAS.Buildings.Data.WindPressureCoeff.Lowrise_Square_Exposed Cp_table + constrainedby IDEAS.Buildings.Data.Interfaces.WindPressureCoeff + "Tables with wind pressure coefficients for walls, floors and roofs" + annotation ( + __Dymola_choicesAllMatching=true, + Placement(transformation(extent={{-34,78},{-30,82}})), + Dialog(tab="Airflow", group="Wind Pressure")); + + parameter Real coeffsCp[:,:]= if inc<=Modelica.Constants.pi/18 then Cp_table.Cp_Roof_0_10 elseif inc<=Modelica.Constants.pi/6 then Cp_table.Cp_Roof_11_30 elseif inc<=Modelica.Constants.pi/4 then Cp_table.Cp_Roof_30_45 elseif inc==Modelica.Constants.pi then Cp_table.Cp_Floor else Cp_table.Cp_Wall + "Cp at different angles of attack, default the correct table will be selected from Cp_table based on the surface tilt" + annotation(Dialog(tab="Airflow", group="Wind Pressure")); + + parameter Boolean Use_custom_Cs = false + "if checked, Cs will be used in stead of the default related to the interzonal airflow type " + annotation(choices(checkBox=true),Dialog(enable=true,tab="Airflow", group="Wind Pressure")); + parameter Real Cs=sim.Cs "Wind speed modifier" - annotation (Dialog(tab="Airflow", group="Wind")); + annotation (Dialog(enable=Use_custom_Cs,tab="Airflow", group="Wind Pressure")); - parameter Real Habs=1 + final parameter Real Habs=hfloor_a + hRef_a + (hVertical/2) "Absolute height of boundary for correcting the wind speed" annotation (Dialog(tab="Airflow", group="Wind")); @@ -182,8 +195,10 @@ protected annotation (Placement(transformation(extent={{-20,-12},{0,-32}}))); Fluid.Sources.OutsideAir outsideAir( redeclare package Medium = Medium, - Cs=Cs, - Habs=Habs, azi = aziInt, + Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + then (outsideAir.A0*outsideAir.A0)*((Habs/outsideAir.Hwin)^(2* + outsideAir.a)) elseif not Use_custom_Cs then sim.Cs else Cs, + Habs=Habs, final azi = aziInt, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then (if use_trickle_vent then 2 else 1) else (if use_trickle_vent then 3 else 2), table = coeffsCp, use_TDryBul_in = true) if sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None @@ -467,4 +482,4 @@ Adjusted implementation for grouping of solar calculations. ")); -end Window; \ No newline at end of file +end Window; From 1a8139b9650c1c7841ba0e8bf59199018654f7b4 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Mon, 29 Aug 2022 16:42:13 +0200 Subject: [PATCH 058/140] Update Window.mo --- IDEAS/Buildings/Components/Window.mo | 34 ++++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 4348238e0f..76ac5bb616 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -26,9 +26,13 @@ model Window "Multipane window" linIntCon=true, checkCoatings=glazing.checkLowPerformanceGlazing), setArea(A=A_glass*nWin), + hRef_a=if inc == 0 then hzone_a else (hzone_a - hVertical)/2, + hVertical=if inc == Modelica.Constants.pi or inc == 0 then 0 else min(hzone_a, sqrt(A)), q50_zone(v50_surf=q50_internal*A_glass), - res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass), - res2(A=A_glass/2)); + res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, + h_a=(Habs - sim.Hpres) + 0.25*hVertical), + res2(A=A_glass/2, + h_a=(Habs - sim.Hpres) - 0.25*hVertical)); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); @@ -74,10 +78,8 @@ model Window "Multipane window" Modelica.Blocks.Interfaces.RealInput Ctrl if controlled "Control signal between 0 and 1, i.e. 1 is fully closed" annotation ( Placement(visible = true,transformation( - origin={-50,-110},extent={{20,-20},{-20,20}}, rotation=-90), iconTransformation( - origin={-40,-100},extent={{10,-10},{-10,10}}, rotation=-90))); @@ -104,7 +106,7 @@ model Window "Multipane window" "Wind speed modifier" annotation (Dialog(enable=Use_custom_Cs,tab="Airflow", group="Wind Pressure")); - final parameter Real Habs=hfloor_a + hRef_a + (hVertical/2) + final parameter Real Habs(fixed=false) "Absolute height of boundary for correcting the wind speed" annotation (Dialog(tab="Airflow", group="Wind")); @@ -198,14 +200,19 @@ protected Cs=if not Use_custom_Cs and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then (outsideAir.A0*outsideAir.A0)*((Habs/outsideAir.Hwin)^(2* outsideAir.a)) elseif not Use_custom_Cs then sim.Cs else Cs, - Habs=Habs, final azi = aziInt, + Habs=Habs, + final azi = aziInt, nPorts=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort - then (if use_trickle_vent then 2 else 1) else (if use_trickle_vent then 3 else 2), table = coeffsCp, use_TDryBul_in = true) + then (if use_trickle_vent then 2 else 1) else (if use_trickle_vent then 3 else 2), + table = coeffsCp, + use_TDryBul_in = true) if sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None "Outside air model" annotation (Placement(transformation(extent={{-40,-100},{-20,-80}}))); + initial equation QTra_design = (U_value*A + (if fraType.briTyp.present then fraType.briTyp.G else 0)) *(273.15 + 21 - Tdes.y); + Habs =hfloor_a + hRef_a + (hVertical/2); assert(not use_trickle_vent or sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None, "In " + getInstanceName() + ": Trickle vents can only be enabled when sim.interZonalAirFlowType is not None."); @@ -267,7 +274,7 @@ equation connect(heaCapGlaExt.port, layMul.port_b) annotation ( Line(points = {{-10, -12}, {-10, 0}}, color = {191, 0, 0})); connect(res1.port_a, outsideAir.ports[1]) annotation ( - Line(points = {{20, -40}, {16, -40}, {16, -90}, {-20, -90}}, color = {0, 127, 255})); + Line(points={{20,-36},{16,-36},{16,-90},{-20,-90}}, color = {0, 127, 255})); connect(res2.port_a, outsideAir.ports[2]) annotation ( Line(points = {{20, -60}, {16, -60}, {16, -90}, {-20, -90}}, color = {0, 127, 255})); connect(trickleVent.port_a, outsideAir.ports[if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 2 else 3]) annotation ( @@ -286,12 +293,15 @@ equation connect(shaType.hForcedConExt, radSolData.hForcedConExt) annotation ( Line(points={{-68.5,-32.7043},{-76,-32.7043},{-76,-62.2},{-79.4,-62.2}}, color = {0, 0, 127})); - connect(outsideAir.TDryBul_in, shaType.TDryBul) annotation( - Line(points = {{-42, -90}, {-46, -90}, {-46, -48}, {-58, -48}}, color = {0, 0, 127})); + connect(outsideAir.TDryBul_in, shaType.TDryBul) annotation ( + Line(points={{-42,-90},{-46,-90},{-46,-49.4895},{-57.5,-49.4895}}, + color = {0, 0, 127})); annotation ( Icon(coordinateSystem(preserveAspectRatio=true, extent={{-60,-100},{60,100}}), - graphics={Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, extent = {{-50, -90}, {50, 100}}), - Polygon(fillColor = {255, 255, 170}, pattern = LinePattern.None, fillPattern = FillPattern.Solid, points = {{-46, 60}, {50, 24}, {50, -50}, {-30, -20}, {-46, -20}, {-46, 60}}), + graphics={Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, + fillPattern = FillPattern.Solid, extent = {{-50, -90}, {50, 100}}), + Polygon(fillColor = {255, 255, 170}, pattern = LinePattern.None, + fillPattern = FillPattern.Solid, points = {{-46, 60}, {50, 24}, {50, -50}, {-30, -20}, {-46, -20}, {-46, 60}}), Line( points={{-50,60},{-30,60},{-30,80},{50,80}}, color={175,175,175}), From 62a2a9505d64a38b8c0bd1f24e5b55f345af6f0d Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 31 Aug 2022 10:17:00 +0200 Subject: [PATCH 059/140] Simple TwoPort model that still works. Made to test simple model with two-port implementation >> Error not in calculation of reference heights or density column model. But this case is single zone (+without internal wall) --- IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo | 5 +++++ IDEAS/Examples/Benchmark/package.order | 1 + 2 files changed, 6 insertions(+) create mode 100644 IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo diff --git a/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo b/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo new file mode 100644 index 0000000000..551fd2f605 --- /dev/null +++ b/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo @@ -0,0 +1,5 @@ +within IDEAS.Examples.Benchmark; +model ScalingComponentsTwoPort + extends ScalingComponents(sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, + n50=1.6)); +end ScalingComponentsTwoPort; diff --git a/IDEAS/Examples/Benchmark/package.order b/IDEAS/Examples/Benchmark/package.order index c9dcc5401e..e2f8c551fc 100644 --- a/IDEAS/Examples/Benchmark/package.order +++ b/IDEAS/Examples/Benchmark/package.order @@ -1,3 +1,4 @@ ScalingBuildings ScalingComponents +ScalingComponentsTwoPort ScalingEnvelopeFreeFloat From 45e58d98f74be08e9da45f6f0e9c8fef36117a4a Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 15:16:43 +0200 Subject: [PATCH 060/140] Implementation using Multi-Port in partial surf --- .../Components/Interfaces/PartialSurface.mo | 19 +++++++++++++++---- IDEAS/Buildings/Components/InternalWall.mo | 17 ++++++++++------- IDEAS/Buildings/Components/Window.mo | 7 ++++--- 3 files changed, 29 insertions(+), 14 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index a081785b8d..bd1318d4c3 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -123,6 +123,13 @@ partial model PartialSurface "Partial model for building envelope component" + Modelica.Fluid.Fittings.MultiPort multiPort1(redeclare package Medium = Medium, + nPorts_b=1) if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + annotation (Placement(transformation(extent={{48,-42},{44,-30}}))); + Modelica.Fluid.Fittings.MultiPort multiPort2(redeclare package Medium = Medium, + nPorts_b=1) if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + annotation (Placement(transformation(extent={{50,-64},{46,-54}}))); + protected parameter Boolean add_cracks = true "Add cracks"; @@ -417,10 +424,6 @@ equation points={{70,20.2105},{60,20.2105},{60,20},{56,20}}, color={255,204,51}, thickness=0.5)); - connect(res1.port_b, propsBusInt.port_1) annotation (Line(points={{40,-36},{50, - -36},{50,19.91},{56.09,19.91}}, color={0,127,255})); - connect(res2.port_b, propsBusInt.port_2) annotation (Line(points={{40,-60},{50, - -60},{50,19.91},{56.09,19.91}}, color={0,127,255})); connect(setArea.areaPort, sim.areaPort); connect(q50_zone.v50, propsBusInt.v50) annotation (Line(points={{79,-58},{56,-58}, {56,-20},{56.09,-20},{56.09,19.91}}, color={0,0,127})); @@ -436,6 +439,14 @@ equation -47.6},{80,-47.6},{80,-48},{56.09,-48},{56.09,19.91}}, color={0,0,127})); connect(q50_zone.dummy_h[2], propsBusInt.hfloor) annotation (Line(points={{79.4, -45.6},{80,-45.6},{80,-46},{56.09,-46},{56.09,19.91}}, color={0,0,127})); + connect(multiPort1.port_a, propsBusInt.port_1) annotation (Line(points={{48,-36}, + {48,20},{56.09,20},{56.09,19.91}}, color={0,127,255})); + connect(multiPort2.port_a, propsBusInt.port_2) annotation (Line(points={{50,-59}, + {50,20},{56.09,20},{56.09,19.91}}, color={0,127,255})); + connect(res1.port_b, multiPort1.ports_b[1]) annotation (Line(points={{40,-36}, + {44,-36}}, color={0,127,255})); + connect(res2.port_b, multiPort2.ports_b[1]) annotation (Line(points={{40,-60}, + {46,-60},{46,-59}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}})), diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index bd31372730..c2af69e5c6 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -11,7 +11,9 @@ model InternalWall "interior opaque wall between two zones" final QTra_design=U_value*A*(TRef_a - TRef_b), q50_zone(v50_surf=0), res1(h_a=-0.5*hzone_b + 0.25*hVertical + hRef_b), - res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b)); + res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b), + multiPort1(nPorts_b=if hasCavity then 2 else 1), + multiPort2(nPorts_b=if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then 2 else 1)); //using custom q50 since this model is not an external component parameter Boolean linIntCon_b=sim.linIntCon @@ -200,10 +202,6 @@ equation connect(theConDoor.port_b, propsBusInt.surfCon) annotation (Line(points={{10,40}, {46,40},{46,19.91},{56.09,19.91}}, color={191,0,0})); - connect(dooOpe.port_a2, propsBusInt.port_1) annotation (Line(points={{10,86},{ - 38,86},{38,19.91},{56.09,19.91}}, color={0,127,255})); - connect(dooOpe.port_b1, propsBusInt.port_2) annotation (Line(points={{10,98},{ - 42,98},{42,19.91},{56.09,19.91}}, color={0,127,255})); connect(dooOpe.port_a1, propsBus_b.port_2) annotation (Line(points={{-10,98},{ -42,98},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,86},{ @@ -221,10 +219,15 @@ equation {-30,20},{-44,20},{-44,20.1},{-100.1,20.1}}, color={0,127,255})); connect(col_b_pos.port_a, resDoor.port_a) annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); - connect(col_a_pos.port_b, propsBusInt.port_1) annotation (Line(points={{26,42}, - {26,19.91},{56.09,19.91}}, color={0,127,255})); connect(col_a_pos.port_a, resDoor.port_b) annotation (Line(points={{26,62},{26,68},{10,68}}, color={0,127,255})); + connect(dooOpe.port_b1, multiPort1.ports_b[2]) + annotation (Line(points={{10,98},{44,98},{44,-36}}, color={0,127,255})); + connect(dooOpe.port_a2, multiPort2.ports_b[2]) + annotation (Line(points={{10,86},{42,86},{42,-59},{46,-59}}, + color={0,127,255})); + connect(col_a_pos.port_b, multiPort1.ports_b[2]) annotation (Line(points={{26,42}, + {26,28},{44,28},{44,-36}}, color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false,extent={{-60,-100},{60,100}}), graphics={ diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index 76ac5bb616..e8e4b341df 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -32,7 +32,8 @@ model Window "Multipane window" res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=(Habs - sim.Hpres) + 0.25*hVertical), res2(A=A_glass/2, - h_a=(Habs - sim.Hpres) - 0.25*hVertical)); + h_a=(Habs - sim.Hpres) - 0.25*hVertical), + multiPort1(nPorts_b=if use_trickle_vent then 2 else 1)); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); @@ -279,8 +280,6 @@ equation Line(points = {{20, -60}, {16, -60}, {16, -90}, {-20, -90}}, color = {0, 127, 255})); connect(trickleVent.port_a, outsideAir.ports[if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 2 else 3]) annotation ( Line(points = {{20, -78}, {16, -78}, {16, -92}, {-2, -92}, {-2, -90}, {-20, -90}}, color = {0, 127, 255})); - connect(trickleVent.port_b, propsBusInt.port_1) annotation ( - Line(points = {{40, -78}, {50, -78}, {50, 19.91}, {56.09, 19.91}}, color = {0, 127, 255})); connect(radSolData.Te, shaType.Te) annotation ( Line(points={{-79.4,-64},{-68.5,-64},{-68.5,-29.9067}}, color = {0, 0, 127})); connect(shaType.port_frame, layFra.port_b) annotation ( @@ -296,6 +295,8 @@ equation connect(outsideAir.TDryBul_in, shaType.TDryBul) annotation ( Line(points={{-42,-90},{-46,-90},{-46,-49.4895},{-57.5,-49.4895}}, color = {0, 0, 127})); + connect(trickleVent.port_b, multiPort1.ports_b[2]) annotation (Line(points={{40, + -78},{44,-78},{44,-29},{46,-29}}, color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=true, extent={{-60,-100},{60,100}}), graphics={Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, From 1e4fd131197b5b6430d86206fb097a70a06f5eb5 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 15:17:18 +0200 Subject: [PATCH 061/140] Deleted ScalingComponentsTwoPort --- IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo | 5 ----- IDEAS/Examples/Benchmark/package.order | 1 - 2 files changed, 6 deletions(-) delete mode 100644 IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo diff --git a/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo b/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo deleted file mode 100644 index 551fd2f605..0000000000 --- a/IDEAS/Examples/Benchmark/ScalingComponentsTwoPort.mo +++ /dev/null @@ -1,5 +0,0 @@ -within IDEAS.Examples.Benchmark; -model ScalingComponentsTwoPort - extends ScalingComponents(sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts, - n50=1.6)); -end ScalingComponentsTwoPort; diff --git a/IDEAS/Examples/Benchmark/package.order b/IDEAS/Examples/Benchmark/package.order index e2f8c551fc..c9dcc5401e 100644 --- a/IDEAS/Examples/Benchmark/package.order +++ b/IDEAS/Examples/Benchmark/package.order @@ -1,4 +1,3 @@ ScalingBuildings ScalingComponents -ScalingComponentsTwoPort ScalingEnvelopeFreeFloat From 7f4b7aae01c1bff3031f2fced8fba819893e053c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 15:46:51 +0200 Subject: [PATCH 062/140] Multiport at propsbus_b of internal wall. --- IDEAS/Buildings/Components/InternalWall.mo | 36 ++++++++++++++++------ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index c2af69e5c6..198b3468cd 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -155,6 +155,17 @@ public IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort annotation (Placement(transformation(extent={{16,42},{36,62}}))); + Modelica.Fluid.Fittings.MultiPort multiPort_b1(redeclare package Medium = Medium, + nPorts_b=if hasCavity then 2 else 1) if add_cracks and sim.interZonalAirFlowType + <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + annotation (Placement(transformation(extent={{-70,22},{-66,34}}))); + Modelica.Fluid.Fittings.MultiPort multiPort_b2( redeclare package Medium = Medium, + nPorts_b=if hasCavity and sim.interZonalAirFlowType + == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then 2 + else 1) if add_cracks and sim.interZonalAirFlowType + == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + annotation (Placement(transformation(extent={{-70,6},{-66,16}}))); + initial equation hzone_b = propsBus_b.hzone; hfloor_b= propsBus_b.hfloor; @@ -202,21 +213,11 @@ equation connect(theConDoor.port_b, propsBusInt.surfCon) annotation (Line(points={{10,40}, {46,40},{46,19.91},{56.09,19.91}}, color={191,0,0})); - connect(dooOpe.port_a1, propsBus_b.port_2) annotation (Line(points={{-10,98},{ - -42,98},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,86},{ - -38,86},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(res1.port_a, propsBus_b.port_1) annotation (Line(points={{20,-36},{-60, - -36},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(res2.port_a, propsBus_b.port_2) annotation (Line(points={{20,-60},{-60, - -60},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); connect(q50_zone.v50, propsBus_b.v50) annotation (Line(points={{79,-58},{56, -58},{56,20.1},{-100.1,20.1}}, color={0,0,127})); connect(q50_zone.using_custom_q50, propsBus_b.use_custom_q50) annotation (Line(points={{79,-52}, {56,-52},{56,20.1},{-100.1,20.1}}, color={0,0,127})); - connect(col_b_pos.port_b, propsBus_b.port_1) annotation (Line(points={{-30,42}, - {-30,20},{-44,20},{-44,20.1},{-100.1,20.1}}, color={0,127,255})); connect(col_b_pos.port_a, resDoor.port_a) annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); connect(col_a_pos.port_a, resDoor.port_b) @@ -228,6 +229,21 @@ equation color={0,127,255})); connect(col_a_pos.port_b, multiPort1.ports_b[2]) annotation (Line(points={{26,42}, {26,28},{44,28},{44,-36}}, color={0,127,255})); + connect(res2.port_a, multiPort_b2.ports_b[1]) annotation (Line(points={{20,-60}, + {-62,-60},{-62,11},{-66,11}}, color={0,127,255})); + connect(res1.port_a, multiPort_b1.ports_b[1]) annotation (Line(points={{20,-36}, + {-58,-36},{-58,28},{-66,28}}, color={0,127,255})); + connect(col_b_pos.port_b, multiPort_b1.ports_b[2]) + annotation (Line(points={{-30,42},{-30,28},{-66,28}}, color={0,127,255})); + connect(dooOpe.port_a1, multiPort_b1.ports_b[2]) annotation (Line(points={{-10,98}, + {-54,98},{-54,28},{-66,28}}, color={0,127,255})); + connect(dooOpe.port_b2, multiPort_b2.ports_b[2]) annotation (Line(points={{-10,86}, + {-52,86},{-52,11},{-66,11}}, color={0,127,255})); + connect(multiPort_b1.port_a, propsBus_b.port_1) annotation (Line(points={{-70, + 28},{-72,28},{-72,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(multiPort_b2.port_a, propsBus_b.port_2) annotation (Line(points={{-70,11}, + {-72,11},{-72,20.1},{-100.1,20.1}}, + color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false,extent={{-60,-100},{60,100}}), graphics={ From 514718d9dd1755a4b1aea258e612999df4d88ec4 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 17:23:50 +0200 Subject: [PATCH 063/140] Use resDoo <> opeDoo when the opening is horizontal Optimization for horizontal openings where more then 1 orifice (like in the door model) is not necessary. --- IDEAS/Buildings/Components/InternalWall.mo | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 198b3468cd..581fe216c3 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -13,7 +13,7 @@ model InternalWall "interior opaque wall between two zones" res1(h_a=-0.5*hzone_b + 0.25*hVertical + hRef_b), res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b), multiPort1(nPorts_b=if hasCavity then 2 else 1), - multiPort2(nPorts_b=if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then 2 else 1)); + multiPort2(nPorts_b=if useDooOpe then 2 else 1)); //using custom q50 since this model is not an external component parameter Boolean linIntCon_b=sim.linIntCon @@ -123,7 +123,11 @@ protected if hasCavity and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "Thermal-only model for open door" annotation (Placement(transformation(extent={{-10,30},{10,50}}))); + public + final parameter Boolean useDooOpe=hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and inc<>0 and inc<>Modelica.Constants.pi; + final parameter Boolean useResDoor=hasCavity and not useDooOpe; + IDEAS.Airflow.Multizone.DoorDiscretizedOpen dooOpe( redeclare package Medium = Medium, wOpe=w, @@ -132,14 +136,14 @@ public hB=(hzone_b/2) - hRef_b, nCom=if Ope_hvert==0 then 2 else 4, CD=CD) - if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + if useDooOpe "2-port model for open door" annotation (Placement(transformation(extent={{-10,82},{10,102}}))); Airflow.Multizone.Orifice resDoor( redeclare package Medium = Medium, A=w*h, CD=CD) - if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort + if useResDoor "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); @@ -147,23 +151,20 @@ public Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_b_pos(redeclare package Medium = Medium, h=-0.5*hzone_b + 0.5*Ope_hvert + hRef_b) - if hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort - annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); + if useResDoor annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + 0.5 - *Ope_hvert + hRef_a) if hasCavity and sim.interZonalAirFlowType == - IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort - annotation (Placement(transformation(extent={{16,42},{36,62}}))); + *Ope_hvert + hRef_a) + if useResDoor annotation (Placement(transformation(extent={{16,42},{36,62}}))); Modelica.Fluid.Fittings.MultiPort multiPort_b1(redeclare package Medium = Medium, - nPorts_b=if hasCavity then 2 else 1) if add_cracks and sim.interZonalAirFlowType - <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None + nPorts_b=if hasCavity then 2 else 1) + if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None annotation (Placement(transformation(extent={{-70,22},{-66,34}}))); + Modelica.Fluid.Fittings.MultiPort multiPort_b2( redeclare package Medium = Medium, - nPorts_b=if hasCavity and sim.interZonalAirFlowType - == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then 2 - else 1) if add_cracks and sim.interZonalAirFlowType - == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts + nPorts_b=if useDooOpe then 2 else 1) + if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation (Placement(transformation(extent={{-70,6},{-66,16}}))); initial equation @@ -222,11 +223,10 @@ equation annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); connect(col_a_pos.port_a, resDoor.port_b) annotation (Line(points={{26,62},{26,68},{10,68}}, color={0,127,255})); - connect(dooOpe.port_b1, multiPort1.ports_b[2]) - annotation (Line(points={{10,98},{44,98},{44,-36}}, color={0,127,255})); - connect(dooOpe.port_a2, multiPort2.ports_b[2]) - annotation (Line(points={{10,86},{42,86},{42,-59},{46,-59}}, + connect(dooOpe.port_b1, multiPort1.ports_b[2]) annotation (Line(points={{10,98},{44,98},{44,-36}}, color={0,127,255})); + connect(dooOpe.port_a2, multiPort2.ports_b[2]) annotation (Line(points={{10,86},{42,86},{42,-59},{46,-59}}, color={0,127,255})); + connect(col_a_pos.port_b, multiPort1.ports_b[2]) annotation (Line(points={{26,42}, {26,28},{44,28},{44,-36}}, color={0,127,255})); connect(res2.port_a, multiPort_b2.ports_b[1]) annotation (Line(points={{20,-60}, From e212fca2b0830d946bb02393eca15155b0ff7a99 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 17:52:57 +0200 Subject: [PATCH 064/140] Debug. ResDoor should not appear when interzonalairflow.non --- IDEAS/Buildings/Components/InternalWall.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 581fe216c3..bbe09d0e0a 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -126,7 +126,7 @@ protected public final parameter Boolean useDooOpe=hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and inc<>0 and inc<>Modelica.Constants.pi; - final parameter Boolean useResDoor=hasCavity and not useDooOpe; + final parameter Boolean useResDoor=hasCavity and not useDooOpe and not sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None; IDEAS.Airflow.Multizone.DoorDiscretizedOpen dooOpe( redeclare package Medium = Medium, From 94fe7f47c264614a57a69a58c24960aca2d6d1b3 Mon Sep 17 00:00:00 2001 From: kldjonge Date: Wed, 7 Sep 2022 18:32:04 +0200 Subject: [PATCH 065/140] Got rid of weird if statement --- .../Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo index 7aa580a37c..17bd7ca516 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo @@ -60,8 +60,8 @@ equation V_flow = m_flow/Medium.density(sta_b); - dp = if h > 0 then port_a.p - port_b.p else -port_a.p + port_b.p; - dp = -abs(h)*rho*Modelica.Constants.g_n; + dp = port_a.p - port_b.p; + dp=-h*rho*Modelica.Constants.g_n; // Isenthalpic state transformation (no storage and no loss of energy) port_a.h_outflow = inStream(port_b.h_outflow); From 586c7b95eed52a1c06e4c109f19aaeaf7c54fc2c Mon Sep 17 00:00:00 2001 From: kldjonge Date: Fri, 9 Sep 2022 20:09:38 +0200 Subject: [PATCH 066/140] Revert tricklevent implementation --- .../Components/Interfaces/PartialSurface.mo | 19 ++----- IDEAS/Buildings/Components/InternalWall.mo | 51 +++++++------------ IDEAS/Buildings/Components/Window.mo | 7 ++- 3 files changed, 25 insertions(+), 52 deletions(-) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index bd1318d4c3..a081785b8d 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -123,13 +123,6 @@ partial model PartialSurface "Partial model for building envelope component" - Modelica.Fluid.Fittings.MultiPort multiPort1(redeclare package Medium = Medium, - nPorts_b=1) if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None - annotation (Placement(transformation(extent={{48,-42},{44,-30}}))); - Modelica.Fluid.Fittings.MultiPort multiPort2(redeclare package Medium = Medium, - nPorts_b=1) if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - annotation (Placement(transformation(extent={{50,-64},{46,-54}}))); - protected parameter Boolean add_cracks = true "Add cracks"; @@ -424,6 +417,10 @@ equation points={{70,20.2105},{60,20.2105},{60,20},{56,20}}, color={255,204,51}, thickness=0.5)); + connect(res1.port_b, propsBusInt.port_1) annotation (Line(points={{40,-36},{50, + -36},{50,19.91},{56.09,19.91}}, color={0,127,255})); + connect(res2.port_b, propsBusInt.port_2) annotation (Line(points={{40,-60},{50, + -60},{50,19.91},{56.09,19.91}}, color={0,127,255})); connect(setArea.areaPort, sim.areaPort); connect(q50_zone.v50, propsBusInt.v50) annotation (Line(points={{79,-58},{56,-58}, {56,-20},{56.09,-20},{56.09,19.91}}, color={0,0,127})); @@ -439,14 +436,6 @@ equation -47.6},{80,-47.6},{80,-48},{56.09,-48},{56.09,19.91}}, color={0,0,127})); connect(q50_zone.dummy_h[2], propsBusInt.hfloor) annotation (Line(points={{79.4, -45.6},{80,-45.6},{80,-46},{56.09,-46},{56.09,19.91}}, color={0,0,127})); - connect(multiPort1.port_a, propsBusInt.port_1) annotation (Line(points={{48,-36}, - {48,20},{56.09,20},{56.09,19.91}}, color={0,127,255})); - connect(multiPort2.port_a, propsBusInt.port_2) annotation (Line(points={{50,-59}, - {50,20},{56.09,20},{56.09,19.91}}, color={0,127,255})); - connect(res1.port_b, multiPort1.ports_b[1]) annotation (Line(points={{40,-36}, - {44,-36}}, color={0,127,255})); - connect(res2.port_b, multiPort2.ports_b[1]) annotation (Line(points={{40,-60}, - {46,-60},{46,-59}}, color={0,127,255})); annotation ( Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{ 100,100}})), diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index bbe09d0e0a..c93bd97eab 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -11,9 +11,8 @@ model InternalWall "interior opaque wall between two zones" final QTra_design=U_value*A*(TRef_a - TRef_b), q50_zone(v50_surf=0), res1(h_a=-0.5*hzone_b + 0.25*hVertical + hRef_b), - res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b), - multiPort1(nPorts_b=if hasCavity then 2 else 1), - multiPort2(nPorts_b=if useDooOpe then 2 else 1)); + res2(h_a=-0.5*hzone_b + 0.75*hVertical + hRef_b)); + //using custom q50 since this model is not an external component parameter Boolean linIntCon_b=sim.linIntCon @@ -157,16 +156,6 @@ public *Ope_hvert + hRef_a) if useResDoor annotation (Placement(transformation(extent={{16,42},{36,62}}))); - Modelica.Fluid.Fittings.MultiPort multiPort_b1(redeclare package Medium = Medium, - nPorts_b=if hasCavity then 2 else 1) - if add_cracks and sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None - annotation (Placement(transformation(extent={{-70,22},{-66,34}}))); - - Modelica.Fluid.Fittings.MultiPort multiPort_b2( redeclare package Medium = Medium, - nPorts_b=if useDooOpe then 2 else 1) - if add_cracks and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts - annotation (Placement(transformation(extent={{-70,6},{-66,16}}))); - initial equation hzone_b = propsBus_b.hzone; hfloor_b= propsBus_b.hfloor; @@ -214,6 +203,20 @@ equation connect(theConDoor.port_b, propsBusInt.surfCon) annotation (Line(points={{10,40}, {46,40},{46,19.91},{56.09,19.91}}, color={191,0,0})); + + connect(dooOpe.port_a2, propsBusInt.port_1) annotation (Line(points={{10,86},{ + 38,86},{38,19.91},{56.09,19.91}}, color={0,127,255})); + connect(dooOpe.port_b1, propsBusInt.port_2) annotation (Line(points={{10,98},{ + 42,98},{42,19.91},{56.09,19.91}}, color={0,127,255})); + connect(dooOpe.port_a1, propsBus_b.port_2) annotation (Line(points={{-10,98},{ + -42,98},{-42,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(dooOpe.port_b2, propsBus_b.port_1) annotation (Line(points={{-10,86},{ + -38,86},{-38,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(res1.port_a, propsBus_b.port_1) annotation (Line(points={{20,-36},{-60, + -36},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(res2.port_a, propsBus_b.port_2) annotation (Line(points={{20,-60},{-60, + -60},{-60,20.1},{-100.1,20.1}}, color={0,127,255})); + connect(q50_zone.v50, propsBus_b.v50) annotation (Line(points={{79,-58},{56, -58},{56,20.1},{-100.1,20.1}}, color={0,0,127})); connect(q50_zone.using_custom_q50, propsBus_b.use_custom_q50) annotation (Line(points={{79,-52}, @@ -221,29 +224,11 @@ equation connect(col_b_pos.port_a, resDoor.port_a) annotation (Line(points={{-30,62},{-30,68},{-10,68}}, color={0,127,255})); + connect(col_a_pos.port_b, propsBusInt.port_1) annotation (Line(points={{26,42}, + {26,19.91},{56.09,19.91}}, color={0,127,255})); connect(col_a_pos.port_a, resDoor.port_b) annotation (Line(points={{26,62},{26,68},{10,68}}, color={0,127,255})); - connect(dooOpe.port_b1, multiPort1.ports_b[2]) annotation (Line(points={{10,98},{44,98},{44,-36}}, color={0,127,255})); - connect(dooOpe.port_a2, multiPort2.ports_b[2]) annotation (Line(points={{10,86},{42,86},{42,-59},{46,-59}}, - color={0,127,255})); - connect(col_a_pos.port_b, multiPort1.ports_b[2]) annotation (Line(points={{26,42}, - {26,28},{44,28},{44,-36}}, color={0,127,255})); - connect(res2.port_a, multiPort_b2.ports_b[1]) annotation (Line(points={{20,-60}, - {-62,-60},{-62,11},{-66,11}}, color={0,127,255})); - connect(res1.port_a, multiPort_b1.ports_b[1]) annotation (Line(points={{20,-36}, - {-58,-36},{-58,28},{-66,28}}, color={0,127,255})); - connect(col_b_pos.port_b, multiPort_b1.ports_b[2]) - annotation (Line(points={{-30,42},{-30,28},{-66,28}}, color={0,127,255})); - connect(dooOpe.port_a1, multiPort_b1.ports_b[2]) annotation (Line(points={{-10,98}, - {-54,98},{-54,28},{-66,28}}, color={0,127,255})); - connect(dooOpe.port_b2, multiPort_b2.ports_b[2]) annotation (Line(points={{-10,86}, - {-52,86},{-52,11},{-66,11}}, color={0,127,255})); - connect(multiPort_b1.port_a, propsBus_b.port_1) annotation (Line(points={{-70, - 28},{-72,28},{-72,20.1},{-100.1,20.1}}, color={0,127,255})); - connect(multiPort_b2.port_a, propsBus_b.port_2) annotation (Line(points={{-70,11}, - {-72,11},{-72,20.1},{-100.1,20.1}}, - color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=false,extent={{-60,-100},{60,100}}), graphics={ diff --git a/IDEAS/Buildings/Components/Window.mo b/IDEAS/Buildings/Components/Window.mo index e8e4b341df..76ac5bb616 100644 --- a/IDEAS/Buildings/Components/Window.mo +++ b/IDEAS/Buildings/Components/Window.mo @@ -32,8 +32,7 @@ model Window "Multipane window" res1(A=if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts then A_glass/2 else A_glass, h_a=(Habs - sim.Hpres) + 0.25*hVertical), res2(A=A_glass/2, - h_a=(Habs - sim.Hpres) - 0.25*hVertical), - multiPort1(nPorts_b=if use_trickle_vent then 2 else 1)); + h_a=(Habs - sim.Hpres) - 0.25*hVertical)); parameter Boolean linExtCon=sim.linExtCon "= true, if exterior convective heat transfer should be linearised (uses average wind speed)" annotation(Dialog(tab="Convection")); @@ -280,6 +279,8 @@ equation Line(points = {{20, -60}, {16, -60}, {16, -90}, {-20, -90}}, color = {0, 127, 255})); connect(trickleVent.port_a, outsideAir.ports[if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort then 2 else 3]) annotation ( Line(points = {{20, -78}, {16, -78}, {16, -92}, {-2, -92}, {-2, -90}, {-20, -90}}, color = {0, 127, 255})); + connect(trickleVent.port_b, propsBusInt.port_1) annotation ( + Line(points = {{40, -78}, {50, -78}, {50, 19.91}, {56.09, 19.91}}, color = {0, 127, 255})); connect(radSolData.Te, shaType.Te) annotation ( Line(points={{-79.4,-64},{-68.5,-64},{-68.5,-29.9067}}, color = {0, 0, 127})); connect(shaType.port_frame, layFra.port_b) annotation ( @@ -295,8 +296,6 @@ equation connect(outsideAir.TDryBul_in, shaType.TDryBul) annotation ( Line(points={{-42,-90},{-46,-90},{-46,-49.4895},{-57.5,-49.4895}}, color = {0, 0, 127})); - connect(trickleVent.port_b, multiPort1.ports_b[2]) annotation (Line(points={{40, - -78},{44,-78},{44,-29},{46,-29}}, color={0,127,255})); annotation ( Icon(coordinateSystem(preserveAspectRatio=true, extent={{-60,-100},{60,100}}), graphics={Rectangle(fillColor = {255, 255, 255}, pattern = LinePattern.None, From 52381f39b2f6ab246e139493389d4431f09949c3 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Wed, 21 Sep 2022 14:39:43 +0200 Subject: [PATCH 067/140] code cleanups --- .../BaseClasses/ReversibleDensityColumn.mo | 67 +++++++--------- .../Components/Interfaces/PartialSurface.mo | 78 +++++++++---------- 2 files changed, 66 insertions(+), 79 deletions(-) diff --git a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo index 17bd7ca516..f831d0982c 100644 --- a/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo +++ b/IDEAS/Airflow/Multizone/BaseClasses/ReversibleDensityColumn.mo @@ -1,44 +1,49 @@ within IDEAS.Airflow.Multizone.BaseClasses; model ReversibleDensityColumn "Vertical shaft with no friction and no storage of heat and mass, reversible because it can handle negative column heights" - - replaceable package Medium = - Modelica.Media.Interfaces.PartialMedium "Medium in the component" - annotation (choices( + replaceable package Medium = IDEAS.Media.Air + "Medium in the component" + annotation (choices( choice(redeclare package Medium = IDEAS.Media.Air "Moist air"))); - parameter Modelica.Units.SI.Length h=3 "Height of shaft"; + parameter Modelica.Units.SI.Length h = 3 "Height of shaft"; Modelica.Fluid.Interfaces.FluidPort_a port_a( -redeclare package Medium = Medium, -p(start=Medium.p_default)) -"Fluid connector a (positive design flow direction is from port_a to port_b)" + redeclare package Medium = Medium, + p(start=Medium.p_default)) + "Fluid connector a (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{-10,90},{10,110}}), iconTransformation(extent={{-10,90},{10,110}}))); Modelica.Fluid.Interfaces.FluidPort_b port_b( -redeclare package Medium = Medium, -p(start=Medium.p_default)) -"Fluid connector b (positive design flow direction is from port_a to port_b)" + redeclare package Medium = Medium, + p(start=Medium.p_default)) + "Fluid connector b (positive design flow direction is from port_a to port_b)" annotation (Placement(transformation(extent={{10,-110},{-10,-90}}), iconTransformation(extent={{10,-110},{-10,-90}}))); - Modelica.Units.SI.VolumeFlowRate V_flow -"Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; - Modelica.Units.SI.MassFlowRate m_flow -"Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; - Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") -"Pressure difference between port_a and port_b"; - Modelica.Units.SI.Density rho "Density in medium column"; + Modelica.Units.SI.VolumeFlowRate V_flow = m_flow/Medium.density(sta_b) + "Volume flow rate at inflowing port (positive when flow from port_a to port_b)"; + Modelica.Units.SI.MassFlowRate m_flow = port_a.m_flow + "Mass flow rate from port_a to port_b (m_flow > 0 is design flow direction)"; + Modelica.Units.SI.PressureDifference dp(displayUnit="Pa") = port_a.p - port_b.p + "Pressure difference between port_a and port_b"; + Modelica.Units.SI.Density rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( + p=Medium.p_default, + T=Medium.temperature(Medium.setState_phX( + port_b.p, + inStream(port_b.h_outflow), + Xi)), + X_w=if Medium.nXi == 0 then 0 else Xi[1]) + "Density in medium column"; protected Medium.ThermodynamicState sta_b=Medium.setState_phX( - port_b.p, - actualStream(port_b.h_outflow), - actualStream(port_b.Xi_outflow)) "Medium properties in port_a"; - Medium.MassFraction Xi[Medium.nXi] "Mass fraction used to compute density"; + port_b.p, + actualStream(port_b.h_outflow), + actualStream(port_b.Xi_outflow)) + "Medium properties in port_a"; + Medium.MassFraction Xi[Medium.nXi] = inStream(port_b.Xi_outflow) + "Mass fraction used to compute density"; equation - // Design direction of mass flow rate - m_flow = port_a.m_flow; - // Pressure difference between ports // Xi is computed first as it is used in two expression, and in one // of them only one component is used. @@ -49,18 +54,6 @@ equation // of a medium that takes enthalpy as an argument would be dangerous // as different media can have different datum for the enthalpy. - Xi = inStream(port_b.Xi_outflow); - rho = IDEAS.Utilities.Psychrometrics.Functions.density_pTX( - p=Medium.p_default, - T=Medium.temperature(Medium.setState_phX( - port_b.p, - inStream(port_b.h_outflow), - Xi)), - X_w=if Medium.nXi == 0 then 0 else Xi[1]); - - V_flow = m_flow/Medium.density(sta_b); - - dp = port_a.p - port_b.p; dp=-h*rho*Modelica.Constants.g_n; // Isenthalpic state transformation (no storage and no loss of energy) diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index a081785b8d..0ef3be16b5 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -180,65 +180,59 @@ protected model PowerLaw_q50_stack - - replaceable package Medium = Modelica.Media.Interfaces.PartialMedium constrainedby - Modelica.Media.Interfaces.PartialMedium annotation ( + "Power law pressure drop with integrated stack effect" + replaceable package Medium = Modelica.Media.Interfaces.PartialMedium + constrainedby Modelica.Media.Interfaces.PartialMedium + annotation ( __Dymola_choicesAllMatching=true); + outer BoundaryConditions.SimInfoManager sim + annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); + parameter Modelica.Units.SI.Area A "Surface area"; + parameter Real m=0.65 "Flow exponent"; + parameter Real h_a=0 "Column height, height at port_a" annotation (Dialog(group="Flow Path")); + parameter Real h_b=0 "Column height, height at port_b" annotation (Dialog(group="Flow Path")); + parameter Real q50 "Leaked volume flow rate per unit A at 50Pa"; + final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); - parameter Modelica.Units.SI.Area A - "Surface area"; - - parameter Real m=0.65; - final parameter Boolean StackEff= sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts "True if stack effect is used" annotation(Evaluate=true); - - - parameter Real h_a=0 "column height, height at port_a" annotation (Dialog(group="Flow Path")); - parameter Real h_b=0 "column height, height at port_b" annotation (Dialog(group="Flow Path")); - parameter Real q50 - "Leaked volume flow rate per unit A at 50Pa"; - - Modelica.Fluid.Interfaces.FluidPort_a port_a(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{-110,-10}, + Modelica.Fluid.Interfaces.FluidPort_a port_a( + redeclare package Medium =Medium) + "Port a" annotation (Placement(transformation(rotation=0, extent={{-110,-10}, {-90,10}}), iconTransformation(extent={{-110,-10},{-90,10}}))); - Modelica.Fluid.Interfaces.FluidPort_b port_b(redeclare package Medium =Medium) annotation (Placement(transformation(rotation=0, extent={{90,-10}, + Modelica.Fluid.Interfaces.FluidPort_b port_b( + redeclare package Medium =Medium) + "Port b" annotation (Placement(transformation(rotation=0, extent={{90,-10}, {110,10}}), iconTransformation(extent={{90,-10},{110,10}}))); - - outer BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{80,-100},{100,-80}}))); - - Airflow.Multizone.Point_m_flow - res1( - redeclare package Medium = Medium, - final forceErrorControlOnFlow=false, - m=m, - useDefaultProperties= not StackEff, - dpMea_nominal=50, - mMea_flow_nominal=A*(q50*1.2)/3600) - "Middle or bottom crack " - annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); - - Airflow.Multizone.BaseClasses.ReversibleDensityColumn - col_a_pos( + IDEAS.Airflow.Multizone.Point_m_flow res1( + redeclare package Medium = Medium, + final forceErrorControlOnFlow=false, + m=m, + useDefaultProperties= not StackEff, + dpMea_nominal=50, + mMea_flow_nominal=A*(q50*1.2)/3600) + "Middle or bottom crack " + annotation (Placement(transformation(extent={{-10,-10},{10,10}}))); + IDEAS.Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_a_pos( redeclare package Medium = Medium, h=h_a) if StackEff annotation (Placement(transformation(extent={{-70,-10},{-50,10}}))); - Airflow.Multizone.BaseClasses.ReversibleDensityColumn - col_b_pos( + + IDEAS.Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_b_pos( redeclare package Medium = Medium, h=h_b) if StackEff annotation (Placement(transformation(extent={{50,-10},{70,10}}))); - Fluid.FixedResistances.LosslessPipe No_stack_a( + IDEAS.Fluid.FixedResistances.LosslessPipe No_stack_a( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=A*q50*1.2/3600) - if not StackEff + m_flow_nominal=A*q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{-68,30},{-48,50}}))); - Fluid.FixedResistances.LosslessPipe No_stack_b( + IDEAS.Fluid.FixedResistances.LosslessPipe No_stack_b( redeclare package Medium = Medium, allowFlowReversal=true, - m_flow_nominal=A*q50*1.2/3600) - if not StackEff + m_flow_nominal=A*q50*1.2/3600) + if not StackEff annotation (Placement(transformation(extent={{50,30},{70,50}}))); From ad7b6c9798655e38aaffa3283a102b518ec20663 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Wed, 12 Oct 2022 21:44:05 +0200 Subject: [PATCH 068/140] revised cardinality --- IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo index 2764720e6e..955f656f90 100644 --- a/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo +++ b/IDEAS/Buildings/Components/Interfaces/ZoneInterface.mo @@ -98,7 +98,7 @@ initial equation for i in 1:nPorts loop assert(cardinality(ports[i])<=2, "Each element of ports should have zero or one external connections but " + - getInstanceName() +".ports[" + String(i) + "] has " + String(cardinality(ports[i]) - 1) + "." + + getInstanceName() +".ports[" + String(i) + "] has less." + " This can cause air to mix at the fluid port, without entering the zone, which is usually unintended. Instead, increase nPorts and create a separate connection.", level=AssertionLevel.warning); From cd1d89ea770ced628a0bd0a24ecec3bee6663517 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Sat, 15 Oct 2022 15:26:16 +0200 Subject: [PATCH 069/140] not adding cracks when there is an open door in IDEAS/Buildings/Components/InternalWall.mo --- IDEAS/Buildings/Components/InternalWall.mo | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index c93bd97eab..180cc6de78 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -2,6 +2,7 @@ within IDEAS.Buildings.Components; model InternalWall "interior opaque wall between two zones" extends IDEAS.Buildings.Components.Interfaces.PartialOpaqueSurface( final use_custom_q50=true, + add_cracks=not useDooOpe, custom_q50=if inc==0 or inc == Modelica.Constants.pi then 0 else 2, final nWin=1, dT_nominal_a=1, @@ -138,6 +139,7 @@ public if useDooOpe "2-port model for open door" annotation (Placement(transformation(extent={{-10,82},{10,102}}))); + Airflow.Multizone.Orifice resDoor( redeclare package Medium = Medium, A=w*h, @@ -145,16 +147,14 @@ public if useResDoor "1-port model for open door" annotation (Placement(transformation(extent={{-10,58},{10,78}}))); - - - Airflow.Multizone.BaseClasses.ReversibleDensityColumn - col_b_pos(redeclare package Medium = Medium, h=-0.5*hzone_b + - 0.5*Ope_hvert + hRef_b) + Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_b_pos( + redeclare package Medium = Medium, + h=-0.5*hzone_b + 0.5*Ope_hvert + hRef_b) if useResDoor annotation (Placement(transformation(extent={{-40,42},{-20,62}}))); - Airflow.Multizone.BaseClasses.ReversibleDensityColumn - col_a_pos(redeclare package Medium = Medium, h=-0.5*hzone_a + 0.5 - *Ope_hvert + hRef_a) - if useResDoor annotation (Placement(transformation(extent={{16,42},{36,62}}))); + Airflow.Multizone.BaseClasses.ReversibleDensityColumn col_a_pos( + redeclare package Medium = Medium, + h=-0.5*hzone_a + 0.5 *Ope_hvert + hRef_a) + if useResDoor annotation (Placement(transformation(extent={{16,42},{36,62}}))); initial equation hzone_b = propsBus_b.hzone; From bb48952a95b06dad2165b621aba7ff1a0bddbcdc Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Sun, 18 Dec 2022 09:25:51 +0100 Subject: [PATCH 070/140] parameter revisions for #1244 --- .../Interfaces/PartialSimInfoManager.mo | 19 ++++++++++++------- .../Components/Interfaces/PartialSurface.mo | 4 ++-- IDEAS/Buildings/Components/InternalWall.mo | 12 ++++++------ IDEAS/Buildings/Components/OuterWall.mo | 8 +++++--- IDEAS/Buildings/Components/Window.mo | 12 +++++++----- IDEAS/Fluid/Sources/OutsideAir.mo | 19 +++++++------------ 6 files changed, 39 insertions(+), 35 deletions(-) diff --git a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo index 3de5ee9058..79931dd375 100644 --- a/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo +++ b/IDEAS/BoundaryConditions/Interfaces/PartialSimInfoManager.mo @@ -103,16 +103,21 @@ partial model PartialSimInfoManager parameter Modelica.Units.SI.Length H=10 "Building or roof height" annotation (Dialog(group="Wind")); - parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " annotation(Dialog(group="Wind")); + parameter Real A0=0.6 "Local terrain constant. 0.6 for Suburban,0.35 for Urban and 1 for Unshielded (Ashrae 1993) " + annotation(Dialog(group="Wind")); parameter Real a=0.28 "Velocity profile exponent. 0.28 for Suburban, 0.4 for Urban and 0.15 for Unshielded (Ashrae 1993) " - annotation(Dialog(group="Wind")); - parameter Modelica.Units.SI.Length Hwin=10 + annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hwind=10 "Height above ground of meteorological wind speed measurement" annotation (Dialog(group="Wind")); - parameter Modelica.Units.SI.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" annotation(Dialog(group="Wind")); - - - parameter Real Cs= (A0*A0)*((H/Hwin)^(2*a)) "Wind speed modifier" + parameter Real Cs_coeff = (A0*A0)*((1/Hwind)^(2*a)) "Multiplication factor for Habs" + annotation(Dialog(group="Wind")); + parameter Modelica.Units.SI.Length Hpres=1 "Height above ground of meteorological ambient pressure measurement" + annotation(Dialog(group="Wind")); + constant Modelica.Units.SI.Density rho_default = 1.2 "Default air density" + annotation(Dialog(group="Wind")); + + parameter Real Cs= Cs_coeff*H "Wind speed modifier" annotation(Dialog(group="Wind")); diff --git a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo index 0ef3be16b5..1ac680a703 100644 --- a/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo +++ b/IDEAS/Buildings/Components/Interfaces/PartialSurface.mo @@ -55,8 +55,8 @@ partial model PartialSurface "Partial model for building envelope component" final parameter Real hzone_a( fixed=false);//connected with propsbus in inital equation final parameter Real hfloor_a( fixed=false); - parameter Real hVertical=if inc==Modelica.Constants.pi or inc==0 then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); - parameter Real hRef_a= if inc==0 then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " + parameter Real hVertical=if IDEAS.Utilities.Math.Functions.isAngle(inc,Modelica.Constants.pi) or IDEAS.Utilities.Math.Functions.isAngle(inc,0) then 0 else hzone_a "Vertical surface height, height of the surface projected to the vertical, 0 for floors and ceilings" annotation(Evaluate=true); + parameter Real hRef_a= if IDEAS.Utilities.Math.Functions.isAngle(inc,0) then hzone_a else 0 "Height above the zone floor at propsbus_a. Height where the surface starts. e.g. 0 for walls at floor level and floors. " annotation(Evaluate=true); final parameter Real Habs_surf=hfloor_a+hRef_a+(hVertical/2) "Absolute height of the middle of the surface, can be used to check the heights after initialisation"; diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index 180cc6de78..a2181e0177 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -3,7 +3,7 @@ model InternalWall "interior opaque wall between two zones" extends IDEAS.Buildings.Components.Interfaces.PartialOpaqueSurface( final use_custom_q50=true, add_cracks=not useDooOpe, - custom_q50=if inc==0 or inc == Modelica.Constants.pi then 0 else 2, + custom_q50=if IDEAS.Utilities.Math.Functions.isAngle(inc,0) or IDEAS.Utilities.Math.Functions.isAngle(inc, Modelica.Constants.pi) then 0 else 2, final nWin=1, dT_nominal_a=1, E(y=if sim.computeConservationOfEnergy then layMul.E else 0), @@ -76,7 +76,7 @@ model InternalWall "interior opaque wall between two zones" final parameter Real hzone_b(fixed=false); final parameter Real hfloor_b(fixed=false); - parameter Real hRef_b=if inc== Modelica.Constants.pi then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; + parameter Real hRef_b=if IDEAS.Utilities.Math.Functions.isAngle(inc, Modelica.Constants.pi) then hzone_b else 0 "Height above the zone floor at propsbus_b. Height where the surface starts. e.g. 0 for walls at floor level and floors. "; @@ -125,7 +125,7 @@ protected annotation (Placement(transformation(extent={{-10,30},{10,50}}))); public - final parameter Boolean useDooOpe=hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and inc<>0 and inc<>Modelica.Constants.pi; + final parameter Boolean useDooOpe=hasCavity and sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and (not IDEAS.Utilities.Math.Functions.isAngle(inc,0) and not IDEAS.Utilities.Math.Functions.isAngle(inc,Modelica.Constants.pi)); final parameter Boolean useResDoor=hasCavity and not useDooOpe and not sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None; IDEAS.Airflow.Multizone.DoorDiscretizedOpen dooOpe( @@ -134,7 +134,7 @@ public hOpe=Ope_hvert, hA=(hzone_a/2) - hRef_a, hB=(hzone_b/2) - hRef_b, - nCom=if Ope_hvert==0 then 2 else 4, + nCom=if abs(Ope_hvert)hfloor_b, getInstanceName()+ "is a ceiling, but the floor of the zone at probsbus_b lies above the floor of zone at probsbus_a, this is probably a mistake",level=AssertionLevel.warning); - //assert(inc==Modelica.Constants.pi and hfloor_ahfloor_b, getInstanceName()+ "is a ceiling, but the floor of the zone at probsbus_b lies above the floor of zone at probsbus_a, this is probably a mistake",level=AssertionLevel.warning); + //assert(IDEAS.Utilities.Math.Functions.isAngle(inc,Modelica.Constants.pi) and hfloor_a Date: Sun, 18 Dec 2022 09:56:46 +0100 Subject: [PATCH 071/140] comment indent --- IDEAS/Buildings/Components/InternalWall.mo | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/InternalWall.mo b/IDEAS/Buildings/Components/InternalWall.mo index a2181e0177..091c347db5 100644 --- a/IDEAS/Buildings/Components/InternalWall.mo +++ b/IDEAS/Buildings/Components/InternalWall.mo @@ -61,7 +61,7 @@ model InternalWall "interior opaque wall between two zones" outputAngles=sim.outputAngles, final use_port_1=sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None, final use_port_2=sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts) - "If inc = Floor, then propsbus_b should be connected to the zone below this floor. + "If inc = Floor, then propsbus_b should be connected to the zone below this floor. If inc = Ceiling, then propsbus_b should be connected to the zone above this ceiling." annotation (Placement(transformation(extent={{-20,-20},{20,20}}, rotation=90, @@ -70,7 +70,6 @@ model InternalWall "interior opaque wall between two zones" rotation=90, origin={-50,20}))); - parameter Real CD=0.78 "Discharge coefficient of cavity" annotation (Dialog(tab="Airflow")); final parameter Real hzone_b(fixed=false); From 83f1f21a1d1d19d1a06c7b3e85fefba2caca532c Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Sun, 18 Dec 2022 10:41:45 +0100 Subject: [PATCH 072/140] fixed singular system error for #1244 --- IDEAS/Buildings/Components/BoundaryWall.mo | 2 +- IDEAS/Buildings/Components/SlabOnGround.mo | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/BoundaryWall.mo b/IDEAS/Buildings/Components/BoundaryWall.mo index 8b440c7d94..0861c000a9 100644 --- a/IDEAS/Buildings/Components/BoundaryWall.mo +++ b/IDEAS/Buildings/Components/BoundaryWall.mo @@ -49,7 +49,7 @@ model BoundaryWall "Opaque wall with optional prescribed heat flow rate or tempe Fluid.Sources.MassFlowSource_T boundary2( redeclare package Medium = Medium, nPorts=1, - final m_flow=0) + final m_flow=1e-10) if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation (Placement(transformation(extent={{-28,-76},{-8,-56}}))); protected diff --git a/IDEAS/Buildings/Components/SlabOnGround.mo b/IDEAS/Buildings/Components/SlabOnGround.mo index e0091f265c..d0844e6b02 100644 --- a/IDEAS/Buildings/Components/SlabOnGround.mo +++ b/IDEAS/Buildings/Components/SlabOnGround.mo @@ -42,7 +42,7 @@ model SlabOnGround "opaque floor on ground slab" IDEAS.Fluid.Sources.MassFlowSource_T boundary2( redeclare package Medium = Medium, nPorts=1, - final m_flow=0) + final m_flow=1e-10) if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts annotation (Placement(transformation(extent={{-28,-76},{-8,-56}}))); protected From 0567df57105a814e467fdfb230db4d63ea426b93 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Wed, 28 Dec 2022 11:42:13 +0100 Subject: [PATCH 073/140] WallUnitTest update for interzonal airflow v2 --- .../Components/Examples/WallUnitTest.mo | 23 ++++---- .../Components/Interfaces/DummyConnection.mo | 52 ++++++++++--------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo index b9e3747d81..aadb7531f9 100644 --- a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo +++ b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo @@ -1,7 +1,9 @@ within IDEAS.Buildings.Components.Examples; model WallUnitTest "Unit test for verifying results for all wall components" + package Medium = IDEAS.Media.Air; extends Modelica.Icons.Example; BoundaryWall boundaryWall( + redeclare package Medium=Medium, redeclare Data.Constructions.CavityWall constructionType, inc=IDEAS.Types.Tilt.Wall, azi=IDEAS.Types.Azimuth.S, @@ -9,6 +11,7 @@ model WallUnitTest "Unit test for verifying results for all wall components" use_T_in=true) "Boundary wall example" annotation (Placement(transformation(extent={{-36,60},{-26,80}}))); InternalWall internalWall( + redeclare package Medium=Medium, inc=IDEAS.Types.Tilt.Wall, azi=IDEAS.Types.Azimuth.S, A=2, @@ -17,6 +20,7 @@ model WallUnitTest "Unit test for verifying results for all wall components" "Internal wall example" annotation (Placement(transformation(extent={{-36,20},{-24,40}}))); OuterWall outerWall( + redeclare package Medium=Medium, inc=IDEAS.Types.Tilt.Wall, azi=IDEAS.Types.Azimuth.S, A=2, @@ -24,28 +28,27 @@ model WallUnitTest "Unit test for verifying results for all wall components" "Outer wall example" annotation (Placement(transformation(extent={{-36,-20},{-26,0}}))); SlabOnGround slabOnGround( + redeclare package Medium=Medium, inc=IDEAS.Types.Tilt.Floor, azi=IDEAS.Types.Azimuth.S, A=2, redeclare Validation.Data.Constructions.HeavyFloor constructionType) "Slab on ground example" annotation (Placement(transformation(extent={{-36,-60},{-26,-40}}))); -public - inner BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{-100,80},{-80,100}}))); -public + inner BoundaryConditions.SimInfoManager sim(interZonalAirFlowType = IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts) annotation( + Placement(transformation(extent = {{-100, 80}, {-80, 100}}))); Modelica.Blocks.Sources.Constant Tconst(k=300) "Constant temperature boundary condition" annotation (Placement(transformation(extent={{-80,60},{-60,80}}))); - Interfaces.DummyConnection dummyConnection(isZone=true) + Interfaces.DummyConnection dummyConnection(redeclare package Medium=Medium, isZone=true) annotation (Placement(transformation(extent={{20,60},{0,80}}))); - Interfaces.DummyConnection dummyConnection1(isZone=true) + Interfaces.DummyConnection dummyConnection1(redeclare package Medium=Medium, isZone=true) annotation (Placement(transformation(extent={{20,20},{0,40}}))); - Interfaces.DummyConnection dummyConnection2(isZone=true) + Interfaces.DummyConnection dummyConnection2(redeclare package Medium=Medium, isZone=true) annotation (Placement(transformation(extent={{20,-20},{0,0}}))); - Interfaces.DummyConnection dummyConnection3(isZone=true) + Interfaces.DummyConnection dummyConnection3(redeclare package Medium=Medium, isZone=true) annotation (Placement(transformation(extent={{20,-60},{0,-40}}))); - Interfaces.DummyConnection dummyConnection4(isZone=true) + Interfaces.DummyConnection dummyConnection4(redeclare package Medium=Medium, isZone=true) annotation (Placement(transformation(extent={{-80,20},{-60,40}}))); equation connect(Tconst.y, boundaryWall.T) annotation (Line(points={{-59,70},{-48,70}, @@ -98,4 +101,4 @@ First implementation. ")); -end WallUnitTest; +end WallUnitTest; \ No newline at end of file diff --git a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo index 30d1ada8c7..335385ef5d 100644 --- a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo +++ b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo @@ -3,6 +3,8 @@ model DummyConnection "Source generator/sink for propsbus" parameter Boolean isZone = false "Set to true when connecting to a surface"; parameter Real A=1 "Surface area" annotation(Dialog(enable=not isZone)); + replaceable package Medium = + Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.Units.SI.HeatFlowRate surfCon=0 "Fixed heat flow rate for surfCon" annotation (Dialog(enable=not isZone)); parameter Modelica.Units.SI.HeatFlowRate iSolDir=0 @@ -12,12 +14,11 @@ model DummyConnection "Source generator/sink for propsbus" parameter Modelica.Units.SI.Temperature T=293.15 "Fixed temperature for surfRad, or zone when isZone"; - outer IDEAS.BoundaryConditions.SimInfoManager sim - annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); + outer IDEAS.BoundaryConditions.SimInfoManager sim annotation (Placement(transformation(extent={{-100,20},{-80,40}}))); IDEAS.Buildings.Components.Interfaces.ZoneBus zoneBus( - redeclare package Medium = IDEAS.Media.Air, - outputAngles=sim.outputAngles, - numIncAndAziInBus=sim.numIncAndAziInBus) + redeclare package Medium = Medium, + numIncAndAziInBus=sim.numIncAndAziInBus, + outputAngles=sim.outputAngles, use_port_1 = sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None, use_port_2 = sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts) annotation (Placement(transformation(extent={{80,-22},{120,18}}))); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow prescribedHeatFlow[3]( Q_flow={surfCon,iSolDif,iSolDir}) @@ -26,7 +27,7 @@ model DummyConnection "Source generator/sink for propsbus" Modelica.Blocks.Sources.Constant area(k=A) if not isZone annotation (Placement(transformation(extent={{0,40},{20,60}}))); Modelica.Blocks.Sources.Constant eps(k=0.88) if not isZone - annotation (Placement(transformation(extent={{0,80},{20,100}}))); + annotation (Placement(visible = true, transformation(origin = {0, 0}, extent = {{0, 80}, {20, 100}}, rotation = 0))); Modelica.Blocks.Sources.Constant QTra(k=A) if not isZone annotation (Placement(transformation(extent={{0,0},{20,20}}))); @@ -54,6 +55,10 @@ model DummyConnection "Source generator/sink for propsbus" annotation (Placement(transformation(extent={{-80,-100},{-60,-80}}))); Modelica.Blocks.Sources.BooleanConstant custom_q50(k=false) if not isZone annotation (Placement(transformation(extent={{-80,-130},{-60,-110}}))); + Modelica.Blocks.Sources.Constant hZone(k = 0.88) if isZone "Zone height" annotation( + Placement(visible = true, transformation(origin = {-42, -16}, extent = {{0, 80}, {20, 100}}, rotation = 0))); + IDEAS.Fluid.Sources.Boundary_pT bou(redeclare package Medium= IDEAS.Media.Air, nPorts = 2) if isZone annotation( + Placement(visible = true, transformation(origin = {-30, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0))); equation connect(prescribedHeatFlow[1].port, zoneBus.surfCon) annotation (Line( points={{-50,20},{62,20},{62,-1.9},{100.1,-1.9}}, @@ -68,13 +73,11 @@ equation color={191,0,0}, smooth=Smooth.None)); connect(eps.y, zoneBus.epsLw) annotation (Line( - points={{21,90},{100.1,90},{100.1,-1.9}}, - color={0,0,127}, - smooth=Smooth.None)); + points = {{21, 90}, {100.1, 90}, {100.1, -1.9}}, + color={0,0,127})); connect(eps.y, zoneBus.epsSw) annotation (Line( - points={{21,90},{100,90},{100,34},{100.1,34},{100.1,-1.9}}, - color={0,0,127}, - smooth=Smooth.None)); + points = {{21, 90}, {100, 90}, {100, 34}, {100.1, 34}, {100.1, -1.9}}, + color={0,0,127})); connect(area.y, zoneBus.area) annotation (Line( points={{21,50},{100.1,50},{100.1,-1.9}}, color={0,0,127}, @@ -132,17 +135,18 @@ equation connect(custom_q50.y, zoneBus.use_custom_q50) annotation (Line(points={{-59, -120},{100.1,-120},{100.1,-1.9}}, color={255,0,255})); - annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100, - -100},{100,100}})), Icon(coordinateSystem( - preserveAspectRatio=false, extent={{-100,-100},{100,100}}), graphics={ - Line( - points={{60,60},{-60,-60}}, - color={0,0,255}, - smooth=Smooth.None), Line( - points={{-60,60},{60,-60}}, - color={0,0,255}, - smooth=Smooth.None)}), - Documentation(revisions=" + connect(hZone.y, zoneBus.hzone) annotation( + Line(points = {{-20, 74}, {100, 74}, {100, -2}}, color = {0, 0, 127})); + connect(hZone.y, zoneBus.hfloor) annotation( + Line(points = {{-20, 74}, {100, 74}, {100, -2}}, color = {0, 0, 127})); + connect(bou.ports[2], zoneBus.port_2) annotation( + Line(points = {{-20, 40}, {100, 40}, {100, -2}}, color = {255, 204, 51})); + connect(bou.ports[1], zoneBus.port_1) annotation( + Line(points = {{-20, 40}, {100, 40}, {100, -2}}, color = {255, 204, 51})); + annotation( + Diagram(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}})), + Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-100, -100}, {100, 100}}), graphics = {Line(points = {{60, 60}, {-60, -60}}, color = {0, 0, 255}), Line(points = {{-60, 60}, {60, -60}}, color = {0, 0, 255})}), + Documentation(revisions = "
  • May 23, 2022, by Filip Jorissen:
    @@ -164,4 +168,4 @@ See
")); -end DummyConnection; +end DummyConnection; \ No newline at end of file From 5a3ccadfadee84f9633a25b8b0ef34891fcd96cf Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Mon, 2 Jan 2023 16:29:44 +0100 Subject: [PATCH 074/140] newlines at the end of files --- IDEAS/Buildings/Components/Examples/WallUnitTest.mo | 3 ++- IDEAS/Buildings/Components/Interfaces/DummyConnection.mo | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo index aadb7531f9..682a84ed46 100644 --- a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo +++ b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo @@ -101,4 +101,5 @@ First implementation. ")); -end WallUnitTest; \ No newline at end of file +end WallUnitTest; + diff --git a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo index 335385ef5d..e89b0d3d55 100644 --- a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo +++ b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo @@ -168,4 +168,5 @@ See ")); -end DummyConnection; \ No newline at end of file +end DummyConnection; + From b7c34aa84fb55affbdaad908cd90409670619184 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Mon, 2 Jan 2023 16:30:59 +0100 Subject: [PATCH 075/140] newline fix --- IDEAS/Buildings/Components/Examples/WallUnitTest.mo | 1 - IDEAS/Buildings/Components/Interfaces/DummyConnection.mo | 1 - 2 files changed, 2 deletions(-) diff --git a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo index 682a84ed46..088b165b8b 100644 --- a/IDEAS/Buildings/Components/Examples/WallUnitTest.mo +++ b/IDEAS/Buildings/Components/Examples/WallUnitTest.mo @@ -102,4 +102,3 @@ First implementation. ")); end WallUnitTest; - diff --git a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo index e89b0d3d55..23845a66f2 100644 --- a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo +++ b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo @@ -169,4 +169,3 @@ See ")); end DummyConnection; - From a11680f39d2fb59d597051ac0830b81978c710a9 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Mon, 2 Jan 2023 16:33:50 +0100 Subject: [PATCH 076/140] revision history and code formatting --- IDEAS/Buildings/Components/Interfaces/DummyConnection.mo | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo index 23845a66f2..d53f49a3ab 100644 --- a/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo +++ b/IDEAS/Buildings/Components/Interfaces/DummyConnection.mo @@ -18,7 +18,9 @@ model DummyConnection "Source generator/sink for propsbus" IDEAS.Buildings.Components.Interfaces.ZoneBus zoneBus( redeclare package Medium = Medium, numIncAndAziInBus=sim.numIncAndAziInBus, - outputAngles=sim.outputAngles, use_port_1 = sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None, use_port_2 = sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts) + outputAngles=sim.outputAngles, + use_port_1 = sim.interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.None, + use_port_2 = sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts) annotation (Placement(transformation(extent={{80,-22},{120,18}}))); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow prescribedHeatFlow[3]( Q_flow={surfCon,iSolDif,iSolDir}) @@ -149,6 +151,10 @@ equation Documentation(revisions = "