CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   Fundamental output format control of field values and time (

dbxmcf April 15, 2010 23:12

Fundamental output format control of field values and time
Hi, All:

I have a specific question regarding the output format of OpenFOAM, especially for 2 issues (I believe they are similar)
(1) After running an arbitrary simulation, the field values (U, p, etc.) at each time step will be saved in their respective folder with their time value (e.g. time value of 0.005, 0.01, 0.015, 0.02), is there a way to use C/C++'s printf-like format control of the folder name like %2.2e, i.e. for each folder, I would like to see output of time= 5.0e-3, 1.0e-2, 1.5e-2, 2.0e-2)?
(2) The same for the field values, is there a way to control the U and p format, like %3.2e, so p=0.00367 would be formatted to p=3.67e-3?

I know this might be very fundamental question, thanks a lot for your help!

AlmostSurelyRob January 12, 2011 11:50

I was also looking for a printf-like format specification, but to no avail. I guess it shouldn't be too difficult to implement it. Meanwhile, you can turn scientific notation by giving the parameter timeFormat a value of scientific as described here:

All times are GMT -4. The time now is 02:34.