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.
function temperatureResponseMatrix extends Modelica.Icons.Function; input Integer nBor "Number of boreholes"; input Real cooBor[nBor, 2] "Borehole coordinates"; input Modelica.SIunits.Height hBor "Borehole length"; input Modelica.SIunits.Height dBor "Borehole buried depth"; input Modelica.SIunits.Radius rBor "Borehole radius"; input Modelica.SIunits.ThermalDiffusivity aSoi "Thermal diffusivity of soil"; input Modelica.SIunits.ThermalConductivity kSoi "Thermal conductivity of soil"; input Integer nSeg "Number of line source segments per borehole"; input Integer nTimSho "Number of time steps in short time region"; input Integer nTimLon "Number of time steps in long time region"; input Integer nTimTot "Number of g-function points"; input Real ttsMax "Maximum non-dimensional time for g-function calculation"; input String sha "SHA-1 encryption of the g-function arguments"; input Boolean forceGFunCalc "Set to true to force the thermal response to be calculated at the start"; output Modelica.SIunits.ThermalResistance TStep[nTimTot, 2] "Temperature step-response time series"; end temperatureResponseMatrix;