LBL logo

Buildings.Fluid.FMI

Package with base classes that facilitate exporting models as an FMU

Information

This package contains blocks that serve as containers for exporting models from Buildings.Fluid as a Functional Mockup Unit (FMU).

This allows using models from Buildings.Fluid, add them to a block that only has input and output signals, but no acausal connectors, and then export the model as a Functional Mockup Unit. Models can be individual models or systems that are composed of various models. For more information, see the User's Guide.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Fluid.FMI.UsersGuide UsersGuide User's Guide
Buildings.Fluid.FMI.FlowSplitter_u FlowSplitter_u Container to export a flow splitter as an FMU
Buildings.Fluid.FMI.InletAdaptor InletAdaptor Model for exposing a fluid inlet to the FMI interface
Buildings.Fluid.FMI.OutletAdaptor OutletAdaptor Model for exposing a fluid outlet to the FMI interface
Buildings.Fluid.FMI.Sink_T Sink_T FMI model for a sink with temperature for reverse flow as an input
Buildings.Fluid.FMI.Source_T Source_T FMI model for a boundary with mass flow rate, pressure and temperature as an input
Buildings.Fluid.FMI.TwoPort TwoPort Container to export a thermofluid flow model with two ports as an FMU
Buildings.Fluid.FMI.TwoPortComponent TwoPortComponent Container to export thermofluid flow models with two ports as an FMU
Buildings.Fluid.FMI.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluid.FMI.Interfaces Interfaces Package with interfaces for models that serves as an FMU container

Buildings.Fluid.FMI.FlowSplitter_u Buildings.Fluid.FMI.FlowSplitter_u

Container to export a flow splitter as an FMU

Buildings.Fluid.FMI.FlowSplitter_u

Information

Block that takes as an input the inflowing fluid at the port inlet and a vector of control signals for the mass flow rates u. The mass flow of all outlet ports i is set to the value of u[i] m_flow_nominal[i]. If the inflowing mass flow rate at the port inlet is not equal to the sum of u[i] m_flow_in[i], the simulation stops with an assert.

Assumptions and limitations

The mass flow rates at all outlet ports must be non-negative. Reverse flow is not yet implemented. If either of these limitations are violated, then the model stops with an error.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
MassFlowRatem_flow_nominal[nout] Nominal mass flow rate for each outlet [kg/s]
Integernout Number of outlets
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
InletinletFluid inlet
Outletoutlet[nout]Fluid outlet
input RealInputu[nout]Control signal for the mass flow rates [1]

Modelica definition

block FlowSplitter_u "Container to export a flow splitter as an FMU" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Modelica.SIunits.MassFlowRate m_flow_nominal[nout]( each min=0) "Nominal mass flow rate for each outlet"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; parameter Integer nout(min=1) "Number of outlets"; parameter Boolean use_p_in=true "= true to use a pressure from connector, false to output Medium.p_default"; Interfaces.Inlet inlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid inlet"; Interfaces.Outlet outlet[nout]( redeclare each final package Medium = Medium, each final allowFlowReversal=allowFlowReversal, each final use_p_in=use_p_in) "Fluid outlet"; Modelica.Blocks.Interfaces.RealInput u[nout]( unit="1") "Control signal for the mass flow rates"; protected final parameter Modelica.SIunits.MassFlowRate mAve_flow_nominal= sum(m_flow_nominal)/nout "Average nominal mass flow rate"; protected Buildings.Fluid.FMI.Interfaces.FluidProperties bacPro_internal( redeclare final package Medium = Medium) "Internal connector for fluid properties for back flow"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_out_internal = 0 "Internal connector for mass fraction of backward flow properties"; initial equation for i in 1:nout loop assert(m_flow_nominal[i] > 0, "Nominal mass flow rate must be bigger than zero."); end for; equation for i in 1:nout loop assert(u[i] >= 0, "Control signal must be non-negative."); // Dymola 2015 FD01 (on Linux 64) does not automatically // remove the conditional equation below. We thus have to manually check // if use_p_in is true before connecting the inlet and outlet pressures. if use_p_in then connect(inlet.p, outlet[i].p); end if; outlet[i].m_flow = u[i]*m_flow_nominal[i]; outlet[i].forward = inlet.forward; end for; // As reverse flow is not supported, we assign // default values for the inlet.backward properties bacPro_internal.T = Medium.T_default; connect(bacPro_internal.X_w, X_w_out_internal); bacPro_internal.C = zeros(Medium.nC); // Conditional connector connect(bacPro_internal, inlet.backward); // Stop if mass is not conserved in the system assert(abs(inlet.m_flow-sum(outlet.m_flow)) < 1E-2 * mAve_flow_nominal, "Mass flow rate is not conserved. inlet.m_flow = " + String(inlet.m_flow) + " sum(outlet.m_flow) = " + String(sum(outlet.m_flow))); end FlowSplitter_u;

