model ControlledFlowMachine
package Medium =
Buildings.Media.Air ;
Modelica.Blocks.Sources.Pulse y(
startTime=0,
offset=0,
amplitude=1,
period=120,
width=50);
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium = Medium,
use_p_in=false,
p=101325,
T=293.15,
nPorts=4);
Buildings.Fluid.Sensors.MassFlowRate masFloRat1(
redeclare package Medium =
Medium);
Buildings.Fluid.Sensors.RelativePressure relPre(
redeclare package Medium =
Medium);
Buildings.Fluid.Movers.SpeedControlled_y fan1(
redeclare package Medium = Medium,
per(pressure(
final V_flow={0,1.8,3}, dp={1000,600,0})),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
FixedResistances.FixedResistanceDpM dp1(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
FixedResistances.FixedResistanceDpM dp2(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
Buildings.Fluid.Sensors.MassFlowRate masFloRat2(
redeclare package Medium = Medium);
FixedResistances.FixedResistanceDpM dp3(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
Buildings.Fluid.Sensors.MassFlowRate masFloRat3(
redeclare package Medium = Medium);
Buildings.Fluid.Movers.FlowControlled_dp fan3(
redeclare package Medium = Medium,
m_flow_nominal=6000/3600*1.2,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
Buildings.Fluid.Movers.FlowControlled_m_flow fan2(
redeclare package Medium = Medium,
m_flow_nominal=6000/3600*1.2,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
FixedResistances.FixedResistanceDpM dp4(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
Buildings.Fluid.Sensors.MassFlowRate masFloRat4(
redeclare package Medium = Medium);
Buildings.Fluid.Movers.SpeedControlled_Nrpm fan4(
redeclare package Medium = Medium,
per(pressure(
final V_flow={0,1.8,3}, dp={1000,600,0})),
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState);
Modelica.Blocks.Math.Gain gain(k=1500) ;
FixedResistances.FixedResistanceDpM dp5(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
FixedResistances.FixedResistanceDpM dp6(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
FixedResistances.FixedResistanceDpM dp7(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
FixedResistances.FixedResistanceDpM dp8(
m_flow_nominal=6000/3600*1.2,
redeclare package Medium = Medium,
dp_nominal=300) ;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium = Medium,
use_p_in=false,
p=101325,
T=293.15,
nPorts=4);
equation
connect(fan1.port_a, relPre.port_b);
connect(fan1.port_b, relPre.port_a);
connect(fan1.port_b, dp1.port_a);
connect(fan2.port_b, dp2.port_a);
connect(fan3.port_b, dp3.port_a);
connect(fan4.port_b, dp4.port_a);
connect(gain.y, fan4.Nrpm);
connect(masFloRat1.m_flow, fan2.m_flow_in);
connect(relPre.p_rel, fan3.dp_in);
connect(dp8.port_b, fan4.port_a);
connect(dp5.port_b, fan1.port_a);
connect(dp6.port_b, fan2.port_a);
connect(dp7.port_b, fan3.port_a);
connect(y.y, fan1.y);
connect(y.y, gain.u);
connect(dp8.port_a, sou.ports[1]);
connect(dp5.port_a, sou.ports[2]);
connect(dp6.port_a, sou.ports[3]);
connect(dp7.port_a, sou.ports[4]);
connect(dp4.port_b, masFloRat4.port_a);
connect(dp1.port_b, masFloRat1.port_a);
connect(dp2.port_b, masFloRat2.port_a);
connect(dp3.port_b, masFloRat3.port_a);
connect(masFloRat4.port_b, sin.ports[1]);
connect(masFloRat1.port_b, sin.ports[2]);
connect(masFloRat2.port_b, sin.ports[3]);
connect(masFloRat3.port_b, sin.ports[4]);
end ControlledFlowMachine;
This is the base class for examples that demonstrates the use of a flow machine whose flow rate transitions to zero.
partial model FlowMachine_ZeroFlow
replaceable package Medium =
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium ;
parameter Modelica.SIunits.MassFlowRate m_flow_nominal= 1 ;
parameter Modelica.SIunits.PressureDifference dp_nominal = 500 ;
Modelica.Blocks.Sources.Ramp y(
offset=1,
duration=0.5,
startTime=0.25,
height=-1) ;
Buildings.Fluid.Sources.Boundary_pT sou(
redeclare package Medium =
Medium,
use_p_in=false,
p=101325,
T=293.15,
nPorts=4);
Buildings.Fluid.FixedResistances.FixedResistanceDpM dpSta(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal/2) ;
replaceable Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine floMacSta
constrainedby Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine(
redeclare package Medium =
Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState) ;
replaceable Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine floMacDyn
constrainedby Buildings.Fluid.Movers.BaseClasses.PartialFlowMachine(
redeclare package Medium =
Medium,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial) ;
Buildings.Fluid.FixedResistances.FixedResistanceDpM dpDyn(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal/2) ;
Modelica.Blocks.Math.Gain gain ;
Buildings.Fluid.FixedResistances.FixedResistanceDpM dpSta1(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal/2) ;
Buildings.Fluid.FixedResistances.FixedResistanceDpM dpDyn1(
redeclare package Medium =
Medium,
m_flow_nominal=m_flow_nominal,
dp_nominal=dp_nominal/2) ;
equation
connect(floMacSta.port_b, dpSta.port_a);
connect(y.y, gain.u);
connect(floMacDyn.port_b, dpDyn.port_a);
connect(dpSta1.port_b, floMacSta.port_a);
connect(dpDyn1.port_b, floMacDyn.port_a);
connect(dpSta1.port_a, sou.ports[1]);
connect(dpDyn1.port_a, sou.ports[2]);
connect(dpDyn.port_b, sou.ports[3]);
connect(dpSta.port_b, sou.ports[4]);
end FlowMachine_ZeroFlow;