Skip to content

Commit

Permalink
Issue3514 ctrl flow annotations (#3515)
Browse files Browse the repository at this point in the history
* Update __ctrlFlow annotations

* Fix missing keywords and annotations
  • Loading branch information
AntoineGautier authored Sep 21, 2023
1 parent d0cfa19 commit fc85054
Show file tree
Hide file tree
Showing 22 changed files with 72 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ partial model PartialHeatRecovery "Interface class for heat recovery"
replaceable package MediumAir=Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.AirHandlersFans.Types.HeatRecovery typ
"Equipment type"
annotation (Evaluate=true, Dialog(group="Configuration"));

parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrl_flow(enable=false));
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrlFlow(enable=false));

Buildings.Templates.AirHandlersFans.Interfaces.Bus bus
if typ <> Buildings.Templates.AirHandlersFans.Types.HeatRecovery.None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ partial model PartialOutdoorReliefReturnSection
replaceable package MediumAir=Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.AirHandlersFans.Types.OutdoorReliefReturnSection typ
"Outdoor/relief/return air section type"
Expand Down Expand Up @@ -95,11 +95,11 @@ partial model PartialOutdoorReliefReturnSection
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations"),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrl_flow(enable=false));
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrlFlow(enable=false));

Modelica.Fluid.Interfaces.FluidPort_b port_Rel(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ partial model PartialOutdoorSection "Interface class for outdoor air section"
replaceable package MediumAir=Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Controls.OBC.ASHRAE.G36.Types.OutdoorAirSection typ
"Outdoor air section type"
Expand Down Expand Up @@ -35,11 +35,11 @@ partial model PartialOutdoorSection "Interface class for outdoor air section"
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations"),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrl_flow(enable=false));
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrlFlow(enable=false));

Modelica.Fluid.Interfaces.FluidPort_a port_a(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ partial model PartialReliefReturnSection "Interface class for relief/return air
replaceable package MediumAir=Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.AirHandlersFans.Types.ReliefReturnSection typ
"Relief/return air section type"
Expand Down Expand Up @@ -54,11 +54,11 @@ partial model PartialReliefReturnSection "Interface class for relief/return air
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations"),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Boolean allowFlowReversal = true
"= false to simplify equations, assuming, but not enforcing, no flow reversal"
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrl_flow(enable=false));
annotation(Dialog(tab="Assumptions"), Evaluate=true, __ctrlFlow(enable=false));

