Buildings.Fluid.Interfaces.Examples.BaseClasses

Package with base classes for Buildings.Fluid.Interfaces.Examples

Information

This package contains base classes that are used to construct the models in Buildings.Fluid.Interfaces.Examples.

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

Package Content

Name Description
Buildings.Fluid.Interfaces.Examples.BaseClasses.PrescribedOutletState PrescribedOutletState Test model for prescribed outlet state

Buildings.Fluid.Interfaces.Examples.BaseClasses.PrescribedOutletState

Test model for prescribed outlet state

Buildings.Fluid.Interfaces.Examples.BaseClasses.PrescribedOutletState

Information

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 on the top has almost unlimited positive capacity (Q_flow_nominal = 1.0e10 Watts), and hence its outlet temperature always reaches the set points.

The model in the middle has a limited negative capacitiy (Q_flow_nominal = 1000 Watts), and hence its outlet state reaches only a limited value corresponding to its maximum negative capacity.

The model at the bottom has unlimited capacity.

At t=1000 second, the flow reverses its direction.

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.

Parameters

TypeNameDefaultDescription
replaceable package MediumBuildings.Media.AirMedium model
MassFlowRatem_flow_nominal0.1Nominal mass flow rate [kg/s]

Connectors

TypeNameDescription
replaceable package MediumMedium model

Modelica definition

partial model PrescribedOutletState "Test model for prescribed outlet state" replaceable package Medium = Buildings.Media.Air constrainedby Modelica.Media.Interfaces.PartialMedium "Medium model"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal=0.1 "Nominal mass flow rate"; Buildings.Fluid.Sources.Boundary_pT sin( redeclare package Medium = Medium, use_T_in=false, p(displayUnit="Pa"), T=293.15, nPorts=4) "Sink"; 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) "Steady-state model of the heater with high capacity"; 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) "Setpoint heating and humidification"; 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) "Steady-state model of the cooler with limited capacity"; 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) "Setpoint cooling and dehumidification"; 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) "Steady-state model of the heater or cooler with unlimited capacity"; 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) "Steady-state model of the heater or cooler with unlimited capacity"; 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) "Setpoint cooling, heating, dehumidification and humidification"; Modelica.Blocks.Sources.Ramp m_flow( height=-2*m_flow_nominal, duration=100, offset=m_flow_nominal, startTime=1000) "Mass flow rate"; Buildings.Fluid.Sources.MassFlowSource_T sou1( redeclare package Medium = Medium, use_m_flow_in=true, T=293.15, nPorts=1) "Flow source"; Buildings.Fluid.Sources.MassFlowSource_T sou2( redeclare package Medium = Medium, use_m_flow_in=true, T=293.15, nPorts=1) "Flow source"; Buildings.Fluid.Sources.MassFlowSource_T sou3( redeclare package Medium = Medium, use_m_flow_in=true, T=293.15, nPorts=1) "Flow source"; Buildings.Fluid.Sources.MassFlowSource_T sou4( redeclare package Medium = Medium, use_m_flow_in=true, T=293.15, nPorts=1) "Flow source"; 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;