Skip to content

Commit

Permalink
Merge pull request #1416 from open-ideas/issue1415_ImportUnitsSI
Browse files Browse the repository at this point in the history
Issue1415 Remove "import Modelica.Units.SI"
  • Loading branch information
jelgerjansen authored Feb 7, 2025
2 parents 6ad3d70 + 8600fca commit 729b353
Show file tree
Hide file tree
Showing 40 changed files with 356 additions and 117 deletions.
7 changes: 6 additions & 1 deletion IDEAS/Airflow/AHU/Examples/Adsolair58.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ model Adsolair58 "Adsolair58 example model"
replaceable package Medium = IDEAS.Media.Air;
replaceable package MediumWater = IDEAS.Media.Water "Heating medium";
parameter Modelica.Units.SI.Pressure dp_nominal=100 "Constant output value";
parameter SI.MassFlowRate m_flow_nominal=0.3 "Nominal air mass flow rate";
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.3 "Nominal air mass flow rate";
Adsolair58HeaCoi adsolair58(
redeclare package MediumAir = Medium,
redeclare BaseClasses.Adsolair14200 per,
Expand Down Expand Up @@ -361,6 +361,11 @@ A PI controller is used to track the set point temperature.
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
October 30, 2024, by Lucas Verleyen:<br/>
Updates according to <a href=\"https://github.com/ibpsa/modelica-ibpsa/tree/8ed71caee72b911a1d9b5a76e6cb7ed809875e1e\">IBPSA</a>.<br/>
See <a href=\"https://github.com/open-ideas/IDEAS/pull/1383\">#1383</a>
Expand Down
11 changes: 8 additions & 3 deletions IDEAS/Airflow/Multizone/CrackOrOperableDoor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ model CrackOrOperableDoor
parameter Modelica.Units.SI.Length h_a1 = 0 "Height at port a1(hasCavity=false)";
parameter Modelica.Units.SI.Length h_a2 "Height at port a2(hasCavity=false)";

parameter SI.Length hA=(h_a1 + h_b2)/2
parameter Modelica.Units.SI.Length hA=(h_a1 + h_b2)/2
"Height of reference pressure at port a1 for opening (hasCavity=true) model";
parameter SI.Length hB=(h_a2 + h_b1)/2
parameter Modelica.Units.SI.Length hB=(h_a2 + h_b1)/2
"Height of reference pressure at port b1 for opening (hasCavity=true) model";

final parameter Real CDCloRat(min=0, max=1)=1
Expand Down Expand Up @@ -165,7 +165,7 @@ model CrackOrOperableDoor
"Door constantly opened" annotation (
Placement(visible = true, transformation(origin = {-54, -14}, extent = {{-6, -6}, {6, 6}}, rotation = 0)));

parameter SI.Angle inc=Modelica.Constants.pi/2
parameter Modelica.Units.SI.Angle inc=Modelica.Constants.pi/2
"inclination angle (vertical=pi/2)";
initial equation
assert( not (interZonalAirFlowType <> IDEAS.BoundaryConditions.Types.InterZonalAirFlow.TwoPorts and useDoor and use_y),
Expand Down Expand Up @@ -223,6 +223,11 @@ There is no support for open doors when using only a single fluid port.
revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
January 30, 2025, by Klaas De Jonge:<br/>
Changed wrong parameter declaration <code>doo.vZer</code> to have compatible units.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1402\">#1402</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
within IDEAS.BoundaryConditions.Examples;
model StrobeInfoManager_offset
"Unit test for SimInfoManager with time offset on read data"
import IDEAS;
extends Modelica.Icons.Example;
inner IDEAS.BoundaryConditions.Occupants.Extern.StrobeInfoManager strobe(
nOcc=10,
Expand All @@ -26,6 +25,11 @@ model StrobeInfoManager_offset
Documentation(revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import IDEAS</code> statement.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a>.
</li>
<li>
December 20, 2017 by Bram van der Heijde:<br/>
First implementation.
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected
"True when a convection + radiation equation should be used to model the layer instead of conduction";

public
parameter SI.TemperatureDifference dT_nom_air=1
parameter Modelica.Units.SI.TemperatureDifference dT_nom_air=1
"Nominal temperature difference for air layers, used for linearising Rayleigh number";
equation
connect(E_internal, monLayDyn.E);
Expand Down Expand Up @@ -150,6 +150,11 @@ equation
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
September 9, 2019, by Kristoff Six:<br/>
Updated with <code>checkCoating</code> for issue
<a href=\"https://github.com/open-ideas/IDEAS/issues/1038\">#1038</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ model MultiLayer "multiple material layers in series"
parameter Boolean disableInitPortB= false
"Remove initial equation at port b"
annotation(Evaluate=true, Dialog(group="Dynamics"));
parameter SI.TemperatureDifference dT_nom_air=1
parameter Modelica.Units.SI.TemperatureDifference dT_nom_air=1
"Nominal temperature difference for air layers, used for linearising Rayleigh number"
annotation(Dialog(enable=linIntCon));
parameter Boolean checkCoatings = false
Expand Down Expand Up @@ -176,6 +176,11 @@ equation
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
August 9, 2022, by Filip Jorissen:<br/>
Updated documentation and added parameters for issue
<a href=\"https://github.com/open-ideas/IDEAS/issues/1270\">#1270</a>.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
within IDEAS.Buildings.Components.BaseClasses.RadiativeHeatTransfer.Examples;
model ZoneLwGainDistribution
import IDEAS;
extends Modelica.Icons.Example;
Modelica.Blocks.Sources.Ramp ramDir(
duration=1,
Expand Down Expand Up @@ -90,6 +89,11 @@ equation
Documentation(revisions="<html>
<ul>
<li>
February 7, 2025, by Jelger Jansen:<br/>
Removed <code>import IDEAS</code> statement.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a>.
</li>
<li>
January 19, 2017 by Filip Jorissen:<br/>
First implementation
</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ partial model RectangularZoneTemplateInterface
parameter Interfaces.WindowDynamicsType windowDynamicsType=IDEAS.Buildings.Components.Interfaces.WindowDynamicsType.Two
"Type of dynamics for glazings and frames: using zero, one combined or two states"
annotation(Dialog(group="Windows", tab="Advanced"));
parameter SI.TemperatureDifference dT_nominal_win=-3
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_win=-3
"Nominal temperature difference used for linearisation, negative temperatures indicate the solid is colder"
annotation(Dialog(group="Convective heat transfer", tab="Advanced"));
parameter Boolean linExtCon=sim.linExtCon
Expand All @@ -215,35 +215,35 @@ partial model RectangularZoneTemplateInterface
"= true, if exterior radiative heat transfer for windows should be linearised"
annotation(Dialog(tab="Advanced", group="Radiative heat exchange"));

parameter SI.TemperatureDifference dT_nominal_bou=-1
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_bou=-1
"Nominal temperature difference for boundary walls, used for linearisation, negative temperatures indicate the solid is colder"
annotation(Dialog(tab="Advanced", group="Convective heat transfer"));
parameter SI.TemperatureDifference dT_nominal_out=-3
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_out=-3
"Nominal temperature difference for outer walls, used for linearisation, negative temperatures indicate the solid is colder"
annotation(Dialog(tab="Advanced", group="Convective heat transfer"));
parameter SI.TemperatureDifference dT_nominal_sla=-3
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_sla=-3
"Nominal temperature difference of slab on ground, used for linearisation, negative temperatures indicate the solid is colder"
annotation(Dialog(tab="Advanced", group="Convective heat transfer"));
parameter SI.Temperature TeAvg=273.15 + 10.8
parameter Modelica.Units.SI.Temperature TeAvg=273.15 + 10.8
"Annual average outdoor temperature"
annotation(Dialog(tab="Floor", group="Slab on ground", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));
parameter SI.Temperature TiAvg=273.15 + 22
parameter Modelica.Units.SI.Temperature TiAvg=273.15 + 22
"Annual average indoor temperature"
annotation(Dialog(tab="Floor", group="Slab on ground", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));
parameter SI.TemperatureDifference dTeAvg=4
parameter Modelica.Units.SI.TemperatureDifference dTeAvg=4
"Amplitude of variation of monthly average outdoor temperature"
annotation(Dialog(tab="Floor", group="Slab on ground", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));
parameter SI.TemperatureDifference dTiAvg=2
parameter Modelica.Units.SI.TemperatureDifference dTiAvg=2
"Amplitude of variation of monthly average indoor temperature"
annotation(Dialog(tab="Floor", group="Slab on ground", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));
parameter Modelica.Units.SI.Temperature T_start_gro[3]=fill(TeAvg, 3)
"Initial temperatures of the ground layers (with first value = deepest layer
and last value = shallowest layer"
annotation(Evaluate=true,Dialog(tab="Floor", group="Slab on ground", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));
parameter SI.TemperatureDifference dT_nominal_intA=1
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_intA=1
"Nominal temperature difference between zone air and interior walls, used for linearisation"
annotation(Dialog(tab="Advanced", group="Convective heat transfer"));
parameter SI.TemperatureDifference dT_nominal_intB=1
parameter Modelica.Units.SI.TemperatureDifference dT_nominal_intB=1
"Nominal temperature difference between interior walls exterior connection, used for linearisation"
annotation(Dialog(tab="Advanced", group="Convective heat transfer"));
replaceable parameter IDEAS.Buildings.Data.Constructions.CavityWall conTypA
Expand Down Expand Up @@ -496,40 +496,40 @@ partial model RectangularZoneTemplateInterface
parameter Boolean hasBuildingShadeA=false
"=true, to enable computation of shade cast by opposite building or object on OuterWall"
annotation(Dialog(tab="Face A", group="Building shade", enable=(bouTypA==IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall)));
parameter SI.Length LShaA=0
parameter Modelica.Units.SI.Length LShaA=0
"Distance between shading object and wall, perpendicular to wall"
annotation(Dialog(enable=hasBuildingShadeA,tab="Face A", group="Building shade"));
parameter SI.Length dhShaA=0
parameter Modelica.Units.SI.Length dhShaA=0
"Height difference between top of shading object and top of wall A"
annotation(Dialog(enable=hasBuildingShadeA,tab="Face A", group="Building shade"));
parameter Boolean hasBuildingShadeB=false
"=true, to enable computation of shade cast by opposite building or object on OuterWall"
annotation(Dialog(tab="Face B", group="Building shade", enable=(bouTypB==IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall)));
parameter SI.Length LShaB=0
parameter Modelica.Units.SI.Length LShaB=0
"Distance between shading object and wall, perpendicular to wall"
annotation(Dialog(enable=hasBuildingShadeB,tab="Face B", group="Building shade"));
parameter SI.Length dhShaB=0
parameter Modelica.Units.SI.Length dhShaB=0
"Height difference between top of shading object and top of wall B"
annotation(Dialog(enable=hasBuildingShadeB,tab="Face B", group="Building shade"));
parameter Boolean hasBuildingShadeC=false
"=true, to enable computation of shade cast by opposite building or object on OuterWall"
annotation(Dialog(tab="Face C", group="Building shade", enable=(bouTypC==IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall)));
parameter SI.Length LShaC=0
parameter Modelica.Units.SI.Length LShaC=0
"Distance between shading object and wall, perpendicular to wall"
annotation(Dialog(enable=hasBuildingShadeC,tab="Face C", group="Building shade"));
parameter SI.Length dhShaC=0
parameter Modelica.Units.SI.Length dhShaC=0
"Height difference between top of shading object and top of wall C"
annotation(Dialog(enable=hasBuildingShadeC,tab="Face C", group="Building shade"));
parameter Boolean hasBuildingShadeD=false
"=true, to enable computation of shade cast by opposite building or object on OuterWall"
annotation(Dialog(tab="Face D", group="Building shade", enable=(bouTypD==IDEAS.Buildings.Components.Interfaces.BoundaryType.OuterWall)));
parameter SI.Length LShaD=0
parameter Modelica.Units.SI.Length LShaD=0
"Distance between shading object and wall, perpendicular to wall"
annotation(Dialog(enable=hasBuildingShadeD,tab="Face D", group="Building shade"));
parameter SI.Length dhShaD=0
parameter Modelica.Units.SI.Length dhShaD=0
"Height difference between top of shading object and top of wall D"
annotation(Dialog(enable=hasBuildingShadeD,tab="Face D", group="Building shade"));
parameter SI.Length PWall = (if hasOutA then lA else 0) + (if hasOutB then lB else 0) + (if hasOutC then lC else 0) + (if hasOutD then lD else 0)
parameter Modelica.Units.SI.Length PWall = (if hasOutA then lA else 0) + (if hasOutB then lB else 0) + (if hasOutC then lC else 0) + (if hasOutD then lD else 0)
"Total floor slab perimeter length" annotation(Dialog(tab="Advanced", group="SlabOnGround", enable=(bouTypFlo == IDEAS.Buildings.Components.Interfaces.BoundaryType.SlabOnGround)));


Expand Down Expand Up @@ -1546,6 +1546,11 @@ components cannot be propagated.
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
January 30, 2025, by Jelger Jansen:<br/>
Updated default window glazing type to avoid obsolete type warning.
See <a href=https://github.com/open-ideas/IDEAS/issues/1402>#1402</a>
Expand Down
11 changes: 8 additions & 3 deletions IDEAS/Buildings/Components/Validations/WindowEN673.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ model WindowEN673 "Verifies U value of a glazing record"
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));

replaceable package Medium = IDEAS.Media.Air "Air medium";
parameter SI.Temperature TZone=273.15 + 20
parameter Modelica.Units.SI.Temperature TZone=273.15 + 20
"Fixed interior temperature";
parameter SI.Temperature TOut=273.15
parameter Modelica.Units.SI.Temperature TOut=273.15
"Fixed exterior temperature";

Modelica.Units.SI.CoefficientOfHeatTransfer U_EN673=windowEN673.layMul.port_a.Q_flow
Expand Down Expand Up @@ -107,7 +107,7 @@ protected
TBlaSkySou=IDEAS.BoundaryConditions.Types.DataSource.Parameter,
TBlaSky=TDryBulFixed));

parameter SI.Temperature TDryBulFixed=293.15
parameter Modelica.Units.SI.Temperature TDryBulFixed=293.15
"Dry bulb temperature (used if TDryBul=Parameter)";
end SimInfoManagerFixedBC;
initial equation
Expand Down Expand Up @@ -148,6 +148,11 @@ equation
__Dymola_Algorithm="Lsodar"), Documentation(revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
November 6, 2023, by Filip Jorissen:<br/>
Set frame fraction to zero in normal window.
</li>
Expand Down
11 changes: 8 additions & 3 deletions IDEAS/Buildings/Components/Window.mo
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@ model Window "Multipane window"
parameter Boolean use_trickle_vent = false
"= true, to enable trickle vent"
annotation(Dialog(group="Trickle vent", tab="Airflow"));
parameter SI.MassFlowRate m_flow_nominal = 0
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = 0
"Nominal mass flow rate of trickle vent"
annotation(Dialog(group="Trickle vent", tab="Airflow", enable=use_trickle_vent));
parameter SI.PressureDifference dp_nominal(displayUnit="Pa") = 5
parameter Modelica.Units.SI.PressureDifference dp_nominal(displayUnit="Pa") = 5
"Pressure drop at nominal mass flow rate of trickle vent"
annotation(Dialog(group="Trickle vent", tab="Airflow", enable=use_trickle_vent));
parameter Boolean use_trickle_vent_control = false
"=true, to enable trickle vent control input"
annotation(Dialog(group="Trickle vent", tab="Airflow", enable=use_trickle_vent));
parameter SI.Length hTrickleVent= hVertical+hRelSurfBot_a
parameter Modelica.Units.SI.Length hTrickleVent= hVertical+hRelSurfBot_a
"vertical distance between the floor of the zone (top) and the trickle vent"
annotation(Dialog(group="Trickle vent", tab="Airflow", enable=use_trickle_vent));

Expand Down Expand Up @@ -467,6 +467,11 @@ IDEAS.Buildings.Components.Validations.WindowEN673</a>
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
November 7, 2024, by Anna Dell'Isola and Jelger Jansen:<br/>
Update calculation of transmission design losses.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1337\">#1337</a>
Expand Down
7 changes: 6 additions & 1 deletion IDEAS/Buildings/Examples/ScreenComparison.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model ScreenComparison "Comparison between a model with and without screen"
inner BoundaryConditions.SimInfoManager sim(interZonalAirFlowType=IDEAS.BoundaryConditions.Types.InterZonalAirFlow.OnePort)
annotation (Placement(transformation(extent={{-100,80},{-80,100}})));
replaceable package Medium = IDEAS.Media.Air;
parameter SI.MassFlowRate m_flow_nominal = zoneWithScreen.V*1.2*ACH/3600
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal = zoneWithScreen.V*1.2*ACH/3600
"Nominal mass flow rate of trickle vent";
parameter Real ACH = 1
"Ventilation air change rate";
Expand Down Expand Up @@ -88,6 +88,11 @@ equation
Documentation(revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Added <code>Modelica.Units.</code> to one or multiple parameter(s) due to the removal of <code>import</code> in IDEAS/package.mo.
See <a href=\"https://github.com/open-ideas/IDEAS/issues/1415\">#1415</a> .
</li>
<li>
October 30, 2024, by Lucas Verleyen:<br/>
Updates according to <a href=\"https://github.com/ibpsa/modelica-ibpsa/tree/8ed71caee72b911a1d9b5a76e6cb7ed809875e1e\">IBPSA</a>.<br/>
See <a href=\"https://github.com/open-ideas/IDEAS/pull/1383\">#1383</a>
Expand Down
Loading

0 comments on commit 729b353

Please sign in to comment.