functionshaGFunction

Returns a SHA1 encryption of the formatted arguments for the g-function generation

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

Information

This function returns the SHA1 encryption of its arguments.

Implementation

Each argument is formatted in exponential notation with four significant digits, for example 1.234e+001, with no spaces or other separating characters between each argument value. To prevent too long strings that can cause buffer overflows, the sha encoding of each argument is computed and added to the next string that is parsed.

The SHA1 encryption is computed using Buildings.Utilities.Cryptographics.sha.

Inputs

TypeNameDefaultDescription
IntegernBorNumber of boreholes
Modelica.Units.SI.Position[nBor,2]cooBorCoordinates of boreholes
Modelica.Units.SI.HeighthBorBorehole length
Modelica.Units.SI.HeightdBorBorehole buried depth
Modelica.Units.SI.RadiusrBorBorehole radius
Modelica.Units.SI.ThermalDiffusivityaSoiGround thermal diffusivity used in g-function evaluation
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
RealttsMaxMaximum adimensional time for gfunc calculation

Outputs

TypeNameDefaultDescription
StringshaSHA1 encryption of the g-function arguments

Revisions

  • June 9, 2022, by Massimo Cimmino:
    Added the number of clusters to the encryption.
  • November 1, 2019 by Michael Wetter:
    Declared string as a constant due to JModelica's tigther type checking. See #1230.
  • September 11, 2018, by Michael Wetter:
    Refactored implementation to avoid buffer overflow.
  • September 11, 2018 by Damien Picard:
    Split long strings into small strings to avoid buffer overflow. See #1018.
  • June 22, 2018 by Alex Laferrière:
    First implementation.