Skip to content

Commit

Permalink
Merge branch 'master' into issue1970_githubImage
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Feb 14, 2025
2 parents ed34828 + 0d48fc8 commit 208dcaa
Show file tree
Hide file tree
Showing 16 changed files with 244 additions and 178 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ env:
- TEST_ARG="make test-openmodelica PACKAGE=\"IBPSA.{Examples,Experimental}\""
- TEST_ARG="make test-dymola PACKAGE=\"IBPSA.Fluid.{Actuators,BaseClasses,Chillers,Delays,Geothermal,Examples,FMI,FixedResistances}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"IBPSA.Fluid.{Actuators,BaseClasses,Chillers,Delays,Geothermal,Examples,FMI,FixedResistances}\""
- TEST_ARG="make test-dymola PACKAGE=\"IBPSA.Fluid.{HeatExchangers,HeatPumps,Humidifiers,Interfaces,MassExchangers,MixingVolumes,Movers,Sensors,Sources,Storage}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"IBPSA.Fluid.{HeatExchangers,HeatPumps,Humidifiers,Interfaces,MassExchangers,MixingVolumes,Movers,Sensors,Sources,Storage}\""
- TEST_ARG="make test-dymola PACKAGE=\"IBPSA.Fluid.{HeatExchangers,HeatPumps,Humidifiers,Interfaces,MassExchangers,MixingVolumes,Movers,SolarCollectors,Sensors,Sources,Storage}\""
- TEST_ARG="make test-openmodelica PACKAGE=\"IBPSA.Fluid.{HeatExchangers,HeatPumps,Humidifiers,Interfaces,MassExchangers,MixingVolumes,Movers,SolarCollectors,Sensors,Sources,Storage}\""
- TEST_ARG="make test-dymola PACKAGE=\"IBPSA.ThermalZones\""
- TEST_ARG="make test-openmodelica PACKAGE=\"IBPSA.ThermalZones\""
- TEST_ARG="make test-dymola PACKAGE=\"IBPSA.{Airflow,BoundaryConditions,Controls,Electrical}\""
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within IBPSA.BoundaryConditions.SolarIrradiation.BaseClasses;
block BrighteningCoefficient "Circumsolar and horizon brightening coefficients"
extends Modelica.Blocks.Icons.Block;
import H = IBPSA.Utilities.Math.Functions.regStep;
Modelica.Blocks.Interfaces.RealInput zen(
quantity="Angle",
unit="rad",
Expand Down Expand Up @@ -42,43 +41,42 @@ protected
Real b7;
Real b8;
equation
b1 = H(
b1 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=1.065 - skyCle,
x_small=d);
b2 = H(
b2 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=1.23 - skyCle,
x_small=d);
b3 = H(
b3 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=1.50 - skyCle,
x_small=d);
b4 = H(
b4 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=1.95 - skyCle,
x_small=d);
b5 = H(
b5 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=2.80 - skyCle,
x_small=d);

b6 = H(
b6 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=4.50 - skyCle,
x_small=d);
b7 = H(
b7 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=6.20 - skyCle,
x_small=d);
b8 = H(
b8 = IBPSA.Utilities.Math.Functions.regStep(
y1=1,
y2=0,
x=skyCle - 6.20,
Expand Down Expand Up @@ -119,6 +117,12 @@ This component computes the circumsolar and horizon brightening coefficients.
</html>", revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import</code> statement.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
<li>
April 27, 2018, by Michael Wetter:<br/>
Corrected <code>displayUnit</code>.<br/>
This is for
Expand Down
26 changes: 13 additions & 13 deletions IBPSA/Controls/OBC/CDL/Logical/TrueFalseHold.mo
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ block TrueFalseHold
protected
/* The following parameter is required solely as a warkaround for a bug in OCT [Modelon - 1263].
Both Dymola and OMC can handle the initial equation pre(u)=u, which complies with MLS. */
parameter Boolean pre_u_start=false
parameter Boolean pre_u_start=false
"Value of pre(u) at initial time"
annotation (Evaluate=true);
Boolean not_u = not u
Expand All @@ -49,21 +49,15 @@ equation
y = u;
entryTimeTrue = if y then time else pre(entryTimeTrue);
entryTimeFalse = if not y then time else pre(entryTimeFalse);
/*
The two elsewhen clauses below are kept separate to address an issue
with event handling in the CVODE solver.
*/
elsewhen {edge(u), edge(not_u)} then
y = if time >= pre(entryTimeFalse) + falseHoldDuration and
time >= pre(entryTimeTrue) + trueHoldDuration then u
elsewhen {edge(u),
edge(not_u),
time >= pre(entryTimeFalse) + falseHoldDuration and
time >= pre(entryTimeTrue) + trueHoldDuration} then
y=if time >= pre(entryTimeFalse) + falseHoldDuration and
time >= pre(entryTimeTrue) + trueHoldDuration then u
else pre(y);
entryTimeTrue = if edge(y) then time else pre(entryTimeTrue);
entryTimeFalse = if edge(not_y) then time else pre(entryTimeFalse);
elsewhen time >= pre(entryTimeFalse) + falseHoldDuration and
time >= pre(entryTimeTrue) + trueHoldDuration then
y = u;
entryTimeTrue = if edge(y) then time else pre(entryTimeTrue);
entryTimeFalse = if edge(not_y) then time else pre(entryTimeFalse);
end when;
annotation (
defaultComponentName="truFalHol",
Expand Down Expand Up @@ -145,6 +139,12 @@ alt=\"Input and output of the block\"/>
revisions="<html>
<ul>
<li>
January 13, 2025, by Antoine Gautier:<br/>
Merge <code>elsewhen</code> clauses.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4082\">Buildings, issue 4082</a>.
</li>
<li>
August 26, 2024, by Antoine Gautier:<br/>
Resolved an issue with unit impulse signals.<br/>
This is for
Expand Down
10 changes: 6 additions & 4 deletions IBPSA/Controls/SetPoints/OccupancySchedule.mo
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ protected
end getOutput;

encapsulated function switchInteger "Switch two Integer arguments"
import Modelica;
extends Modelica.Icons.Function;
input Integer x1 "First argument";
input Integer x2 "Second argument";
output Integer y1 "Output = x2";
Expand All @@ -107,8 +105,6 @@ algorithm
end switchInteger;

encapsulated function switchReal "Switch two Real arguments"
import Modelica;
extends Modelica.Icons.Function;
input Real x1 "First argument";
input Real x2 "Second argument";
output Real y1 "Output = x2";
Expand Down Expand Up @@ -197,6 +193,12 @@ The period always starts at <i>t=0</i> seconds.
</html>", revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import</code> statement.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
<li>
March 25, 2021, by Michael Wetter:<br/>
Integrated changes from Buildings for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1454\">IBPSA, #1454</a>.
Expand Down
19 changes: 14 additions & 5 deletions IBPSA/Electrical/PhaseSystems/ThreePhase_d.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ package ThreePhase_d "AC system covering only resistive loads with three symmetr

redeclare function phaseVoltages "Return phase to neutral voltages"
extends Modelica.Icons.Function;
input SI.Voltage V "system voltage";
input SI.Angle phi = 0 "phase angle";
output SI.Voltage v[n] "phase to neutral voltages";
input Modelica.Units.SI.Voltage V "system voltage";
input Modelica.Units.SI.Angle phi = 0 "phase angle";
output Modelica.Units.SI.Voltage v[n] "phase to neutral voltages";
algorithm
v := {V}/sqrt(3);
end phaseVoltages;
Expand All @@ -16,8 +16,8 @@ package ThreePhase_d "AC system covering only resistive loads with three symmetr
redeclare function systemVoltage
"Return system voltage as function of phase voltages"
extends Modelica.Icons.Function;
input SI.Voltage v[n];
output SI.Voltage V;
input Modelica.Units.SI.Voltage v[n];
output Modelica.Units.SI.Voltage V;
algorithm
V := sqrt(3)*v[1];
end systemVoltage;
Expand All @@ -33,5 +33,14 @@ package ThreePhase_d "AC system covering only resistive loads with three symmetr
This package declares the functions that are used to implement
the AC three-phase balanced and purely resistive models.
</p>
</html>", revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to relevant types.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
</ul>
</html>"));
end ThreePhase_d;
9 changes: 6 additions & 3 deletions IBPSA/Electrical/PhaseSystems/package.mo
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
within IBPSA.Electrical;
package PhaseSystems "Phase systems used in power connectors"
extends Modelica.Icons.Package;
import Modelica.Units.SI;
import Modelica.Constants.pi;


annotation (Icon(graphics={Line(
points={{-70,-52},{50,-52}},
Expand Down Expand Up @@ -64,6 +61,12 @@ Proc. of the 10th Modelica Conference, Lund, Sweden, March 2014.
</html>", revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import</code> statements.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
<li>
May 27, 2014, by Marco Bonvini:<br/>
Created documentation.
</li>
Expand Down
15 changes: 10 additions & 5 deletions IBPSA/Fluid/Actuators/Dampers/MixingBox.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ model MixingBox "Outside air mixing box with interlocked air dampers"
Modelica.Media.Interfaces.PartialMedium "Medium in the component"
annotation (choices(
choice(redeclare package Medium = IBPSA.Media.Air "Moist air")));
import Modelica.Constants;

parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
Expand Down Expand Up @@ -83,22 +82,22 @@ model MixingBox "Outside air mixing box with interlocked air dampers"
annotation(Dialog(tab="Damper coefficients"));

Modelica.Fluid.Interfaces.FluidPort_a port_Out(redeclare package Medium =
Medium, m_flow(start=0, min=if allowFlowReversal then -Constants.inf else
Medium, m_flow(start=0, min=if allowFlowReversal then -Modelica.Constants.inf else
0))
"Fluid connector a (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{-110,50},{-90,70}})));
Modelica.Fluid.Interfaces.FluidPort_b port_Exh(redeclare package Medium =
Medium, m_flow(start=0, max=if allowFlowReversal then +Constants.inf else
Medium, m_flow(start=0, max=if allowFlowReversal then +Modelica.Constants.inf else
0))
"Fluid connector b (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{-90,-70},{-110,-50}})));
Modelica.Fluid.Interfaces.FluidPort_a port_Ret(redeclare package Medium =
Medium, m_flow(start=0, min=if allowFlowReversal then -Constants.inf else
Medium, m_flow(start=0, min=if allowFlowReversal then -Modelica.Constants.inf else
0))
"Fluid connector a (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{110,-70},{90,-50}})));
Modelica.Fluid.Interfaces.FluidPort_b port_Sup(redeclare package Medium =
Medium, m_flow(start=0, max=if allowFlowReversal then +Constants.inf else
Medium, m_flow(start=0, max=if allowFlowReversal then +Modelica.Constants.inf else
0))
"Fluid connector b (positive design flow direction is from port_a to port_b)"
annotation (Placement(transformation(extent={{110,50},{90,70}})));
Expand Down Expand Up @@ -298,6 +297,12 @@ defaultComponentName="eco",
Documentation(revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import</code> statement.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
<li>
September 21, 2021, by Michael Wetter:<br/>
Corrected typo in comments.<br/>
This is for
Expand Down
15 changes: 10 additions & 5 deletions IBPSA/Fluid/BaseClasses/ActuatorFilter.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within IBPSA.Fluid.BaseClasses;
block ActuatorFilter
"Filter used for actuators of valves, dampers and movers"
import Modelica.Blocks.Types.Init;
extends Modelica.Blocks.Interfaces.SISO;

constant Integer n=2 "Order of filter";
Expand All @@ -17,7 +16,7 @@ block ActuatorFilter
annotation (Dialog(group="Initialization"));
parameter Real y_start=0.0
"Initial value of output (remaining states are in steady state)"
annotation(Dialog(enable=initType == Init.InitialOutput, group=
annotation(Dialog(enable=initType == Modelica.Blocks.Types.Init.InitialOutput, group=
"Initialization"));

parameter Real u_nominal = 1 "Magnitude of input";
Expand All @@ -37,11 +36,11 @@ protected
Real s[n](start=x_start/u_nom) "Filter states";

initial equation
if initType == Init.SteadyState then
if initType == Modelica.Blocks.Types.Init.SteadyState then
der(s) = zeros(n);
elseif initType == Init.InitialState then
elseif initType == Modelica.Blocks.Types.Init.InitialState then
s = x_start/u_nom;
elseif initType == Init.InitialOutput then
elseif initType == Modelica.Blocks.Types.Init.InitialOutput then
y = y_start;
der(s[1:n - 1]) = zeros(n - 1);
end if;
Expand Down Expand Up @@ -100,6 +99,12 @@ for a discussion.
</html>", revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import</code> statement.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1961\">IBPSA, #1961</a>.
</li>
<li>
July 22, 2021, by Michael Wetter:<br/>
First implementation for
<a href=\"https://https://github.com/ibpsa/modelica-ibpsa/issues/1498\">IBPSA, #1498</a>
Expand Down
Loading

0 comments on commit 208dcaa

Please sign in to comment.