About CSV observers

 October 5, 2021  |   A. Thoni


OpenFLUID observers are a simple and efficient way to output results from simulations to CSV files. As they have been recently updated with significant evolutions, Let’s have a closer look to these observers…

CSV format -Comma-Separated Values- can be considered as an open format frequently used to easily store tabular data. OpenFLUID provides two observers to export spatialized variables in CSV files. In these files, each line of data associates a date to the value of a single variable when using the single column observer, or to several variables values ones when using the multi-column observer.

So, these observers are very useful or building up sets of results for further post-processing:

Depending on the needs behind the CSV export, it is possible to use a simple-column observer, or a multi-column observer since version 2.1.9. The simple-column observer generates a file for each variable and spatial unit while the multi-column observer allows to group several variables and spatial units in a single file or split into many files.
Easy and customizable!

💡 Tip: Data lines for which no value is defined (the well-known NA) are hidden by default in the multi-column observer. However, it is possible to display these values by setting the parameter “naemptylinekeep” to “true” for this observer.

Several OpenFLUID users 😉 gave us feedback about unexpected consequences tied with these recent evolutions.
Let’s make a focus on it!

Since they are available, the default configuration for these observers used to set a fixed floating-point format for decimal numbers. With the recent updates, the default configuration for the floating-point format is set to the most relevant format for these values (fixed or scientific). This evolution does not affect the effective values in the simulations, but can lead to differences in the representations of values in the outputted files using the CSV observers. Keep in mind that now the default configuration picks automatically the most relevant format between standard format (0.12) and scientific (1.2e-1). You still can provide a custom configuration adapted to your needs.

Below is an example of values comparison to highlight this evolution:

Actual values OpenFLUID 2.1.9
and previous
Since
OpenFLUID 2.1.10
0
0.01234
0.0001234
0.000001234
0.00000
0.01234
0.00012
0.00000
0
0.01234
0.0001234
1.234e-06

These observers that export as CSV formatted files have an key role in OpenFLUID. They make possible to easily export simulation data in a format that can be considered as universal. For this reason, we paid special attention to making them usable, more robust and we are gradually making them evolve. We hope that they will help you in your modelling processes and that the recent evolutions of the latest versions of OpenFLUID have allowed you to improve your uses.

So feel free to come back to us to discuss about it! 👋