Buildings.Templates.Components.Sensors

Sensor models

Information

This package contains models for sensors.

Extends from Modelica.Icons.VariantsPackage (Icon for package containing variants).

Package Content

Name Description
Buildings.Templates.Components.Sensors.DifferentialPressure DifferentialPressure Differential pressure sensor
Buildings.Templates.Components.Sensors.HumidityRatio HumidityRatio Humidity ratio sensor
Buildings.Templates.Components.Sensors.SpecificEnthalpy SpecificEnthalpy Specific enthalpy sensor
Buildings.Templates.Components.Sensors.Temperature Temperature Temperature sensor
Buildings.Templates.Components.Sensors.VolumeFlowRate VolumeFlowRate Volume flow rate sensor

Buildings.Templates.Components.Sensors.DifferentialPressure Buildings.Templates.Components.Sensors.DifferentialPressure

Differential pressure sensor

Buildings.Templates.Components.Sensors.DifferentialPressure

Information

This is a model for a differential pressure sensor that can be enabled or disabled with the Boolean parameter have_sen. If disabled, the control input variable y is removed and the model simply consists of two fluid ports that are not connected to each other and for which the following equations are used. So the model must still be provided with pressure conditions at each port.

// Zero flow equations
port_(a|b).m_flow = 0;
// No contribution of specific quantities
port_(a|b).h_outflow = 0;
port_(a|b).Xi_outflow = zeros(Medium.nXi);
port_(a|b).C_outflow = zeros(Medium.nC);

