Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

86 nonlinear heating curve #87

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions BESMod/Systems/Demand/Building/TEASERThermalZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -194,13 +194,13 @@ model TEASERThermalZone
rotation=0,
origin={62,-120})));
Modelica.Blocks.Math.MultiSum multiSumEle(final k=fill(1, multiSumEle.nu),
final nu=2*nZones) annotation (Placement(
nu=2*nZones) annotation (Placement(
transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={30,-120})));
BESMod.Utilities.KPIs.RoomControlCalculator roomControlCalculator[nZones](each
final for_heating=true, each final dTComBou=0)
BESMod.Utilities.KPIs.RoomControlCalculator roomControlCalculator[nZones](each final
for_heating=true, each final dTComBou=0)
annotation (Placement(transformation(extent={{50,-40},{70,-20}})));
equation

Expand All @@ -221,11 +221,11 @@ equation
index=-1,
extent={{-3,-6},{-3,-6}},
horizontalAlignment=TextAlignment.Right));
connect(thermalZone[i].QIntGains_flow[2], multiSumEle.u[2*i-1]) annotation (Line(
points={{-42.7,33.6},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12,
connect(thermalZone[i].QIntGains_flow[1], multiSumEle.u[2*i-1]) annotation (Line(
points={{-42.7,32.4},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12,
-134},{12,-120},{20,-120}}, color={0,0,127}));
connect(thermalZone[i].QIntGains_flow[3], multiSumEle.u[2*i]) annotation (Line(
points={{-42.7,34.8},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12,
connect(thermalZone[i].QIntGains_flow[2], multiSumEle.u[2*i]) annotation (Line(
points={{-42.7,33.6},{-42.7,0},{-28,0},{-28,-68},{-6,-68},{-6,-134},{12,
-134},{12,-120},{20,-120}},
color={0,0,127}));
if use_ventilation then
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions;
function ConstantGradientHeatCurve "Linear heating curve"
extends BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions.PartialHeatingCurve;
protected
Real graTSupAtTOda_nominal = (1/nHeaTra * ((TSup_nominal + TRet_nominal)/2 - TRoom) + (
TSup_nominal - TRet_nominal)/2) / (THeaThr - TOda_nominal);
algorithm
TSup := TSup_nominal - graTSupAtTOda_nominal * (TOda - TOda_nominal);
end ConstantGradientHeatCurve;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions;
function IdealHeatingCurve "Ideal heating curve with no linearization"
extends BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions.PartialHeatingCurve;
protected
Real QRel = (THeaThr - TOda)/(THeaThr - TOda_nominal);

algorithm
TSup := TRoom + ((TSup_nominal + TRet_nominal)/2 - TRoom) * QRel^(1/nHeaTra) + (
TSup_nominal - TRet_nominal)/2*QRel;
end IdealHeatingCurve;
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions;
partial function PartialHeatingCurve "Partial function to define interfacesHeating curve based on Lämmle et al."
input Modelica.Units.SI.Temperature TOda "Outdoor air temperature";
input Modelica.Units.SI.Temperature THeaThr "Heating threshold temperature";
input Modelica.Units.SI.Temperature TRoom "Room temperature";
input Modelica.Units.SI.Temperature TSup_nominal "Nominal supply temperature";
input Modelica.Units.SI.Temperature TRet_nominal "Nominal return temperature";
input Modelica.Units.SI.Temperature TOda_nominal "Nominal outdoor air temperature";
input Real nHeaTra "Heat transfer exponent";
output Modelica.Units.SI.Temperature TSup "Supply temperature";

annotation (Documentation(info="<html>
<p>The functions in this package are based on the equations provided in https://www.sciencedirect.com/science/article/pii/S0360544221032011?via&percnt;3Dihub</p>
</html>"));
end PartialHeatingCurve;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
within BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses;
package Functions "Package with functions for heating curves"
end Functions;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ConstantGradientHeatCurve
IdealHeatingCurve
PartialHeatingCurve
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
PartialSetpoint
Functions
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ model IdealHeatingCurve "Ideal linear heating curve"
annotation (Placement(transformation(extent={{-60,-80},{-40,-60}})));
parameter Modelica.Units.SI.TemperatureDifference dTAddCon=0
"Constant offset of ideal heating curve";
protected
parameter Modelica.Units.SI.Temperature TSupMea_nominal=
(TSup_nominal + TRet_nominal) / 2 "Nominal mean temperature";
Real derQRel = - 1 / (maxTZoneSet.yMax - TOda_nominal);
parameter Modelica.Units.SI.Temperature THeaThr=293.15 "Heating threshold temeperature";

replaceable function heaCur =
BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions.ConstantGradientHeatCurve
constrainedby BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions.PartialHeatingCurve
"Linearization approach"
annotation(choicesAllMatching=true);
equation
if TOda < maxTZoneSet.yMax then
TSet = TSup_nominal + dTAddCon + (derQRel * (TSupMea_nominal - maxTZoneSet.yMax) *
1 / nHeaTra + (TSup_nominal - TRet_nominal) / 2 * derQRel) * (TOda - TOda_nominal);
TSet = heaCur(TOda, THeaThr, maxTZoneSet.yMax, TSup_nominal, TRet_nominal, TOda_nominal, nHeaTra) + dTAddCon;
else
// No heating required.
TSet = maxTZoneSet.yMax + dTAddCon;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ model PartialHeatPump "Generation with only the heat pump"
parameter Modelica.Units.SI.Temperature THeaTresh=293.15
"Heating treshhold temperature for bivalent design"
annotation (Dialog(group="Heat Pump System Design"));
parameter Modelica.Units.SI.Temperature TSupAtBiv = BESMod.Systems.Hydraulical.Control.Components.BuildingSupplyTemperatureSetpoints.BaseClasses.Functions.ConstantGradientHeatCurve(
TBiv, THeaTresh, 293.15, TSup_nominal[1], TSup_nominal[1] - 10, TOda_nominal, 1.24)
"Supply temperature at bivalence point for design"
annotation (Dialog(group="Heat Pump System Design"));

parameter
BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign
genDesTyp "Type of generation system design" annotation (Dialog(
Expand Down Expand Up @@ -179,7 +184,7 @@ model PartialHeatPump "Generation with only the heat pump"
final show_T=show_T,
final QHea_flow_nominal=QPri_flow_nominal,
QCoo_flow_nominal=QCoo_flow_nominal,
final TConHea_nominal=TSup_nominal[1],
final TConHea_nominal=if genDesTyp == BESMod.Systems.Hydraulical.Generation.Types.GenerationDesign.Monovalent then TSup_nominal[1] else TSupAtBiv,
final TEvaHea_nominal=TBiv,
final TConCoo_nominal=TConCoo_nominal,
final TEvaCoo_nominal=TEvaCoo_nominal,
Expand Down Expand Up @@ -315,6 +320,8 @@ model PartialHeatPump "Generation with only the heat pump"
extent={{-10,-10},{10,10}},
rotation=0,
origin={-170,-30})));


equation
connect(bouEva.ports[1], heatPump.port_a2) annotation (Line(points={{-80,50},{
-70,50},{-70,35},{-51,35}}, color={0,127,255}));
Expand Down
32 changes: 32 additions & 0 deletions BESMod/Systems/Hydraulical/Transfer/IdealValveRadiator.mo
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ model IdealValveRadiator
Dialog(group="Component data"),
choicesAllMatching=true,
Placement(transformation(extent={{-70,-98},{-50,-78}})));
Modelica.Blocks.Sources.RealExpression senTSup[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_in.p,
inStream(portTra_in.h_outflow),
inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-90,10})));
Modelica.Blocks.Sources.RealExpression senTRet[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_out.p,
inStream(portTra_out.h_outflow),
inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-90,-10})));
equation
connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-2.8,-32},{40,
-32},{40,-40},{100,-40}}, color={191,0,0}));
Expand Down Expand Up @@ -147,4 +167,16 @@ equation
connect(reaPasThrOpe.y, gain.u)
annotation (Line(points={{-1.9984e-15,59},{-1.9984e-15,50},{10,50},{10,42}},
color={0,0,127}));
connect(senTSup.y, outBusTra.TSup) annotation (Line(points={{-79,10},{-56,10},
{-56,-50},{0,-50},{0,-104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(senTRet.y, outBusTra.TRet) annotation (Line(points={{-79,-10},{-56,-10},
{-56,-50},{0,-50},{0,-104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
end IdealValveRadiator;
32 changes: 32 additions & 0 deletions BESMod/Systems/Hydraulical/Transfer/RadiatorPressureBased.mo
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,26 @@ model RadiatorPressureBased "Pressure Based transfer system"
extent={{-10,-10},{10,10}},
rotation=270,
origin={30,70})));
Modelica.Blocks.Sources.RealExpression senTRet[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_out.p,
inStream(portTra_out.h_outflow),
inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-30,-74})));
Modelica.Blocks.Sources.RealExpression senTSup[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_in.p,
inStream(portTra_in.h_outflow),
inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-30,-54})));
equation
connect(rad.heatPortRad, heatPortRad) annotation (Line(points={{-5.08,-27.2},
{40,-27.2},{40,-40},{100,-40}}, color={191,0,0}));
Expand Down Expand Up @@ -195,4 +215,16 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(senTSup.y, outBusTra.TSup) annotation (Line(points={{-19,-54},{0,-54},
{0,-104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(senTRet.y, outBusTra.TRet) annotation (Line(points={{-19,-74},{0,-74},
{0,-104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
end RadiatorPressureBased;
33 changes: 33 additions & 0 deletions BESMod/Systems/Hydraulical/Transfer/UFHTransferSystem.mo
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,26 @@ model UFHTransferSystem
Dialog(group="Component data"),
choicesAllMatching=true,
Placement(transformation(extent={{-100,-98},{-80,-78}})));
Modelica.Blocks.Sources.RealExpression senTRet[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_out.p,
inStream(portTra_out.h_outflow),
inStream(portTra_out.Xi_outflow)))) "Real expression for return temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-60,-74})));
Modelica.Blocks.Sources.RealExpression senTSup[nParallelSup](final y(
final unit="K",
displayUnit="degC") = Medium.temperature(Medium.setState_phX(
portTra_in.p,
inStream(portTra_in.h_outflow),
inStream(portTra_in.Xi_outflow)))) "Real expression for supply temperature"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=0,
origin={-60,-54})));
protected
parameter
BESMod.Systems.Hydraulical.Components.UFH.ActiveWallBaseDataDefinition
Expand Down Expand Up @@ -196,6 +216,19 @@ equation
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(senTSup.y, outBusTra.TSup) annotation (Line(points={{-49,-54},{0,-54},
{0,-104}}, color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
connect(senTRet.y, outBusTra.TRet) annotation (Line(points={{-49,-74},{-50,
-74},{-50,-90},{0,-90},{0,-104}},
color={0,0,127}), Text(
string="%second",
index=1,
extent={{6,3},{6,3}},
horizontalAlignment=TextAlignment.Left));
annotation (Documentation(info="<html>
<p>According to https://www.energie-lexikon.info/heizkoerperexponent.html, the heating transfer exponent of underfloor heating systems is between 1 and 1.1.</p>
</html>"));
Expand Down