UdK-VPT / BuildingSystems

Modelica BuildingSystems library
http://modelica-buildingsystems.de/
BSD 3-Clause "New" or "Revised" License
70 stars 34 forks source link

Conditional declaration in AirvolumeMixed #167

Open MatthewSZhang opened 3 years ago

MatthewSZhang commented 3 years ago

I found a conditional declaration of in BuildingSystems.Buildings.Airvolumes.AirvoumeMixed shown as: "BuildingSystems.Buildings.Airvolumes.MixingVolumeMoistAir air( redeclare package Medium = Medium, geometryType=geometryType, V=V, m_flow_nominal=0.1, nPorts=nAirpaths, T_start=T_start[1], X_start={x_start[1],1-x_start[1]}, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, massDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) if TSou == BuildingSystems.Buildings.Types.DataSource.Calculation "Mixed air volume of moist air" annotation (Placement(transformation(extent={{-10,-10},{10,10}})));"

Then the component 'air' is used in " Modelica.Blocks.Sources.RealExpression pAir( y=air.p) annotation (Placement(transformation(extent={{44,50},{64,70}})));"

The issue is that Modelica Language Specification (Version 3.4), Section 4.4.5, said, "A component declared with a condition-attribute can only be modified and/or used in connections", but why when I tested it in BuildingSystems.Applications.HeatingSystems.WaterHeatingSystem, no error appears in Dymola.

Is it a bug in AirvolumeMixed, but Dymola for some reason bypasses it, or it is a correct usage of conditional declaration?