Skip to content

Commit

Permalink
Merge pull request #1790 from ibpsa/issue1744_vdi6007-non-constant-t-…
Browse files Browse the repository at this point in the history
…ground

Issue1744 vdi6007 non constant t ground
  • Loading branch information
mwetter authored Sep 15, 2023
2 parents a18de7c + c0b12b0 commit 386a90a
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
last-generated=2023-09-14
statistics-initialization=
{
"linear": "5"
}
statistics-simulation=
{
"linear": "0, 3, 0",
"nonlinear": " ",
"number of continuous time states": "4",
"numerical Jacobians": "0"
}
time=[0e+00, 3.1536e+07]
eqAirTemp.TEqAir=[2.789571533203125e+02, 2.813718017578125e+02, 2.7872587890625e+02, 2.807901184082031e+02, 2.835259521484375e+02, 2.823024597167969e+02, 2.827985473632813e+02, 2.822135131835938e+02, 2.784553283691406e+02, 2.797283508300781e+02, 2.843675231933594e+02, 2.796825317382812e+02, 2.830658447265625e+02, 2.863615112304688e+02, 2.829901916503906e+02, 2.81193115234375e+02, 2.834943542480469e+02, 2.822643676757813e+02, 2.849333984375e+02, 2.8688466796875e+02, 2.813687744140625e+02, 2.854065185546875e+02, 2.824746765136719e+02, 2.820121215820312e+02, 2.881613098144531e+02, 2.850013122558594e+02, 2.823730773925781e+02, 2.873432434082031e+02, 2.857710876464844e+02, 2.85406591796875e+02, 2.900100402832031e+02, 2.826182189941406e+02, 2.84790185546875e+02, 2.966639404296875e+02, 2.837040283203125e+02, 2.864047241210938e+02, 2.959377624511719e+02, 2.883143005371094e+02, 2.897021667480469e+02, 2.957674682617188e+02, 2.864564819335938e+02, 2.896947265625e+02, 2.955205017089844e+02, 2.871305236816406e+02, 2.91426025390625e+02, 2.9104345703125e+02, 2.86251953125e+02, 2.90456201171875e+02, 2.876586730957031e+02, 2.879760803222656e+02, 2.924863586425781e+02, 2.866445068359375e+02, 2.888368591308594e+02, 2.952922973632812e+02, 2.882718566894531e+02, 2.897318420410156e+02, 2.960734008789062e+02, 2.874204406738281e+02, 2.916609802246094e+02, 2.970692016601562e+02, 2.87395751953125e+02, 2.934731872558594e+02, 2.889349975585938e+02, 2.884504028320313e+02, 2.923549438476563e+02, 2.880719299316406e+02, 2.882120971679688e+02, 2.9177724609375e+02, 2.858329772949219e+02, 2.879469116210938e+02, 2.915469055175781e+02, 2.855946655273438e+02, 2.865959594726563e+02, 2.939826416015625e+02, 2.875797424316406e+02, 2.867238159179688e+02, 2.938005920410156e+02, 2.847250549316406e+02, 2.881406921386719e+02, 2.924451721191406e+02, 2.846399841308594e+02, 2.869987976074219e+02, 2.848623596191406e+02, 2.824324584960938e+02, 2.857318481445312e+02, 2.833520812988281e+02, 2.841896728515625e+02, 2.867588134765625e+02, 2.826075927734375e+02, 2.824429504394531e+02, 2.851797180175781e+02, 2.797426086425781e+02, 2.819598083496094e+02, 2.841822814941406e+02, 2.791549987792969e+02, 2.806098937988281e+02, 2.82980029296875e+02, 2.807776794433594e+02, 2.813313049316406e+02, 2.808358093261719e+02, 2.823453063964844e+02]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
simulateModel("IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomTwoElementsNonConstantTGround", tolerance=1e-6, stopTime=3.1536e+007, numberOfIntervals=0, outputInterval=3600, method="CVode", resultFile="SimpleRoomTwoElementsNonConstantTGround");
createPlot(id = 1,
position = {55, 50, 697, 502},
x = "time",
y = {"eqAirTemp.TEqAir"},
autoscale = true,
autoerase = true,
autoreplot = true,
grid = true,
color = true,
leftTitleType = 1,
bottomTitleType = 1);
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ partial model PartialVDI6007
parameter Real wfGro(unit="1")
"Weight factor of the ground (0 if not considered)";
parameter Modelica.Units.SI.Temperature TGro
"Temperature of the ground in contact with floor plate";
"Constant temperature of the ground in contact with floor plate"
annotation (
HideResult=TGroundFromInput,
Dialog(enable=not TGroundFromInput));
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hConWallOut
"Exterior walls convective coefficient of heat transfer (outdoor)";
parameter Modelica.Units.SI.CoefficientOfHeatTransfer hRad
"Coefficient of heat transfer for linearized radiation";
parameter Boolean withLongwave=true
"Set to true to include longwave radiation exchange"
annotation(choices(checkBox = true));
parameter Boolean TGroundFromInput=false
"Set to true to use TGro_in input connector instead of TGro constant"
annotation(choices(checkBox = true));

