The ROpenFLUID package allows to use OpenFLUID within the GNU R environment. This package is available for OpenFLUID 1.7.2 and later versions. Only linux and windows systems are currently supported.


  • Have OpenFLUID 1.7.2 or later installed
  • Download and install the R environment
  • Install the RUnit package within the R environment. Open an R session and run the following command:

Installation of the ROpenFLUID package

  • Download the ROpenFLUID package corresponding to your OpenFLUID version
  • Install the ROpenFLUID package within the R environment. Open an R session and run the following command:

in the previous command, replace x.x.x-x with the correct version number (e.g. 2.1.9-20190918)

Using OpenFLUID within R

  • The ROpenFLUID package reference manual is available in the Manuals section.
  • All OpenFLUID commands in R are prefixed by OpenFLUID. (''e.g. OpenFLUID.openDataset, OpenFLUID.runSimulation, ...'')


(The following commands are illustrated with the example "Primitives" delivered with OpenFLUID)

  • Running a project as a black box. This command allows a low interaction level between R and OpenFLUID environnement, the pre- and post-processing of a simulation are performed without the ROpenFLUID package commands.
library("ROpenFLUID")  # should be done only once

  • Opening an input dataset, running the simulation and visualising the temporal evolution of the variable "var1" of the unit "8" of class "unitsA"
ofsim = OpenFLUID.openDataset("/path/to/openfluid/examples/Primitives/IN")
OpenFLUID.addVariablesExportAsCSV(ofsim,"unitsA",8,"var1")  # to export all variables of class "unitsA", do not specify either unit identifiers or variable names
var1A8 = OpenFLUID.loadResult(ofsim,"unitsA",8,"var1")
  • Modifying simulation default time step and running the simulation
  • Modifying parameter "gmult" of the simulator "examples.primitives.unitsA.up" and running the simulation
gmult = as.numeric(OpenFLUID.getSimulatorParam(ofsim,"examples.primitives.unitsA.up","gmult"))  # warning: the return type of this command is "character"
  • Modifying attribute "inivar1" of the unit "8" of class "unitsA" and running the simulation
inivar1 = as.numeric(OpenFLUID.getAttribute(ofsim,"unitsA",8,"inivar1"))  # warning: the return type of this command  is "character"