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
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Time | samplePeriod (from DiscreteBlock) | Sample period of component | |
| SI.Time | startTime (from DiscreteBlock) | 0 | First sample time instant |
| String | cfdFilNam | CFD input file name | |
| Boolean | activateInterface | true | Set to false to deactivate interface and use instead yFixed as output |
| Integer | nXi | Number of independent species concentration of the inflowing medium | |
| Integer | nC | Number of trace substances of the inflowing medium | |
| Integer | nWri | Number of values to write to the CFD simulation | |
| Integer | nRea | Number of double values to be read from the CFD simulation | |
| Integer[nWri] | flaWri | ones(nWri) | Flag for double values (0: use current value, 1: use average over interval, 2: use integral over interval) |
| Real[nRea] | yFixed | Fixed output, used if activateInterface=false | |
| Integer | nSur | Number of surfaces | |
| Integer | nConExtWin | number of exterior construction with window | |
| CFDSurfaceIdentifier[nSur] | surIde | Surface identifiers | |
| Boolean | haveShade | Set to true if at least one window in the room has a shade | |
| Boolean | haveSensor | Flag, true if the model has at least one sensor | |
| String[:] | sensorName | Names of sensors as declared in the CFD input file | |
| String[:] | portName | Names of fluid ports as declared in the CFD input file | |
| Boolean | verbose | false | Set to true for verbose output |
| Modelica.Units.SI.Density | rho_start | Density at initial state |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput[nWri] | u | Inputs to CFD | |
| Modelica.Blocks.Interfaces.RealOutput[nRea] | y | Outputs received from CFD |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| CFDThread | CFDThre | CFDThread() | Allocate memory for cosimulation variables via constructor and send stop command to FFD via destructor |
| Real[nWri] | uInt | Value of integral | |
| Real[nWri] | uIntPre | Value of integral at previous sampling instance | |
| Real[nWri] | uWri | Value to be sent to the CFD interface |
Contents
| Name | Description |
|---|---|
| sendParametersprotected | |
| exchangeprotected | |
| returnNonUniqueStringsprotected | |
| assertStringsAreUniqueprotected |
Revisions
-
October 2, 2025, by Michael Wetter:
Declared functions asimpure. -
January 12, 2019, by Michael Wetter:
RemovedEvaluatestatement as the model is used withfixed=falsewhich 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 parameteruStart, 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:
Setstartandfixedattributes inu[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:
Changedinitial algorithmtoinitial equation. -
January 24, 2014, by Wangda Zuo:
Enabled the transfer of Xi and X to CFD. -
July 19, 2013, by Michael Wetter:
First implementation.