Skip to content

Commit

Permalink
Reapply "Merge remote-tracking branch master into project_itz_fixes_v…
Browse files Browse the repository at this point in the history
…2 (issue 1337)"

This reverts commit 841a907.
  • Loading branch information
jelgerjansen committed Jan 20, 2025
1 parent 3091670 commit f903f6b
Show file tree
Hide file tree
Showing 11 changed files with 200 additions and 70 deletions.
34 changes: 24 additions & 10 deletions IDEAS/Buildings/Components/BoundaryWall.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,36 @@ model BoundaryWall "Opaque wall with optional prescribed heat flow rate or tempe
final custom_q50=0,
final use_custom_q50=true,
final nWin=1,
QTra_design=U_value*A*(273.15 + 21 - TRef_a),
dT_nominal_a=-1,
add_door=false,
final QTra_design(fixed=false),
layMul(disableInitPortB=use_T_in or use_T_fixed, monLay(monLayDyn(each
addRes_b=(sim.lineariseDymola and (use_T_in or use_T_fixed))))));

parameter Boolean use_T_in = false
"Use a temperature boundary condition which is read from the input connector T_in"
annotation(Dialog(group="Boundary conditions"));
parameter Boolean use_T_fixed = false
"Get the boundary temperature from the input connector"
"Use a fixed temperature boundary condition which is read from the parameter T_fixed"
annotation(Dialog(group="Boundary conditions"));
parameter Modelica.Units.SI.Temperature T_fixed=294.15
"Fixed boundary temperature"
annotation (Dialog(group="Boundary conditions", enable=use_T_fixed));
parameter Boolean use_T_in = false
"Get the boundary temperature from the input connector"
annotation(Dialog(group="Boundary conditions"));
annotation (Dialog(group="Boundary conditions",enable=use_T_fixed));
parameter Modelica.Units.SI.Temperature T_in_nom=T_fixed
"Nominal boundary temperature, for calculation of design heat loss"
annotation (Dialog(group="Design power", tab="Advanced",enable=use_T_fixed or use_T_in));
parameter Boolean use_Q_in = false
"Get the boundary heat flux from the input connector"
"Use a heat flow boundary condition which is read from the input connection Q_in"
annotation(Dialog(group="Boundary conditions"));

