Skip to content

Commit

Permalink
Merge pull request #244 from RWTH-EBC/release_v030
Browse files Browse the repository at this point in the history
Release v030
  • Loading branch information
marcusfuchs committed May 4, 2016
2 parents f12b174 + 5c15fb0 commit 7804a42
Show file tree
Hide file tree
Showing 989 changed files with 15,381 additions and 6,835 deletions.
243 changes: 186 additions & 57 deletions AixLib/.copiedFiles.txt

Large diffs are not rendered by default.

1,435 changes: 1,435 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/AHU.mo

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/BaseClasses/package.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
within AixLib.Airflow.AirHandlingUnit;
package BaseClasses
extends Modelica.Icons.BasesPackage;

end BaseClasses;
1 change: 1 addition & 0 deletions AixLib/Airflow/AirHandlingUnit/BaseClasses/package.order
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PartialAHU
156 changes: 156 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/BaseClasses/partialAHU.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
within AixLib.Airflow.AirHandlingUnit.BaseClasses;
partial model PartialAHU "Defines necessary parameters and connectors"

// Booleans for possible AHU modes
inner parameter Boolean heating=true "Heating Function of AHU"
annotation (Dialog(group="AHU Modes"));
inner parameter Boolean cooling=true "Cooling Function of AHU"
annotation (Dialog(group="AHU Modes"));
inner parameter Boolean dehumidificationSet=if heating and cooling then true
else false
"Dehumidification Function of AHU (Cooling and Heating must be enabled)"
annotation (Dialog(group="AHU Modes", enable=(heating and cooling)));
inner parameter Boolean humidificationSet=if heating and cooling then true else false
"Humidification Function of AHU (Cooling and Heating must be enabled)"
annotation (Dialog(group="AHU Modes", enable=(heating and cooling)));
inner Boolean dehumidification;
inner Boolean humidification;
inner parameter Real BPF_DeHu(
min=0,
max=1) = 0.2
"By-pass factor of cooling coil during dehumidification. Necessary to calculate the real outgoing enthalpy flow of heat exchanger in dehumidification mode taking the surface enthalpy of the cooling coil into account"
annotation (Dialog(group="Settings AHU Value", enable=(dehumidification
and cooling and heating)));
inner parameter Boolean HRS=true
"Is a HeatRecoverySystem physically integrated in the AHU?"
annotation (Dialog(group="AHU Modes"), choices(checkBox=true));
// Efficiency of HRS
parameter Real efficiencyHRS_enabled(
min=0,
max=1) = 0.8 "efficiency of HRS in the AHU modes when HRS is enabled"
annotation (Dialog(group="Settings AHU Value", enable=HRS));
parameter Real efficiencyHRS_disabled(
min=0,
max=1) = 0.2
"taking a little heat transfer into account although HRS is disabled (in case that a HRS is physically installed in the AHU)"
annotation (Dialog(group="Settings AHU Value", enable=HRS));

parameter Real clockPeriodGeneric(min=0) = 1800
"time period in s for sampling (= converting time-continous into time-discrete) input variables. Recommendation: half of the duration of one simulation interval"
annotation (Dialog(group="Settings for State Machines"));

// assumed increase in ventilator pressure
parameter Modelica.SIunits.Pressure dp_sup=800
"pressure difference over supply fan"
annotation (Dialog(tab="Fans", group="Constant Assumptions"));
parameter Modelica.SIunits.Pressure dp_eta=800
"pressure difference over extract fan"
annotation (Dialog(tab="Fans", group="Constant Assumptions"));
// assumed efficiencies of the ventilators
parameter Modelica.SIunits.Efficiency eta_sup=0.7 "efficiency of supply fan"
annotation (Dialog(tab="Fans", group="Constant Assumptions"));
parameter Modelica.SIunits.Efficiency eta_eta=0.7 "efficiency of extract fan"
annotation (Dialog(tab="Fans", group="Constant Assumptions"));

