impure functionconstructor

Construct to connect to a thermal zone in EnergyPlus

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

Information

The function constructor is a C function that is called by a Modelica simulator exactly once during the initialization. The function returns the object adapter that will be used to store the data structure needed to communicate with EnergyPlus.

Inputs

TypeNameDefaultDescription
IntegerobjectTypeType of the object (1: ThermalZone, 2: Schedule, 3: Actuator, 4: Surface)
Modelica.Units.SI.TimestartTimeStart time of the simulation
StringmodelicaNameBuildingName of this Modelica building instance that connects to this thermal zone
StringmodelicaInstanceNameName of the Modelica instance of this object
StringspawnExeName of the spawn executable, without extension, such as spawn-0.2.0-d7f1e095f3
StringidfVersionIDF version with underscores, such as 24_2_0
StringidfNameName of the IDF
StringepwNameName of the weather file
Buildings.ThermalZones.EnergyPlus_24_2_0.Data.RunPeriodrunPeriodEnergyPlus RunPeriod configuration
RealrelativeSurfaceToleranceRelative tolerance of surface temperature calculations
StringepNameName of the object in EnergyPlus
BooleanusePrecompiledFMUSet to true to use precompiled FMU with name specified by input fmuName
StringfmuNameSpecify if a pre-compiled FMU should be used instead of EnergyPlus (mainly for development)
StringbuildingsRootFileLocationName of top-level legal.html file of the Buildings library (used to find the spawn executable)
Buildings.ThermalZones.EnergyPlus_24_2_0.Types.LogLevelslogLevelLogLevels of EnergyPlus output
BooleanprintUnitSet to true to print units for OutputVariable object. Must be false for all other objects
StringjsonNameName of the object in the json configuration file
StringjsonKeysValuesKeys and values string to be written to the json configuration file
String[nParOut]parOutNamesNames of parameter in modelDescription.xml file
String[nParOut]parOutUnitsModelica units of the parameters
IntegernParOutNumber of parameters
String[nInp]inpNamesNames of inputs in modelDescription.xml file
String[nInp]inpUnitsModelica units of the inputs
IntegernInpSize of inpNames
String[nOut]outNamesNames of outputs in modelDescription.xml file
String[nOut]outUnitsModelica units of the outputs
IntegernOutSize of outNames
Integer[nDer,2]derivatives_structureList of derivatives (1-based index, [i,j] means dy_i/du_j
IntegernDerSize of derivatives
Real[nDer]derivatives_deltaIncrements for derivative calculation

Outputs

TypeNameDefaultDescription
SpawnExternalObjectadapter

Revisions

  • July 10, 2026, by Michael Wetter:
    Corrected C function implementation to comply with Modelica Language Standard.
    This change only affects the C function implementation and does not impact the Modelica function signature.
    This is for issue 4658.
  • April 21, 2022, by Michael Wetter:
    Added support for EnergyPlus RunPeriod object.
    This is for #2926.
  • December 11, 2021, by Michael Wetter:
    Declared function as impure for MSL 4.0.0.
  • February 18, 2021, by Michael Wetter:
    Refactor synchronization of constructors.
    This is for #2360.
  • February 14, 2018, by Michael Wetter:
    First implementation.