This package contains examples for the use of models that can be found in Buildings.Fluid.Actuators.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Name | Description |
---|---|
Damper | |
ThreeWayValves | |
TwoWayValves | |
TwoWayValvesMotor | |
ValveParameterization | Model to test and illustrate different parameterization for valves |
VAVBoxExponential | |
MixingBox | |
MixingBoxMinimumFlow |
model Damper extends Modelica.Icons.Example; package Medium = Buildings.Media.IdealGases.SimpleAir;Buildings.Fluid.Actuators.Dampers.Exponential res( A=1, redeclare package Medium = Medium, m_flow_nominal=1, filteredOpening=false); Modelica.Blocks.Sources.Ramp yRam( duration=0.3, offset=0, startTime=0.2, height=1); Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, use_p_in=true, nPorts=1, T=293.15); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, use_p_in=true, nPorts=1, T=293.15); Modelica.Blocks.Sources.Constant PAtm(k=101325); Modelica.Blocks.Sources.Constant PAtm0(k=101335); inner Modelica.Fluid.System system; equationconnect(yRam.y, res.y); connect(PAtm.y, sin.p_in); connect(PAtm0.y, sou.p_in); connect(sou.ports[1], res.port_a); connect(sin.ports[1], res.port_b); end Damper;
Test model for three way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.
Extends from Modelica.Icons.Example (Icon for runnable examples).
model ThreeWayValves extends Modelica.Icons.Example; package Medium = Buildings.Media.ConstantPropertyLiquidWater "Medium in the component";Buildings.Fluid.Actuators.Valves.ThreeWayLinear valLin( redeclare package Medium = Medium, l={0.05,0.05}, m_flow_nominal=2, filteredOpening=false) "Valve model, linear opening characteristics"; Modelica.Blocks.Sources.Ramp y( height=1, duration=1, offset=0) "Control signal"; Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=2, use_p_in=true, T=313.15); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, nPorts=2, use_p_in=true, T=313.15); Modelica.Blocks.Sources.Constant PSin(k=3E5); Modelica.Blocks.Sources.Constant PSou(k=306000); Actuators.Valves.ThreeWayEqualPercentageLinear valEquPerLin( l={0.05,0.05}, redeclare package Medium = Medium, R=10, m_flow_nominal=2, filteredOpening=false); Buildings.Fluid.Sources.Boundary_pT ret( redeclare package Medium = Medium, nPorts=2, use_p_in=true, T=303.15); inner Modelica.Fluid.System system; equationconnect(y.y, valLin.y); connect(PSin.y, sin.p_in); connect(y.y, valEquPerLin.y); connect(sou.ports[1], valLin.port_1); connect(sou.ports[2], valEquPerLin.port_1); connect(valLin.port_2, sin.ports[1]); connect(valEquPerLin.port_2, sin.ports[2]); connect(PSou.y, ret.p_in); connect(ret.ports[1], valLin.port_3); connect(ret.ports[2], valEquPerLin.port_3); connect(PSou.y, sou.p_in); end ThreeWayValves;
Test model for two way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.
The parameter filterOpening
is set to false
,
as this model is used to plot the flow at different opening signals
without taking into account the travel time of the actuator.
Extends from Modelica.Icons.Example (Icon for runnable examples).
model TwoWayValves extends Modelica.Icons.Example; package Medium = Buildings.Media.ConstantPropertyLiquidWater;Buildings.Fluid.Actuators.Valves.TwoWayLinear valLin( redeclare package Medium = Medium, l=0.05, m_flow_nominal=2, filteredOpening=false) "Valve model, linear opening characteristics"; Modelica.Blocks.Sources.Ramp y( height=1, duration=1, offset=0) "Control signal"; Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=3, use_p_in=false, p(displayUnit="Pa") = 306000, T=293.15); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, nPorts=3, p(displayUnit="Pa") = 3E5, T=293.15); Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening valQui( redeclare package Medium = Medium, l=0.05, m_flow_nominal=2, filteredOpening=false) "Valve model, quick opening characteristics"; Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valEqu( redeclare package Medium = Medium, l=0.05, R=10, delta0=0.1, m_flow_nominal=2, filteredOpening=false) "Valve model, equal percentage opening characteristics"; inner Modelica.Fluid.System system; equationconnect(y.y, valLin.y); connect(y.y, valQui.y); connect(y.y, valEqu.y); connect(sou.ports[1], valLin.port_a); connect(valQui.port_a, sou.ports[2]); connect(valEqu.port_a, sou.ports[3]); connect(valLin.port_b, sin.ports[1]); connect(valQui.port_b, sin.ports[2]); connect(valEqu.port_b, sin.ports[3]); end TwoWayValves;
Test model for two way valves. Note that the leakage flow rate has been set to a large value and the rangeability to a small value for better visualization of the valve characteristics. To use common values, use the default values.
All valves are connected to a model of a motor with
hysteresis. A more efficient implementation that approximates
a motor but lacks hysteresis would be to
set the valve parameter filteredOpening=true
instead
of using the motor model.
Extends from Modelica.Icons.Example (Icon for runnable examples).
model TwoWayValvesMotor extends Modelica.Icons.Example; package Medium = Buildings.Media.ConstantPropertyLiquidWater;Buildings.Fluid.Actuators.Valves.TwoWayLinear valLin( redeclare package Medium = Medium, l=0.05, m_flow_nominal=2, filteredOpening=false) "Valve model, linear opening characteristics"; Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, nPorts=3, use_p_in=true, T=293.15); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, nPorts=3, use_p_in=true, T=293.15); Modelica.Blocks.Sources.Constant PSin(k=3E5); Modelica.Blocks.Sources.Constant PSou(k=306000); Buildings.Fluid.Actuators.Valves.TwoWayQuickOpening valQui( redeclare package Medium = Medium, l=0.05, m_flow_nominal=2, filteredOpening=false) "Valve model, quick opening characteristics"; Buildings.Fluid.Actuators.Valves.TwoWayEqualPercentage valEqu( redeclare package Medium = Medium, l=0.05, R=10, delta0=0.1, m_flow_nominal=2, filteredOpening=false) "Valve model, equal percentage opening characteristics"; Modelica.Blocks.Sources.TimeTable ySet(table=[0,0; 60,0; 60,1; 120,1; 180,0.5; 240,0.5; 300,0; 360,0; 360,0.25; 420,0.25; 480,1; 540,1.5; 600,-0.25]) "Set point for actuator"; Actuators.Motors.IdealMotor mot( tOpe=60) "Motor model"; inner Modelica.Fluid.System system; equationconnect(PSin.y, sin.p_in); connect(PSou.y, sou.p_in); connect(ySet.y, mot.u); connect(mot.y, valEqu.y); connect(mot.y, valQui.y); connect(mot.y, valLin.y); connect(sou.ports[1], valLin.port_a); connect(sou.ports[2], valQui.port_a); connect(sou.ports[3], valEqu.port_a); connect(valLin.port_b, sin.ports[1]); connect(valQui.port_b, sin.ports[2]); connect(valEqu.port_b, sin.ports[3]); end TwoWayValvesMotor;
Test model for two way valves. This model tests the different parameterization of the valve model. The top and bottom two valves need to have the same flow rates.
Extends from Modelica.Icons.Example (Icon for runnable examples).
model ValveParameterization "Model to test and illustrate different parameterization for valves" extends Modelica.Icons.Example; import Buildings; package Medium = Buildings.Media.ConstantPropertyLiquidWater;Buildings.Fluid.Actuators.Valves.TwoWayLinear valOPPoi( redeclare package Medium = Medium, m_flow_nominal=150/3600, CvData=Buildings.Fluid.Types.CvTypes.OpPoint, dpValve_nominal(displayUnit="kPa") = 4500, filteredOpening=false) "Valve model, linear opening characteristics"; Modelica.Blocks.Sources.Constant y(k=1) "Control signal"; Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, use_p_in=true, nPorts=4, T=293.15); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, nPorts=4, use_p_in=false, p=300000, T=293.15); Modelica.Blocks.Sources.Ramp PSou( duration=1, offset=3E5, height=1E5); Valves.TwoWayLinear valKv( redeclare package Medium = Medium, CvData=Buildings.Fluid.Types.CvTypes.Kv, m_flow_nominal=150/3600, Kv=0.73, dpValve_nominal=450000, filteredOpening=false) "Valve model, linear opening characteristics"; inner Modelica.Fluid.System system; Valves.TwoWayLinear valCv( redeclare package Medium = Medium, m_flow_nominal=150/3600, CvData=Buildings.Fluid.Types.CvTypes.Cv, Cv=0.84, dpValve_nominal=450000, filteredOpening=false) "Valve model, linear opening characteristics"; Buildings.Fluid.Sensors.MassFlowRate senM_flowOpPoi(redeclare package Medium = Medium); Buildings.Fluid.Sensors.MassFlowRate senM_flowKv(redeclare package Medium = Medium); Buildings.Fluid.Sensors.MassFlowRate senM_flowCv(redeclare package Medium = Medium); Modelica.Fluid.Valves.ValveIncompressible valFlu( redeclare package Medium = Medium, dp_nominal(displayUnit="Pa") = 4500, m_flow_nominal=0.0416, CvData=Modelica.Fluid.Types.CvTypes.Cv, Cv=0.84) "Valve model, linear opening characteristics"; Buildings.Fluid.Sensors.MassFlowRate senM_flowFlu( redeclare package Medium = Medium); Buildings.Utilities.Diagnostics.AssertEquality equ1(threShold=0.01); Buildings.Utilities.Diagnostics.AssertEquality equ2(threShold=0.01); equationconnect(y.y, valOPPoi.y); connect(PSou.y, sou.p_in); connect(y.y, valKv.y); connect(valKv.port_a, sou.ports[2]); connect(sou.ports[3], valCv.port_a); connect(y.y, valCv.y); connect(sou.ports[1], valOPPoi.port_a); connect(valOPPoi.port_b, senM_flowOpPoi.port_a); connect(valKv.port_b, senM_flowKv.port_a); connect(valCv.port_b, senM_flowCv.port_a); connect(senM_flowCv.port_b, sin.ports[3]); connect(senM_flowKv.port_b, sin.ports[2]); connect(senM_flowOpPoi.port_b, sin.ports[1]); connect(valFlu.port_b, senM_flowFlu.port_a); connect(sou.ports[4],valFlu. port_a); connect(senM_flowFlu.port_b, sin.ports[4]); connect(y.y,valFlu. opening); connect(senM_flowOpPoi.m_flow, equ1.u1); connect(senM_flowKv.m_flow, equ1.u2); connect(senM_flowCv.m_flow, equ2.u1); connect(senM_flowFlu.m_flow, equ2.u2); end ValveParameterization;
model VAVBoxExponential extends Modelica.Icons.Example; package Medium = Buildings.Media.IdealGases.SimpleAir;Buildings.Fluid.Actuators.Dampers.Exponential dam( redeclare package Medium = Medium, A=1.8, m_flow_nominal=2); Modelica.Blocks.Sources.Step yDam( height=-1, offset=1, startTime=60); Modelica.Blocks.Sources.Ramp P( height=-10, offset=101330, startTime=0, duration=60); Buildings.Fluid.Sources.Boundary_pT sou( redeclare package Medium = Medium, T=273.15 + 20, nPorts=2, use_p_in=true); Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, T=273.15 + 20, nPorts=2, use_p_in=true); Modelica.Blocks.Sources.Constant PAtm(k=101325); Buildings.Fluid.Actuators.Dampers.VAVBoxExponential vav( redeclare package Medium = Medium, dp_nominal=5, A=1.8, m_flow_nominal=2); Buildings.Fluid.FixedResistances.FixedResistanceDpM res( from_dp=true, m_flow_nominal=2, redeclare package Medium = Medium, dp_nominal=5 - 0.45*2^2/1.2/1.8^2/2); inner Modelica.Fluid.System system; equationconnect(yDam.y,dam. y); connect(P.y, sou.p_in); connect(PAtm.y, sin.p_in); connect(yDam.y, vav.y); connect(res.port_b, dam.port_a); connect(sou.ports[1], res.port_a); connect(sou.ports[2], vav.port_a); connect(dam.port_b, sin.ports[1]); connect(sin.ports[2], vav.port_b); end VAVBoxExponential;
model MixingBox extends Modelica.Icons.Example; package Medium = Buildings.Media.GasesConstantDensity.SimpleAir "Medium in the component";Dampers.MixingBox mixBox( AOut=0.7, AExh=1, ARec=1, mOut_flow_nominal=1, dpOut_nominal=20, mRec_flow_nominal=1, dpRec_nominal=20, mExh_flow_nominal=1, dpExh_nominal=20, redeclare package Medium = Medium) "mixing box"; Buildings.Fluid.Sources.Boundary_pT bouIn( redeclare package Medium = Medium, T=273.15 + 10, use_p_in=true, nPorts=2); Buildings.Fluid.Sources.Boundary_pT bouSup( redeclare package Medium = Medium, T=273.15 + 26, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT bouRet( redeclare package Medium = Medium, T=273.15 + 20, use_p_in=true, nPorts=1); Modelica.Blocks.Sources.Constant PAtm(k=101325); Modelica.Blocks.Sources.Ramp PSup( offset=101320, height=-10, startTime=0, duration=20); Modelica.Blocks.Sources.Ramp PRet( height=10, offset=101330, duration=20, startTime=20); Modelica.Blocks.Sources.Step yDam( height=1, offset=0, startTime=60); inner Modelica.Fluid.System system; equationconnect(yDam.y, mixBox.y); connect(bouIn.p_in, PAtm.y); connect(PRet.y, bouRet.p_in); connect(bouSup.p_in, PSup.y); connect(bouIn.ports[1], mixBox.port_Out); connect(bouIn.ports[2], mixBox.port_Exh); connect(bouSup.ports[1], mixBox.port_Sup); connect(bouRet.ports[1], mixBox.port_Ret); end MixingBox;
model MixingBoxMinimumFlow extends Modelica.Icons.Example; package Medium = Buildings.Media.GasesConstantDensity.SimpleAir "Medium in the component";Buildings.Fluid.Actuators.Dampers.MixingBoxMinimumFlow mixBox( AOutMin=0.3, AOut=0.7, AExh=1, ARec=1, mOutMin_flow_nominal=0.3, dpOutMin_nominal=20, mOut_flow_nominal=1, dpOut_nominal=20, mRec_flow_nominal=1, dpRec_nominal=20, mExh_flow_nominal=1, dpExh_nominal=20, redeclare package Medium = Medium) "mixing box"; Buildings.Fluid.Sources.Boundary_pT bouIn( redeclare package Medium = Medium, T=273.15 + 10, use_p_in=true, nPorts=3); Buildings.Fluid.Sources.Boundary_pT bouSup( redeclare package Medium = Medium, T=273.15 + 26, use_p_in=true, nPorts=1); Buildings.Fluid.Sources.Boundary_pT bouRet( redeclare package Medium = Medium, T=273.15 + 20, use_p_in=true, nPorts=1); Modelica.Blocks.Sources.Constant PAtm(k=101325); Modelica.Blocks.Sources.Constant yDamMin(k=0.5); Modelica.Blocks.Sources.Ramp PSup( offset=101320, height=-10, startTime=0, duration=20); Modelica.Blocks.Sources.Ramp PRet( height=10, offset=101330, duration=20, startTime=20); Modelica.Blocks.Sources.Step yDam( height=0.1, offset=0.45, startTime=60); inner Modelica.Fluid.System system; equationconnect(yDamMin.y, mixBox.yOutMin); connect(yDam.y, mixBox.y); connect(bouIn.p_in, PAtm.y); connect(PRet.y, bouRet.p_in); connect(bouSup.p_in, PSup.y); connect(bouIn.ports[1], mixBox.port_OutMin); connect(bouIn.ports[2], mixBox.port_Out); connect(bouIn.ports[3], mixBox.port_Exh); connect(bouSup.ports[1], mixBox.port_Sup); connect(bouRet.ports[1], mixBox.port_Ret); end MixingBoxMinimumFlow;