Extends from Buildings.Templates.Components.Interfaces.PartialSensor (Interface class for sensor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal0Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSentrueSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value [Pa]

Modelica definition

model DifferentialPressure "Differential pressure sensor" extends Buildings.Templates.Components.Interfaces.PartialSensor( y(final unit="Pa", displayUnit="Pa"), final m_flow_nominal=0, final isDifPreSen=true); Buildings.Fluid.Sensors.RelativePressure senRelPre( redeclare final package Medium=Medium) if have_sen "Relative pressure sensor"; equation connect(port_a, senRelPre.port_a); connect(senRelPre.p_rel, y); connect(senRelPre.port_b, port_b); end DifferentialPressure;

Buildings.Templates.Components.Sensors.HumidityRatio Buildings.Templates.Components.Sensors.HumidityRatio

Humidity ratio sensor

Buildings.Templates.Components.Sensors.HumidityRatio

Information

This is a model for a humidity ratio (in kg/kg dry air) sensor that can be enabled or disabled with the Boolean parameter have_sen. If disabled, the control input variable y is removed and the model is a direct fluid pass-through.

Extends from Buildings.Templates.Components.Interfaces.PartialSensor (Interface class for sensor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value [kg/kg]

Modelica definition

model HumidityRatio "Humidity ratio sensor" extends Buildings.Templates.Components.Interfaces.PartialSensor( y(final unit="kg/kg"), final isDifPreSen=false); Buildings.Fluid.Sensors.MassFractionTwoPort senMasFra( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final allowFlowReversal=allowFlowReversal) if have_sen "Mass fraction sensor"; Buildings.Utilities.Psychrometrics.ToDryAir toDryAir if have_sen "Conversion into kg/kg dry air"; Buildings.Templates.Components.Routing.PassThroughFluid pas( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal) if not have_sen "Pass through"; equation connect(port_a, senMasFra.port_a); connect(senMasFra.port_b, port_b); connect(senMasFra.X, toDryAir.XiTotalAir); connect(port_a, pas.port_a); connect(pas.port_b, port_b); connect(toDryAir.XiDry, y); end HumidityRatio;

Buildings.Templates.Components.Sensors.SpecificEnthalpy Buildings.Templates.Components.Sensors.SpecificEnthalpy

Specific enthalpy sensor

Buildings.Templates.Components.Sensors.SpecificEnthalpy

Information

This is a model for a specific enthalpy sensor that can be enabled or disabled with the Boolean parameter have_sen. If disabled, the control input variable y is removed and the model is a direct fluid pass-through.

Extends from Buildings.Templates.Components.Interfaces.PartialSensor (Interface class for sensor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value [J/kg]

Modelica definition

model SpecificEnthalpy "Specific enthalpy sensor" extends Buildings.Templates.Components.Interfaces.PartialSensor( y(final unit="J/kg"), final isDifPreSen=false); Buildings.Fluid.Sensors.SpecificEnthalpyTwoPort senSpeEnt( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final allowFlowReversal=allowFlowReversal) if have_sen "Specific enthalpy sensor"; Buildings.Templates.Components.Routing.PassThroughFluid pas( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal) if not have_sen "Pass through"; equation connect(port_a,senSpeEnt. port_a); connect(senSpeEnt.port_b, port_b); connect(port_a, pas.port_a); connect(pas.port_b, port_b); connect(senSpeEnt.h_out, y); end SpecificEnthalpy;

Buildings.Templates.Components.Sensors.Temperature Buildings.Templates.Components.Sensors.Temperature

Temperature sensor

Buildings.Templates.Components.Sensors.Temperature

Information

This is a model for a dry bulb temperature sensor that can be enabled or disabled with the Boolean parameter have_sen. If disabled, the control input variable y is removed and the model is a direct fluid pass-through.

Extends from Buildings.Templates.Components.Interfaces.PartialSensor (Interface class for sensor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
SensorTemperaturetypBuildings.Templates.Componen...Type of temperature sensor
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value [K]

Modelica definition

model Temperature "Temperature sensor" extends Buildings.Templates.Components.Interfaces.PartialSensor( y(final unit="K", displayUnit="degC"), final isDifPreSen=false); parameter Buildings.Templates.Components.Types.SensorTemperature typ= Buildings.Templates.Components.Types.SensorTemperature.Standard "Type of temperature sensor"; Buildings.Fluid.Sensors.TemperatureTwoPort senTem( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final allowFlowReversal=allowFlowReversal) if have_sen "Temperature sensor"; Buildings.Templates.Components.Routing.PassThroughFluid pas( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal) if not have_sen "Pass through"; equation connect(port_a, senTem.port_a); connect(senTem.port_b, port_b); connect(port_a, pas.port_a); connect(pas.port_b, port_b); connect(senTem.T, y); end Temperature;

Buildings.Templates.Components.Sensors.VolumeFlowRate Buildings.Templates.Components.Sensors.VolumeFlowRate

Volume flow rate sensor

Buildings.Templates.Components.Sensors.VolumeFlowRate

Information

This is a model for a volume flow rate sensor that can be enabled or disabled with the Boolean parameter have_sen. If disabled, the control input variable y is removed and the model is a direct fluid pass-through.

Extends from Buildings.Templates.Components.Interfaces.PartialSensor (Interface class for sensor).

Parameters

TypeNameDefaultDescription
replaceable package MediumPartialMediumMedium in the component
SensorVolumeFlowRatetyp Type of volume flow rate sensor
Nominal condition
MassFlowRatem_flow_nominal Nominal mass flow rate [kg/s]
Configuration
Booleanhave_sentrueSet to true for sensor, false for direct pass through
BooleanisDifPreSenfalseSet to true for differential pressure sensor, false for any other sensor
Assumptions
BooleanallowFlowReversaltrue= false to simplify equations, assuming, but not enforcing, no flow reversal
Advanced
MassFlowRatem_flow_small1E-4*abs(m_flow_nominal)Small mass flow rate for regularization of zero flow [kg/s]
Diagnostics
Booleanshow_Tfalse= true, if actual temperature at port is computed
Graphics
Integertext_rotation0Text rotation angle in icon layer
Booleantext_flipfalseTrue to flip text horizontally in icon layer

Connectors

TypeNameDescription
FluidPort_aport_aFluid connector a (positive design flow direction is from port_a to port_b)
FluidPort_bport_bFluid connector b (positive design flow direction is from port_a to port_b)
output RealOutputyConnector for measured value [m3/s]

Modelica definition

model VolumeFlowRate "Volume flow rate sensor" extends Buildings.Templates.Components.Interfaces.PartialSensor( y(final unit="m3/s"), final isDifPreSen=false); parameter Buildings.Templates.Components.Types.SensorVolumeFlowRate typ "Type of volume flow rate sensor"; Buildings.Fluid.Sensors.VolumeFlowRate senVolFlo( redeclare final package Medium=Medium, final m_flow_nominal=m_flow_nominal, final allowFlowReversal=allowFlowReversal) if have_sen "Volume flow rate sensor"; Buildings.Templates.Components.Routing.PassThroughFluid pas( redeclare final package Medium = Medium, final allowFlowReversal=allowFlowReversal) if not have_sen "Pass through"; equation connect(port_a, senVolFlo.port_a); connect(senVolFlo.port_b, port_b); connect(port_a, pas.port_a); connect(pas.port_b, port_b); connect(senVolFlo.V_flow, y); end VolumeFlowRate;