Skip to content

Commit

Permalink
Merge branch 'master' into issue3911_EP_24_2_0_mw
Browse files Browse the repository at this point in the history
  • Loading branch information
mwetter committed Nov 7, 2024
2 parents 0c597dd + e775985 commit 174eae0
Show file tree
Hide file tree
Showing 50 changed files with 1,092 additions and 459 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
global:
- DOCKER_REPONAME=lbnlblum
- BUILDINGSPY_VERSION=BuildingsPy@0bc654fd913c83f64163be167807e8989eff0293
- OMC_VERSION=ubuntu-2204-omc:1.23.0-1
- OMC_VERSION=ubuntu-2204-omc:1.24.0-1
- OPTIMICA_VERSION=travis-ubuntu-2204-optimica:1.51.6
- DYMOLA_VERSION=travis_ubuntu-2004_dymola:2024xRefresh1-x86_64
- ENERGYPLUS_9_6_0=EnergyPlus-9.6.0-f420c06a69-Linux-Ubuntu20.04-x86_64
Expand Down
48 changes: 48 additions & 0 deletions Buildings/.copiedFiles.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,6 +850,40 @@ Buildings/Fluid/BaseClasses/Validation/package.mo
Buildings/Fluid/BaseClasses/Validation/package.order
Buildings/Fluid/BaseClasses/package.mo
Buildings/Fluid/BaseClasses/package.order
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/FixedEvaporating.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/InterpolateStates.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/DryFluid.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/WetFluid.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/package.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/package.order
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/package.mo
Buildings/Fluid/CHPs/OrganicRankine/BaseClasses/package.order
Buildings/Fluid/CHPs/OrganicRankine/ConstantEvaporation.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/Generic.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Acetone.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Ethanol.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Heptane.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Pentane.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Propane.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/R123.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/R134a.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/R245fa.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/R32.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/Toluene.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/package.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/WorkingFluids/package.order
Buildings/Fluid/CHPs/OrganicRankine/Data/package.mo
Buildings/Fluid/CHPs/OrganicRankine/Data/package.order
Buildings/Fluid/CHPs/OrganicRankine/Examples/ORCHotWater.mo
Buildings/Fluid/CHPs/OrganicRankine/Examples/package.mo
Buildings/Fluid/CHPs/OrganicRankine/Examples/package.order
Buildings/Fluid/CHPs/OrganicRankine/Validation/VariableSource.mo
Buildings/Fluid/CHPs/OrganicRankine/Validation/package.mo
Buildings/Fluid/CHPs/OrganicRankine/Validation/package.order
Buildings/Fluid/CHPs/OrganicRankine/package.mo
Buildings/Fluid/CHPs/OrganicRankine/package.order
Buildings/Fluid/CHPs/package.mo
Buildings/Fluid/CHPs/package.order
Buildings/Fluid/Chillers/BaseClasses/Carnot.mo
Buildings/Fluid/Chillers/BaseClasses/PartialCarnot_T.mo
Buildings/Fluid/Chillers/BaseClasses/PartialCarnot_y.mo
Expand Down Expand Up @@ -2295,6 +2329,15 @@ Buildings/Resources/Images/Fluid/Actuators/valvePressureDropSeries.png
Buildings/Resources/Images/Fluid/Actuators/valveResponse.png
Buildings/Resources/Images/Fluid/Actuators/valveResponse.svg
Buildings/Resources/Images/Fluid/Actuators/valveSchematic.png
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/ComputationPaths.pdf
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/ComputationPaths.png
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/ComputationPaths.svg
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/CycleArchitecture.pdf
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/CycleArchitecture.png
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/CycleArchitecture.svg
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/SupportCurves.pdf
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/SupportCurves.png
Buildings/Resources/Images/Fluid/CHPs/OrganicRankine/SupportCurves.svg
Buildings/Resources/Images/Fluid/FMI/ExportContainers/Validation/RoomConvectiveHVACConvective.pdf
Buildings/Resources/Images/Fluid/FMI/ExportContainers/Validation/RoomConvectiveHVACConvective.png
Buildings/Resources/Images/Fluid/FMI/ExportContainers/Validation/RoomConvectiveHVACConvective.svg
Expand Down Expand Up @@ -2424,6 +2467,7 @@ Buildings/Resources/Images/Utilities/Math/Functions/Examples/cubicHermite.png
Buildings/Resources/Images/Utilities/Math/Functions/SmoothExponentialXPower.png
Buildings/Resources/Images/Utilities/Math/int.pdf
Buildings/Resources/Images/Utilities/Math/int.png
Buildings/Resources/Python-Sources/MakeORCFluidRecord.py
Buildings/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/PowerLaw.mos
Buildings/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/PowerLawFixedM.mos
Buildings/Resources/Scripts/Dymola/Airflow/Multizone/BaseClasses/Examples/WindPressureLowRise.mos
Expand Down Expand Up @@ -2645,6 +2689,10 @@ Buildings/Resources/Scripts/Dymola/Fluid/BaseClasses/FlowModels/Validation/Inver
Buildings/Resources/Scripts/Dymola/Fluid/BaseClasses/FlowModels/Validation/InvertingBasicFlowFunction_m_flow.mos
Buildings/Resources/Scripts/Dymola/Fluid/BaseClasses/Validation/ActuatorFilter.mos
Buildings/Resources/Scripts/Dymola/Fluid/BaseClasses/Validation/MassFlowRateMultiplier.mos
Buildings/Resources/Scripts/Dymola/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/DryFluid.mos
Buildings/Resources/Scripts/Dymola/Fluid/CHPs/OrganicRankine/BaseClasses/Validation/WetFluid.mos
Buildings/Resources/Scripts/Dymola/Fluid/CHPs/OrganicRankine/Examples/ORCHotWater.mos
Buildings/Resources/Scripts/Dymola/Fluid/CHPs/OrganicRankine/Validation/VariableSource.mos
Buildings/Resources/Scripts/Dymola/Fluid/Chillers/Examples/Carnot_TEva.mos
Buildings/Resources/Scripts/Dymola/Fluid/Chillers/Examples/Carnot_y.mos
Buildings/Resources/Scripts/Dymola/Fluid/Chillers/ModularReversible/Examples/CarnotWithLosses.mos
Expand Down
8 changes: 4 additions & 4 deletions Buildings/Airflow/Multizone/BaseClasses/DoorDiscretized.mo
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ partial model DoorDiscretized
Modelica.Units.SI.Velocity vTop "Velocity at top of opening from A to B";
Modelica.Units.SI.Velocity vBot "Velocity at bottom of opening from A to B";

