Skip to content

Commit

Permalink
Merge branch 'master' of github.com:lbl-srg/modelica-buildings into i…
Browse files Browse the repository at this point in the history
…ssue1374_template_CHW_final
  • Loading branch information
AntoineGautier committed Feb 12, 2025
2 parents 7dc5f69 + 8712af7 commit 0c2e878
Show file tree
Hide file tree
Showing 30 changed files with 140 additions and 70 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ env:
- DOCKER_REPONAME=lbnlblum
- BUILDINGSPY_VERSION=BuildingsPy@0bc654fd913c83f64163be167807e8989eff0293
- OMC_VERSION=ubuntu-2204-omc:1.24.0-1
- OPTIMICA_VERSION=travis-ubuntu-2204-optimica:1.51.6
- OPTIMICA_VERSION=travis-ubuntu-2204-optimica:1.55.11
- DYMOLA_VERSION=travis_ubuntu-2004_dymola:2025x-x86_64
- ENERGYPLUS_9_6_0=EnergyPlus-9.6.0-f420c06a69-Linux-Ubuntu20.04-x86_64
- ENERGYPLUS_23_1_0=EnergyPlus-23.1.0-87ed9199d4-Linux-Ubuntu20.04-x86_64
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ model ConstantCarnotEffectiveness "Carnot EER with a constant Carnot effectivene
min=0,
final unit="1") = etaCarnot_nominal*(TEva_nominal - TAppEva_nominal)/(
TCon_nominal + TAppCon_nominal - (TEva_nominal - TAppEva_nominal))
"Nominal EER";
"Nominal EER"
annotation(Dialog(group="Nominal condition"));