Modelica.Blocks.Interfaces.RealInput Vflow_in(unit="m3/s") "m3/s"
annotation (Placement(
transformation(extent={{-114,68},{-86,96}}), iconTransformation(extent={{-100,
-14},{-92,-6}})));
Modelica.Blocks.Interfaces.RealInput T_outdoorAir(unit="K", start=288.15) "K"
annotation (Placement(transformation(extent={{-114,42},{-86,70}}),
iconTransformation(extent={{-92,-20},{-84,-12}})));
Modelica.Blocks.Interfaces.RealInput X_outdoorAir(start=0.007)
"kg of water/kg of dry air" annotation (Placement(transformation(extent={{-114,22},
{-86,50}}), iconTransformation(extent={{-92,-30},{-84,-22}})));
Modelica.Blocks.Interfaces.RealInput T_extractAir(unit="K", start=296.15) "K"
annotation (Placement(transformation(
extent={{14,-14},{-14,14}},
rotation=0,
origin={100,90}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,28})));
Modelica.Blocks.Interfaces.RealInput phi_extractAir(start=0.8)
"relativ Humidity [Range: 0...1]" annotation (Placement(transformation(
extent={{14,-14},{-14,14}},
rotation=0,
origin={100,72}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,18})));
Modelica.Blocks.Interfaces.RealOutput phi_supply(start=0.8)
"relativ Humidity [Range: 0...1]" annotation (Placement(transformation(
extent={{-9,-9},{9,9}},
rotation=0,
origin={99,9}), iconTransformation(
extent={{4,-4},{-4,4}},
rotation=180,
origin={84,-34})));
Modelica.Blocks.Interfaces.RealInput T_supplyAir(unit="K", start=295.15)
"K (use as PortIn)"
annotation (Placement(transformation(extent={{114,28},{86,56}}),
iconTransformation(extent={{88,-18},{80,-10}})));
Modelica.Blocks.Interfaces.RealInput phi_supplyAir[2](start={0.4,0.6})
"relativ Humidity [Range: 0...1] (Vector: [1] min, [2] max)" annotation (
Placement(transformation(
extent={{14,-14},{-14,14}},
rotation=0,
origin={100,24}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,-24})));
Modelica.Blocks.Interfaces.RealOutput QflowC(unit="W", min=0, start=0.01)
"The absorbed cooling power supplied from a cooling circuit [W]"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-62,-100}),iconTransformation(
extent={{-5,-5},{5,5}},
rotation=-90,
origin={-11,-35})));
Modelica.Blocks.Interfaces.RealOutput QflowH(unit="W", min=0, start=0.01)
"The absorbed heating power supplied from a heating circuit [W]"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-22,-100}),iconTransformation(
extent={{-5,-5},{5,5}},
rotation=-90,
origin={29,-35})));
Modelica.Blocks.Interfaces.RealOutput Pel(unit="W", min=0, start=1e-3)
"The consumed electrical power supplied from the mains [W]" annotation (
Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={18,-100}),iconTransformation(
extent={{-5,-5},{5,5}},
rotation=-90,
origin={49,-35})));
Modelica.Blocks.Interfaces.RealOutput Vflow_out(unit="m3/s",start=1e-3) "m3/s"
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={54,-100}),iconTransformation(extent={{4,-4},{-4,4}}, origin={-96,16})));
Modelica.Blocks.Interfaces.RealOutput T_supplyAirOut(unit="K", start=295.15)
"K (use as PortOut)" annotation (Placement(transformation(
extent={{-9,-9},{9,9}},
rotation=0,
origin={99,57}), iconTransformation(
extent={{4,-4},{-4,4}},
rotation=180,
origin={84,-4})));
equation
dehumidification = if dehumidificationSet and heating and cooling then dehumidificationSet else false;
humidification = if dehumidificationSet and heating and cooling then humidificationSet else false;

annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}},
preserveAspectRatio=false)), Icon(coordinateSystem(extent={{-100,-40},
{100,40}}, preserveAspectRatio=false)),
Documentation(revisions="<html>
<ul>
<li><i><span style=\"font-family: MS Shell Dlg 2;\">February, 2016&nbsp;</span></i> by Philipp Mehrfeld:<br/>Model implemented</li>
</ul>
</html>", info="<html>
<p><span style=\"font-family: MS Shell Dlg 2;\">Base class to provide connectors. Thus, it is possible to declare parameters in a general way in superior building model and give the opportunity whether an <a href=\"AixLib.Airflow.AirHandlingUnit.AHU\">AHU exist</a> or <a href=\"AixLib.Airflow.AirHandlingUnit.NoAHU\">does not</a>.</span></p>
</html>"));
end PartialAHU;
168 changes: 168 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/Examples/TestAHU.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
within AixLib.Airflow.AirHandlingUnit.Examples;
model TestAHU
"Example to test all states of the AHU model - Play with the possible modes (boolean parameters for: heating, cooling, de-/humidification"
extends Modelica.Icons.Example;

Modelica.Blocks.Sources.Sine tempOutside(
amplitude=10,
freqHz=1/86400,
phase=-3.1415/2,
offset=292)
annotation (Placement(transformation(extent={{-100,-16},{-80,4}})));
Modelica.Blocks.Sources.Constant Vflow_in(k=100)
annotation (Placement(transformation(extent={{-100,24},{-80,44}})));
Modelica.Blocks.Sources.Constant desiredT_sup(k=293)
annotation (Placement(transformation(extent={{62,-26},{42,-6}})));
AHU ahu( clockPeriodGeneric=30,
heating=true,
cooling=true,
HRS=true)
annotation (Placement(transformation(extent={{-68,-18},{26,18}})));
Modelica.Blocks.Sources.Constant phi_roomMin(k=0.47)
annotation (Placement(transformation(extent={{68,-56},{48,-36}})));
Modelica.Blocks.Sources.Constant phi_roomMax(k=0.55)
annotation (Placement(transformation(extent={{98,-56},{78,-36}})));

Modelica.Blocks.Sources.Sine waterLoadOutside(
freqHz=1/86400,
offset=0.008,
amplitude=0.002,
phase=-0.054829518451402)
annotation (Placement(transformation(extent={{-100,-50},{-80,-30}})));
Modelica.Blocks.Sources.Constant phi_RoomExtractAir(k=0.6)
annotation (Placement(transformation(extent={{98,-24},{78,-4}})));
Modelica.Blocks.Sources.Sine tempAddInRoom(
freqHz=1/86400,
amplitude=2,
phase=-3.1415/4,
offset=1.7)
annotation (Placement(transformation(extent={{98,20},{78,40}})));
Modelica.Blocks.Math.Add addToExtractTemp
annotation (Placement(transformation(extent={{46,12},{34,24}})));
Modelica.Blocks.Interfaces.RealOutput QFlowCool(
final quantity="Power",
final unit="W") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={-26,-86})));
Modelica.Blocks.Interfaces.RealOutput QFlowHeat(
final quantity="Power",
final unit="W") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={0,-86})));
Modelica.Blocks.Interfaces.RealOutput PEl(
final quantity="Power",
final unit="W") annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
origin={26,-86})));
equation

