impure functiontemperatureResponseMatrix

Reads and possibly writes a matrix with a time series of the borefield's temperature response

Extends from Modelica.Icons.Function (Icon for functions).

Information

This function uses the parameters required to calculate the borefield's thermal response to build a SHA1-encrypted string unique to the borefield in question. Then, if the forceGFunCalc input is true or if there is no .mat file with the SHA1 hash as its filename in the tmp/temperatureResponseMatrix folder, the thermal response will be calculated and written as a .mat file. Otherwise, the thermal response will simply be read from the .mat file. In the .mat file, the data is saved in a matrix with the name TStep, where the first column is the time (in seconds) and the second column is the temperature step response, which is the g-function divided by 2 π H ksoi, with H being the borehole length and ksoi being the thermal conductivity of the soil.

Inputs

TypeNameDefaultDescription
IntegernBorNumber of boreholes
Real[nBor,2]cooBorBorehole coordinates
Modelica.Units.SI.HeighthBorBorehole length
Modelica.Units.SI.HeightdBorBorehole buried depth
Modelica.Units.SI.RadiusrBorBorehole radius
Modelica.Units.SI.ThermalDiffusivityaSoiThermal diffusivity of soil
Modelica.Units.SI.ThermalConductivitykSoiThermal conductivity of soil
IntegernSegNumber of line source segments per borehole
IntegernCluNumber of clusters for g-function calculation
IntegernTimShoNumber of time steps in short time region
IntegernTimLonNumber of time steps in long time region
IntegernTimTotNumber of g-function points
RealttsMaxMaximum non-dimensional time for g-function calculation
StringshaSHA-1 encryption of the g-function arguments
BooleanforceGFunCalcSet to true to force the thermal response to be calculated at the start

Outputs

TypeNameDefaultDescription
Real[nTimTot,2]TStepTemperature step-response time series

Revisions

  • March 20, 2026, by Michael Wetter:
    Corrected type declaration of g-function.
    This is for Buildings, #4501.
  • December 11, 2021, by Michael Wetter:
    Added impure declaration for MSL 4.0.0.
  • August 27, 2018, by Michael Wetter:
    Changed name of temporary directory so that it is clear for users that this is a temporary directory.
  • July 15, 2018, by Michael Wetter:
    Changed implementation to use matrix read and write from the Modelica Standard Library.
  • March 5, 2018, by Alex Laferrière:
    First implementation.