modelVelocity

Ideal sensor for flow velocity

Extends from Buildings.Fluid.Sensors.BaseClasses.PartialDynamicFlowSensor (Partial component to model sensors that measure flow properties using a dynamic model), Modelica.Icons.RoundSensor (Icon representing a round measurement device).

Information

This model outputs the flow velocity flowing from port_a to port_b.

The sensor is ideal, i.e., it does not influence the fluid. If the parameter tau is non-zero, then the measured density that is used to convert the mass flow rate into volumetric flow rate is computed using a first order differential equation. Setting tau=0 is not recommend. See Buildings.Fluid.Sensors.UsersGuide for an explanation.

Typical use and important parameters

In order to use the flow velocity sensor, the cross sectional area of the flow channel crossSection must be specified in m2. For a circular flow channel (e.g. a round pipe) of diameter diameter, the cross sectional area can be specified as crossSection = diameter * diameter / 4 * Modelica.Constants.pi. See Buildings.Fluid.Sensors.Examples.Velocity for an example implementation with diameter = 0.1.

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)
Modelica.Units.SI.AreaACross sectional area of flow channel
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)
Medium.Densityd_startMedium.density(Medium.setState_pTX(p_start, T_start, X_start))Initial or guess value of density
Modelica.Units.SI.TemperatureT_startMedium.T_defaultTemperature used to compute d_start
Modelica.Units.SI.Pressurep_startMedium.p_defaultPressure used to compute d_start
Modelica.Units.SI.MassFraction[Medium.nX]X_startMedium.X_defaultMass fraction used to compute d_start

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.RealOutputvFlow velocity from port_a to port_b

Components

TypeNameDefaultDescription
Modelica.Units.SI.VolumeFlowRateV_flowVolume flow rate from port_a to port_b

Revisions

  • June 25, 2026, by Michael Wetter:
    Added nominal attribute to state variable.
    This is for IBPSA, #2132.
  • February 25, 2020, by Michael Wetter:
    Changed icon to display its operating state.
    This is for #1294.
  • May 20, 2016, by Marcus Fuchs:
    First implementation. Implementation is based on Buildings.Fluid.Sensors.VolumeFlowRate.