Skip to content

Commit

Permalink
Merge pull request #440 from RWTH-EBC/release_v05
Browse files Browse the repository at this point in the history
Release v0.5.2
  • Loading branch information
Ana Constantin authored Jul 27, 2017
2 parents 4b7047c + f2ee851 commit 165f647
Show file tree
Hide file tree
Showing 1,744 changed files with 60,021 additions and 12,600 deletions.
32 changes: 32 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
language: python
python:
- "2.7"

cache: pip

notifications:
email: false

git:
depth: 10

services:
- docker

env:
- TEST_ARG="make test-documentation"


# Install dependencies
# For sphinx, we need to install specific package versions, otherwise
# the html output may have small formatting differences which causes
# the test to fail
install:
- export PYTHONIOENCODING=UTF8 # just in case
- pip install --upgrade pip setuptools wheel
- pip install --only-binary=numpy,scipy,matplotlib numpy scipy matplotlib
- pip install git+https://github.com/lbl-srg/BuildingsPy@master

# Execute tests
script:
- (cd AixLib/Resources/Scripts/travis && travis_wait 70 $TEST_ARG)
180 changes: 157 additions & 23 deletions AixLib/.copiedFiles.txt

Large diffs are not rendered by default.

60 changes: 33 additions & 27 deletions AixLib/Airflow/AirHandlingUnit/AHU.mo
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ model AHU

// Sampler (time-continous to time-discrete variables)

Modelica_Synchronous.RealSignals.Sampler.SampleVectorizedAndClocked sample(n=8)
Modelica_Synchronous.RealSignals.Sampler.SampleVectorizedAndClocked sample(n=9)
annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=-90,
Expand Down Expand Up @@ -747,6 +747,7 @@ equation
X_supMax = sample.y[6];
X_eta = sample.y[7];
V_dot_sup = sample.y[8];
V_dot_eta = sample.y[9];

