modelTraceSubstancesFlowSource

Source with mass flow that does not take part in medium mass balance (such as CO2)

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

TypeNameDefaultDescription
IntegernPorts0Number of ports
StringsubstanceName"CO2"Name of trace substance
Booleanuse_m_flow_infalseGet the trace substance mass flow rate from the input connector
Modelica.Units.SI.MassFlowRatem_flow0Fixed mass flow rate going out of the fluid port

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputm_flow_inPrescribed mass flow rate for extra property
Modelica.Fluid.Interfaces.FluidPorts_b[nPorts]portsConnector for fluid ports

Contents

NameDescription
MediumMedium in the component

Revisions

  • May 21, 2026, by Michael Wetter:
    Replaced deprecated cardinality function with the annotation mayOnlyConnectOnce.
    This is for Buildings, #4607.
  • March 11, 2024, by Michael Wetter:
    Corrected use of HideResult.
    This is for #1850.
  • November 14, 2019, by Michael Wetter:
    Rewrote assignment of C_in_internal to 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:
    Added unit and quantity attributes.
  • 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:
    Removed nPorts=1 in 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 annotation Evaluate=true.
  • September 10, 2013, by Michael Wetter:
    Added missing each in declaration of C_in_internal. This eliminates a compilation error in OpenModelica.
  • March 27, 2013, by Michael Wetter:
    Removed binding for C_in_internal to 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.