From 0dff908345c4eb79a959222acebc090e19fb3803 Mon Sep 17 00:00:00 2001 From: Filip Jorissen Date: Mon, 23 Oct 2017 11:31:13 +0200 Subject: [PATCH 1/2] revised implementation of heat losses of TemperatureTwoPort see #840 --- IBPSA/Fluid/Sensors/TemperatureTwoPort.mo | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/IBPSA/Fluid/Sensors/TemperatureTwoPort.mo b/IBPSA/Fluid/Sensors/TemperatureTwoPort.mo index 0898326ace..b74140863b 100644 --- a/IBPSA/Fluid/Sensors/TemperatureTwoPort.mo +++ b/IBPSA/Fluid/Sensors/TemperatureTwoPort.mo @@ -28,7 +28,9 @@ model TemperatureTwoPort "Ideal two port temperature sensor" protected parameter Real tauHeaTraInv(final unit = "1/s")= if tauHeaTra<1E-10 then 0 else 1/tauHeaTra - "Dummy parameter to avoid division by tauLoss"; + "Dummy parameter to avoid division by tauHeaTra"; + parameter Real ratTau = if dynamic then tauHeaTra/tau else 1 + "Ratio of tau"; Medium.Temperature TMed(start=T_start) "Medium temperature to which the sensor is exposed"; Medium.Temperature T_a_inflow "Temperature of inflowing fluid at port_a"; @@ -63,7 +65,7 @@ equation // Output signal of sensor if dynamic then if transferHeat then - der(T) = (TMed-T)*k*tauInv + (TAmb-T)*tauHeaTraInv; + der(T) = (TMed-T)*k*tauInv + (TAmb-T)*tauHeaTraInv/(ratTau*k+1); else der(T) = (TMed-T)*k*tauInv; end if; @@ -134,7 +136,8 @@ IBPSA.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. +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.

@@ -153,6 +156,12 @@ the mass flow rate on should set transferHeat=false. ", revisions="