Buildings.Fluid.Examples.Performance.BaseClasses

Information

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.Fluid.Examples.Performance.BaseClasses.Example1 Example1 Example 1 partial model

Buildings.Fluid.Examples.Performance.BaseClasses.Example1 Buildings.Fluid.Examples.Performance.BaseClasses.Example1

Example 1 partial model

Buildings.Fluid.Examples.Performance.BaseClasses.Example1

Information

This partial model is extended by Buildings.Fluid.Examples.Performance.Example1v1 and Buildings.Fluid.Examples.Performance.Example1v2 and is created to avoid errors in the implementation of the two depending examples.

Extends from Modelica.Icons.Example (Icon for runnable examples).

Parameters

TypeNameDefaultDescription
Realm_flow_nominal0.1Gain value multiplied with input signal

Modelica definition

partial model Example1 "Example 1 partial model" extends Modelica.Icons.Example; package Medium = Modelica.Media.Water.ConstantPropertyLiquidWater; parameter Real m_flow_nominal=0.1 "Gain value multiplied with input signal"; Buildings.Fluid.Sources.Boundary_pT bou( redeclare package Medium = Medium, nPorts=1) "Boundary for pressure boundary condition"; Fluid.Movers.FlowControlled_m_flow pump( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, use_inputFilter=false, allowFlowReversal=allowFlowReversal.k, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, nominalValuesDefineDefaultPressureCurve=true) "Pump model with unidirectional flow"; Buildings.Fluid.HeatExchangers.Heater_T hea( redeclare package Medium = Medium, dp_nominal=1000, QMax_flow=1000, m_flow_nominal=m_flow_nominal, energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial, allowFlowReversal=allowFlowReversal.k) "Heater"; Modelica.Blocks.Sources.Pulse pulse(period=1000) "Pulse input"; Modelica.Blocks.Math.Gain gain(k=m_flow_nominal) "Gain for m_flow_nominal"; Buildings.Fluid.Actuators.Valves.ThreeWayLinear val( redeclare package Medium = Medium, m_flow_nominal=m_flow_nominal, dpValve_nominal=1000, l={0.002,0.002}, energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState, use_inputFilter=false, portFlowDirection_1=if allowFlowReversal.k then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering, portFlowDirection_2=if allowFlowReversal.k then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Leaving, portFlowDirection_3=if allowFlowReversal.k then Modelica.Fluid.Types.PortFlowDirection.Bidirectional else Modelica.Fluid.Types.PortFlowDirection.Entering) "Three way valve with constant input"; Modelica.Blocks.Sources.Constant const(k=0.5) "Constant valve set point"; Modelica.Blocks.Sources.BooleanConstant allowFlowReversal(k=true) "Block for setting allowFlowReversal in components"; Buildings.Fluid.FixedResistances.PressureDrop[nRes.k] res( redeclare package Medium = Medium, each allowFlowReversal=allowFlowReversal.k, each m_flow_nominal=m_flow_nominal, each dp_nominal=1000, each from_dp=from_dp.k) "Fluid resistance for splitting flow"; Modelica.Blocks.Sources.IntegerConstant nRes(k=20) "Number of parallel branches"; Modelica.Blocks.Sources.BooleanConstant from_dp(k=false) "Block for setting from_dp in res"; equation connect(bou.ports[1],hea. port_a); connect(pulse.y,hea. TSet); connect(pump.m_flow_in, gain.y); connect(gain.u,pulse. y); connect(hea.port_b,val. port_1); connect(val.port_2, pump.port_a); connect(const.y,val. y); connect(val.port_3,hea. port_a); for i in 1:nRes.k loop connect(pump.port_b, res[i].port_a); end for; end Example1;