View Issue Details

IDProjectCategoryView StatusLast Update
0003922OpenFOAMBugpublic2022-11-03 15:57
Reportertniemi Assigned Tohenry  
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003922: Bug with fieldAverage together with foamPostProcess
DescriptionFollowing this commit

the test/postProcessing/channel no longer works because fieldAverage is not able to find kMean from the registry.

The reason for the bug is quite subtle: foamPostProcess constructs functionObjects before solver, so turbulence models are not available during construction of fieldAverage. This means that k-field is not available, so kMean is not added to registry. However, when actually calculating averages, k is in the registry and fieldAverage assumes that kMean also exist.

When running a solver, functionObjects are constructed at the beginning of the time loop so turbulence fields etc. are already there. And before the commit, initialisation of fieldAverage was done later just when starting to calculate the averages.

There would be several ways to fix this, but I was thinking would it be best to check for functionObject::postProcess and if true, don't do anything. Even before the commit, the postProcess would destroy averaging data because fieldAverage would try to read properties from startTime and fail resulting to overwriting the mean fields.
TagsNo tags attached.



2022-11-02 08:53

reporter   ~0012837

So I would propose fieldAveraging should check functionObject::postProcess in read, execute and write and skip if true. Possibly write a warning like


2022-11-03 15:57

manager   ~0012853

Resolved by commit ee4f05411d2c3046e3a6fcc557674bc657183785

Issue History

Date Modified Username Field Change
2022-11-02 08:39 tniemi New Issue
2022-11-02 08:53 tniemi Note Added: 0012837
2022-11-03 15:57 henry Assigned To => henry
2022-11-03 15:57 henry Status new => resolved
2022-11-03 15:57 henry Resolution open => fixed
2022-11-03 15:57 henry Fixed in Version => dev
2022-11-03 15:57 henry Note Added: 0012853