connect(desiredT_sup.y, ahu.T_supplyAir) annotation (Line(
points={{41,-16},{34,-16},{34,-4.5},{18.48,-4.5}},
color={0,0,127},
smooth=Smooth.None));
connect(tempOutside.y, ahu.T_outdoorAir) annotation (Line(
points={{-79,-6},{-74,-6},{-74,-6.3},{-62.36,-6.3}},
color={0,0,127},
smooth=Smooth.None));
connect(Vflow_in.y, ahu.Vflow_in) annotation (Line(
points={{-79,34},{-76,34},{-76,-3.6},{-66.12,-3.6}},
color={0,0,127},
smooth=Smooth.None));
connect(phi_roomMin.y, ahu.phi_supplyAir[1]) annotation (Line(
points={{47,-46},{32,-46},{32,-8.1},{18.48,-8.1}},
color={0,0,127},
smooth=Smooth.None));
connect(waterLoadOutside.y, ahu.X_outdoorAir) annotation (Line(
points={{-79,-40},{-72,-40},{-72,-10.8},{-62.36,-10.8}},
color={0,0,127},
smooth=Smooth.None));
connect(phi_RoomExtractAir.y, ahu.phi_extractAir) annotation (Line(
points={{77,-14},{66,-14},{66,0},{30,0},{30,8.1},{18.48,8.1}},
color={0,0,127},
smooth=Smooth.None));
connect(phi_roomMax.y, ahu.phi_supplyAir[2]) annotation (Line(points={{77,-46},
{72,-46},{72,-66},{28,-66},{28,-9.9},{18.48,-9.9}}, color={0,0,
127}));
connect(ahu.T_extractAir, addToExtractTemp.y) annotation (Line(points={{18.48,
12.6},{27.92,12.6},{27.92,18},{33.4,18}}, color={0,0,127}));
connect(tempAddInRoom.y, addToExtractTemp.u1) annotation (Line(points={{77,30},
{66,30},{56,30},{56,21.6},{47.2,21.6}}, color={0,0,127}));
connect(desiredT_sup.y, addToExtractTemp.u2) annotation (Line(points={{41,-16},
{38,-16},{38,6},{56,6},{56,14.4},{47.2,14.4}}, color={0,0,127}));
connect(ahu.QflowC, QFlowCool) annotation (Line(points={{-22.41,-14.85},{
-22.41,-46.425},{-26,-46.425},{-26,-86}}, color={0,0,127}));
connect(ahu.QflowH, QFlowHeat) annotation (Line(points={{-1.73,-14.85},{-1.73,
-47.425},{0,-47.425},{0,-86}}, color={0,0,127}));
connect(ahu.Pel, PEl) annotation (Line(points={{8.61,-14.85},{8.61,-47.425},{
26,-47.425},{26,-86}}, color={0,0,127}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}}), graphics={
Text(
extent={{-88,84},{-50,58}},
lineColor={28,108,200},
fontSize=6,
textString="Heat Cool Dehu Hu HRS
1 1 1 1 1
1 1 1 0 1
1 1 0 1 1
1 1 0 0 1
1 0 0 0 1
0 1 0 0 1
0 0 0 0 1
1 1 1 1 0
1 1 1 0 0
1 1 0 1 0
1 1 0 0 0
1 0 0 0 0
0 1 0 0 0
0 0 0 0 0
"), Text(
extent={{-88,100},{-44,90}},
lineColor={28,108,200},
textString="Use the following Table for investigation of all possible modes.
Check whether variable allCond is always 1."),
Text(
extent={{-20,76},{36,62}},
lineColor={28,108,200},
fontSize=4,
horizontalAlignment=TextAlignment.Left,
textString="createPlot(id=1, position={917, 10, 693, 691}, y={\"ahu.allCond\"}, range={0.0, 90000.0, 0.89, 1.11}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}}, markers={MarkerStyle.SmallSquare});
createPlot(id=2, position={60, 18, 727, 669}, y={\"ahu.startState.active\", \"ahu.deHuHRS_true.active\", \"ahu.deHuHRS_false.active\",
\"ahu.onlyHeatingHRS_true.active\", \"ahu.onlyHeatingHRS_false.active\"}, range={0.0, 90000.0, -0.05, 1.05}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}, {238,46,47}, {0,140,72}, {217,67,180}, {0,0,0}}, markers={MarkerStyle.SmallSquare, MarkerStyle.SmallSquare, MarkerStyle.SmallSquare,
MarkerStyle.SmallSquare, MarkerStyle.SmallSquare});
createPlot(id=3, position={821, 15, 744, 666}, y={\"ahu.onlyCoolingHRS_true.active\", \"ahu.onlyCoolingHRS_false.active\",
\"ahu.huPreHHRS_true.active\", \"ahu.huPreHHRS_false.active\", \"ahu.huCHRS_true.active\",
\"ahu.huCHRS_false.active\"}, range={0.0, 90000.0, -0.05, 1.05}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}, {238,46,47}, {0,140,72}, {217,67,180}, {0,0,0}, {162,29,33}}, markers={MarkerStyle.SmallSquare, MarkerStyle.SmallSquare, MarkerStyle.SmallSquare,
MarkerStyle.SmallSquare, MarkerStyle.SmallSquare, MarkerStyle.SmallSquare});
createPlot(id=4, position={77, 62, 1429, 635}, y={\"ahu.QflowC\", \"ahu.QflowH\"}, range={0.0, 88000.0, -100000.0, 2100000.0}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}, {238,46,47}});
createPlot(id=5, position={50, 59, 1411, 632}, y={\"ahu.X_oda\", \"ahu.X_supMin\", \"ahu.X_supMax\"}, range={0.0, 88000.0, 0.0058000000000000005, 0.0102}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}, {238,46,47}, {0,140,72}}, markers={MarkerStyle.SmallSquare, MarkerStyle.SmallSquare, MarkerStyle.SmallSquare});
createPlot(id=6, position={31, 19, 1416, 654}, y={\"ahu.T_6\", \"ahu.T_oda\", \"ahu.T_supplyAirOut\"}, range={0.0, 88000.0, 8.0, 30.0}, grid=true, filename=\"TestAHU.mat\", colors={{28,108,200}, {238,46,47}, {28,108,200}}, markers={MarkerStyle.SmallSquare, MarkerStyle.SmallSquare, MarkerStyle.None});"),
Text(
extent={{-20,102},{64,82}},
lineColor={28,108,200},
textString="Double Click the text below, copy everything and
paste it after the simulation in the command line
to display most interesting plots.",
horizontalAlignment=TextAlignment.Left)}),
experiment(
StopTime=86400,
Interval=60,
__Dymola_Algorithm="Lsodar"),
__Dymola_experimentSetupOutput(events=false),
Documentation(info="<html>
<h4><span style=\"color:#008000\">Overview</span></h4>
<p>Simulation to check the behaviour of the simple Air Handling Unit models. Various possibilities for inputs are provided. </p>
<h4><span style=\"color:#008000\">Concept</span></h4>
<p>Temperature inputs are in Kelvin and the water load fraction is in kg(Water)/kg(Dry Air). </p>
<p>Occupation and Schedule is a percentage value between 0 and 1.</p>
<p>The zone parameter is needed to automatically calculate the air flow rate based on the occupation and room area.</p>
</html>"));
end TestAHU;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
within AixLib.HVAC.AirHandlingUnit;
within AixLib.Airflow.AirHandlingUnit;
package Examples "Contains examples for Air Handling Units"
extends Modelica.Icons.ExamplesPackage;

Expand Down
48 changes: 48 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/NoAHU.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
within AixLib.Airflow.AirHandlingUnit;
model NoAHU "If no AHU should exist at all"
extends AixLib.Airflow.AirHandlingUnit.BaseClasses.PartialAHU;
Modelica.Blocks.Sources.Constant dummyPhi_supply(k=0.5)
annotation (Placement(transformation(extent={{38,0},{56,18}})));
Modelica.Blocks.Sources.Constant zeroVFlowOut(k(unit="m3/s") = 0)
annotation (Placement(transformation(extent={{84,-76},{64,-56}})));
Modelica.Blocks.Sources.Constant dummyT_supplyAirOut(k=293)
annotation (Placement(transformation(extent={{38,48},{56,66}})));
Modelica.Blocks.Sources.CombiTimeTable zeroPowerElAndHeat1(
tableOnFile=false,
table=[0,0.0],
columns={2},
extrapolation=Modelica.Blocks.Types.Extrapolation.HoldLastPoint)
annotation (Placement(transformation(extent={{-94,-76},{-74,-56}})));
equation
connect(dummyPhi_supply.y, phi_supply)
annotation (Line(points={{56.9,9},{99,9}}, color={0,0,127}));
connect(zeroVFlowOut.y, Vflow_out)
annotation (Line(points={{63,-66},{54,-66},{54,-100}}, color={0,0,127}));
connect(dummyT_supplyAirOut.y, T_supplyAirOut)
annotation (Line(points={{56.9,57},{99,57},{99,57}}, color={0,0,127}));
connect(zeroPowerElAndHeat1.y[1], QflowC) annotation (Line(points={{-73,-66},
{-66,-66},{-62,-66},{-62,-100}}, color={0,0,127}));
connect(zeroPowerElAndHeat1.y[1], QflowH) annotation (Line(points={{-73,-66},
{-46,-66},{-22,-66},{-22,-100}}, color={0,0,127}));
connect(zeroPowerElAndHeat1.y[1], Pel) annotation (Line(points={{-73,-66},{
-28,-66},{18,-66},{18,-100}}, color={0,0,127}));
annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{-100,
-100},{100,100}})),
Icon(coordinateSystem(preserveAspectRatio=false,
extent={{-100,-40},{100,40}}), graphics={Text(
extent={{-48,44},{48,14}},
lineColor={28,108,200},
textString="no AHU"), Text(
extent={{-36,12},{32,-6}},
lineColor={28,108,200},
textString="(All outputs = 0)")}),
Documentation(revisions="<html>
<ul>
<li><i>February, 2016&nbsp;</i>
by Philipp Mehrfeld:<br/>
Model implemented</li>
</ul>
</html>", info="<html>
<p><span style=\"font-family: MS Shell Dlg 2;\">This model can be seen as a dummy. Connectors exist due to partialAHU but outputs are zero and inputs do not have any effect. As a conclusion it is easier to choose whether an AHU exist in a building or not. For an example see </span><code>AixLib.Building.LowOrder.Examples.MultizoneExample</code><span style=\"font-family: MS Shell Dlg 2;\">.</span></p>
</html>"));
end NoAHU;
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
within AixLib.HVAC;
within AixLib.Airflow;
package AirHandlingUnit
end AirHandlingUnit;
4 changes: 4 additions & 0 deletions AixLib/Airflow/AirHandlingUnit/package.order
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
AHU
NoAHU
Examples
BaseClasses
Loading

0 comments on commit 7804a42

Please sign in to comment.