Skip to content

Commit

Permalink
Merge pull request #853 from RWTH-EBC/issue740_MergeIbpsa
Browse files Browse the repository at this point in the history
Issue740 merge ibpsa
  • Loading branch information
KremerMartin authored Jan 16, 2020
2 parents 0bd164d + cff1bc9 commit c1681fd
Show file tree
Hide file tree
Showing 229 changed files with 2,001 additions and 709 deletions.
32 changes: 28 additions & 4 deletions AixLib/.copiedFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,13 @@ AixLib\Controls\Discrete\Examples\package.mo
AixLib\Controls\Discrete\Examples\package.order
AixLib\Controls\Discrete\package.mo
AixLib\Controls\Discrete\package.order
AixLib\Controls\SetPoints\Examples\HotWaterTemperatureReset.mo
AixLib\Controls\SetPoints\Examples\OccupancySchedule.mo
AixLib\Controls\SetPoints\Examples\SupplyReturnTemperatureReset.mo
AixLib\Controls\SetPoints\Examples\Table.mo
AixLib\Controls\SetPoints\Examples\package.mo
AixLib\Controls\SetPoints\Examples\package.order
AixLib\Controls\SetPoints\HotWaterTemperatureReset.mo
AixLib\Controls\SetPoints\OccupancySchedule.mo
AixLib\Controls\SetPoints\SupplyReturnTemperatureReset.mo
AixLib\Controls\SetPoints\Table.mo
AixLib\Controls\SetPoints\Validation\OccupancyScheduleNegativeStartTime.mo
AixLib\Controls\SetPoints\Validation\OccupancySchedulePositiveStartTime.mo
Expand Down Expand Up @@ -469,6 +469,8 @@ AixLib\Fluid\FixedResistances\BaseClasses\Validation\package.mo
AixLib\Fluid\FixedResistances\BaseClasses\Validation\package.order
AixLib\Fluid\FixedResistances\BaseClasses\package.mo
AixLib\Fluid\FixedResistances\BaseClasses\package.order
AixLib\Fluid\FixedResistances\CheckValve.mo
AixLib\Fluid\FixedResistances\Examples\CheckValve.mo
AixLib\Fluid\FixedResistances\Examples\FlowJunction.mo
AixLib\Fluid\FixedResistances\Examples\HydraulicDiameter.mo
AixLib\Fluid\FixedResistances\Examples\PlugFlowPipe.mo
Expand Down Expand Up @@ -1124,6 +1126,16 @@ AixLib\Fluid\Sources\Outside_CpLowRise.mo
AixLib\Fluid\Sources\PropertySource_T.mo
AixLib\Fluid\Sources\PropertySource_h.mo
AixLib\Fluid\Sources\TraceSubstancesFlowSource.mo
AixLib\Fluid\Sources\Validation\BaseClasses\BoundarySystem.mo
AixLib\Fluid\Sources\Validation\BaseClasses\BoundarySystemWithX_in.mo
AixLib\Fluid\Sources\Validation\BaseClasses\BoundarySystemWithXi_in.mo
AixLib\Fluid\Sources\Validation\BaseClasses\package.mo
AixLib\Fluid\Sources\Validation\BaseClasses\package.order
AixLib\Fluid\Sources\Validation\Boundary.mo
AixLib\Fluid\Sources\Validation\BoundaryWithX_in.mo
AixLib\Fluid\Sources\Validation\BoundaryWithXi_in.mo
AixLib\Fluid\Sources\Validation\package.mo
AixLib\Fluid\Sources\Validation\package.order
AixLib\Fluid\Sources\package.mo
AixLib\Fluid\Sources\package.order
AixLib\Fluid\Storage\BaseClasses\Buoyancy.mo
Expand All @@ -1149,6 +1161,7 @@ AixLib\Fluid\Storage\UsersGuide.mo
AixLib\Fluid\Storage\Validation\HeatExchangerDynamics.mo
AixLib\Fluid\Storage\Validation\HeatExchangerLocation.mo
AixLib\Fluid\Storage\Validation\StratifiedLoadingUnloading.mo
AixLib\Fluid\Storage\Validation\StratifiedNonUniformInitial.mo
AixLib\Fluid\Storage\Validation\package.mo
AixLib\Fluid\Storage\Validation\package.order
AixLib\Fluid\Storage\package.mo
Expand Down Expand Up @@ -1274,8 +1287,8 @@ AixLib\Resources\Images\Controls\Continuous\Examples\PIDHysteresisTimerError.png
AixLib\Resources\Images\Controls\Continuous\Examples\PIDHysteresisTimerOutput.png
AixLib\Resources\Images\Controls\Continuous\Examples\SignalRankerU.png
AixLib\Resources\Images\Controls\Continuous\Examples\SignalRankerY.png
AixLib\Resources\Images\Controls\SetPoints\Examples\HotWaterTemperatureReset.png
AixLib\Resources\Images\Controls\SetPoints\Examples\OccupancySchedule.png
AixLib\Resources\Images\Controls\SetPoints\Examples\SupplyReturnTemperatureReset.png
AixLib\Resources\Images\Controls\SetPoints\Table.png
AixLib\Resources\Images\Fluid\Actuators\Valves\Examples\TwoWayValveTable_kv.png
AixLib\Resources\Images\Fluid\Actuators\threeWayValvePressureDropSeries.png
Expand Down Expand Up @@ -1480,8 +1493,8 @@ AixLib\Resources\Scripts\Dymola\Controls\Continuous\Examples\SignalRanker.mos
AixLib\Resources\Scripts\Dymola\Controls\Continuous\Validation\LimPIDReset.mos
AixLib\Resources\Scripts\Dymola\Controls\Continuous\Validation\OffTimerNonZeroStart.mos
AixLib\Resources\Scripts\Dymola\Controls\Discrete\Examples\BooleanDelay.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Examples\HotWaterTemperatureReset.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Examples\OccupancySchedule.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Examples\SupplyReturnTemperatureReset.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Examples\Table.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Validation\OccupancyScheduleNegativeStartTime.mos
AixLib\Resources\Scripts\Dymola\Controls\SetPoints\Validation\OccupancySchedulePositiveStartTime.mos
Expand Down Expand Up @@ -1586,6 +1599,7 @@ AixLib\Resources\Scripts\Dymola\Fluid\FMI\Validation\HeaterFan.mos
AixLib\Resources\Scripts\Dymola\Fluid\FMI\Validation\HeaterFanPressureDriven.mos
AixLib\Resources\Scripts\Dymola\Fluid\FMI\Validation\HeaterFan_noReverseFlow.mos
AixLib\Resources\Scripts\Dymola\Fluid\FixedResistances\BaseClasses\Validation\PlugFlowCore.mos
AixLib\Resources\Scripts\Dymola\Fluid\FixedResistances\Examples\CheckValve.mos
AixLib\Resources\Scripts\Dymola\Fluid\FixedResistances\Examples\FlowJunction.mos
AixLib\Resources\Scripts\Dymola\Fluid\FixedResistances\Examples\HydraulicDiameter.mos
AixLib\Resources\Scripts\Dymola\Fluid\FixedResistances\Examples\PlugFlowPipe.mos
Expand Down Expand Up @@ -1787,6 +1801,9 @@ AixLib\Resources\Scripts\Dymola\Fluid\Sources\Examples\Outside_CpLowRise.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Examples\PropertySource_T.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Examples\PropertySource_h.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Examples\TraceSubstancesFlowSource.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Validation\Boundary.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Validation\BoundaryWithX_in.mos
AixLib\Resources\Scripts\Dymola\Fluid\Sources\Validation\BoundaryWithXi_in.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\BaseClasses\Examples\IndirectTankHeatExchanger.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Examples\ExpansionVessel.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Examples\Stratified.mos
Expand All @@ -1795,6 +1812,7 @@ AixLib\Resources\Scripts\Dymola\Fluid\Storage\Examples\StratifiedUnloadAtMinimum
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Validation\HeatExchangerDynamics.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Validation\HeatExchangerLocation.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Validation\StratifiedLoadingUnloading.mos
AixLib\Resources\Scripts\Dymola\Fluid\Storage\Validation\StratifiedNonUniformInitial.mos
AixLib\Resources\Scripts\Dymola\Media\Antifreeze\Validation\PropyleneGlycolWater.mos
AixLib\Resources\Scripts\Dymola\Media\Examples\AirDerivativeCheck.mos
AixLib\Resources\Scripts\Dymola\Media\Examples\AirProperties.mos
Expand All @@ -1816,6 +1834,8 @@ AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Examples\SimpleRoomFou
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Examples\SimpleRoomOneElement.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Examples\SimpleRoomThreeElements.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Examples\SimpleRoomTwoElements.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Validation\RoomWithLatentGain.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Validation\RoomWithoutLatentGain.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Validation\VDI6007\TestCase1.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Validation\VDI6007\TestCase10.mos
AixLib\Resources\Scripts\Dymola\ThermalZones\ReducedOrder\Validation\VDI6007\TestCase11.mos
Expand Down Expand Up @@ -1881,6 +1901,7 @@ AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\RegNonZeroPowe
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\RegNonZeroPowerDerivative_2_Check.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\RegStep.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\SmoothExponentialDerivativeCheck.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\SmoothHeavisideDerivatives.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\SpliceFunction.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\SpliceFunctionDerivativeCheck.mos
AixLib\Resources\Scripts\Dymola\Utilities\Math\Functions\Examples\TrapezoidalIntegration.mos
Expand Down Expand Up @@ -2012,6 +2033,8 @@ AixLib\ThermalZones\ReducedOrder\SolarGain\BaseClasses\package.order
AixLib\ThermalZones\ReducedOrder\SolarGain\CorrectionGDoublePane.mo
AixLib\ThermalZones\ReducedOrder\SolarGain\package.mo
AixLib\ThermalZones\ReducedOrder\SolarGain\package.order
AixLib\ThermalZones\ReducedOrder\Validation\RoomWithLatentGain.mo
AixLib\ThermalZones\ReducedOrder\Validation\RoomWithoutLatentGain.mo
AixLib\ThermalZones\ReducedOrder\Validation\VDI6007\BaseClasses\VerifyDifferenceThreePeriods.mo
AixLib\ThermalZones\ReducedOrder\Validation\VDI6007\BaseClasses\package.mo
AixLib\ThermalZones\ReducedOrder\Validation\VDI6007\BaseClasses\package.order
Expand Down Expand Up @@ -2165,6 +2188,7 @@ AixLib\Utilities\Math\Functions\Examples\RegNonZeroPowerDerivativeCheck.mo
AixLib\Utilities\Math\Functions\Examples\RegNonZeroPowerDerivative_2_Check.mo
AixLib\Utilities\Math\Functions\Examples\RegStep.mo
AixLib\Utilities\Math\Functions\Examples\SmoothExponentialDerivativeCheck.mo
AixLib\Utilities\Math\Functions\Examples\SmoothHeavisideDerivatives.mo
AixLib\Utilities\Math\Functions\Examples\SpliceFunction.mo
AixLib\Utilities\Math\Functions\Examples\SpliceFunctionDerivativeCheck.mo
AixLib\Utilities\Math\Functions\Examples\TrapezoidalIntegration.mo
Expand Down
4 changes: 2 additions & 2 deletions AixLib/Airflow/Multizone/Examples/OneOpenDoor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ model OneOpenDoor "Model with one open and one closed door"