Buildings.Fluid.FMI.InletAdaptor Buildings.Fluid.FMI.InletAdaptor

Model for exposing a fluid inlet to the FMI interface

Buildings.Fluid.FMI.InletAdaptor

Information

Model that is used to connect an input signal to a fluid port. The model needs to be used in conjunction with an instance of Buildings.Fluid.FMI.OutletAdaptor in order for fluid mass flow rate and pressure to be properly assigned to the acausal fluid models.

See Buildings.Fluid.FMI.TwoPortComponent or Buildings.Fluid.FMI.Examples.FMUs.ResistanceVolume for how to use this model.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model within the source
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium model within the source
InletinletFluid inlet
FluidPort_bport_bFluid port
output RealOutputpPressure [Pa]

Modelica definition

model InletAdaptor "Model for exposing a fluid inlet to the FMI interface" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model within the source"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; parameter Boolean use_p_in = true "= true to use a pressure from connector, false to output Medium.p_default"; Buildings.Fluid.FMI.Interfaces.Inlet inlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid inlet"; Modelica.Fluid.Interfaces.FluidPort_b port_b( redeclare final package Medium=Medium) "Fluid port"; Modelica.Blocks.Interfaces.RealOutput p(unit="Pa") if use_p_in "Pressure"; protected Buildings.Fluid.FMI.Interfaces.FluidProperties bacPro_internal( redeclare final package Medium = Medium) "Internal connector for fluid properties for back flow"; Buildings.Fluid.FMI.Interfaces.PressureOutput p_in_internal "Internal connector for pressure"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_in_internal "Internal connector for mass fraction of forward flow properties"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_out_internal "Internal connector for mass fraction of backward flow properties"; initial equation assert(Medium.nXi < 2, "The medium must have zero or one independent mass fraction Medium.nXi."); equation // To locally balance the model, the pressure is only imposed at the // outlet model. // The sign is negative because inlet.m_flow > 0 // means that fluid flows out of this component -port_b.m_flow = inlet.m_flow; port_b.h_outflow = Medium.specificEnthalpy_pTX( p= p_in_internal, T= inlet.forward.T, X= fill(X_w_in_internal, Medium.nXi)); port_b.C_outflow = inlet.forward.C; // Conditional connector for mass fraction for forward flow if Medium.nXi == 0 then X_w_in_internal = 0; else connect(X_w_in_internal, inlet.forward.X_w); end if; port_b.Xi_outflow = fill(X_w_in_internal, Medium.nXi); // Conditional connector for flow reversal connect(inlet.backward, bacPro_internal); // Mass fraction for reverse flow X_w_out_internal = if Medium.nXi > 0 and allowFlowReversal then inStream(port_b.Xi_outflow[1]) else 0; connect(bacPro_internal.X_w, X_w_out_internal); if allowFlowReversal then bacPro_internal.T = Medium.temperature_phX( p= p_in_internal, h= inStream(port_b.h_outflow), X= inStream(port_b.Xi_outflow)); bacPro_internal.C = inStream(port_b.C_outflow); else bacPro_internal.T = Medium.T_default; bacPro_internal.C = fill(0, Medium.nC); end if; // Conditional connectors for pressure if use_p_in then connect(inlet.p, p_in_internal); else p_in_internal = Medium.p_default; end if; connect(p, p_in_internal); end InletAdaptor;

Buildings.Fluid.FMI.OutletAdaptor Buildings.Fluid.FMI.OutletAdaptor

Model for exposing a fluid outlet to the FMI interface

Buildings.Fluid.FMI.OutletAdaptor

