pure functiongetPeakLoad

Function that reads the peak load from the load profile

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

Information

Function that reads a double value from a text file.

This function scans a file that has a format such as

#1
#Some other text
#Peak space cooling load = -383165.6989 Watts
#Peak space heating load = 893931.4335 Watts
double tab1(8760,4)
0,0,5972.314925,16
3600,0,4925.839944,1750.915684
...

The parameter string is a string that the function searches for, starting at the first line. If it finds the string, it expects an equality sign, and returns the double value after this equality sign. If the function encounters the end of the file, it terminates the simulation with an assertion.

See Buildings.DHC.Loads.BaseClasses.Validation.GetPeakLoad for how to invoke this function.

Inputs

TypeNameDefaultDescription
StringstringString that is written before the '=' sign
StringfilNamName of data file with heating and cooling load

Outputs

TypeNameDefaultDescription
RealnumberNumber that is read from the file

Contents

NameDescription
pureReadLineprotectedRead a line of text from a file and return it in a string

Revisions

  • January 24, 2022, by Michael Wetter:
    Reformulated function as a pure function.
    This is for issue 2816.
  • December 11, 2021, by Michael Wetter:
    Declared function as impure for MSL 4.0.0.
  • December 1, 2015, by Michael Wetter:
    First implementation.