blockCFDExchange

Block that exchanges data with the CFD code

Extends from Modelica.Blocks.Interfaces.DiscreteBlock (Base class of discrete control blocks).

Information

This block samples interface variables and exchanges data with the CFD code.

For a documentation of the exchange parameters and variables, see Buildings.ThermalZones.Detailed.UsersGuide.CFD.

Parameters

TypeNameDefaultDescription
SI.TimesamplePeriod (from DiscreteBlock)Sample period of component
SI.TimestartTime (from DiscreteBlock)0First sample time instant
StringcfdFilNamCFD input file name
BooleanactivateInterfacetrueSet to false to deactivate interface and use instead yFixed as output
IntegernXiNumber of independent species concentration of the inflowing medium
IntegernCNumber of trace substances of the inflowing medium
IntegernWriNumber of values to write to the CFD simulation
IntegernReaNumber of double values to be read from the CFD simulation
Integer[nWri]flaWriones(nWri)Flag for double values (0: use current value, 1: use average over interval, 2: use integral over interval)
Real[nRea]yFixedFixed output, used if activateInterface=false
IntegernSurNumber of surfaces
IntegernConExtWinnumber of exterior construction with window
CFDSurfaceIdentifier[nSur]surIdeSurface identifiers
BooleanhaveShadeSet to true if at least one window in the room has a shade
BooleanhaveSensorFlag, true if the model has at least one sensor
String[:]sensorNameNames of sensors as declared in the CFD input file
String[:]portNameNames of fluid ports as declared in the CFD input file
BooleanverbosefalseSet to true for verbose output
Modelica.Units.SI.Densityrho_startDensity at initial state

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInput[nWri]uInputs to CFD
Modelica.Blocks.Interfaces.RealOutput[nRea]yOutputs received from CFD

Components

TypeNameDefaultDescription
CFDThreadCFDThreCFDThread()Allocate memory for cosimulation variables via constructor and send stop command to FFD via destructor
Real[nWri]uIntValue of integral
Real[nWri]uIntPreValue of integral at previous sampling instance
Real[nWri]uWriValue to be sent to the CFD interface

Contents

NameDescription
sendParametersprotected
exchangeprotected
returnNonUniqueStringsprotected
assertStringsAreUniqueprotected

Revisions

  • October 2, 2025, by Michael Wetter:
    Declared functions as impure.
  • January 12, 2019, by Michael Wetter:
    Removed Evaluate statement as the model is used with fixed=false which causes a warning in JModelica.
  • July 27, 2018, by Wei Tian and Xu Han:
    To fix the issue FFD fails in JModelica tests due to unsupported OS #612 at issue 612. November 17, 2016, by Michael Wetter:
    Removed public parameter uStart, which is not needed and refactored model.
    This is for issue 579.
  • April 21, 2016, by Michael Wetter:
    Movded call to Buildings.BoundaryConditions.WeatherData.BaseClasses.getAbsolutePath from this model to Buildings.ThermalZones.Detailed.CFD. This is for Buildings, #506.
  • September 28, 2015, by Michael Wetter:
    Provided start value for all variables to avoid warning in the pedantic Modelica check in Dymola 2016 about unspecified initial conditions. This closes issue 459.
  • June 4, 2015, by Michael Wetter:
    Set start and fixed attributes in u[nWri](start=_uStart, each fixed=true) to avoid a warning in Dymola 2016 about unspecified initial conditions. This closes issue 422.
  • February 6, 2015, by Michael Wetter:
    Changed initial algorithm to initial equation.
  • January 24, 2014, by Wangda Zuo:
    Enabled the transfer of Xi and X to CFD.
  • July 19, 2013, by Michael Wetter:
    First implementation.