Modelica.Blocks.Sources.Constant constNegOne(final k=-1)
"Negative one to negative evaporator heat flow rate" annotation (Placement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ For a network of <i>n</i> buried pipes that are coaxial, the matrix <i>P</i> of
<i>n x n</i> is computed from the system geometry:
</p>
<p>
<img alt=\"image\" src=\"modelica://Buildings/Resources/Images/Fluid/Geothermal/BuriedPipes/BaseClasses/groundCouplingFactors.svg\" />
<img alt=\"image\" src=\"modelica://Buildings/Resources/Images/Fluid/FixedResistances/BuriedPipes/BaseClasses/groundCouplingFactors.svg\" />
</p>
<p>
where: <br>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,19 @@ partial model PartialReversibleRefrigerantMachine
"if use_rev=true, device data for cooling and heating need to entered. Set allowDifferentDeviceIdentifiers=true to allow different device identifiers devIde"
annotation(Dialog(tab="Advanced", enable=use_rev));

// Safety control
parameter Boolean use_intSafCtr=true
"=true to enable internal safety control"
annotation (Dialog(group="Safety control"), choices(checkBox=true));
replaceable parameter
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021 safCtrPar
constrainedby
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Generic
"Safety control parameters" annotation (Dialog(enable=use_intSafCtr,
group="Safety control"),
choicesAllMatching=true,
Placement(transformation(extent={{42,-18},{58,-2}})));

//Condenser
parameter Modelica.Units.SI.Time tauCon=30
"Condenser heat transfer time constant at nominal flow"
Expand Down Expand Up @@ -130,20 +143,6 @@ partial model PartialReversibleRefrigerantMachine
MediumEva.specificHeatCapacityCp(staEva_nominal)
"Evaporator medium specific heat capacity";

// Safety control
parameter Boolean use_intSafCtr=true
"=true to enable internal safety control"
annotation (Dialog(group="Safety control"), choices(checkBox=true));
replaceable parameter
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Wuellhorst2021 safCtrPar
constrainedby
Buildings.Fluid.HeatPumps.ModularReversible.Controls.Safety.Data.Generic
"Safety control parameters" annotation (Dialog(enable=use_intSafCtr,
group="Safety control"),
choicesAllMatching=true,
Placement(transformation(extent={{42,-18},{58,-2}})));


//Assumptions
parameter Boolean allowFlowReversalEva=true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ within Buildings.Fluid.HeatPumps.ModularReversible.RefrigerantCycle.BaseClasses;
partial model PartialCarnot
"Model with components for Carnot efficiency calculation"
parameter Boolean useForChi "=false to use in heat pump models";
parameter Real etaCarnot_nominal=0.3 "Constant Carnot effectiveness";
parameter Real etaCarnot_nominal=0.3 "Constant Carnot effectiveness"
annotation(Dialog(group="Nominal condition"));
parameter Boolean use_constAppTem=false
"=true to fix approach temperatures at nominal values. This can improve simulation speed";
"=true to fix approach temperatures at nominal values. This can improve simulation speed"
annotation(Dialog(group="Efficiency"));
parameter Modelica.Units.SI.TemperatureDifference TAppCon_nominal(min=0)
"Temperature difference between refrigerant and working fluid outlet in condenser"
annotation (Dialog(group="Efficiency"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ partial model PartialHeatPumpCycle
"Calculates evaporator heat flow with total energy balance" annotation (
Placement(transformation(extent={{-80,-20},{-60,0}}, rotation=0)));
equation
connect(iceFacCal.iceFac, sigBus.icefacHPMea) annotation (Line(points={{-81.2,
connect(iceFacCal.iceFac, sigBus.iceFacHPMea) annotation (Line(points={{-81.2,
-50},{-64,-50},{-64,-28},{-110,-28},{-110,120},{1,120}},
color={0,0,127}),
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ partial model PartialTableData2D
annotation (Dialog(group="Nominal condition"));
parameter Modelica.Blocks.Types.Smoothness smoothness=
Modelica.Blocks.Types.Smoothness.LinearSegments
"Smoothness of table interpolation";
"Smoothness of table interpolation"
annotation(Dialog(group="Data handling"));
parameter Modelica.Blocks.Types.Extrapolation extrapolation=
Modelica.Blocks.Types.Extrapolation.LastTwoPoints
"Extrapolation of data outside the definition range";
"Extrapolation of data outside the definition range"
annotation(Dialog(group="Data handling"));
parameter Boolean use_TEvaOutForTab=true
"=true to use evaporator outlet temperature, false for inlet";
parameter Boolean use_TConOutForTab=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ model ConstantCarnotEffectiveness "Carnot COP with a constant Carnot effectivene
min=0,
final unit="1") = etaCarnot_nominal*(TCon_nominal + TAppCon_nominal)/(
TCon_nominal + TAppCon_nominal - (TEva_nominal - TAppEva_nominal))
"Nominal coefficient of performance";
"Nominal coefficient of performance"
annotation(Dialog(group="Nominal condition"));
equation

connect(pasThrYMea.u, sigBus.yMea) annotation (Line(points={{18,70},{0,70},{0,
Expand Down
12 changes: 9 additions & 3 deletions Buildings/Fluid/MixingVolumes/Validation/MixingVolume.mo
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ model MixingVolume "Test model for mixing volumes"
use_portsData=false,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
annotation (Placement(transformation(extent={{0,60},{20,80}})));
Buildings.Utilities.Diagnostics.CheckEquality cheEqu1
Buildings.Utilities.Diagnostics.CheckEquality cheEqu1(threShold = 10)
"Check for equality of results"
annotation (Placement(transformation(extent={{156,70},{176,90}})));
Buildings.Fluid.Sensors.EnthalpyFlowRate entFloRat(
Expand Down Expand Up @@ -95,7 +95,7 @@ model MixingVolume "Test model for mixing volumes"
m_flow_nominal=2,
dp_nominal=2.5)
annotation (Placement(transformation(extent={{80,-92},{100,-72}})));
Buildings.Utilities.Diagnostics.CheckEquality cheEqu2
Buildings.Utilities.Diagnostics.CheckEquality cheEqu2(threShold = 10)
"Check for equality of results"
annotation (Placement(transformation(extent={{156,10},{176,30}})));
Buildings.Fluid.Sensors.EnthalpyFlowRate entFloRat2(
Expand Down Expand Up @@ -180,6 +180,12 @@ library.
</html>", revisions="<html>
<ul>
<li>
January 10, 2025, by Michael Wetter:<br/>
Changed tolerance of assertion blocks.<br/>
This is for issue
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1952\">IBPSA #1952</a>.
</li>
<li>
April 12, 2017, by Michael Wetter:<br/>
Removed temperature connection that is no longer needed.<br/>
This is for issue
Expand Down Expand Up @@ -216,4 +222,4 @@ First implementation.
</li>
</ul>
</html>"));
end MixingVolume;
end MixingVolume;
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ partial model PartialSolarCollector "Partial model for solar collectors"
Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series
"Selection of system configuration"
annotation(Dialog(group="Configuration declarations"));
parameter Integer nPanelsSer=0 "Number of array panels in series"
annotation(Dialog(group="Configuration declarations", enable= (sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Array)));
parameter Integer nPanelsPar=0 "Number of array panels in parallel"
annotation(Dialog(group="Configuration declarations", enable= (sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Array)));

Expand Down Expand Up @@ -158,14 +156,14 @@ protected
totalArea/per.A "Number of panels used in the simulation";
parameter Real nPanelsSer_internal=
if sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series then
nPanels
nPanels_internal
else if sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel then
1
else
nPanelsSer "Number of panels in series";
nPanels_internal/nPanelsPar_internal "Number of panels in series";
parameter Real nPanelsPar_internal=
if sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Parallel then
nPanels
nPanels_internal
else if sysConfig == Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Series then
1
else
Expand All @@ -186,12 +184,10 @@ initial equation
": The constant homotopyInitialization has been modified from its default value. This constant will be removed in future releases.",
level = AssertionLevel.warning);

if sysConfig==Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Array then
assert(abs(nPanelsPar_internal*nPanelsSer_internal-nPanels_internal) < 1E-6,
"In " + getInstanceName() +
": The product of the number of panels in series and parallel is not equal to the total number of panels in the array.",
level = AssertionLevel.error);
end if;
assert(mod(ATot_internal,per.A)/per.A <= 0.01,
"In " + getInstanceName() +
": The total collector area is not an exact multitude of a single collector's area.",
level = AssertionLevel.warning);

equation
connect(shaCoe_internal,shaCoe_in);
Expand Down Expand Up @@ -258,6 +254,14 @@ EnergyPlus 23.2.0 Engineering Reference</a>
</html>", revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Use <code>nPanels_internal</code> when calculating <code>nPanelsPar_internal</code> and <code>nPanelsSer_internal</code>.
Only request <code>nPanelsPar</code> as an input for an array of collectors and
add assert to check if the total collector area is an exact multitude of a single collector's area.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1956\">IBPSA, #1956</a>.
</li>
<li>
February 27, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
Expand Down
7 changes: 6 additions & 1 deletion Buildings/Fluid/SolarCollectors/Examples/FlatPlate.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ model FlatPlate "Test model for FlatPlate"
rho=0.2,
nColType=Buildings.Fluid.SolarCollectors.Types.NumberSelection.Number,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Array,
nPanelsSer=5,
nPanelsPar=5,
per=Buildings.Fluid.SolarCollectors.Data.GlazedFlatPlate.FP_GuangdongFSPTY95(),
nPanels=25,
Expand Down Expand Up @@ -86,6 +85,12 @@ for a variable fluid flow rate and weather data from San Francisco, CA, USA.
revisions="<html>
<ul>
<li>
February 4, 2025, by Jelger Jansen:<br/>
Remove <code>nPanelsSer</code> as a model parameter.
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1956\">IBPSA, #1956</a>.
</li>
<li>
February 15, 2024, by Jelger Jansen:<br/>
Refactor model.<br/>
This is for
Expand Down
10 changes: 5 additions & 5 deletions Buildings/Fluid/SolarCollectors/UsersGuide.mo
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ the collector field has a mass flow rate equal to
</li>
<li>
<code>Array</code>: If <code>Array</code> is selected it is assumed that the
panels are mounted as a rectangular array with <code>nPanelsPar</code> rows,
each having <code>nPanelsSer</code> panels in series. As a result there is a
pressure drop corresponding to <code>dp_nominal</code> for each panel per row
and the effective <code>dp_nominal</code> for the system is
<code>dp_nominal</code> * <code>nPanelsSer</code>.
panels are mounted as a rectangular array with <code>nPanelsPar</code> rows in parallel.
As a result, the pressure drop is calculated using <code>dp_nominal = nSer * per.dp_nominal</code>,
where <code>nSer</code> is the number of panels in series, which is internally computed,
and <code>per.dp_nominal</code> is the pressure drop of a panel as obtained from the performance
record <code>per</code> at the respective nominal mass flow rate.
</li>
</ul>
</li>
Expand Down
16 changes: 13 additions & 3 deletions Buildings/Fluid/SolarCollectors/Validation/EN12975_Array.mo
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ model EN12975_Array
nPanels=4,
nSeg=3,
sysConfig=Buildings.Fluid.SolarCollectors.Types.SystemConfiguration.Array,
nPanelsSer=2,
nPanelsPar=2)
"Flat plate solar collector model, has been modified for validation purposes"
annotation (Placement(transformation(extent={{-20,20},{0,40}})));

Collector solCol1(nSeg=3, nPanels=2)
Collector solCol1(
nSeg=3,
nPanels=2)
"Flat plate solar collector model, has been modified for validation purposes"
annotation (Placement(transformation(extent={{-50,-40},{-30,-20}})));

Collector solCol2(nSeg=3, nPanels=2)
Collector solCol2(
nSeg=3,
nPanels=2)
"Flat plate solar collector model, has been modified for validation purposes"
annotation (Placement(transformation(extent={{-50,-80},{-30,-60}})));

Expand Down Expand Up @@ -147,6 +150,13 @@ Furthermore, the pressure drops over all models should be the same.
</html>", revisions="<html>
<ul>
<li>
February 11, 2025, by Michael Wetter:<br/>
Removed parameter assignment for parameter that no longer exists.<br/>
This is for
<a href=\"https://github.com/ibpsa/modelica-ibpsa/issues/1968\">IBPSA, #1968</a>.
</li>
<li>
February 27, 2024, by Jelger Jansen:<br/>
First implementation.<br/>
This is for
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 9 additions & 5 deletions Buildings/Resources/Scripts/BuildingsPy/conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
comment: 'Simulation works locally, see https://github.com/lbl-srg/modelica-buildings/issues/3910'
simulate: false
optimica:
time_out: 600
comment: Timeout after 600 seconds
simulate: false
- model_name: Buildings.DHC.Plants.Combined.Validation.AllElectricCWStorage
optimica:
comment: Simulation times out
Expand Down Expand Up @@ -139,16 +140,16 @@
comment: Timeout during translation
time_out: 600
optimica:
comment: Timeout on travis
time_out: 600
comment: timeout on travis after 600s, https://app.travis-ci.com/github/lbl-srg/modelica-buildings/jobs/630222413
translate: false
- model_name: Buildings.Examples.VAVReheat.Validation.Guideline36SteadyState
openmodelica:
comment: simulation terminated by an assertion at initialization
simulate: false
time_out: 600
optimica:
comment: timeout on travis after 300s, https://app.travis-ci.com/github/lbl-srg/modelica-buildings/jobs/618700275
time_out: 600
comment: timeout on travis after 600s, https://app.travis-ci.com/github/lbl-srg/modelica-buildings/jobs/630222413
translate: false
- model_name: Buildings.Fluid.Examples.FlowSystem.Basic
openmodelica:
comment: '''omc'' caused ''simulation terminated by an assertion at initialization''.'
Expand Down Expand Up @@ -309,6 +310,9 @@
openmodelica:
comment: Translation failed.
translate: false
optimica:
comment: PyModelicaException due to NullPointerException
translate: false
- model_name: Buildings.Templates.Plants.HeatPumps.Components.Validation.ValvesIsolation
openmodelica:
comment: Translation failed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ clear

convertClear();

// Conversion for https://github.com/ibpsa/modelica-ibpsa/issues/1956
convertModifiers("Buildings.Fluid.SolarCollectors.ASHRAE93",
{"nPanelsSer"}, fill("",0), true);
convertModifiers("Buildings.Fluid.SolarCollectors.EN12975",
{"nPanelsSer"}, fill("",0), true);

// Conversion for https://github.com/lbl-srg/modelica-buildings/issues/4069

Expand Down
Loading

0 comments on commit 0c2e878

Please sign in to comment.