parameter Modelica.Units.SI.HeatFlowRate Q_in_nom=0
"Nominal boundary heat flux, for calculation of design heat loss (positive if entering the wall)"
annotation (Dialog(group="Design power", tab="Advanced", enable=use_Q_in));
Modelica.Blocks.Interfaces.RealInput T if use_T_in
"Input for boundary temperature" annotation (Placement(
transformation(extent={{-120,10},{-100,30}}),iconTransformation(extent={{-120,10},
{-100,30}})));
Modelica.Blocks.Interfaces.RealInput Q_flow if use_Q_in
"Input for boundary heat flow rate entering the wall" annotation (Placement(
"Input for boundary heat flow rate entering the wall (positive)" annotation (Placement(
transformation(extent={{-120,-30},{-100,-10}}),
iconTransformation(extent={{-120,
-30},{-100,-10}})));
Expand Down Expand Up @@ -70,6 +75,8 @@ protected
IDEAS.Buildings.Components.Interfaces.WeaBus weaBus(final numSolBus=sim.numIncAndAziInBus,
outputAngles=sim.outputAngles) "Weather bus"
annotation (Placement(transformation(extent={{40,-80},{60,-60}})));
initial equation
QTra_design=if use_T_in or use_T_fixed then U_value*A*(TRefZon - T_in_nom) else -Q_in_nom;
equation
assert(not (use_T_in and use_Q_in or use_T_in and use_T_fixed or use_Q_in and use_T_fixed),
"In "+getInstanceName()+": Only one of the following options can be used simultaneously: use_T_in, use_Q_in, use_T_fixed");
Expand Down Expand Up @@ -137,11 +144,18 @@ to enable an input for a prescribed boundary condition temperature or heat flow
Alternatively, parameters <code>use_T_fixed</code> and <code>T_fixed</code> can be used
to specify a fixed boundary condition temperature.
It is not allowed to enabled multiple of these three options.
If all are disabled then an adiabatic boundary (<code>Q_flow=0</code>) is used.
If all are disabled, an adiabatic boundary (<code>Q_flow=0</code>) is used.</p>
Parameters <code>T_in_nom</code> and <code>Q_in_nom</code> are used for the calculation
of heat losses, when the temperature boundary condition and heat flow boundary condition are applied, respectively.
</p>
</html>", revisions = "<html>
<ul>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Update calculation of transmission design losses.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
<li>
Februari 18, 2024, by Filip Jorissen:<br/>
Modifications for supporting trickle vents and interzonal airflow.
</li>
Expand Down
25 changes: 21 additions & 4 deletions IDEAS/Buildings/Components/Interfaces/DummyConnection.mo
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ model DummyConnection "Source generator/sink for propsbus"
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 = 3) if isZone annotation(
Placement(visible = true, transformation(origin = {-30, 40}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Modelica.Blocks.Sources.Constant TRefZon(k=T) if isZone
annotation (Placement(transformation(extent={{-40,60},{-20,80}})));

equation
connect(prescribedHeatFlow[1].port, zoneBus.surfCon) annotation (Line(
points={{-50,20},{62,20},{62,-1.9},{100.1,-1.9}},
Expand Down Expand Up @@ -147,12 +150,26 @@ equation
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 = "<html>
connect(TRefZon.y, zoneBus.TRefZon) annotation (Line(points={{-19,70},{100.1,70},
{100.1,-1.9}}, color={0,0,127}));
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="<html>
<ul>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Assign value for <code>TRefZon</code> in the bus connector.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
<li>
January 2, 2023, by Filip Jorissen:<br/>
Added support for stack effect airflow.
</li>
Expand Down
13 changes: 8 additions & 5 deletions IDEAS/Buildings/Components/Interfaces/PartialSurface.mo
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,7 @@ partial model PartialSurface "Partial model for building envelope component"
annotation (Dialog(group="Design power",tab="Advanced"));
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.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"));
annotation (Dialog(tab="Dynamics", group="Initial condition"));
parameter Boolean linIntCon_a=sim.linIntCon
"= true, if convective heat transfer should be linearised"
annotation (Dialog(tab="Convection"));
Expand Down Expand Up @@ -137,6 +133,9 @@ protected
Modelica.Thermal.HeatTransfer.Sources.PrescribedHeatFlow prescribedHeatFlowQgai
"Component for computing conservation of energy";

Modelica.Units.SI.Temperature TRefZon=propsBusInt.TRefZon
"Reference zone temperature for calculation of design heat load";

IDEAS.Buildings.Components.Interfaces.ZoneBusVarMultiplicator gain(redeclare
package Medium = Medium, k=nWin)
"Gain for all propsBus variable to represent nWin surfaces instead of 1"
Expand Down Expand Up @@ -269,6 +268,10 @@ equation
Documentation(revisions="<html>
<ul>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Add variable <code>TRefZon</code> to be used when calculating <code>QTra_design</code>.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
October 30, 2024, by Klaas De Jonge and Filip Jorissen:<br/>
Additions for supporting interzonal airflow: use of crackoroperabledoor model, default column height implementation for stack-effect.
</li>
Expand Down
26 changes: 19 additions & 7 deletions IDEAS/Buildings/Components/Interfaces/PartialZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,16 @@ model PartialZone "Building zone model"
parameter Boolean calculateViewFactor = false
"Explicit calculation of view factors: works well only for rectangular zones!"
annotation(Dialog(tab="Advanced", group="Radiative heat exchange"));
parameter Modelica.Units.SI.Temperature TZon_design=294.15
"Reference zone temperature for calculation of design heat load"
annotation (Dialog(group="Design heat load", tab="Advanced"));
final parameter Modelica.Units.SI.Power QInf_design=1012*1.204*V/3600*n50_int
/n50toAch*(273.15 + 21 - sim.Tdes)
/n50toAch*(TZon_design - sim.Tdes)
"Design heat losses from infiltration at reference outdoor temperature";
final parameter Modelica.Units.SI.Power QRH_design=A*fRH
"Additional power required to compensate for the effects of intermittent heating";
final parameter Modelica.Units.SI.Power Q_design(fixed=false)
"Total design heat losses for the zone";
"Total design heat losses for the zone (including transmission, infiltration, and reheating; excluding ventilation)";
parameter Medium.Temperature T_start=Medium.T_default
"Start value of temperature"
annotation(Dialog(tab = "Initialization"));
Expand Down Expand Up @@ -194,6 +197,9 @@ model PartialZone "Building zone model"
Modelica.Blocks.Math.Add addCFlow[max(Medium.nC,1)](k2 = intGaiOcc.s_co2) "Add tracer mass flow rates" annotation (
Placement(visible = true, transformation(origin = {-6, 34}, extent = {{4, -4}, {-4, 4}}, rotation = 0)));
protected
Modelica.Blocks.Sources.RealExpression TRefZon[nSurf](each y=TZon_design)
"Reference zone temperature for the surfaces connected to this zone, for calculation of design heat load";

parameter Real n50_int(unit="1/h",min=0.01,fixed= false)
"n50 value cfr airtightness, i.e. the ACH at a pressure diffence of 50 Pa"
annotation(Dialog(enable=use_custom_n50,tab="Airflow", group="Airtightness"));
Expand Down Expand Up @@ -314,11 +320,11 @@ end Setq50;


initial equation


n50_int = if use_custom_n50 and not setq50.allSurfacesCustom then n50 else sum(propsBusInt.v50)/V;

Q_design=QInf_design+QRH_design+QTra_design; //Total design load for zone (additional ventilation losses are calculated in the ventilation system)
Q_design=QInf_design+QRH_design+QTra_design;
//Total design load for zone (excluding ventilation losses, these are assumed to be calculated in the ventilation system
//and should be added afterwards to obtain the total design heat load). See for example IDEAS.Templates.Interfaces.Building.

equation
if interzonalAirFlow.verifyBothPortsConnected then
Expand Down Expand Up @@ -545,8 +551,9 @@ end for;
Line(points = {{-18, 26}, {-12, 26}, {-12, 10}, {110, 10}}, color = {0, 0, 127}));
connect(addmWatFlow.u1, mWat_flow) annotation(
Line(points = {{-2, 42}, {10, 42}, {10, -80}, {120, -80}}, color = {0, 0, 127}));
annotation (Placement(transformation(extent={{
140,48},{100,88}})),
connect(TRefZon.y, propsBusInt.TRefZon);

annotation (Placement(transformation(extent={{140,48},{100,88}})),
Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-100},{100,100}}),
graphics),
Documentation(info="<html>
Expand All @@ -559,6 +566,11 @@ Change Medium to IDEAS.Media.Air and use 'constrainedby' for Modelica.Media.Inte
This is for <a href=https://github.com/open-ideas/IDEAS/issues/1375>#1375</a>.
</li>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Add parameter <code>TZon_design</code> to be used when calculating <code>Q_design</code>.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
<li>
October 30, 2024, by Klaas De Jonge:<br/>
Modifications for interzonal airflow and stack-effect input.
</li>
Expand Down
16 changes: 11 additions & 5 deletions IDEAS/Buildings/Components/Interfaces/ZoneBus.mo
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ expandable 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" 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 ();


IDEAS.Buildings.Components.Interfaces.BooleanConnector use_custom_n50 "true if the zone n50 is a custom value";
IDEAS.Buildings.Components.Interfaces.RealConnector hzone(final unit="m") "Zone height: distance between floor and ceiling";
IDEAS.Buildings.Components.Interfaces.RealConnector hfloor(final unit="m") "Absolute height of zone floor";
IDEAS.Buildings.Components.Interfaces.RealConnector TRefZon(
final quantity="Temperature",
final unit="K") "Reference zone temperature";
annotation (Documentation(info="<html>
<p>
Connector that contains a weather bus and further
Expand All @@ -65,6 +66,11 @@ heat and information between a zone and a surface.
</html>", revisions="<html>
<ul>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Add connector <code>TRefZon</code> to be used when calculating <code>QTra_design</code>.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
<li>
Februari 18, 2024, by Filip Jorissen:<br/>
Modifications for supporting trickle vents and interzonal airflow.
</li>
Expand Down
19 changes: 16 additions & 3 deletions IDEAS/Buildings/Components/Interfaces/ZoneBusVarMultiplicator.mo
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ protected
redeclare package Medium = Medium,final k=k) if sim.interZonalAirFlowType == IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts
"Mass flow rate multiplier for port 3"
annotation (Placement(transformation(origin = {0, -208}, extent = {{-10, -200}, {10, -180}})));
Modelica.Blocks.Math.Gain QTra_desgin(k=k) "Design heat flow rate"
Modelica.Blocks.Math.Gain QTra_design(k=k) "Design heat flow rate"
annotation (Placement(transformation(extent={{-10,178},{10,198}})));
Modelica.Blocks.Math.Gain area(k=k) "Heat exchange surface area"
annotation (Placement(transformation(extent={{-10,150},{10,170}})));
Expand Down Expand Up @@ -87,10 +87,14 @@ protected
Modelica.Blocks.Routing.RealPassThrough hFloor
"Absolute height of the zone floor"
annotation (Placement(transformation(extent={{8,-384},{-12,-364}})));
Modelica.Blocks.Routing.RealPassThrough TRefZon
"Reference zone temperature for calculation of design heat load"
annotation (Placement(transformation(extent={{8,-356},{-12,-336}})));

equation
connect(QTra_desgin.u, propsBus_a.QTra_design) annotation (Line(points={{-12,188},
connect(QTra_design.u, propsBus_a.QTra_design) annotation (Line(points={{-12,188},
{-100.1,188},{-100.1,0.1}}, color={0,0,127}));
connect(QTra_desgin.y, propsBus_b.QTra_design) annotation (Line(points={{11,188},
connect(QTra_design.y, propsBus_b.QTra_design) annotation (Line(points={{11,188},
{100.1,188},{100.1,-0.1}},color={0,0,127}));
connect(area.u, propsBus_a.area) annotation (Line(points={{-12,160},{-100.1,
160},{-100.1,0.1}},color={0,0,127}));
Expand Down Expand Up @@ -181,6 +185,10 @@ equation
Line(points = {{-10, -398}, {-100, -398}, {-100, 0}}, color = {0, 127, 255}));
connect(massFlowRateMultiplier3.port_b, propsBus_b.port_3) annotation(
Line(points = {{10, -398}, {100, -398}, {100, 0}}, color = {0, 127, 255}));
connect(TRefZon.u, propsBus_b.TRefZon) annotation (Line(points={{10,-346},{
100.1,-346},{100.1,-0.1}}, color={0,0,127}));
connect(TRefZon.y, propsBus_a.TRefZon) annotation (Line(points={{-13,-346},{
-100.1,-346},{-100.1,0.1}}, color={0,0,127}));
annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100,-180},
{100,200}}), graphics={
Polygon(
Expand All @@ -205,6 +213,11 @@ equation
Documentation(revisions="<html>
<ul>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Add connector <code>TRefZon</code> to be used when calculating <code>QTra_design</code>.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
</li>
<li>
Februari 18, 2024, by Filip Jorissen:<br/>
Modifications for supporting trickle vents and interzonal airflow.
</li>
Expand Down
Loading

0 comments on commit f903f6b

Please sign in to comment.