View Issue Details

IDProjectCategoryView StatusLast Update
0001921OpenFOAMBugpublic2015-11-20 13:24
Reporteruser1281Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityN/A
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version12.04
Summary0001921: Invalid writeFormat and timeFormat in functions subDict in controlDict
DescriptionThe timeFormat and writeFormat set in controlDict seem not valid for data output by functionObject. Those controls are not available independently for each function object. The format is hard-coded to a specific format as E-notation, leading the very large number fuzzy.
TagsNo tags attached.

Activities

henry

2015-11-20 07:31

manager   ~0005634

Which functionObject?

user1281

2015-11-20 07:53

  ~0005635

Last edited: 2015-11-20 07:54

faceSource and cellSource. my question post on cfdonline:http://www.cfd-online.com/Forums/openfoam-solving/162270-writeformat-timeformat-functions-subdict-controldict.html
for example, in the result file, it gives time 1.065053e+09. however what i need is the exact time (say 1065052800). this is confused with 1065053000. the timeFormat set in controlDict is fixed and the timePrecision is 0. but this setting seems invalid for the functionObjects.

henry

2015-11-20 07:57

manager   ~0005636

It would be useful if you could provide "steps to reproduce" here.

wyldckat

2015-11-20 10:15

updater   ~0005638

@henry: I had taken a look back then when the reporter posted about this in the forum thread. It's the format that is hard coded :(

File: https://github.com/OpenFOAM/OpenFOAM-3.0.x/blob/master/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C#L39

Method:

  void Foam::functionObjectFile::initStream(Ostream& os) const
  {
      os.setf(ios_base::scientific, ios_base::floatfield);
      os.width(charWidth());
  }

wyldckat

2015-11-20 10:20

updater   ~0005639

I believe that for reproducing the problem is just a matter of running the tutorial "multiphase/interFoam/ras/waterChannel" with the "writePrecision" and "timePrecision" cranked up to 12, which will not affect the output from the function object "inletFlux".

henry

2015-11-20 11:15

manager   ~0005640

@Bruno: I am surprised the reporter did not provide the steps to reproduce the problem; it would have saved some time and effort from others.

The simplest option would be to apply the timeFormat and writeFormat from controlDict to the functionObjects which also provides consistent output. Or is there a need to support different output formatting for all functionObjects or even for each functionObject separately?

user1281

2015-11-20 11:27

  ~0005641

@henry: I am quite sorry for the delay and non-clarification. it's due to my poor English,
@Bruno: thanks for your help with the problem.

now it is clarified. I think there is a need to support different output formatting for each functionObject separately, just like the entry with the keyword timeStart and timeEnd.

thanks for the attention.

henry

2015-11-20 11:35

manager   ~0005642

I think at least the time should be formatted in the same manner as Time::timeName() to ensure uniqueness and consistency. Maybe the write precision of the data could be changed per functionObject but again I would expect that whatever is specified in controlDict should be sufficent and suitable for all scalar output.

I will push the use of Time::timeName() in functionObject shortly.

henry

2015-11-20 13:24

manager   ~0005643

Resolved in OpenFOAM-dev by commit 016aad0d720846d09b67bbc039e44e5bd89475fd

Issue History

Date Modified Username Field Change
2015-11-20 06:55 user1281 New Issue
2015-11-20 07:31 henry Note Added: 0005634
2015-11-20 07:53 user1281 Note Added: 0005635
2015-11-20 07:54 user1281 Note Edited: 0005635
2015-11-20 07:57 henry Note Added: 0005636
2015-11-20 10:15 wyldckat Note Added: 0005638
2015-11-20 10:20 wyldckat Note Added: 0005639
2015-11-20 11:15 henry Note Added: 0005640
2015-11-20 11:27 user1281 Note Added: 0005641
2015-11-20 11:35 henry Note Added: 0005642
2015-11-20 13:24 henry Note Added: 0005643
2015-11-20 13:24 henry Status new => resolved
2015-11-20 13:24 henry Resolution open => fixed
2015-11-20 13:24 henry Assigned To => henry