modelTraceSubstancesFlowSource
Information
This model can be used to inject trace substances into a system. The model adds a mass flow rate to its port with a trace substance concentration of 1.
Typical use and important parameters
A typical use of this model is to add carbon dioxide to room air, since the
carbon dioxide concentration is typically so small that it need not be
added to the room mass balance, and since the mass flow rate can be
made small compared to the room volume if the medium that leaves this
component has a carbon dioxide concentration of 1.
The parameter substanceName must be set to the name of the substance
that is injected into the fluid.
Note however that mixing volumes from the package Buildings.Fluid.MixingVolumes allow to directly add a trace substance mass flow rate, which is more efficient than using this model.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nPorts | 0 | Number of ports |
| String | substanceName | "CO2" | Name of trace substance |
| Boolean | use_m_flow_in | false | Get the trace substance mass flow rate from the input connector |
| Modelica.Units.SI.MassFlowRate | m_flow | 0 | Fixed mass flow rate going out of the fluid port |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | m_flow_in | Prescribed mass flow rate for extra property | |
| Modelica.Fluid.Interfaces.FluidPorts_b[nPorts] | ports | Connector for fluid ports |
Contents
| Name | Description |
|---|---|
| Medium in the component |
Revisions
-
May 21, 2026, by Michael Wetter:
Replaced deprecatedcardinalityfunction with the annotationmayOnlyConnectOnce.
This is for Buildings, #4607. -
March 11, 2024, by Michael Wetter:
Corrected use ofHideResult.
This is for #1850. -
November 14, 2019, by Michael Wetter:
Rewrote assignment ofC_in_internalto avoid an initial algorithm section.
This is for #1250. -
January 23, 2019, by Michael Wetter:
Refactored implementation to provide default medium choice. This refactoring removes the dependency of the base class but is compatible with the previous implementation.
This is for #1050. -
January 26, 2016, by Michael Wetter:
Addedunitandquantityattributes. -
January 19, 2016, by Michael Wetter:
Updated documentation due to the addition of an input for trace substance in the mixing volume. This is for issue 372. -
October 30, 2015, by Matthis Thorade:
RemovednPorts=1in extension of the base class as the default must be 0. This avoids a warning in the pedantic model check of Dymola 2016. -
May 29, 2014, by Michael Wetter:
Removed undesirable annotationEvaluate=true. -
September 10, 2013, by Michael Wetter:
Added missingeachin declaration ofC_in_internal. This eliminates a compilation error in OpenModelica. -
March 27, 2013, by Michael Wetter:
Removed binding forC_in_internalto allow pedantic check in Dymola 2014. -
February 22, by Michael Wetter:
Improved code that searches for the index of the trace substance in the medium model. -
September 18, 2008 by Michael Wetter:
First implementation.