Information

Model that is used to connect a fluid port with an output signal. The model needs to be used in conjunction with an instance of Buildings.Fluid.FMI.InletAdaptor in order for fluid mass flow rate and pressure to be properly assigned to the acausal fluid models.

See Buildings.Fluid.FMI.TwoPortComponent or Buildings.Fluid.FMI.Examples.FMUs.ResistanceVolume for how to use this model.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium model within the source
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium model within the source
OutletoutletFluid outlet
FluidPort_aport_aFluid port
input PressureInputpPressure to be sent to outlet [Pa]

Modelica definition

model OutletAdaptor "Model for exposing a fluid outlet to the FMI interface" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium model within the source"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; parameter Boolean use_p_in = true "= true to use a pressure from connector, false to output Medium.p_default"; Buildings.Fluid.FMI.Interfaces.Outlet outlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid outlet"; Modelica.Fluid.Interfaces.FluidPort_a port_a( redeclare final package Medium=Medium) "Fluid port"; Buildings.Fluid.FMI.Interfaces.PressureInput p if use_p_in "Pressure to be sent to outlet"; protected Buildings.Fluid.FMI.Interfaces.FluidProperties bacPro_internal( redeclare final package Medium = Medium) "Internal connector for fluid properties for back flow"; Buildings.Fluid.FMI.Interfaces.PressureOutput p_in_internal "Internal connector for pressure"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_in_internal "Internal connector for mass fraction of forward flow properties"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_out_internal "Internal connector for mass fraction of backward flow properties"; initial equation assert(Medium.nXi < 2, "The medium must have zero or one independent mass fraction Medium.nXi."); equation port_a.m_flow = outlet.m_flow; outlet.forward.T = Medium.temperature_phX( p= p_in_internal, h= inStream(port_a.h_outflow), X= inStream(port_a.Xi_outflow)); inStream(port_a.C_outflow) = outlet.forward.C; // Mass fraction for forward flow X_w_in_internal = if Medium.nXi > 0 then inStream(port_a.Xi_outflow[1]) else 0; connect(outlet.forward.X_w, X_w_in_internal); // Conditional connector for mass fraction for backward flow if Medium.nXi > 0 and allowFlowReversal then connect(X_w_out_internal, outlet.backward.X_w); else X_w_out_internal = 0; end if; port_a.Xi_outflow = fill(X_w_out_internal, Medium.nXi); // Conditional connector for flow reversal connect(outlet.backward, bacPro_internal); if not allowFlowReversal then bacPro_internal.T = Medium.T_default; bacPro_internal.C = fill(0, Medium.nC); if Medium.nXi > 0 then // This test for nXi is needed for Buildings.Fluid.FMI.Examples.HeaterFan_noReverseFlow // to work with Buildings.Media.Water connect(bacPro_internal.X_w, X_w_out_internal); end if; end if; bacPro_internal.T = Medium.temperature_phX( p= p_in_internal, h= port_a.h_outflow, X= port_a.Xi_outflow); bacPro_internal.C = port_a.C_outflow; // Conditional connectors for pressure if use_p_in then connect(outlet.p, p_in_internal); else p_in_internal = Medium.p_default; end if; connect(p, p_in_internal); port_a.p = p_in_internal; end OutletAdaptor;

Buildings.Fluid.FMI.Sink_T Buildings.Fluid.FMI.Sink_T

FMI model for a sink with temperature for reverse flow as an input

Buildings.Fluid.FMI.Sink_T

Information

Model of a sink that takes as an input the medium properties temperature, mass fractions (if Medium.nXi > 0) and trace substances (if Medium.nC > 0). These properties are used during reverse flow.

For a system of components with the connectors of the Buildings.Fluid.FMI package, this component is required to set the medium properties for the reverse flow.

If the parameter use_p_in is set to true, then the model as an output connector p. This can be used to obtain the pressure of the sink, which may be needed to iteratively solve for the mass flow rate.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
input RealInputT_inPrescribed boundary temperature [K]
input RealInputX_w_inPrescribed boundary composition [1]
input RealInputC_in[Medium.nC]Prescribed boundary composition
InletinletFluid port
output PressureOutputpPressure [Pa]

Modelica definition

