From 767c4e5fc7f5e191af6b1257c15f7306e5a682fc Mon Sep 17 00:00:00 2001 From: Michael Wetter Date: Wed, 11 Sep 2024 12:31:29 +0000 Subject: [PATCH] Correct compliance with MSL (maint 10) (#3983) * Corrected Modelica syntax for Dymola 2025x beta1 * Updated release notes --- .../BaseClasses/surfaceTemperature.mo | 36 +++++++++++----- .../Transmission/BaseClasses/BaseCable.mo | 30 +++++++++++-- .../BaseClasses/der_temperature_u.mo | 11 ++++- Buildings/Utilities/Math/Functions/round.mo | 9 +++- Buildings/package.mo | 42 +++++++++++++++++-- 5 files changed, 108 insertions(+), 20 deletions(-) diff --git a/Buildings/BoundaryConditions/GroundTemperature/BaseClasses/surfaceTemperature.mo b/Buildings/BoundaryConditions/GroundTemperature/BaseClasses/surfaceTemperature.mo index 1c0a735d29a..80a997192bd 100644 --- a/Buildings/BoundaryConditions/GroundTemperature/BaseClasses/surfaceTemperature.mo +++ b/Buildings/BoundaryConditions/GroundTemperature/BaseClasses/surfaceTemperature.mo @@ -21,22 +21,29 @@ protected cliCon.TSurAmp/freq*(cos(freq*(cliCon.sinPha/secInDay - day)) - cos(freq* (cliCon.sinPha/secInDay - (day + 1)))) for day in 1:Year} "Daily mean air temperature (surface = 0 from uncorrected climatic constants)"; - parameter Modelica.Units.SI.Temperature TSurDayMea[Year]={if TAirDayMea[day] - > TFre then (TFre + (TAirDayMea[day] - TFre)*nFacTha) else (TFre + ( - TAirDayMea[day] - TFre)*nFacFre) for day in 1:Year} - "Daily mean corrected surface temperature"; - parameter Real C1 = sum({TSurDayMea[day] * cos(freq * day) for day in 1:Year}); - parameter Real C2 = sum({TSurDayMea[day] * sin(freq * day) for day in 1:Year}); - parameter Modelica.Units.SI.Temperature corTSurMea=sum(TSurDayMea)/Year + Modelica.Units.SI.TemperatureDifference corTSurAmp + "Surface temperature amplitude"; + + Modelica.Units.SI.Temperature TSurDayMea[Year] + "Daily mean corrected surface temperature"; + Modelica.Units.SI.Temperature corTSurMea "Mean annual surface temperature"; - parameter Modelica.Units.SI.TemperatureDifference corTSurAmp=2/Year .* (C1^2 - + C2^2)^0.5 "Surface temperature amplitude"; - parameter Modelica.Units.SI.Duration corSinPha(displayUnit="d") = ( - Modelica.Math.atan(C2/C1) + pi/2)*secInDay/freq + + Real C1 "Coefficient for phase lag of soil surface temperature"; + Real C2 "Coefficient for phase lag of soil surface temperature"; + Modelica.Units.SI.Duration corSinPha(displayUnit="d") "Phase lag of soil surface temperature"; algorithm + TSurDayMea[:]:={if TAirDayMea[day] > TFre then (TFre + (TAirDayMea[day] - + TFre)*nFacTha) else (TFre + (TAirDayMea[day] - TFre)*nFacFre) for day in 1: + Year}; + corTSurMea:=sum(TSurDayMea)/Year; + C1 :=sum({TSurDayMea[day]*cos(freq*day) for day in 1:Year}); + C2 :=sum({TSurDayMea[day]*sin(freq*day) for day in 1:Year}); + corSinPha :=(Modelica.Math.atan(C2/C1) + pi/2)*secInDay/freq; + corTSurAmp:=2/Year .* (C1^2 + C2^2)^0.5; // Analytical mean by integrating undisturbed soil temperature formula corCliCon := ClimaticConstants.Generic( TSurMea = corTSurMea, @@ -46,6 +53,13 @@ algorithm annotation (Documentation(revisions="