View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0003922||OpenFOAM||Bug||public||2022-11-02 08:39||2022-11-03 15:57|
|Fixed in Version||dev|
|Summary||0003922: Bug with fieldAverage together with foamPostProcess|
|Description||Following this commit https://github.com/OpenFOAM/OpenFOAM-dev/commit/65b7f628577fbbcb18d8fb7f686183f4ba0b0e3d|
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.
|Tags||No tags attached.|
||So I would propose fieldAveraging should check functionObject::postProcess in read, execute and write and skip if true. Possibly write a warning like https://github.com/OpenFOAM/OpenFOAM-dev/blob/master/src/functionObjects/field/ddt/ddt.C|
Resolved by commit ee4f05411d2c3046e3a6fcc557674bc657183785
|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|