Modelica.Fluid.Interfaces.FluidPort_a port_a(
redeclare final package Medium = MediumAir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ partial model PartialAirHandler "Interface class for air handler"
inner replaceable package MediumAir=Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));
inner replaceable package MediumChiWat=Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
"CHW medium"
annotation(Dialog(enable=have_souChiWat),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
inner replaceable package MediumHeaWat=Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
"HHW medium"
annotation(Dialog(enable=have_souHeaWat),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Buildings.Templates.AirHandlersFans.Types.Configuration typ
"Type of system"
Expand All @@ -27,7 +27,8 @@ partial model PartialAirHandler "Interface class for air handler"
final typFanRet=typFanRet,
final have_souChiWat=have_souChiWat,
final have_souHeaWat=have_souHeaWat)
"Configuration parameters";
"Configuration parameters"
annotation(__ctrlFlow(enable=false));

inner parameter Integer nZon(min=1)
"Number of served zones"
Expand Down Expand Up @@ -90,21 +91,21 @@ partial model PartialAirHandler "Interface class for air handler"
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations"),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

final parameter Boolean allowFlowReversalAir=true
"= true to allow flow reversal, false restricts to design direction - Air side"
annotation (Dialog(tab="Assumptions"), Evaluate=true,
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Boolean allowFlowReversalLiq=true
"= true to allow flow reversal, false restricts to design direction - CHW and HW side"
annotation (Dialog(tab="Assumptions", enable=have_souChiWat or have_souHeaWat),
Evaluate=true,
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Boolean show_T = false
"= true, if actual temperature at ports of subcomponents is computed"
annotation(Dialog(tab="Advanced",group="Diagnostics"),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

Modelica.Fluid.Interfaces.FluidPort_a port_Out(
redeclare final package Medium = MediumAir,
Expand Down
7 changes: 4 additions & 3 deletions Buildings/Templates/AirHandlersFans/VAVMultiZone.mo
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ model VAVMultiZone "Multiple-zone VAV"
Hence, no choices annotation, but still replaceable to access parameter
dialog box of the component.
*/
inner Buildings.Templates.AirHandlersFans.Components.OutdoorReliefReturnSection.MixedAirWithDamper
inner replaceable Buildings.Templates.AirHandlersFans.Components.OutdoorReliefReturnSection.MixedAirWithDamper
secOutRel(
redeclare final package MediumAir = MediumAir,
final typCtlFanRet=ctl.typCtlFanRet,
Expand All @@ -72,8 +72,8 @@ model VAVMultiZone "Multiple-zone VAV"
final fanRet=dat.fanRet))
"Outdoor/relief/return air section"
annotation (
Dialog(group="Configuration"), Placement(transformation(extent={{-280,-220},
{-120,-60}})));
Dialog(group="Configuration"),
Placement(transformation(extent={{-280,-220},{-120,-60}})));

Buildings.Templates.Components.Sensors.Temperature TAirMix(
redeclare final package Medium = MediumAir,
Expand Down Expand Up @@ -448,6 +448,7 @@ equation
connect(fanSupBlo.port_b, coiHeaPre.port_a)
annotation (Line(points={{-30,-200},{10,-200}}, color={0,127,255}));
annotation (
__ctrlFlow_template,
defaultComponentName="VAV",
Icon(coordinateSystem(preserveAspectRatio=false), graphics={
Rectangle(
Expand Down
4 changes: 3 additions & 1 deletion Buildings/Templates/AirHandlersFans/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ within Buildings.Templates;
package AirHandlersFans "Air handlers and fans"
extends Modelica.Icons.Package;

annotation (Documentation(info="<html>
annotation (
__ctrlFlow_template,
Documentation(info="<html>
<p>
This package contains templates for air handlers and fans.
</p>
Expand Down
2 changes: 1 addition & 1 deletion Buildings/Templates/Components/Coils/WaterBasedCooling.mo
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ model WaterBasedCooling "Chilled water coil"
final show_T=show_T)
"Heat exchanger"
annotation (
__ctrl_flow(enable=false),
__ctrlFlow(enable=false),
Placement(transformation(extent={{10,4},{-10,-16}})));

Buildings.Fluid.FixedResistances.Junction jun(
Expand Down
2 changes: 1 addition & 1 deletion Buildings/Templates/Components/Coils/WaterBasedHeating.mo
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ model WaterBasedHeating "Hot water coil"
final allowFlowReversal2=allowFlowReversalAir,
final show_T=show_T)
"Heat exchanger"
annotation (__ctrl_flow(enable=false),
annotation (__ctrlFlow(enable=false),
Placement(transformation(extent={{10,4},{-10,-16}})));

Buildings.Templates.Components.Routing.PassThroughFluid pas(
Expand Down
16 changes: 8 additions & 8 deletions Buildings/Templates/Components/Interfaces/PartialCoil.mo
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ partial model PartialCoil "Interface class for coil"
redeclare final package Medium=MediumAir,
final m_flow_nominal=mAir_flow_nominal,
final allowFlowReversal=allowFlowReversalAir)
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

replaceable package MediumAir=Buildings.Media.Air
"Air medium"
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));
/*
The following definition is needed only for Dymola that does not allow
port_aSou and port_bSou to be instantiated without redeclaring their medium
Expand All @@ -17,7 +17,7 @@ partial model PartialCoil "Interface class for coil"
replaceable package MediumSou=Buildings.Media.Water
constrainedby Modelica.Media.Interfaces.PartialMedium
"Source-side medium"
annotation(Dialog(enable=false), __ctrl_flow(enable=false));
annotation(Dialog(enable=false), __ctrlFlow(enable=false));

parameter Buildings.Templates.Components.Types.Coil typ
"Equipment type"
Expand All @@ -43,7 +43,7 @@ partial model PartialCoil "Interface class for coil"
"Design and operating parameters"
annotation (
Placement(transformation(extent={{70,70},{90,90}})),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

final parameter Modelica.Units.SI.MassFlowRate mAir_flow_nominal(
final min=0) = dat.mAir_flow_nominal
Expand All @@ -63,27 +63,27 @@ partial model PartialCoil "Interface class for coil"
typ==Buildings.Templates.Components.Types.Coil.ElectricHeating or
typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or
typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed)),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations",
enable=typ==Buildings.Templates.Components.Types.Coil.ElectricHeating or
typ==Buildings.Templates.Components.Types.Coil.EvaporatorMultiStage or
typ==Buildings.Templates.Components.Types.Coil.EvaporatorVariableSpeed),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Boolean allowFlowReversalAir=true
"= true to allow flow reversal, false restricts to design direction - Air side"
annotation (Dialog(tab="Assumptions"), Evaluate=true,
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Boolean allowFlowReversalLiq=true
"= true to allow flow reversal, false restricts to design direction - CHW and HW side"
annotation (Dialog(tab="Assumptions",
enable=typ==Buildings.Templates.Components.Types.Coil.WaterBasedCooling or
typ==Buildings.Templates.Components.Types.Coil.WaterBasedHeating),
Evaluate=true,
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

Modelica.Fluid.Interfaces.FluidPort_a port_aSou(
redeclare final package Medium = MediumSou,
Expand Down
2 changes: 1 addition & 1 deletion Buildings/Templates/Components/Interfaces/PartialDamper.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ within Buildings.Templates.Components.Interfaces;
partial model PartialDamper "Interface class for damper"
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow_nominal=dat.m_flow_nominal)
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.Components.Types.Damper typ
"Equipment type"
Expand Down
8 changes: 4 additions & 4 deletions Buildings/Templates/Components/Interfaces/PartialFan.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ within Buildings.Templates.Components.Interfaces;
partial model PartialFan "Interface class for fan"
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow_nominal=dat.m_flow_nominal)
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.Components.Types.Fan typ
"Equipment type"
Expand All @@ -19,14 +19,14 @@ partial model PartialFan "Interface class for fan"
group="Nominal condition",
enable=typ<>Buildings.Templates.Components.Types.Fan.None and
energyDynamics<>Modelica.Fluid.Types.Dynamics.SteadyState),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true,
Dialog(tab = "Dynamics", group="Conservation equations",
enable=typ<>Buildings.Templates.Components.Types.Fan.None),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Buildings.Templates.Components.Types.FanSingle typSin=
Buildings.Templates.Components.Types.FanSingle.Housed
Expand All @@ -44,7 +44,7 @@ partial model PartialFan "Interface class for fan"
final nFan=nFan)
"Design and operating parameters"
annotation(Placement(transformation(extent={{70,70},{90,90}})),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Integer nFan(
final min=0,
Expand Down
2 changes: 1 addition & 1 deletion Buildings/Templates/Components/Interfaces/PartialSensor.mo
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
within Buildings.Templates.Components.Interfaces;
partial model PartialSensor "Interface class for sensor"
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Boolean have_sen=true
"Set to true for sensor, false for direct pass through"
Expand Down
20 changes: 12 additions & 8 deletions Buildings/Templates/Components/Interfaces/PartialValve.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ within Buildings.Templates.Components.Interfaces;
partial model PartialValve "Interface class for valve"
extends Buildings.Fluid.Interfaces.PartialTwoPortInterface(
final m_flow_nominal=dat.m_flow_nominal)
annotation(__ctrl_flow(enable=false));
annotation(__ctrlFlow(enable=false));

parameter Buildings.Templates.Components.Types.Valve typ
"Equipment type"
Expand All @@ -11,7 +11,7 @@ partial model PartialValve "Interface class for valve"
parameter Buildings.Templates.Components.Data.Valve dat(final typ=typ)
"Design and operating parameters"
annotation (Placement(transformation(extent={{70,70},{90,90}})),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

final parameter Modelica.Units.SI.PressureDifference dpValve_nominal=
dat.dpValve_nominal
Expand All @@ -25,20 +25,24 @@ partial model PartialValve "Interface class for valve"

parameter Boolean use_inputFilter=true
"= true, if opening is filtered with a 2nd order CriticalDamping filter"
annotation(Dialog(tab="Dynamics", group="Filtered opening",
annotation(__ctrlFlow(enable=false),
Dialog(tab="Dynamics", group="Filtered opening",
enable=typ<>Buildings.Templates.Components.Types.Valve.None));
parameter Modelica.Units.SI.Time riseTime=120
"Rise time of the filter (time to reach 99.6 % of an opening step)"
annotation (Dialog(
annotation (__ctrlFlow(enable=false),
Dialog(
tab="Dynamics",
group="Filtered opening",
enable=use_inputFilter and typ<>Buildings.Templates.Components.Types.Valve.None));
parameter Modelica.Blocks.Types.Init init=Modelica.Blocks.Types.Init.InitialOutput
"Type of initialization (no init/steady state/initial state/initial output)"
annotation(Dialog(tab="Dynamics", group="Filtered opening",
annotation(__ctrlFlow(enable=false),
Dialog(tab="Dynamics", group="Filtered opening",
enable=use_inputFilter and typ<>Buildings.Templates.Components.Types.Valve.None));
parameter Real y_start=1 "Initial position of actuator"
annotation(Dialog(tab="Dynamics", group="Filtered opening",
annotation(__ctrlFlow(enable=false),
Dialog(tab="Dynamics", group="Filtered opening",
enable=use_inputFilter and typ<>Buildings.Templates.Components.Types.Valve.None));

parameter Modelica.Units.SI.Time tau=10
Expand All @@ -47,14 +51,14 @@ partial model PartialValve "Interface class for valve"
enable=energyDynamics<>Modelica.Fluid.Types.Dynamics.SteadyState and (
typ==Buildings.Templates.Components.Types.Valve.ThreeWayModulating or
typ==Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition)),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));
parameter Modelica.Fluid.Types.Dynamics energyDynamics=
Modelica.Fluid.Types.Dynamics.DynamicFreeInitial
"Type of energy balance: dynamic (3 initialization options) or steady state"
annotation(Evaluate=true, Dialog(tab = "Dynamics", group="Conservation equations",
enable=typ==Buildings.Templates.Components.Types.Valve.ThreeWayModulating or
typ==Buildings.Templates.Components.Types.Valve.ThreeWayTwoPosition),
__ctrl_flow(enable=false));
__ctrlFlow(enable=false));

parameter Integer text_rotation = 0
"Text rotation angle in icon layer"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ model ThreeWayModulating "Three-way modulating valve"
else Modelica.Fluid.Types.PortFlowDirection.Entering)
"Valve"
annotation (
__ctrl_flow(enable=false),
__ctrlFlow(enable=false),
choicesAllMatching=true,
Placement(
transformation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ model ThreeWayTwoPosition "Three-way two-position valve"
else Modelica.Fluid.Types.PortFlowDirection.Entering)
"Valve"
annotation (
__ctrl_flow(enable=false),
__ctrlFlow(enable=false),
choicesAllMatching=true,
Placement(
transformation(
Expand Down
Loading

0 comments on commit fc85054

Please sign in to comment.