modelTemperatureTwoPort
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
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Time | tau (from PartialDynamicFlowSensor) | 1 | Time constant at nominal flow rate (use tau=0 for steady-state sensor, but see user guide for potential problems) |
| Assumptions | |||
| Boolean | allowFlowReversal (from PartialTwoPort) | true | = false to simplify equations, assuming, but not enforcing, no flow reversal |
| Nominal condition | |||
| Modelica.Units.SI.MassFlowRate | m_flow_nominal (from PartialFlowSensor) | Nominal mass flow rate, used for regularization near zero flow | |
| Advanced | |||
| Modelica.Units.SI.MassFlowRate | m_flow_small (from PartialFlowSensor) | 1E-4*m_flow_nominal | For bi-directional flow, temperature is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required) |
| Initialization | |||
| Modelica.Blocks.Types.Init | initType (from PartialDynamicFlowSensor) | Modelica.Blocks.Types.Init.InitialState | Type of initialization (InitialState and InitialOutput are identical) |
| Modelica.Units.SI.Temperature | T_start | Medium.T_default | Initial or guess value of output (= state) |
| Heat transfer | |||
| Boolean | transferHeat | false | if true, temperature T converges towards TAmb when no flow |
| Modelica.Units.SI.Temperature | TAmb | Medium.T_default | Fixed ambient temperature for heat transfer |
| Modelica.Units.SI.Time | tauHeaTra | 1200 | Time constant for heat transfer, default 20 minutes |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.Interfaces.FluidPort_a | port_a (from PartialTwoPort) | Fluid connector a (positive design flow direction is from port_a to port_b) | |
| Modelica.Fluid.Interfaces.FluidPort_b | port_b (from PartialTwoPort) | Fluid connector b (positive design flow direction is from port_a to port_b) | |
| Modelica.Blocks.Interfaces.RealOutput | T | Temperature of the passing fluid |
Revisions
-
June 25, 2026, by Michael Wetter:
Addednominalattribute 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 whentransferHeat=true. See #840. -
January 12, 2016 by Filip Jorissen:
Removed parametertauInvsince 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.