modelTemperatureTwoPort

Ideal two port temperature sensor

Extends from Buildings.Fluid.Sensors.BaseClasses.PartialDynamicFlowSensor (Partial component to model sensors that measure flow properties using a dynamic model).

Information

This model outputs the temperature of the medium in the flow between its fluid ports. The sensor does not influence the fluid.

Typical use and important parameters

If the parameter tau is non-zero, then its output T converges to the temperature of the incoming fluid using a first order differential equation. Setting tau=0 is not recommend. See Buildings.Fluid.Sensors.UsersGuide for an explanation.

If transferHeat = true, then heat transfer with the ambient is approximated and T converges towards the fixed ambient temperature TAmb using a first order approximation with a time constant of tauHeaTra when the flow rate is small. Note that no energy is exchanged with the fluid as the sensor does not influence the fluid temperature.

Setting transferHeat = true is useful, for example, if the sensor is used to measure the fluid temperature in a system with on/off control on the mass flow rate. If transferHeat were false, then the sensor output T would remain constant if the mass flow rate is set to zero, and hence the controller may never switch the mass flow rate on again.

In general, applications in which the sensor output is not used to switch the mass flow rate on should set transferHeat=false.

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.Timetau (from PartialDynamicFlowSensor)1Time constant at nominal flow rate (use tau=0 for steady-state sensor, but see user guide for potential problems)
Assumptions
BooleanallowFlowReversal (from PartialTwoPort)true= false to simplify equations, assuming, but not enforcing, no flow reversal
Nominal condition
Modelica.Units.SI.MassFlowRatem_flow_nominal (from PartialFlowSensor)Nominal mass flow rate, used for regularization near zero flow
Advanced
Modelica.Units.SI.MassFlowRatem_flow_small (from PartialFlowSensor)1E-4*m_flow_nominalFor bi-directional flow, temperature is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required)
Initialization
Modelica.Blocks.Types.InitinitType (from PartialDynamicFlowSensor)Modelica.Blocks.Types.Init.InitialStateType of initialization (InitialState and InitialOutput are identical)
Modelica.Units.SI.TemperatureT_startMedium.T_defaultInitial or guess value of output (= state)
Heat transfer
BooleantransferHeatfalseif true, temperature T converges towards TAmb when no flow
Modelica.Units.SI.TemperatureTAmbMedium.T_defaultFixed ambient temperature for heat transfer
Modelica.Units.SI.TimetauHeaTra1200Time constant for heat transfer, default 20 minutes

Connectors

TypeNameDefaultDescription
Modelica.Fluid.Interfaces.FluidPort_aport_a (from PartialTwoPort)Fluid connector a (positive design flow direction is from port_a to port_b)
Modelica.Fluid.Interfaces.FluidPort_bport_b (from PartialTwoPort)Fluid connector b (positive design flow direction is from port_a to port_b)
Modelica.Blocks.Interfaces.RealOutputTTemperature of the passing fluid

Revisions

  • June 25, 2026, by Michael Wetter:
    Added nominal attribute to state variable.
    This is for IBPSA, #2132.
  • February 21, 2020, by Michael Wetter:
    Changed icon to display its operating state.
    This is for #1294.
  • October 23, 2017 by Filip Jorissen:
    Revised implementation of equations when transferHeat=true. See #840.
  • January 12, 2016 by Filip Jorissen:
    Removed parameter tauInv since this now exists in Buildings.Fluid.Sensors.BaseClasses.PartialDynamicFlowSensor.
  • June 19, 2015 by Michael Wetter:
    Revised model and documentation.
  • June 18, 2015 by Filip Jorissen:
    Added option for simulating thermal losses.
  • June 3, 2011 by Michael Wetter:
    Revised implementation to add dynamics in such a way that the time constant increases as the mass flow rate tends to zero. This significantly improves the numerics.
  • February 26, 2010 by Michael Wetter:
    Set start attribute for temperature output. Prior to this change, the output was 0 at initial time, which caused the plot of the output to use 0 Kelvin as the lower value of the ordinate.
  • September 10, 2008, by Michael Wetter:
    First implementation, based on Buildings.Fluid.Sensors.Temperature.