Collection of models that can be exported as FMUs
This package demonstrates how to configure thermofluid flow models so that they can be exported as FMUs.
In Dymola, to export the models as an FMU,
select from the pull down menu Commands - Export FMU
.
Extends from Modelica.Icons.ExamplesPackage (Icon for packages containing runnable examples).
Name | Description |
---|---|
Fan | FMU declaration for a fixed resistance |
FixedResistanceDpM | FMU declaration for a fixed resistance |
FlowSplitter_u | FMU declaration for a flow splitter |
HeaterCooler_T | FMU declaration for an ideal heater or cooler with prescribed outlet temperature |
HeaterCooler_u | FMU declaration for an ideal heater or cooler with prescribed heat flow rate |
Humidifier_u | FMU declaration for an ideal humidifier |
IdealSource_m_flow | FMU declaration for a fixed resistance |
MixingVolume | Container to export a control volume as an FMU |
ResistanceVolume | Container to export a flow resistance and control volume as an FMU |
TwoPortPassThrough | FMU declaration for a block that simply passes all the inputs to the outputs |
FMU declaration for a fixed resistance
This example demonstrates how to export an FMU with a fluid flow component. The FMU has an instance of Buildings.Fluid.FixedResistances.FlowMachine_dp.
See Buildings.Fluid.FMI.UsersGuide for why there is no model that exports Buildings.Fluid.Movers.FlowMachine_m_flow.
Extends from Buildings.Fluid.FMI.TwoPortComponent (Container to export thermofluid flow models with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 500 | Pressure drop at nominal mass flow rate [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
input RealInput | dp_in | Prescribed pressure rise [Pa] |
FMU declaration for a fixed resistance
This example demonstrates how to export an FMU with a fluid flow component. The FMU has an instance of Buildings.Fluid.FixedResistances.FixedResistanceDpM.
Extends from Buildings.Fluid.FMI.TwoPortComponent (Container to export thermofluid flow models with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 100 | Pressure drop at nominal mass flow rate [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
FMU declaration for a flow splitter
This example demonstrates how to export an FMU with a fluid flow component. The FMU is an instance of Buildings.Fluid.FMI.FlowSplitter_u.
Extends from Buildings.Fluid.FMI.FlowSplitter_u (Container to export a flow splitter as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
MassFlowRate | m_flow_nominal[nout] | {0.1,0.2} | Nominal mass flow rate for each outlet [kg/s] |
Integer | nout | 2 | Number of outlets |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet[nout] | Fluid outlet |
input RealInput | u[nout] | Control signal for the mass flow rates [1] |
FMU declaration for an ideal heater or cooler with prescribed outlet temperature
This example demonstrates how to export an FMU with a heater that takes as an input signal the leaving fluid temperature. The FMU has an instance of Buildings.Fluid.HeatExchangers.HeaterCooler_T.
Extends from Buildings.Fluid.FMI.TwoPortComponent (Container to export thermofluid flow models with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
HeatFlowRate | Q_flow_maxHeat | Modelica.Constants.inf | Maximum heat flow rate for heating (positive) [W] |
HeatFlowRate | Q_flow_maxCool | -Modelica.Constants.inf | Maximum heat flow rate for cooling (negative) [W] |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 0 | Pressure [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
input RealInput | TSet | Set point temperature of the fluid that leaves port_b [K] |
output RealOutput | Q_flow | Heat added to the fluid (if flow is from port_a to port_b) [W] |
FMU declaration for an ideal heater or cooler with prescribed heat flow rate
This example demonstrates how to export an FMU with a heater that takes as an input signal the normalized heat flow rate. The FMU has an instance of Buildings.Fluid.HeatExchangers.HeaterCooler_u.
The mass dynamics has been set to
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState
.
See the
user's guide
for the rationale.
Extends from Buildings.Fluid.FMI.TwoPortComponent (Container to export thermofluid flow models with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 0 | Pressure [Pa] |
HeatFlowRate | Q_flow_nominal | 100 | Heat flow rate at u=1, positive for heating [W] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
input RealInput | u | Control input [1] |
FMU declaration for an ideal humidifier
This example demonstrates how to export an FMU with a humidifier that takes as an input signal the normalized mass flow rate of water that will be added to the medium. The FMU has an instance of Buildings.Fluid.MassExchangers.Humidifier_u.
The mass dynamics has been set to
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState
.
See the
user's guide
for the rationale.
Extends from Buildings.Fluid.FMI.TwoPortComponent (Container to export thermofluid flow models with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 0 | Pressure [Pa] |
Temperature | T | 293.15 | Temperature of water that is added to the fluid stream (used if use_T_in=false) [K] |
MassFlowRate | mWat_flow_nominal | 0.01*0.005 | Water mass flow rate at u=1, positive for humidification [kg/s] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
input RealInput | u | Control input [1] |
FMU declaration for a fixed resistance
This example demonstrates how to export an FMU that sets the mass flow rate.
Extends from Buildings.Fluid.FMI.TwoPort (Container to export a thermofluid flow model with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
input RealInput | m_flow_in | Prescribed mass flow rate [kg/s] |
Container to export a control volume as an FMU
This example demonstrates how to export an FMU with a control volume. The FMU has an instance of Buildings.Fluid.MixingVolumes.MixingVolume.
The mass dynamics has been set to
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState
.
See the
user's guide
for the rationale.
Extends from TwoPort (Container to export a thermofluid flow model with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
Volume | V | 1 | Volume [m3] |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
Container to export a flow resistance and control volume as an FMU
This example demonstrates how to export an FMU with a flow resistance and a control volume. The FMU has an instance of Buildings.Fluid.FixedResistances.FixedResistanceDpM and Buildings.Fluid.MixingVolumes.MixingVolume.
The mass dynamics has been set to
massDynamics=Modelica.Fluid.Types.Dynamics.SteadyState
.
See the
user's guide
for the rationale.
Extends from TwoPort (Container to export a thermofluid flow model with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
Volume | V | 1 | Volume [m3] |
MassFlowRate | m_flow_nominal | 0.01 | Nominal mass flow rate [kg/s] |
Pressure | dp_nominal | 100 | Nominal pressure drop [Pa] |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |
FMU declaration for a block that simply passes all the inputs to the outputs
This example demonstrates how to export an FMU that simply passes all its inputs to its outputs. Such an FMU could for example be used in a block diagram as a place-holder for another FMU that provides an actual implementation of a component.
Extends from Buildings.Fluid.FMI.TwoPort (Container to export a thermofluid flow model with two ports as an FMU).
Type | Name | Default | Description |
---|---|---|---|
replaceable package Medium | PartialMedium | Medium in the component | |
Boolean | use_p_in | true | = true to use a pressure from connector, false to output Medium.p_default |
Assumptions | |||
Boolean | allowFlowReversal | true | = true to allow flow reversal, false restricts to design direction (inlet -> outlet) |
Type | Name | Description |
---|---|---|
replaceable package Medium | Medium in the component | |
Inlet | inlet | Fluid inlet |
Outlet | outlet | Fluid outlet |