model Sink_T "FMI model for a sink with temperature for reverse flow as an input" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Boolean use_p_in = true "= true to use a pressure from connector, false to output Medium.p_default"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; Modelica.Blocks.Interfaces.RealInput T_in(unit="K", displayUnit="degC", min=0) "Prescribed boundary temperature"; Modelica.Blocks.Interfaces.RealInput X_w_in(unit="1") if Medium.nXi > 0 "Prescribed boundary composition"; Modelica.Blocks.Interfaces.RealInput C_in[Medium.nC] "Prescribed boundary composition"; Interfaces.Inlet inlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid port"; Buildings.Fluid.FMI.Interfaces.PressureOutput p if use_p_in "Pressure"; protected Buildings.Fluid.FMI.Interfaces.FluidProperties bacPro_internal( redeclare final package Medium = Medium) "Internal connector for fluid properties for back flow"; Buildings.Fluid.FMI.Interfaces.PressureOutput p_in_internal "Internal connector for pressure"; output Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_in_internal "Internal connector for mass fraction of forward flow properties"; equation // Conditional connector for flow reversal connect(inlet.backward, bacPro_internal); connect(bacPro_internal.X_w, X_w_in_internal); if allowFlowReversal and Medium.nXi > 0 then connect(X_w_in_internal, X_w_in); else X_w_in_internal = 0; end if; if allowFlowReversal then bacPro_internal.T = T_in; bacPro_internal.C = C_in; else bacPro_internal.T = Medium.T_default; bacPro_internal.C = fill(0, Medium.nC); end if; // Propagate pressure to output signal connector // using conditional connectors if use_p_in then connect(inlet.p, p_in_internal); else p_in_internal = Medium.p_default; end if; connect(p, p_in_internal); end Sink_T;

Buildings.Fluid.FMI.Source_T Buildings.Fluid.FMI.Source_T

FMI model for a boundary with mass flow rate, pressure and temperature as an input

Buildings.Fluid.FMI.Source_T

Information

Model of a source that takes as an input the mass flow rate, pressure and the medium properties temperature, mass fractions (if Medium.nXi > 0) and trace substances (if Medium.nC > 0).

For a system of components with the connectors of the Buildings.Fluid.FMI package, this component is required to set the pressure and the mass flow rate of the system.

Extends from Buildings.BaseClasses.BaseIcon (Base icon).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
input RealInputm_flow_inPrescribed mass flow source [kg/s]
input PressureInputp_inPrescribed boundary pressure [Pa]
input RealInputT_inPrescribed boundary temperature [K]
input RealInputX_w_inPrescribed boundary composition [1]
input RealInputC_in[Medium.nC]Prescribed boundary composition
OutletoutletFluid port

Modelica definition

model Source_T "FMI model for a boundary with mass flow rate, pressure and temperature as an input" extends Buildings.BaseClasses.BaseIcon; replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; parameter Boolean use_p_in = true "= true to use a pressure from connector, false to output Medium.p_default"; Modelica.Blocks.Interfaces.RealInput m_flow_in(unit="kg/s") "Prescribed mass flow source"; Buildings.Fluid.FMI.Interfaces.PressureInput p_in if use_p_in "Prescribed boundary pressure"; Modelica.Blocks.Interfaces.RealInput T_in(unit="K", displayUnit="degC", min=0) "Prescribed boundary temperature"; Modelica.Blocks.Interfaces.RealInput X_w_in(unit="1") if Medium.nXi > 0 "Prescribed boundary composition"; Modelica.Blocks.Interfaces.RealInput C_in[Medium.nC] "Prescribed boundary composition"; Interfaces.Outlet outlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid port"; protected Buildings.Fluid.FMI.Interfaces.PressureOutput p_in_internal "Internal connector for pressure"; Buildings.Fluid.FMI.Interfaces.MassFractionConnector X_w_in_internal "Internal connector for mass fraction of forward flow properties"; initial equation assert(Medium.nXi < 2, "The medium must have zero or one independent mass fraction Medium.nXi."); equation // Conditional connect statements for pressure if use_p_in then connect(p_in, p_in_internal); else p_in_internal = Medium.p_default; end if; connect(outlet.p, p_in_internal); // Conditional connectors for mass fraction if Medium.nXi > 0 then connect(X_w_in_internal, X_w_in); else X_w_in_internal = 0; end if; connect(outlet.forward.X_w, X_w_in_internal); outlet.m_flow = m_flow_in; connect(outlet.p, p_in); outlet.forward.T = T_in; outlet.forward.C = C_in; end Source_T;