protected
parameter Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment";

input Modelica.Units.SI.Length dh=hOpe/nCom "Height of each compartment";
protected
parameter Medium.ThermodynamicState sta_default=Medium.setState_pTX(
T=Medium.T_default,
p=Medium.p_default,
Expand All @@ -28,11 +28,11 @@ protected
parameter Modelica.Units.SI.Density rho_default=Medium.density(sta_default)
"Density, used to compute fluid volume";

parameter Real hAg[nCom](each unit="m2/s2")=
input Real hAg[nCom](each unit="m2/s2")=
{Modelica.Constants.g_n*(hA - (i - 0.5)*dh) for i in 1:nCom}
"Product g*h_i for each compartment";

parameter Real hBg[nCom](each unit="m2/s2")=
input Real hBg[nCom](each unit="m2/s2")=
{Modelica.Constants.g_n*(hB - (i - 0.5)*dh) for i in 1:nCom}
"Product g*h_i for each compartment";
Modelica.Units.SI.AbsolutePressure pA[nCom](each nominal=101325)
Expand Down
7 changes: 6 additions & 1 deletion Buildings/Electrical/DC/Loads/Resistor.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ model Resistor "Ideal linear electrical resistor"
redeclare package PhaseSystem = PhaseSystems.TwoConductor,
redeclare Interfaces.Terminal_n terminal,
final mode=Buildings.Electrical.Types.Load.FixedZ_steady_state,
final P_nominal=V_nominal^2/max(R, Modelica.Constants.small));
final P_nominal=V_nominal^2/max(R, sqrt(Modelica.Constants.small)));
extends Modelica.Electrical.Analog.Interfaces.ConditionalHeatPort(T = T_ref);
parameter Modelica.Units.SI.Resistance R(start=1)
"Resistance at temperature T_ref";
Expand Down Expand Up @@ -44,6 +44,11 @@ The temperature <i>T</i> is the temperature of the heat port if <code>useHeatPor
</html>",
revisions="<html>
<ul>
<li>November 2, 2024, by Michael Wetter:<br/>
Changed guarding against division by zero.<br/>
This is for
<a href=\"https://github.com/lbl-srg/modelica-buildings/issues/4032\">Buildings, #4032</a>.
</li>
<li>November 3, 2015, by Michael Wetter:<br/>
Set default value for <code>P_nominal</code> to avoid an error when translating
the model in Dymola's pedantic mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function basicFlowFunction_dp_der
"Mass flow rate where transition to turbulent flow occurs";
input Real dp_der
"Derivative of pressure difference between port_a and port_b (= port_a.p - port_b.p)";
output Real m_flow_der(unit="kg/s2")
output Real m_flow_der
"Derivative of mass flow rate in design flow direction";
protected
Modelica.Units.SI.PressureDifference dp_turbulent=(m_flow_turbulent/k)^2
Expand All @@ -30,8 +30,14 @@ Documentation(info="<html>
<p>
Function that implements the first order derivative of
<a href=\"modelica://Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp\">
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp</a>
with respect to the mass flow rate.
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp</a>,
assuming a constant flow coefficient.
</p>
<p>
When called with <code>dp_der=der(dp)</code>, this function returns
the time derivative of <code>m_flow</code>.
When called with <code>dp_der=1</code>, this function returns
the derivative of <code>m_flow</code> with respect to <code>dp</code>.
</p>
</html>",
revisions="<html>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
within Buildings.Fluid.BaseClasses.FlowModels;
function basicFlowFunction_dp_der2
"2nd derivative of flow function2nd derivative of function that computes mass flow rate for given pressure drop"
"2nd derivative of function that computes mass flow rate for given pressure drop"
extends Modelica.Icons.Function;

input Modelica.Units.SI.PressureDifference dp(displayUnit="Pa")
Expand Down Expand Up @@ -35,8 +35,16 @@ Documentation(info="<html>
<p>
Function that implements the second order derivative of
<a href=\"modelica://Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp\">
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp</a>
with respect to the mass flow rate.
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_dp</a>,
assuming a constant flow coefficient.
</p>
<p>
When called with <code>dp_der=der(dp)</code> and <code>dp_der2=der(dp_der)</code>,
this function returns the second order derivative of <code>m_flow</code>
with respect to time.
When called with <code>dp_der=1</code> and <code>dp_der2=0</code>,
this function returns the second order derivative of <code>m_flow</code>
with respect to <code>dp</code>.
</p>
</html>",
revisions="<html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function basicFlowFunction_m_flow_der
"Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)";
input Modelica.Units.SI.MassFlowRate m_flow_turbulent(min=0)
"Mass flow rate where transition to turbulent flow occurs";
input Real m_flow_der(unit="kg/s2")
input Real m_flow_der
"Derivative of mass flow rate in design flow direction";
output Real dp_der
"Derivative of pressure difference between port_a and port_b (= port_a.p - port_b.p)";
Expand All @@ -31,8 +31,14 @@ Documentation(info="<html>
<p>
Function that implements the first order derivative of
<a href=\"modelica://Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow\">
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow</a>
with respect to the mass flow rate.
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow</a>,
assuming a constant flow coefficient.
</p>
<p>
When called with <code>m_flow_der=der(m_flow)</code>, this function returns
the time derivative of <code>dp</code>.
When called with <code>m_flow_der=1</code>, this function returns
the derivative of <code>dp</code> with respect to <code>m_flow</code>.
</p>
</html>",
revisions="<html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ function basicFlowFunction_m_flow_der2
"Flow coefficient, k=m_flow/sqrt(dp), with unit=(kg.m)^(1/2)";
input Modelica.Units.SI.MassFlowRate m_flow_turbulent(min=0)
"Mass flow rate where transition to turbulent flow occurs";
input Real m_flow_der(unit="kg/s2")
input Real m_flow_der
"1st derivative of mass flow rate in design flow direction";
input Real m_flow_der2(unit="kg/s3")
input Real m_flow_der2
"2nd derivative of mass flow rate in design flow direction";
output Real dp_der2
"2nd derivative of pressure difference between port_a and port_b (= port_a.p - port_b.p)";
Expand All @@ -35,8 +35,16 @@ Documentation(info="<html>
<p>
Function that implements the second order derivative of
<a href=\"modelica://Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow\">
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow</a>
with respect to the mass flow rate.
Buildings.Fluid.BaseClasses.FlowModels.basicFlowFunction_m_flow</a>,
assuming a constant flow coefficient.
</p>
<p>
When called with <code>m_flow_der=der(m_flow)</code> and <code>m_flow_der2=der(m_flow_der)</code>,
this function returns the second order derivative of <code>dp</code>
with respect to time.
When called with <code>m_flow_der=1</code> and <code>m_flow_der2=0</code>,
this function returns the second order derivative of <code>dp</code>
with respect to <code>m_flow</code>.
</p>
</html>",
revisions="<html>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ model FixedEvaporating
Modelica.Blocks.Logical.Hysteresis hys(
uLow = mWor_flow_min,
uHigh = mWor_flow_min + mWor_flow_hysteresis,
u = mWor_flow_internal)
u = mWor_flow_internal,
y(start = false))
"Hysteresis for turning off cycle when working fluid flow too low";

protected
Expand Down Expand Up @@ -190,8 +191,8 @@ This model computes the pinch points and the energy exchange,
and interfaces with the input and output variables.
The evaporating temperature is fixed as a parameter.
See the documentation of
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.Cycle\">
Buildings.Fluid.CHPs.OrganicRankine.Cycle</a>
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation\">
Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation</a>
for more details.
</html>", revisions="<html>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,8 @@ protected
<p>
This model performs the property interpolations of a given working fluid.
See the documentation of
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.Cycle\">
Buildings.Fluid.CHPs.OrganicRankine.Cycle</a>
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation\">
Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation</a>
for more details.
</html>", revisions="<html>
<ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ except that it validates the handling of wet working fluids.
As a result, a superheating temperature is computed that ensures
the expansion does not land under the dome.
How this superheating temperature is found is explained in the documentation of
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.Cycle\">
Buildings.Fluid.CHPs.OrganicRankine.Cycle</a>.
<a href=\"Modelica://Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation\">
Buildings.Fluid.CHPs.OrganicRankine.ConstantEvaporation</a>.
</p>
</html>",revisions="<html>
<ul>
Expand Down
Loading

0 comments on commit 174eae0

Please sign in to comment.