Modelica.Units.SI.Temperature TEqWall[n] "Equivalent wall temperature";
Modelica.Units.SI.Temperature TEqWin[n] "Equivalent window temperature";
Expand Down Expand Up @@ -61,6 +67,20 @@ partial model PartialVDI6007
extent={{-20,-20},{20,20}},
rotation=-90,
origin={0,120})));
Modelica.Blocks.Interfaces.RealInput TGro_in(
final quantity="ThermodynamicTemperature",
final unit="K",
displayUnit="degC") if TGroundFromInput
"Temperature of the ground in contact with floor plate"
annotation (Placement(
transformation(
extent={{-20,-20},{20,20}},
rotation=90,
origin={0,-120})));

protected
SourceSelector TGroSouSel(final useInput=TGroundFromInput, p=TGro)
"Input selector for ground temperature";

initial equation
assert(noEvent(abs(sum(wfWall) + sum(wfWin) + wfGro) > 0.1),
Expand All @@ -80,6 +100,7 @@ equation
TEqWall=TDryBul.+delTEqSW;
end if;

connect(TGro_in, TGroSouSel.uCon);
annotation ( Icon(coordinateSystem(preserveAspectRatio=false,
extent={{-100,-100},{100,100}}),
graphics={
Expand Down Expand Up @@ -120,6 +141,12 @@ equation
revisions="<html>
<ul>
<li>
May 5, 2023, by Philip Groesdonk:<br/>
Added an option for non-constant ground temperature from an input connector.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1744\">#1744</a>.
</li>
<li>
July 11, 2019, by Katharina Brinkmann:<br/>
Renamed <code>alphaRad</code> to <code>hRad</code>,
<code>alphaWinOut</code> to <code>hConWallOut</code>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
within IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.BaseClasses;
block SourceSelector
"Block that selects as its output either a parameter value or its input"
extends Modelica.Blocks.Interfaces.SO;
parameter Boolean useInput "Use input (if true) or parameter value (if false)"
annotation(Evaluate=true);
parameter Real p "Parameter value";
Modelica.Blocks.Interfaces.RealInput uCon if useInput
"Input signal from input connector"
annotation (Placement(transformation(extent={{-140,40},{-100,80}}),
iconTransformation(extent={{-120,70},{-100,90}})));
equation
if not useInput then
y = p;
end if;
connect(uCon, y);
annotation (
defaultComponentName="souSel",
Documentation(info="<html>
<p>
Block that produces at its output the input value <code>uCon</code>
or the parameter value <code>p</code> depending on the parameter value
<code>useInput</code>.
</p>
</html>", revisions="<html>
<ul>
<li>
June 28, 2023, by Philip Groesdonk:<br/>
First implementation.
</li>
</ul>
</html>"),
Icon(graphics={
Rectangle(
extent={{-100,100},{100,-100}},
fillColor={210,210,210},
fillPattern=FillPattern.Solid,
borderPattern=BorderPattern.Raised),
Line(points={{12,0},{100,0}},
color={0,0,127}),
Line(points={{-100,80},{-38,80}},
color={0,0,127}),
Line(points={{-40,80},{8,0}},
color={0,0,127},
visible=useInput,
thickness=1),
Ellipse(lineColor={0,0,255},
pattern=LinePattern.None,
fillPattern=FillPattern.Solid,
extent={{2,-8},{18,8}})}));
end SourceSelector;
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PartialVDI6007
SourceSelector
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ initial equation

equation
delTEqLWWin=delTEqLW;
TEqAir = TEqWall*wfWall + TEqWin*wfWin + TGro*wfGro;
TEqAir = TEqWall*wfWall + TEqWin*wfWin + TGroSouSel.y*wfGro;
annotation (defaultComponentName = "equAirTem",Documentation(revisions="<html>
<ul>
<li>
May 5, 2023, by Philip Groesdonk:<br/>
Added an option for non-constant ground temperature from an input connector.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1744\">#1744</a>.
</li>
<li>
September 26, 2016, by Moritz Lauster:<br/>
Moved calculations to <a href=\"modelica://IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.BaseClasses.PartialVDI6007\">
IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.BaseClasses.PartialVDI6007</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ initial equation

equation
delTEqLWWin=(TBlaSky - TDryBul)*hRad/(hRad + hConWinOut);
TEqAir = TEqWall*wfWall + TGro*wfGro;
TEqAir = TEqWall*wfWall + TGroSouSel.y*wfGro;
TEqAirWin = TEqWin*wfWin;
annotation (defaultComponentName = "equAirTem",Documentation(revisions="<html>
<ul>
<li>
May 5, 2023, by Philip Groesdonk:<br/>
Added an option for non-constant ground temperature from an input connector.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1744\">#1744</a>.
</li>
<li>
July 11, 2019, by Katharina Brinkmann:<br/>
Renamed <code>alphaWinOut</code> to <code>hConWinOut</code>
</li>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
within IBPSA.ThermalZones.ReducedOrder.Examples;
model SimpleRoomTwoElementsNonConstantTGround
"Illustrates the use of non-constant ground temperature for equivalent air temperature calculation"
extends Modelica.Icons.Example;
extends IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomTwoElements(
eqAirTemp(
wfWall={0.15,0.35},
wfGro=0.5,
TGroundFromInput=true));

Modelica.Blocks.Sources.Trapezoid TGro(
amplitude(unit="K") = 10,
rising(displayUnit="d") = 7884000,
width(displayUnit="d") = 7884000,
falling(displayUnit="d") = 7884000,
period(displayUnit="d") = 31536000,
offset(
unit="K",
displayUnit="degC") = 280.15,
startTime(displayUnit="d") = 5184000)
"Trapezoid-shaped source for ground temperature"
annotation (Placement(transformation(extent={{-60,-60},{-40,-40}})));
equation

connect(TGro.y, eqAirTemp.TGro_in)
annotation (Line(points={{-39,-50},{-14,-50},{-14,-16}}, color={0,0,127}));
annotation ( Documentation(info="<html>
<p>
This example shows the application of
<a href=\"modelica://IBPSA.ThermalZones.ReducedOrder.RC.TwoElements\">
IBPSA.ThermalZones.ReducedOrder.RC.TwoElements</a>
in connection with equivalent air temperature calculation in
<a href=\"modelica://IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow\">
IBPSA.ThermalZones.ReducedOrder.EquivalentAirTemperature.VDI6007WithWindow</a>,
where the ground temperature is not a constant, but has a trapezoid source.
Apart from that, it is identical to <a href=\"modelica://IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomTwoElements\">
IBPSA.ThermalZones.ReducedOrder.Examples.SimpleRoomTwoElements</a>.
<h4>References</h4>
<p>VDI. German Association of Engineers Guideline VDI 6007-1
March 2012. Calculation of transient thermal response of rooms
and buildings - modelling of rooms.</p>
</html>", revisions="<html>
<ul>
<li>
June 29, 2023, by Philip Groesdonk:<br/>
First implementation.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1744\">IBPSA, #1744</a>.
</li>
</ul>
</html>"),
experiment(
StopTime=31536000,
Interval=3600,
Tolerance=1e-06),
__Dymola_Commands(file=
"modelica://IBPSA/Resources/Scripts/Dymola/ThermalZones/ReducedOrder/Examples/SimpleRoomTwoElementsNonConstantTGround.mos"
"Simulate and plot"),
Diagram(coordinateSystem(extent={{-100,-120},{100,100}})),
Icon(coordinateSystem(extent={{-100,-100},{100,100}})));
end SimpleRoomTwoElementsNonConstantTGround;
1 change: 1 addition & 0 deletions IBPSA/ThermalZones/ReducedOrder/Examples/package.order
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ SimpleRoomFourElementsTraceSubstance
SimpleRoomOneElement
SimpleRoomThreeElements
SimpleRoomTwoElements
SimpleRoomTwoElementsNonConstantTGround

0 comments on commit 386a90a

Please sign in to comment.