functionObject momentum doesn't write into time folders
Summary
The momentum function object (in OpenFOAM ESI version) does not write anything into the time folders. Only a .dat file in the postProcessing folder. However, when looking at the code it should be writing the momentum into time folders. Also, when using the cylindrical coordinate system of the momentum function object with a tutorial "cavity" it causes a segmentation fault. The simulation was done using OpenFOAM v2006.
Steps to reproduce
Copy tutorial case /incompressible/pisoFoam/RAS/cavity.
Run it using ./Allrun.
Now check the time folders.
To produce the segmentation fault: Change the option cylindrical from false to true. (optionally the cylinder can also be defined according to https://www.openfoam.com/documentation/guides/latest/doc/guide-fos-field-momentum.html )
Example case
Example definition for the momentum function object.
What is the current bug behaviour?
Explained above.
What is the expected correct behavior?
Should print data to time folders.
Relevant logs and/or images
This part does not seems to do anything because fieldPtr seems to always return false.
Environment information
- OpenFOAM version : v2006
- Operating system : Linux Ubuntu
- Hardware info : -
- Compiler : -
Possible fixes
The problem may be related to the lines 521 - 530. For some reason the scopedNames are not found.
This has also been tested using kivaTest tutorial where using the cylindrical coordinate system (cylindrical-->true) did not cause segmentation fault. It also wrote some data into the time folders but only the cyl_r, cyl_t, cyl_z files. Not the "momentum", "angularMomentum" and "angularVelocity". (The cyl_r etc are handled in rows 532 to 585 in the momentum function object's .C file)
Link to source code: https://develop.openfoam.com/Development/openfoam/blob/OpenFOAM-v2012/src/functionObjects/field/momentum/momentum.C