Skip to content

Commit

Permalink
Add MinimalVolumeFlowRateSafety control and restructure safety contro…
Browse files Browse the repository at this point in the history
…l partials #1576
  • Loading branch information
fabian.wuellhorst committed Jul 29, 2022
1 parent 3dbe17a commit f674398
Show file tree
Hide file tree
Showing 22 changed files with 767 additions and 648 deletions.
18 changes: 5 additions & 13 deletions IBPSA/BoundaryConditions/WeatherData/Examples/ReaderTMY3.mo
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
within IBPSA.BoundaryConditions.WeatherData.Examples;
model ReaderTMY3 "Test model for reading weather data"
extends Modelica.Icons.Example;
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(
filNam=Modelica.Utilities.Files.loadResource("modelica://IBPSA/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"))
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDat(filNam=
Modelica.Utilities.Files.loadResource(
"D://01_Projekte//03_Mitsubishi_HiL//TRY2015_Jahr_City_Aachen.mos"))
"Weather data reader"
annotation (Placement(transformation(extent={{-20,40},{0,60}})));
IBPSA.BoundaryConditions.WeatherData.ReaderTMY3 weaDatInpCon(filNam=
Modelica.Utilities.Files.loadResource("modelica://IBPSA/Resources/weatherdata/USA_IL_Chicago-OHare.Intl.AP.725300_TMY3.mos"),
HSou=IBPSA.BoundaryConditions.Types.RadiationDataSource.Input_HGloHor_HDifHor)
Modelica.Utilities.Files.loadResource("D://01_Projekte//03_Mitsubishi_HiL//TRY2015_Jahr_City_Aachen_savecopy.mos"),
HSou=IBPSA.BoundaryConditions.Types.RadiationDataSource.File)
"Weather data reader with radiation data obtained from input connector"
annotation (Placement(transformation(extent={{-20,-60},{0,-40}})));
Modelica.Blocks.Sources.Constant HDifHor(k=0) "Diffuse horizontal radiation"
annotation (Placement(transformation(extent={{-80,-60},{-60,-40}})));
Modelica.Blocks.Sources.Constant HGloHor(k=0) "Horizontal global radiation"
annotation (Placement(transformation(extent={{-80,-20},{-60,0}})));
equation
connect(HGloHor.y, weaDatInpCon.HGloHor_in)
annotation (Line(
points={{-59,-10},{-28,-10},{-28,-63},{-21,-63}},
color={0,0,127}));
connect(HDifHor.y, weaDatInpCon.HDifHor_in)
annotation (Line(
points={{-59,-50},{-40,-50},{-40,-57.6},{-21,-57.6}},
color={0,0,127}));
annotation (experiment(Tolerance=1e-6, StartTime=0, StopTime=8640000),
__Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/BoundaryConditions/WeatherData/Examples/ReaderTMY3.mos"
"Simulate and plot"),
Expand Down
6 changes: 3 additions & 3 deletions IBPSA/Fluid/HeatPumps/BlackBoxData/VCLibMap.mo
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ equation
{-1.9984e-15,54},{92,54},{92,88},{110,88},{110,82}},
color={0,0,127}));
connect(QScaling.y, product_scaling.u1) annotation (Line(points={{-50,59},{
-50,50},{-44,50},{-44,42}},
-50,48},{-44,48},{-44,42}},
color={0,0,127}));
connect(Table_QCon.y, product_scaling.u2) annotation (Line(points={{-110,59},
{-110,48},{-56,48},{-56,42}},
Expand All @@ -183,8 +183,8 @@ equation
connect(divisionPel.u2, max.y) annotation (Line(points={{104,2},{104,14},{110,
14},{110,19}},
color={0,0,127}));
connect(max.u1, Table_COP.y) annotation (Line(points={{116,42},{116,54},{110,
54},{110,59}},color={0,0,127}));
connect(max.u1, Table_COP.y) annotation (Line(points={{116,42},{116,48},{110,
48},{110,59}},color={0,0,127}));
connect(const_minCOP.y, max.u2) annotation (Line(points={{70,59},{70,48},{104,
48},{104,42}}, color={0,0,127}));
connect(multiplex3_1.u1[1], sigBus.ySet) annotation (Line(points={{7,82},{12,
Expand Down
19 changes: 14 additions & 5 deletions IBPSA/Fluid/HeatPumps/Examples/HeatPump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ model HeatPump "Example for the reversible heat pump model."
replaceable package Medium_sou = IBPSA.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium annotation (choicesAllMatching=true);
IBPSA.Fluid.Sources.MassFlowSource_T sourceSideMassFlowSource(
use_m_flow_in=true,
use_T_in=true,
m_flow=1,
nPorts=1,
Expand All @@ -26,7 +27,7 @@ model HeatPump "Example for the reversible heat pump model."
startTime=500,
height=25,
offset=278)
"Ramp signal for the temperature input of the source side's ideal mass flow source"
"Ramp signal for the temperature input of the source side's ideal flow"
annotation (Placement(transformation(extent={{-100,-100},{-80,-80}})));
Modelica.Blocks.Sources.Constant T_amb_internal(k=291.15)
annotation (Placement(transformation(extent={{10,-10},{-10,10}},
Expand All @@ -39,7 +40,7 @@ model HeatPump "Example for the reversible heat pump model."
use_busConnectorOnly=false,
QUse_flow_nominal=1000,
cpCon=4184,
mEva_flow_nominal=sourceSideMassFlowSource.m_flow,
mEva_flow_nominal=mSouStep.offset,
y_nominal=1,
TCon_nominal=313.15,
dTCon_nominal=7,
Expand All @@ -61,12 +62,10 @@ model HeatPump "Example for the reversible heat pump model."
cpEva=4184,
redeclare model BlaBoxHPHeating =
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNorm2D (
QConBlackBox_flow_nominal=3315,
redeclare IBPSA.Fluid.HeatPumps.BlackBoxData.Frosting.NoFrosting
iceFacCalc,
dataTable=
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.EN14511.Vitocal200AWO201
()),
IBPSA.Fluid.HeatPumps.BlackBoxData.EuropeanNom2D.EN14511.Vitocal200AWO201()),
redeclare model BlaBoxHPCooling =
IBPSA.Fluid.Chillers.BlackBoxData.BlackBox.LookUpTable2D (smoothness=
Modelica.Blocks.Types.Smoothness.LinearSegments, dataTable=
Expand Down Expand Up @@ -179,6 +178,14 @@ model HeatPump "Example for the reversible heat pump model."
uLow=273.15 + 15,
uHigh=273.15 + 19)
annotation (Placement(transformation(extent={{40,60},{20,80}})));
Modelica.Blocks.Sources.Pulse mSouStep(
amplitude=-1,
width=50,
period=500,
startTime=500,
offset=1)
"Step signal for the mass flow rate source side's ideal mass flow source"
annotation (Placement(transformation(extent={{-100,-60},{-80,-40}})));
equation

connect(sourceSideMassFlowSource.ports[1], heatPump.port_a2) annotation (Line(
Expand Down Expand Up @@ -229,6 +236,8 @@ equation
connect(booleanToReal.y, heatPump.ySet) annotation (Line(points={{-10,-1},{
-10,-4},{4.83333,-4},{4.83333,-11.16}},
color={0,0,127}));
connect(mSouStep.y, sourceSideMassFlowSource.m_flow_in)
annotation (Line(points={{-79,-50},{-62,-50},{-62,-62}}, color={0,0,127}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}})),
experiment(Tolerance=1e-6, StopTime=3600),
Expand Down
2 changes: 2 additions & 0 deletions IBPSA/Fluid/HeatPumps/HeatPump.mo
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ model HeatPump
"Safety control parameters"
annotation (Dialog(enable=use_safetyControl, group="Safety Control"), choicesAllMatching=true);
IBPSA.Fluid.HeatPumps.SafetyControls.SafetyControl safetyControl(
final mEva_flow_nominal=mEva_flow_nominal_final*scalingFactor,
final mCon_flow_nominal=mCon_flow_nominal_final*scalingFactor,
safetyControlParameters=safetyControlParameters) if use_safetyControl
annotation (Placement(transformation(extent={{-60,-20},{-40,0}})));

Expand Down
23 changes: 9 additions & 14 deletions IBPSA/Fluid/HeatPumps/SafetyControls/AntiFreeze.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within IBPSA.Fluid.HeatPumps.SafetyControls;
model AntiFreeze "Model to prevent source from freezing"
extends BaseClasses.PartialSafetyControl;
extends BaseClasses.PartialSafetyControlWithErrors;

parameter Boolean use_antFre=true
"True if anti freeze control is part of safety control" annotation(choices(checkBox=true));
Expand All @@ -25,14 +25,6 @@ model AntiFreeze "Model to prevent source from freezing"
equation
connect(ySet,swiErr.u1) annotation (Line(points={{-136,20},{32,20},{32,8},{
78,8}}, color={0,0,127}));
connect(booConAntFre.y, swiErr.u2) annotation (Line(
points={{21,-30},{42,-30},{42,0},{78,0}},
color={255,0,255},
pattern=LinePattern.Dash));
connect(hysteresis.y, swiErr.u2) annotation (Line(
points={{-39,-10},{6,-10},{6,0},{78,0}},
color={255,0,255},
pattern=LinePattern.Dash));
connect(modeSet, modeOut) annotation (Line(points={{-136,-20},{-114,-20},{
-114,-64},{96,-64},{96,-20},{130,-20}}, color={255,0,255}));
connect(min.y, hysteresis.u) annotation (Line(points={{-79,-10},{-62,-10}},
Expand All @@ -55,11 +47,14 @@ equation
extent={{-6,3},{-6,3}},
horizontalAlignment=TextAlignment.Right));

connect(hysteresis.y, not1.u) annotation (Line(points={{-39,-10},{-28,-10},{
-28,-56},{-42,-56},{-42,-100}},
color={255,0,255}));
connect(booConAntFre.y, not1.u) annotation (Line(points={{21,-30},{36,-30},{
36,-56},{-42,-56},{-42,-100}}, color={255,0,255}));
connect(booConAntFre.y, booleanPassThrough.u) annotation (Line(
points={{21,-30},{28,-30},{28,0},{38,0}},
color={255,0,255},
pattern=LinePattern.Dash));
connect(hysteresis.y, booleanPassThrough.u) annotation (Line(
points={{-39,-10},{0,-10},{0,0},{38,0}},
color={255,0,255},
pattern=LinePattern.Dash));
annotation (Documentation(revisions="<html><ul>
<li>
<i>November 26, 2018&#160;</i> by Fabian Wüllhorst:<br/>
Expand Down
Loading

0 comments on commit f674398

Please sign in to comment.