// absolute humidity for state of saturated outdoor air
X_odaSat = molarMassRatio*(611.2*exp(17.62*(T_oda - T_0)/(243.12 + T_oda -
Expand Down Expand Up @@ -847,9 +848,6 @@ equation
Modelica.Media.Air.MoistAir.saturationPressure(T_extractAir))/(p_0 -
phi_extractAir*Modelica.Media.Air.MoistAir.saturationPressure(T_extractAir));

// equation for outgoing volume flow
V_dot_sup = V_dot_eta "no leckage between supply and extract air";

// calculation of T_5 and T_6 regarding the electrical power consumption
P_el_sup = V_dot_sup*dp_sup/eta_sup
"Calculation of electrical power consumption";
Expand All @@ -872,8 +870,17 @@ equation
stateToOnlyHeatingHRS_false or stateToOnlyCoolingHRS_true or
stateToOnlyCoolingHRS_false then true else false;

Vflow_out = hold(V_dot_eta);
Pel = if Vflow_out > 0 then hold(P_el_eta) + hold(P_el_sup) else 0;
Vflow_out = hold(V_dot_sup);
if Vflow_out > 0 and hold(V_dot_eta) <= 0 then
Pel = hold(P_el_sup);
elseif Vflow_out <= 0 and hold(V_dot_eta) > 0 then
Pel = hold(P_el_eta);
elseif Vflow_out > 0 and hold(V_dot_eta) > 0 then
Pel = hold(P_el_eta) + hold(P_el_sup);
else
Pel = 0;
end if;

QflowH = if hold(Q_dot_H) > 0 then hold(Q_dot_H) else 0;
QflowC = if hold(Q_dot_C) > 0 then hold(Q_dot_C) else 0;

Expand Down Expand Up @@ -1270,23 +1277,25 @@ equation
//stateToHuCHRS_false==false,

connect(T_outdoorAir, sample.u[1]) annotation (Line(points={{-100,56},{-100,
56},{-67.75,56},{-67.75,26}},
56},{-67.7778,56},{-67.7778,26}},
color={0,0,127}));
connect(X_outdoorAir, sample.u[2]) annotation (Line(points={{-100,36},{-100,
36},{-67.25,36},{-67.25,26}},
36},{-67.3333,36},{-67.3333,26}},
color={0,0,127}));
connect(T_supplyAir, sample.u[3]) annotation (Line(points={{100,42},{100,42},
{-66.75,42},{-66.75,26}},
connect(T_supplyAir, sample.u[3]) annotation (Line(points={{100,36},{100,42},
{-66.8889,42},{-66.8889,26}},
color={0,0,127}));
connect(T_extractAir, sample.u[4]) annotation (Line(points={{100,90},{-60,90},
{-60,60},{-66.25,60},{-66.25,26}},
connect(T_extractAir, sample.u[4]) annotation (Line(points={{100,78},{-60,78},
{-60,60},{-66.4444,60},{-66.4444,26}},
color={0,0,127}));
connect(Vflow_in, sample.u[8]) annotation (Line(points={{-100,82},{-64.25,82},
{-64.25,26}},color={0,0,127}));
connect(hold_phi_sup.y, phi_supply) annotation (Line(points={{79,9},{99,9},{
99,9}}, color={0,0,127}));
connect(Vflow_in, sample.u[8]) annotation (Line(points={{-100,82},{-64.6667,
82},{-64.6667,26}},
color={0,0,127}));
connect(Vflow_in_extractAir_internal, sample.u[9]);
connect(hold_phi_sup.y, phi_supply) annotation (Line(points={{79,9},{99,9},{99,
5}}, color={0,0,127}));
connect(TsupAirOut.y, T_supplyAirOut) annotation (Line(points={{79,57},{99,57},
{99,57}}, color={0,0,127}));
{99,49}}, color={0,0,127}));
public
block StateExtra

Expand Down Expand Up @@ -1344,24 +1353,24 @@ equation
graphics={
Bitmap(
extent={{36,-42},{100,4}}, fileName=
"modelica://AixLib/Images/AHU/HumidifierCooling.jpg"),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/HumidifierCooling.jpg"),
Bitmap(
extent={{-100,-90},{-36,-44}}, fileName=
"modelica://AixLib/Images/AHU/Dehumidifier.jpg"),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/Dehumidifier.jpg"),
Bitmap(
extent={{-32,-42},{32,4}}, fileName=
"modelica://AixLib/Images/AHU/HumidifierHeating.jpg"),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/HumidifierHeating.jpg"),
Bitmap(
extent={{-32,-90},{32,-44}}, fileName=
"modelica://AixLib/Images/AHU/Heating.jpg"),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/Heating.jpg"),
Bitmap(
extent={{36,-90},{100,-44}}, fileName=
"modelica://AixLib/Images/AHU/Cooling.jpg")}),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/Cooling.jpg")}),
experiment(StopTime=13398, Interval=5),
Icon(coordinateSystem(extent={{-100,-40},{100,40}}, preserveAspectRatio=false),
graphics={Bitmap(
extent={{-100,-28},{100,28}}, fileName=
"modelica://AixLib/Resources/Images/AHU/AHUaccToDINV18599-3.jpg"),
"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/AHUaccToDINV18599-3.jpg"),
Rectangle(
extent={{68,24},{98,-18}},
fillColor={255,255,255},
Expand All @@ -1374,9 +1383,6 @@ equation
<p>It is based on incoming and outgoing enthalpy flows of moist air (thermodynamic principle).</p>
<p><span style=\"font-family: MS Shell Dlg 2;\">The model aims to need little computational effort. Therefore state machines represent the basis of the model and no Modelica Fluid is used.</span></p>
<p>If simulation runs instable, reduce clockPeriodGeneric and/or use one of the alternative equations for the calculation of <code>p_sat_surface</code> in both dehumidification state machines (see source code of these state machines).</p>
<h4><span style=\"color: #008000\">Level of Development</span></h4>
<p><img src=\"modelica://AixLib/Resources/Images/stars4.png\" alt=\"stars: 4 out of 5\"/></p>
<p>4 stars because the model was validated with an AHU test bench at E.ON ERC EBC, RWTH Aachen University. Additionally, simulations of a city district were made and compared to measurement data. Examples and descriptions are recorded in [1]. </p>
<h4><span style=\"color: #008000\">Assumptions</span></h4>
<p>For further explanation for each parameter see noted sources and [1]! Please note that the assumptions are made regarding AHUs which are implemented in laboratories.</p>
<ul>
Expand All @@ -1403,7 +1409,7 @@ equation
<li>This model of an AHU is able to represent 5 cases: only heating, only cooling, dehumidification, humidification plus heating, humidification plus cooling.</li>
</ul>
<p><br/>Figure 1 [5, appendix D] </p>
<p><img src=\"modelica://AixLib/Resources/Images/AHU/AHUaccToDINV18599-3.jpg\"
<p><img src=\"modelica://AixLib/Resources/Images/Airflow/AirHandlingUnit/AHUaccToDINV18599-3.jpg\"
alt=\"schema of AHU\"/> </p>
<p><br/><b><span style=\"color: #008000;\">References</span></b></p>
<ul>
Expand Down
54 changes: 37 additions & 17 deletions AixLib/Airflow/AirHandlingUnit/BaseClasses/PartialAHU.mo
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
within AixLib.Airflow.AirHandlingUnit.BaseClasses;
partial model PartialAHU "Defines necessary parameters and connectors"


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"));
// Booleans for possible AHU modes
inner parameter Boolean heating=true "Heating Function of AHU"
annotation (Dialog(group="AHU Modes"));
Expand All @@ -18,12 +22,19 @@ partial model PartialAHU "Defines necessary parameters and connectors"
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"
"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));
parameter Boolean use_Vflow_in_extractAir=false
"If incoming volume flow of outdoor/supply air should not equal the
volume flow of extract air, set this parameter to true"
annotation (Evaluate=true, HideResult=true, Dialog(group="AHU Modes"),
choices(checkBox=true));
// Efficiency of HRS
parameter Real efficiencyHRS_enabled(
min=0,
Expand All @@ -32,13 +43,9 @@ partial model PartialAHU "Defines necessary parameters and connectors"
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)"
"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"
Expand Down Expand Up @@ -66,36 +73,36 @@ partial model PartialAHU "Defines necessary parameters and connectors"
annotation (Placement(transformation(
extent={{14,-14},{-14,14}},
rotation=0,
origin={100,90}),iconTransformation(
origin={100,78}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,28})));
origin={84,22})));
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(
origin={100,62}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,18})));
origin={84,12})));
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(
origin={99,5}), 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}}),
annotation (Placement(transformation(extent={{114,22},{86,50}}),
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(
origin={100,20}),iconTransformation(
extent={{-4,-4},{4,4}},
rotation=180,
origin={84,-24})));
Expand Down Expand Up @@ -126,23 +133,36 @@ partial model PartialAHU "Defines necessary parameters and connectors"
extent={{-5,-5},{5,5}},
rotation=-90,
origin={49,-35})));
Modelica.Blocks.Interfaces.RealOutput Vflow_out(unit="m3/s",start=1e-3) "m3/s"
Modelica.Blocks.Interfaces.RealOutput Vflow_out(unit="m3/s",start=1e-3)
"supply volume flow in 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(
"K (use as PortOut)" annotation (Placement(transformation(
extent={{-9,-9},{9,9}},
rotation=0,
origin={99,57}), iconTransformation(
origin={99,49}), iconTransformation(
extent={{4,-4},{-4,4}},
rotation=180,
origin={84,-4})));
Modelica.Blocks.Interfaces.RealInput Vflow_in_extractAir(unit="m3/s") if
use_Vflow_in_extractAir "Volume flow of extract air"
annotation (Placement(transformation(extent={{114,80},{86,108}}),
iconTransformation(extent={{88,32},{80,40}})));
protected
Modelica.Blocks.Interfaces.RealInput Vflow_in_extractAir_internal(unit="m3/s") "Needed to connect to conditional connector";
equation
dehumidification = if dehumidificationSet and heating and cooling then dehumidificationSet else false;
humidification = if dehumidificationSet and heating and cooling then humidificationSet else false;

