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 380
    • Issues 380
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1734

Closed
Open
Created Jun 18, 2020 by Dominic CHANDAR@dchandar

Array corruption when accessing boundary field

Summary

The cell volume field mesh.V() gets corrupted when a new surfaceVectorField is created and boundary values altered.

Steps to reproduce

Compile and run the attached code 'cellVolume'. It will output the cell volumes in the mesh as well as the min/max volume. Run this code on the cavity case 2D. Ideally, all volumes should be equal. However, you will see that the cells on the boundary have a different volume. But after commenting out the part where the boundary fields are changed, the cell volumes are all correct. Also, if you uncomment the very first occurrence of mesh.V(), it works. Running with valgrind shows no memory leaks. Either I am doing something really stupid or there is an underlying issue.

Example case

Run it on the cavity case from icoFoam.

What is the current bug behaviour?

Incorrect cell volume on the boundary

What is the expected correct behavior?

Should give the expected cell volume

Relevant logs and/or images

Environment information

  • OpenFOAM version : v1812 and v1912
  • Operating system : ubuntucellVolume.tar.gzcellVolume.tar.gz
  • Hardware info :
  • Compiler : gcc

Possible fixes

Assignee
Assign to
Time tracking