| Name | Description |
|---|---|
| Package with conversions for sensor models | |
| Ideal temperature sensor | |
| Ideal enthalphy flow rate sensor | |
| Collection of models that illustrate model use and test models | |
| Ideal wet bulb temperature sensor | |
| Pressure sensor | |
| Ideal relative pressure sensor | |
| Ideal wet bulb temperature sensor |
Buildings.Fluids.Sensors.DryBulbTemperatureDynamic
This component monitors the temperature of the medium in the flow between fluid ports. The sensor does not influence the fluid. Its output is computed using a first order differential equation.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| Time | tau | 10 | Time constant [s] |
| Initialization | |||
| Temp | initType | Modelica.Blocks.Types.Init.N... | Type of initialization (InitialState and InitialOutput are identical) |
| Temperature | T_start | Medium.T_default | Initial or guess value of output (= state) [K] |
| Advanced | |||
| Temp | flowDirection | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port_a | |
| FluidPort_b | port_b | |
| output RealOutput | T | Temperature in port medium |
model DryBulbTemperatureDynamic "Ideal temperature sensor"
extends Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor;
Medium.BaseProperties medium;
parameter Modelica.SIunits.Time tau(min=0) = 10 "Time constant";
Modelica.Blocks.Interfaces.RealOutput T(redeclare type SignalType =
Modelica.SIunits.Temperature(start=T_start))
"Temperature in port medium";
parameter Modelica.Blocks.Types.Init.Temp initType=Modelica.Blocks.Types.Init.NoInit
"Type of initialization (InitialState and InitialOutput are identical)";
parameter Modelica.SIunits.Temperature T_start=Medium.T_default
"Initial or guess value of output (= state)";
initial equation
if initType == Modelica.Blocks.Types.Init.SteadyState then
der(T) = 0;
elseif initType == Modelica.Blocks.Types.Init.InitialState or
initType == Modelica.Blocks.Types.Init.InitialOutput then
T = T_start;
end if;
equation
port_a.p = medium.p;
h = medium.h;
Xi = medium.Xi;
der(T) = (medium.T-T)/tau;
end DryBulbTemperatureDynamic;
Buildings.Fluids.Sensors.EnthalpyFlowRate
This component monitors the enthalphy flow rate of the medium in the flow between fluid ports. The sensor is ideal, i.e., it does not influence the fluid.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| Advanced | |||
| Temp | flowDirection | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port_a | |
| FluidPort_b | port_b | |
| output RealOutput | H_flow | Enthalpy flow rate, positive if from port_a to port_b [W] |
model EnthalpyFlowRate "Ideal enthalphy flow rate sensor"
extends Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor;
extends Modelica.Icons.RotationalSensor;
Modelica.Blocks.Interfaces.RealOutput H_flow(unit="W")
"Enthalpy flow rate, positive if from port_a to port_b";
equation
H_flow = port_a.H_flow;
end EnthalpyFlowRate;
Buildings.Fluids.Sensors.ExtraPropertyOnePort
This component monitors the concentration of a species defined in the vector Medium.C. The sensor is ideal, i.e., it does not influence the fluid.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| String | substanceName | "CO2" | Name of species in vector of auxiliary substances |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port | |
| output RealOutput | C | Mass fraction of auxiliary component in the fluid |
model ExtraPropertyOnePort "Ideal wet bulb temperature sensor"
extends Modelica_Fluid.Sensors.BaseClasses.PartialAbsoluteSensor;
Modelica.Blocks.Interfaces.RealOutput C(
redeclare type SignalType = Modelica.SIunits.MassFraction)
"Mass fraction of auxiliary component in the fluid";
parameter String substanceName = "CO2"
"Name of species in vector of auxiliary substances";
// constant Real con = 28.97/44.01*1E6
// "Conversion from mass fraction CO2 to part per million";
protected
parameter Integer ind(fixed=false)
"Index of species in vector of auxiliary substances";
initial algorithm
ind:= -1;
for i in 1:Medium.nC loop
if ( Modelica.Utilities.Strings.isEqual(Medium.extraPropertiesNames[i], substanceName)) then
ind := i;
end if;
end for;
assert(ind > 0, "Substance '" + substanceName + "' is not present in medium '"
+ Medium.mediumName + "'.\n"
+ "Check sensor parameter and medium model.");
equation
C = port.C[ind];
///////////////////////////////////////////////////////////////////////////////////
// Extra species flow. This may be removed when upgrading to the new Modelica.Fluid.
port.mC_flow = zeros(Medium.nC);
///////////////////////////////////////////////////////////////////////////////////
end ExtraPropertyOnePort;
Buildings.Fluids.Sensors.Pressure
This component monitors the pressure at its ports. The sensor does not influence the fluid. The model is identical to Modelica_Fluid.Sensors.Pressure but it adds the mass balance for the extra species properties that is missing in the original sensor of Modelica_Fluid beta 1.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port | |
| output RealOutput | p | Pressure at port [Pa] |
model Pressure "Pressure sensor" extends Modelica_Fluid.Sensors.Pressure; equation /////////////////////////////////////////////////////////////////////////////////// // Extra species flow. This may be removed when upgrading to the new Modelica.Fluid. port.mC_flow = zeros(Medium.nC); /////////////////////////////////////////////////////////////////////////////////// end Pressure;
Buildings.Fluids.Sensors.RelativePressure
This component monitors the pressure difference between its ports. The sensor does not influence the fluid. The model is identical to Modelica_Fluid.Sensors.RelativePressure but it adds the mass balance for the extra species properties that is missing in the original sensor of Modelica_Fluid beta 1.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port_a | |
| FluidPort_b | port_b | |
| output RealOutput | p_rel | Relative pressure signal |
model RelativePressure "Ideal relative pressure sensor" extends Modelica_Fluid.Sensors.RelativePressure; equation /////////////////////////////////////////////////////////////////////////////////// // Extra species flow. This may be removed when upgrading to the new Modelica.Fluid. port_a.mC_flow = zeros(Medium.nC); port_b.mC_flow = zeros(Medium.nC); /////////////////////////////////////////////////////////////////////////////////// end RelativePressure;
Buildings.Fluids.Sensors.WetBulbTemperature
This component monitors the wet bulb temperature of the medium in the flow between fluid ports. The sensor is ideal, i.e., it does not influence the fluid.
| Type | Name | Default | Description |
|---|---|---|---|
| replaceable package Medium | PartialMedium | Medium in the sensor | |
| Advanced | |||
| Temp | flowDirection | Modelica_Fluid.Types.FlowDir... | Unidirectional (port_a -> port_b) or bidirectional flow component |
| Type | Name | Description |
|---|---|---|
| FluidPort_a | port_a | |
| FluidPort_b | port_b | |
| output RealOutput | T | Wet bulb temperature in port medium |
model WetBulbTemperature "Ideal wet bulb temperature sensor"
extends Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor;
Medium.BaseProperties medium;
Modelica.Blocks.Interfaces.RealOutput T(
redeclare type SignalType = Modelica.SIunits.Temperature,
start=Medium.T_default) "Wet bulb temperature in port medium";
Buildings.Utilities.Psychrometrics.WetBulbTemperature wetBulMod(redeclare
package Medium = Medium) "Model for wet bulb temperature";
equation
port_a.p = medium.p;
h = medium.h;
Xi = medium.Xi;
// Compute wet bulb temperature
wetBulMod.dryBul.h = medium.h;
wetBulMod.dryBul.p = medium.p;
wetBulMod.dryBul.Xi = medium.Xi;
T = wetBulMod.wetBul.T;
end WetBulbTemperature;