connect(Vflow_in_extractAir, Vflow_in_extractAir_internal);

if not use_Vflow_in_extractAir then
Vflow_in_extractAir_internal = Vflow_in;
end if;

annotation (Diagram(coordinateSystem(extent={{-100,-100},{100,100}},
preserveAspectRatio=false)), Icon(coordinateSystem(extent={{-100,-40},
{100,40}}, preserveAspectRatio=false)),
Expand Down
2 changes: 1 addition & 1 deletion AixLib/Airflow/Multizone/BaseClasses/DoorDiscretized.mo
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ revisions="<html>
January 22, 2016, by Michael Wetter:<br/>
Corrected type declaration of pressure difference.
This is
for <a href=\"https://github.com/iea-annex60/modelica-annex60/issues/404\">#404</a>.
for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/404\">#404</a>.
</li>
<li>
September 26, 2013 by Michael Wetter:<br/>
Expand Down
2 changes: 1 addition & 1 deletion AixLib/Airflow/Multizone/BaseClasses/Examples/PowerLaw.mo
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ equation
m=m,
dp_turbulent=dp_turbulent);
annotation (
experiment(StopTime=1.0),
experiment(Tolerance=1e-6, StopTime=1.0),
__Dymola_Commands(file="modelica://AixLib/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/PowerLaw.mos"
"Simulate and plot"), Documentation(info="<html>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ equation
dp_turbulent=dp_turbulent);
assert(abs(V_flow-VFixed_flow) < 1E-10, "Error: The two implementations of the power law model need to give identical results");
annotation (
experiment(StopTime=1.0),
experiment(Tolerance=1e-6, StopTime=1.0),
__Dymola_Commands(file="modelica://AixLib/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/PowerLawFixedM.mos"
"Simulate and plot"), Documentation(info="<html>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ equation
G=G,
incAng=incAng);
annotation (
experiment(StartTime=-2, StopTime=2),
experiment(StartTime=-2, Tolerance=1e-6, StopTime=2),
__Dymola_Commands(file="modelica://AixLib/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/WindPressureLowRise.mos"
"Simulate and plot"), Documentation(info="<html>
<p>
Expand Down
4 changes: 2 additions & 2 deletions AixLib/Airflow/Multizone/BaseClasses/PowerLawResistance.mo
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ revisions="<html>
January 22, 2016, by Michael Wetter:<br/>
Corrected type declaration of pressure difference.
This is
for <a href=\"https://github.com/iea-annex60/modelica-annex60/issues/404\">#404</a>.
for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/404\">#404</a>.
</li>
<li>
November 19, 2015, by Michael Wetter:<br/>
Removed assignment of parameter
<code>showDesignFlowDirection</code> in <code>extends</code> statement.
This is for
<a href=\"https://github.com/iea-annex60/modelica-annex60/issues/349\">#349</a>.
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/349\">#349</a>.
</li>
<li>
January 21, 2015 by Michael Wetter:<br/>
Expand Down
2 changes: 1 addition & 1 deletion AixLib/Airflow/Multizone/BaseClasses/TwoWayFlowElement.mo
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Removed start values for inflowing density
to simplify the parameter window, and because this can usually
be computed from the state variables.<br/>
This is for
<a href=\"https://github.com/iea-annex60/modelica-annex60/issues/552\">#552</a>.
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/552\">#552</a>.
</li>
<li>
February 24, 2015 by Michael Wetter:<br/>
Expand Down
2 changes: 1 addition & 1 deletion AixLib/Airflow/Multizone/BaseClasses/powerLaw.mo
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ revisions="<html>
January 22, 2016, by Michael Wetter:<br/>
Corrected type declaration of pressure difference.
This is
for <a href=\"https://github.com/iea-annex60/modelica-annex60/issues/404\">#404</a>.
for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/404\">#404</a>.
</li>
<li>
<i>August 12, 2011</i> by Michael Wetter:<br/>
Expand Down
2 changes: 1 addition & 1 deletion AixLib/Airflow/Multizone/BaseClasses/powerLawFixedM.mo
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ revisions="<html>
January 22, 2016, by Michael Wetter:<br/>
Corrected type declaration of pressure difference.
This is
for <a href=\"https://github.com/iea-annex60/modelica-annex60/issues/404\">#404</a>.
for <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/404\">#404</a>.
</li>
<li>
<i>August 12, 2011</i> by Michael Wetter:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ which generally leads to better numeric performance.
March 15, 2016, by Michael Wetter:<br/>
Replaced <code>spliceFunction</code> with <code>regStep</code>.
This is for
<a href=\"https://github.com/iea-annex60/modelica-annex60/issues/300\">issue 300</a>.
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/300\">issue 300</a>.
</li>
<li>
January 26, 2016, by Michael Wetter:<br/>
Expand Down
Loading

0 comments on commit 165f647

Please sign in to comment.