package Medium = Modelica.Media.Air.SimpleAir;

AixLib.Airflow.Multizone.DoorDiscretizedOpen dooOpe(redeclare package Medium =
Medium) "Discretized door"
AixLib.Airflow.Multizone.DoorDiscretizedOpen dooOpe(redeclare package Medium
= Medium) "Discretized door"
annotation (Placement(transformation(extent={{10,-8},{30,12}})));

AixLib.Fluid.MixingVolumes.MixingVolume volA(
Expand Down
13 changes: 8 additions & 5 deletions AixLib/BoundaryConditions/Types.mo
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ package Types "Package with type definitions"
<p>
Enumeration to define the data source used in the weather data reader.
</p>
</html>", revisions="<html>
</html>", revisions=
"<html>
<ul>
<li>
July 20, 2011, by Michael Wetter:<br/>
Expand All @@ -31,7 +32,8 @@ First implementation.
<p>
Enumeration to define the data source used in the weather data reader.
</p>
</html>", revisions="<html>
</html>", revisions=
"<html>
<ul>
<li>
August 13, 2012, by Wangda Zuo:<br/>
Expand All @@ -44,12 +46,13 @@ First implementation.
"Use horizontal irradiation",
TemperaturesAndSkyCover
"Use dry-bulb and dew-point temperatures and sky cover")
"Enumeration for computation of sky temperature" annotation (Documentation(
info = "<html>
"Enumeration for computation of sky temperature"
annotation (Documentation(info="<html>
<p>
Enumeration to define the method used to compute the sky temperature.
</p>
</html>", revisions="<html>
</html>", revisions=
"<html>
<ul>
<li>
October 3, 2011, by Michael Wetter:<br/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ algorithm
AixLib.BoundaryConditions.WeatherData.BaseClasses.getHeaderElementTMY3(
filNam=filNam,
start="#LOCATION",
name = "longitude",
name= "longitude",
position=8);
(nexInd, lon) :=Modelica.Utilities.Strings.Advanced.scanReal(
string=element,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ algorithm
AixLib.BoundaryConditions.WeatherData.BaseClasses.getHeaderElementTMY3(
filNam=filNam,
start="#LOCATION",
name = "longitude",
name= "longitude",
position=9);
(nexInd, timZon) :=Modelica.Utilities.Strings.Advanced.scanReal(
string=element,
Expand Down
14 changes: 14 additions & 0 deletions AixLib/BoundaryConditions/WeatherData/ReaderTMY3.mo
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,14 @@ equation
Documentation(info="<html>
<p>
This component reads TMY3 weather data (Wilcox and Marion, 2008) or user specified weather data.
The Modelica built-in variable <code>time</code> determines what row
of the weather file is read.
The value of <code>time</code> is the number of seconds
that have passed since January 1st at midnight (00:00) in the local time zone.
The local time zone value, longitude and latitute are also read from the weather data,
such that the solar position computations are consistent with the weather data.
</p>
<p>
The weather data format is the Typical Meteorological Year (TMY3)
as obtained from the EnergyPlus web site at
<a href=\"http://energyplus.net/weather\">
Expand Down Expand Up @@ -1591,6 +1599,12 @@ Technical Report, NREL/TP-581-43156, revised May 2008.
</html>", revisions="<html>
<ul>
<li>
August 20, 2019, by Filip Jorissen:<br/>
Better clarified the meaning of <code>time</code> in the documentation.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1192\">#1192</a>.
</li>
<li>
March 5, 2019, by Michael Wetter:<br/>
Updated documentation.<br/>
This is for
Expand Down
3 changes: 2 additions & 1 deletion AixLib/Controls/Continuous/Examples/SignalRanker.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ model SignalRanker "Example model for signal ranker"
annotation (Placement(transformation(extent={{-60,-20},{-40,0}})));
Modelica.Blocks.Sources.Pulse pulse(period=0.25)
annotation (Placement(transformation(extent={{-60,20},{-40,40}})));
AixLib.Controls.Continuous.SignalRanker sigRan( nin=3)
AixLib.Controls.Continuous.SignalRanker sigRan(
nin=3)
annotation (Placement(transformation(extent={{-20,20},{0,40}})));
Modelica.Blocks.Sources.ExpSine expSine(freqHz=10, damping=1)
annotation (Placement(transformation(extent={{-60,60},{-40,80}})));
Expand Down
97 changes: 95 additions & 2 deletions AixLib/Controls/Continuous/LimPID.mo
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ protected
annotation (
Placement(transformation(extent={{60,-80},{40,-60}})));

Modelica.Blocks.Nonlinear.Limiter limiter(
Limiter limiter(
final uMax=yMax,
final uMin=yMin,
final strict=strict) "Output limiter"
final strict=strict)
"Output limiter"
annotation (Placement(transformation(extent={{70,-10},{90,10}})));


Expand All @@ -191,6 +192,91 @@ protected
"Signal source for integrator reset"
annotation (Placement(transformation(extent={{-80,-90},{-60,-70}})));

// The block Limiter below has been implemented as it is introduced in MSL 3.2.3, but
// not all tools include MSL 3.2.3.
// See https://github.com/ibpsa/modelica-ibpsa/pull/1222#issuecomment-554114617
block Limiter "Limit the range of a signal"
parameter Real uMax(start=1) "Upper limits of input signals";
parameter Real uMin= -uMax "Lower limits of input signals";
parameter Boolean strict=false "= true, if strict limits with noEvent(..)"
annotation (Evaluate=true, choices(checkBox=true), Dialog(tab="Advanced"));
parameter Boolean limitsAtInit=true
"Has no longer an effect and is only kept for backwards compatibility (the implementation uses now the homotopy operator)"
annotation (Dialog(tab="Dummy"),Evaluate=true, choices(checkBox=true));
extends Modelica.Blocks.Interfaces.SISO;

equation
assert(uMax >= uMin, "Limiter: Limits must be consistent. However, uMax (=" + String(uMax) +
") < uMin (=" + String(uMin) + ")");

if strict then
y = smooth(0, noEvent(if u > uMax then uMax else if u < uMin then uMin else u));
else
y = smooth(0,if u > uMax then uMax else if u < uMin then uMin else u);
end if;
annotation (
Icon(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}}), graphics={
Line(points={{0,-90},{0,68}}, color={192,192,192}),
Polygon(
points={{0,90},{-8,68},{8,68},{0,90}},
lineColor={192,192,192},
fillColor={192,192,192},
fillPattern=FillPattern.Solid),
Line(points={{-90,0},{68,0}}, color={192,192,192}),
Polygon(
points={{90,0},{68,-8},{68,8},{90,0}},
lineColor={192,192,192},
fillColor={192,192,192},
fillPattern=FillPattern.Solid),
Line(points={{-80,-70},{-50,-70},{50,70},{80,70}}),
Text(
extent={{-150,-150},{150,-110}},
textString="uMax=%uMax"),
Line(
visible=strict,
points={{50,70},{80,70}},
color={255,0,0}),
Line(
visible=strict,
points={{-80,-70},{-50,-70}},
color={255,0,0})}),
Diagram(coordinateSystem(
preserveAspectRatio=true,
extent={{-100,-100},{100,100}}), graphics={
Line(points={{0,-60},{0,50}}, color={192,192,192}),
Polygon(
points={{0,60},{-5,50},{5,50},{0,60}},
lineColor={192,192,192},
fillColor={192,192,192},
fillPattern=FillPattern.Solid),
Line(points={{-60,0},{50,0}}, color={192,192,192}),
Polygon(
points={{60,0},{50,-5},{50,5},{60,0}},
lineColor={192,192,192},
fillColor={192,192,192},
fillPattern=FillPattern.Solid),
Line(points={{-50,-40},{-30,-40},{30,40},{50,40}}),
Text(
extent={{46,-6},{68,-18}},
lineColor={128,128,128},
textString="u"),
Text(
extent={{-30,70},{-5,50}},
lineColor={128,128,128},
textString="y"),
Text(
extent={{-58,-54},{-28,-42}},
lineColor={128,128,128},
textString="uMin"),
Text(
extent={{26,40},{66,56}},
lineColor={128,128,128},
textString="uMax")}));
end Limiter;


initial equation
if initType==Modelica.Blocks.Types.InitPID.InitialOutput then
gainPID.y = y_start;
Expand Down Expand Up @@ -336,6 +422,13 @@ Some parameters assignments in the instances have been made final.
revisions="<html>
<ul>
<li>
October 19, 2019, by Filip Jorissen:<br/>
Disabled homotopy to ensure bounded outputs
by copying the implementation from MSL 3.2.3 and by
hardcoding the implementation for <code>homotopyType=NoHomotopy</code>.
See <a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1221\">issue 1221</a>.
</li>
<li>
September 29, 2016, by Michael Wetter:<br/>
Refactored model.
</li>
Expand Down
1 change: 0 additions & 1 deletion AixLib/Controls/Discrete/Examples/package.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within AixLib.Controls.Discrete;
package Examples "Collection of models that illustrate model use and test models"
extends Modelica.Icons.ExamplesPackage;

annotation (preferredView="info", Documentation(info="<html>
<p>
This package contains examples for the use of models that can be found in
Expand Down
1 change: 0 additions & 1 deletion AixLib/Controls/Discrete/package.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within AixLib.Controls;
package Discrete "Package with models for discrete time controls"
extends Modelica.Icons.Package;

annotation (
preferredView="info", Documentation(info="<html>
This package contains component models for discrete time controls.
Expand Down
Loading

0 comments on commit c1681fd

Please sign in to comment.