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

Closed
Open
Created Feb 25, 2022 by Prashant Sonakar@PrashantDeveloper

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

  1. Use tutorials/heatTransfer/buoyantPimpleFoam/hotRoom
  2. Copy the FO in controlDict
    htc2
    {
        type            heatTransferCoeff;
        libs            (fieldFunctionObjects);
        field           T;
        writeControl    outputTime;
        writeInterval   1;
        htcModel        fixedReferenceTemperature;
        patches         (ceiling);
//        result          htc2;
        TRef            373;
    }
  1. 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

Possible fixes

Assignee
Assign to
Time tracking