Buildings.Fluid.FMI.TwoPort Buildings.Fluid.FMI.TwoPort

Container to export a thermofluid flow model with two ports as an FMU

Buildings.Fluid.FMI.TwoPort

Information

Partial model that can be used to export thermofluid flow models as an FMU. This model only declares the inlet and outlet ports, the medium and whether flow reversal is allowed.

See Buildings.Fluid.FMI.Examples.FMUs.ResistanceVolume for a block that extends this partial block.

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
replaceable package MediumMedium in the component
InletinletFluid inlet
OutletoutletFluid outlet

Modelica definition

partial block TwoPort "Container to export a thermofluid flow model with two ports as an FMU" replaceable package Medium = Modelica.Media.Interfaces.PartialMedium "Medium in the component"; parameter Boolean allowFlowReversal = true "= true to allow flow reversal, false restricts to design direction (inlet -> outlet)"; parameter Boolean use_p_in = true "= true to use a pressure from connector, false to output Medium.p_default"; Interfaces.Inlet inlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid inlet"; Interfaces.Outlet outlet( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Fluid outlet"; end TwoPort;

Buildings.Fluid.FMI.TwoPortComponent Buildings.Fluid.FMI.TwoPortComponent

Container to export thermofluid flow models with two ports as an FMU

Buildings.Fluid.FMI.TwoPortComponent

Information

Block that serves as a container to export a thermofluid flow component. This block contains a replaceable model com that needs to be redeclared to export any model that has as its base class Buildings.Fluid.Interfaces.PartialTwoPort. This allows exporting a large variety of thermofluid flow models with a simple redeclare.

See for example Buildings.Fluid.FMI.Examples.FMUs.FixedResistanceDpM or Buildings.Fluid.FMI.Examples.FMUs.HeaterCooler_u for how to use this block.

Note that this block must not be used if the instance com sets a constant pressure. In such a situation, use Buildings.Fluid.FMI.TwoPort together with Buildings.Fluid.FMI.InletAdaptor and Buildings.Fluid.FMI.OutletAdaptor and set the pressure to be equal to the port p of Buildings.Fluid.FMI.OutletAdaptor.

Extends from TwoPort (Container to export a thermofluid flow model with two ports as an FMU).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Booleanuse_p_intrue= true to use a pressure from connector, false to output Medium.p_default
PartialTwoPortcomredeclare Buildings.Fluid.In...Component that holds the actual model
Assumptions
BooleanallowFlowReversaltrue= true to allow flow reversal, false restricts to design direction (inlet -> outlet)

Connectors

TypeNameDescription
InletinletFluid inlet
OutletoutletFluid outlet

Modelica definition

block TwoPortComponent "Container to export thermofluid flow models with two ports as an FMU" extends TwoPort; replaceable Buildings.Fluid.Interfaces.PartialTwoPort com constrainedby Buildings.Fluid.Interfaces.PartialTwoPort( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal) "Component that holds the actual model"; Modelica.Blocks.Sources.RealExpression dpCom(y=com.port_a.p - com.port_b.p) if use_p_in "Pressure drop of the component"; protected Buildings.Fluid.FMI.InletAdaptor bouIn( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Boundary model for inlet"; Buildings.Fluid.FMI.OutletAdaptor bouOut( redeclare final package Medium=Medium, final allowFlowReversal=allowFlowReversal, final use_p_in=use_p_in) "Boundary component for outlet"; Modelica.Blocks.Math.Feedback pOut if use_p_in "Pressure at component outlet"; equation connect(pOut.u1, bouIn.p); connect(com.port_a, bouIn.port_b); connect(com.port_b, bouOut.port_a); connect(inlet, bouIn.inlet); connect(bouOut.outlet, outlet); connect(dpCom.y, pOut.u2); connect(pOut.y, bouOut.p); end TwoPortComponent;

http://simulationresearch.lbl.gov/modelica