From bb1ed02e1ca1d7ae2caf0d88086287160b9eea8b Mon Sep 17 00:00:00 2001 From: AntoineGautier Date: Wed, 7 Feb 2024 09:26:32 +0100 Subject: [PATCH] Add Evaluate annotation, format annotation --- IBPSA/Fluid/Sensors/Examples/PPM.mo | 41 ++++++++++++++++------------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/IBPSA/Fluid/Sensors/Examples/PPM.mo b/IBPSA/Fluid/Sensors/Examples/PPM.mo index 8894d80f92..91b2c4d462 100644 --- a/IBPSA/Fluid/Sensors/Examples/PPM.mo +++ b/IBPSA/Fluid/Sensors/Examples/PPM.mo @@ -4,8 +4,8 @@ model PPM "Test model for the extra property sensor outputting PPM" package Medium = IBPSA.Media.Air(extraPropertiesNames={"CO2"}) "Medium model"; - parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=volDyn.V* - senPPMTwoPort.tau*3*rho_default + parameter Modelica.Units.SI.MassFlowRate m_flow_nominal= + volDyn.V*senPPMTwoPort.tau*3*rho_default "Mass flow rate into and out of the volume"; IBPSA.Fluid.MixingVolumes.MixingVolume volDyn( @@ -93,29 +93,33 @@ model PPM "Test model for the extra property sensor outputting PPM" dp_nominal = 200, m_flow_nominal = m_flow_nominal) "Pressure drop to decouple volume pressure from boundary pressure" - annotation( + annotation ( Placement(transformation(origin = {-28, -50}, extent = {{-2, -10}, {18, 10}}))); protected final parameter Medium.ThermodynamicState state_default = Medium.setState_pTX( T=Medium.T_default, p=Medium.p_default, - X=Medium.X_default[1:Medium.nXi]) "Medium state at default values"; + X=Medium.X_default[1:Medium.nXi]) "Medium state at default values" + annotation(Evaluate=true); // Density at medium default values, used to compute the size of control volumes - final parameter Modelica.Units.SI.Density rho_default=Medium.density(state= - state_default) "Density, used to compute fluid mass"; - + final parameter Modelica.Units.SI.Density rho_default=Medium.density( + state=state_default) + "Density, used to compute fluid mass" + annotation(Evaluate=true); equation - connect(mSou.ports[1], volDyn.ports[1]) annotation (Line(points={{-48,40},{-48,50},{77.3333,50}}, color={0,127,255})); + connect(mSou.ports[1], volDyn.ports[1]) annotation (Line(points={{-48,39},{ + -48,50},{78.6667,50}}, + color={0,127,255})); connect(CO2In.y, volDyn.C_flow[1]) annotation (Line(points={{21,70},{32,70},{32, 54},{68,54}}, color={0,0,127})); connect(senPPMVol.port, volDyn.ports[2]) annotation (Line(points={{130,40},{80, - 40},{80,50}}, color={0,127,255})); + 40},{80,50}},color={0,127,255})); connect(senPPMIn.port, mSou.ports[2]) - annotation (Line(points={{-10,80},{-10,40},{-48,40}}, color={0,127,255})); + annotation (Line(points={{-10,80},{-10,41},{-48,41}}, color={0,127,255})); connect(senPPMTwoPort.port_a, volDyn.ports[3]) annotation (Line(points={{80,20}, - {80,50},{82.6667,50}}, color={0,127,255})); + {80,50},{81.3333,50}}, color={0,127,255})); connect(senPPMNoRev.port_a, senPPMTwoPort.port_b) annotation (Line(points={{80,-20},{80,0}}, color={0,127,255})); connect(senPPMRev.port_b, senPPMNoRev.port_b) annotation (Line(points={{60,-50}, @@ -124,16 +128,17 @@ equation annotation (Line(points={{20,-50},{30,-50},{40,-50}}, color={0,127,255})); connect(CO2In.y,volSte. C_flow[1]) annotation (Line(points={{21,70},{32,70},{32, 84},{68,84}}, color={0,0,127})); - connect(volSte.ports[1], senPPMVol2.port) annotation (Line(points={{77.3333, + connect(volSte.ports[1], senPPMVol2.port) annotation (Line(points={{78.6667, 80},{130,80}}, color={0,127,255})); connect(mSouSta.ports[1], volSte.ports[2]) annotation (Line(points={{-48,120}, {54,120},{54,80},{80,80}}, color={0,127,255})); - connect(sin.ports[1], volSte.ports[3]) annotation( - Line(points = {{-50, -50}, {-50, -80}, {110, -80}, {110, 80}, {82.6667, 80}}, color = {0, 127, 255})); - connect(dp.port_b, senPPMSta.port_b) annotation( + connect(sin.ports[1], volSte.ports[3]) annotation ( + Line(points={{-50,-51},{-50,-80},{110,-80},{110,80},{81.3333,80}}, color = {0, 127, 255})); + connect(dp.port_b, senPPMSta.port_b) annotation ( Line(points = {{-10, -50}, {0, -50}}, color = {0, 127, 255})); - connect(dp.port_a, sin.ports[2]) annotation( - Line(points = {{-30, -50}, {-50, -50}}, color = {0, 127, 255})); + connect(dp.port_a, sin.ports[2]) annotation ( + Line(points={{-30,-50},{-40,-50},{-40,-49},{-50,-49}}, + color = {0, 127, 255})); annotation ( experiment(Tolerance=1e-6, StopTime=3), __Dymola_Commands(file="modelica://IBPSA/Resources/Scripts/Dymola/Fluid/Sensors/Examples/PPM.mos" @@ -168,4 +173,4 @@ See issue ")); -end PPM; \ No newline at end of file +end PPM;