Model that is used as the base class for models that
demonstrates the use of an ideal heater and an ideal cooler,
or an ideal humidifier and dehumidifier.
The model at the bottom has unlimited capacity.
Each flow leg has the same mass flow rate. There are three mass flow sources
as using one source only would yield a nonlinear system of equations that
needs to be solved to determine the mass flow rate distribution.
partial model PrescribedOutletState
replaceable package Medium =
Buildings.Media.Air
constrainedby Modelica.Media.Interfaces.PartialMedium ;
parameter Modelica.Units.SI.MassFlowRate m_flow_nominal=0.1
;
Buildings.Fluid.Sources.Boundary_pT sin(
redeclare package Medium =
Medium,
use_T_in=false,
p(displayUnit="Pa"),
T=293.15,
nPorts=4) ;
Buildings.Fluid.Interfaces.PrescribedOutlet heaHigPow(
redeclare package Medium =
Medium,
QMax_flow=1.0e10,
mWatMax_flow = 0.001,
m_flow_small=1E-4*
abs(m_flow_nominal),
show_T=true,
m_flow_nominal=m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Blocks.Sources.CombiTimeTable setHeaHigPow(table=[
0, 20.0, 0.012;
120, 20.0, 0.012;
500, 60.0, 0.020;
800, 10.0, 0.005;
1200, 30.0, 0.015],
offset={273.15,0},
smoothness = Modelica.Blocks.Types.Smoothness.ConstantSegments)
;
Buildings.Fluid.Interfaces.PrescribedOutlet cooLimPow(
redeclare package Medium =
Medium,
QMin_flow=-1000,
mWatMin_flow = -0.001,
m_flow_small=1E-4*
abs(m_flow_nominal),
show_T=true,
m_flow_nominal=m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Modelica.Blocks.Sources.CombiTimeTable setCooLimPow(table=[
0, 20.0, 0.008;
120, 20.0, 0.008;
500, 15.0, 0.004;
800, 60.0, 0.015;
1200, 10.0, 0.002],
offset={273.15,0},
smoothness = Modelica.Blocks.Types.Smoothness.ConstantSegments)
;
Buildings.Fluid.Interfaces.PrescribedOutlet heaCooUnl(
redeclare package Medium =
Medium,
m_flow_small=1E-4*
abs(m_flow_nominal),
show_T=true,
m_flow_nominal=m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.FixedInitial)
;
Buildings.Fluid.Interfaces.PrescribedOutlet steSta(
redeclare package Medium =
Medium,
m_flow_small=1E-4*
abs(m_flow_nominal),
show_T=true,
m_flow_nominal=m_flow_nominal,
energyDynamics=Modelica.Fluid.Types.Dynamics.SteadyState)
;
Modelica.Blocks.Sources.CombiTimeTable setHeaCooUnl(table=[
0, 20.0, 0.012;
120, 20.0, 0.012;
500, 15.0, 0.008;
800, 10.0, 0.005;
1200, 30.0, 0.015],
offset={273.15,0},
smoothness = Modelica.Blocks.Types.Smoothness.ConstantSegments)
;
Modelica.Blocks.Sources.Ramp m_flow(
height=-2*m_flow_nominal,
duration=100,
offset=m_flow_nominal,
startTime=1000) ;
Buildings.Fluid.Sources.MassFlowSource_T sou1(
redeclare package Medium =
Medium,
use_m_flow_in=true,
T=293.15,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T sou2(
redeclare package Medium =
Medium,
use_m_flow_in=true,
T=293.15,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T sou3(
redeclare package Medium =
Medium,
use_m_flow_in=true,
T=293.15,
nPorts=1) ;
Buildings.Fluid.Sources.MassFlowSource_T sou4(
redeclare package Medium =
Medium,
use_m_flow_in=true,
T=293.15,
nPorts=1) ;
equation
connect(m_flow.y, sou1.m_flow_in);
connect(m_flow.y, sou2.m_flow_in);
connect(m_flow.y, sou3.m_flow_in);
connect(sou1.ports[1], heaHigPow.port_a);
connect(sou2.ports[1], cooLimPow.port_a);
connect(sou3.ports[1], heaCooUnl.port_a);
connect(heaCooUnl.port_b, sin.ports[1]);
connect(cooLimPow.port_b, sin.ports[2]);
connect(heaHigPow.port_b, sin.ports[3]);
connect(m_flow.y, sou4.m_flow_in);
connect(sou4.ports[1], steSta.port_a);
connect(steSta.port_b, sin.ports[4]);
end PrescribedOutletState;