BUG : memory leak issue when storing field
Summary
With !499 (merged) the function object could be used multiple times but sometimes there is conflict when the field is stored in database.
Steps to reproduce
Use two instances of same FO e.g. heatTransferCoefficient without providing 'result' entry. It fails with error
--> FOAM FATAL ERROR: (openfoam-2112)
Failed to store pointer: heatTransferCoeff(T). Risk of memory leakage
Example case
- Use tutorials/heatTransfer/buoyantPimpleFoam/hotRoom
- Copy the FO in controlDict
htc2
{
type heatTransferCoeff;
libs (fieldFunctionObjects);
field T;
writeControl outputTime;
writeInterval 1;
htcModel fixedReferenceTemperature;
patches (ceiling);
// result htc2;
TRef 373;
}
- Running solver without 'result' entry will produce error
What is the current bug behaviour?
Attempts to 'store' field with same name
What is the expected correct behavior?
Probably more elegant error message or 'warning' with internal rename??
Environment information
- OpenFOAM version : v2112