Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 379
    • Issues 379
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #2121

Closed
Open
Created Jun 15, 2021 by Jani Sandgren@JaniS

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.

example_definition_of_momentum_fO

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.

momentum_write_part_fieldPtr

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

Assignee
Assign to
Time tracking