Buildings.Fluids.Sensors

Package with sensor models

Information


This package contains sensor models. Additional sensor models may be found
in 
Modelica_Fluid.Sensors.

Package Content

NameDescription
Buildings.Fluids.Sensors.Conversions Conversions Package with conversions for sensor models
Buildings.Fluids.Sensors.DryBulbTemperatureDynamic DryBulbTemperatureDynamic Ideal temperature sensor
Buildings.Fluids.Sensors.EnthalpyFlowRate EnthalpyFlowRate Ideal enthalphy flow rate sensor
Buildings.Fluids.Sensors.Examples Examples Collection of models that illustrate model use and test models
Buildings.Fluids.Sensors.WetBulbTemperature WetBulbTemperature Ideal wet bulb temperature sensor


Buildings.Fluids.Sensors.DryBulbTemperatureDynamic Buildings.Fluids.Sensors.DryBulbTemperatureDynamic

Ideal temperature sensor

Buildings.Fluids.Sensors.DryBulbTemperatureDynamic

Information


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.


Extends from Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor (Partial component to model sensors that measure flow properties).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Timetau10Time constant [s]
Nominal condition
MassFlowRatem0_flow Nominal mass flow rate [kg/s]
Initialization
InitinitTypeModelica.Blocks.Types.Init.N...Type of initialization (InitialState and InitialOutput are identical)
TemperatureT_startMedium.T_defaultInitial or guess value of output (= state) [K]
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
MassFlowRatem_flow_small1E-4*m0_flowFor bi-directional flow, temperature is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required) [kg/s]

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 RealOutputTTemperature of the passing fluid [K]

Modelica definition

model DryBulbTemperatureDynamic "Ideal temperature sensor"
  extends Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor;

  parameter Modelica.SIunits.Time tau(min=0) = 10 "Time constant";
  Modelica.Blocks.Interfaces.RealOutput T( final quantity="ThermodynamicTemperature",
                                           final unit="K",
                                           min = 0,
                                           displayUnit="degC") 
    "Temperature of the passing fluid";

  parameter Medium.MassFlowRate m0_flow(min=0) "Nominal mass flow rate";
  parameter Medium.MassFlowRate m_flow_small(min=0) = 1E-4*m0_flow 
    "For bi-directional flow, temperature is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required)";

  parameter Modelica.Blocks.Types.Init 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)";
protected 
  Medium.Temperature T_a_inflow "Temperature of inflowing fluid at port_a";
  Medium.Temperature T_b_inflow 
    "Temperature of inflowing fluid at port_b or T_a_inflow, if uni-directional flow";
  Medium.Temperature TMed "Medium to which sensor is exposed";
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 
  if allowFlowReversal then
     T_a_inflow = Medium.temperature(Medium.setState_phX(port_b.p, port_b.h_outflow, port_b.Xi_outflow));
     T_b_inflow = Medium.temperature(Medium.setState_phX(port_a.p, port_a.h_outflow, port_a.Xi_outflow));
     TMed = Modelica_Fluid.Utilities.regStep(port_a.m_flow, T_a_inflow, T_b_inflow, m_flow_small);
  else
     TMed = Medium.temperature(Medium.setState_phX(port_b.p, port_b.h_outflow, port_b.Xi_outflow));
     T_a_inflow = TMed;
     T_b_inflow = TMed;
  end if;
  der(T)  = (TMed-T)/tau;
end DryBulbTemperatureDynamic;

Buildings.Fluids.Sensors.EnthalpyFlowRate Buildings.Fluids.Sensors.EnthalpyFlowRate

Ideal enthalphy flow rate sensor

Buildings.Fluids.Sensors.EnthalpyFlowRate

Information


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.


Extends from Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor (Partial component to model sensors that measure flow properties), Modelica.Icons.RotationalSensor (Icon representing rotational measurement device).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)

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 RealOutputH_flowEnthalpy flow rate, positive if from port_a to port_b [W]

Modelica definition

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 
  if allowFlowReversal then
     H_flow = port_a.m_flow * actualStream(port_a.h_outflow);
  else
     H_flow = port_a.m_flow * port_b.h_outflow;
  end if;
end EnthalpyFlowRate;

Buildings.Fluids.Sensors.WetBulbTemperature Buildings.Fluids.Sensors.WetBulbTemperature

Ideal wet bulb temperature sensor

Buildings.Fluids.Sensors.WetBulbTemperature

Information


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.


Extends from Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor (Partial component to model sensors that measure flow properties).

Parameters

TypeNameDefaultDescription
replaceable package MediumModelica.Media.Interfaces.Pa...Medium in the component
Assumptions
BooleanallowFlowReversalsystem.allowFlowReversal= true to allow flow reversal, false restricts to design direction (port_a -> port_b)
Advanced
MassFlowRatem_flow_small1e-4For bi-directional flow, specific enthalpy is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required) [kg/s]

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 RealOutputTWet bulb temperature in port medium [K]

Modelica definition

model WetBulbTemperature "Ideal wet bulb temperature sensor"
  extends Modelica_Fluid.Sensors.BaseClasses.PartialFlowSensor;


  Modelica.Blocks.Interfaces.RealOutput T(
    start=Medium.T_default,
    final quantity="Temperature",
    final unit="K") "Wet bulb temperature in port medium";

  parameter Medium.MassFlowRate m_flow_small(min=0) = 1e-4 
    "For bi-directional flow, specific enthalpy is regularized in the region |m_flow| < m_flow_small (m_flow_small > 0 required)";
  Buildings.Utilities.Psychrometrics.WetBulbTemperature wetBulMod(redeclare 
      package Medium = Medium) "Model for wet bulb temperature";

equation 
  if allowFlowReversal then
    wetBulMod.dryBul.h  = Modelica_Fluid.Utilities.regStep(port_a.m_flow, port_b.h_outflow, port_a.h_outflow, m_flow_small);
    wetBulMod.dryBul.Xi = Modelica_Fluid.Utilities.regStep(port_a.m_flow, port_b.Xi_outflow, port_a.Xi_outflow, m_flow_small);
  else
    wetBulMod.dryBul.h = port_b.h_outflow;
    wetBulMod.dryBul.Xi = port_b.Xi_outflow;
  end if;
  wetBulMod.dryBul.p  = port_a.p;

  // Compute wet bulb temperature
  T = wetBulMod.wetBul.T;

end WetBulbTemperature;

HTML-documentation generated by Dymola Thu Feb 19 16:52:49 2009.